mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-03 15:08:40 +00:00
Fix preferences window
This commit is contained in:
parent
1003374bb4
commit
f942d4ee43
1 changed files with 15 additions and 0 deletions
|
@ -154,15 +154,27 @@ class Preferences(component.Component):
|
||||||
def _on_get_config(self, config):
|
def _on_get_config(self, config):
|
||||||
log.debug("on_get_config: %s", config)
|
log.debug("on_get_config: %s", config)
|
||||||
self.core_config = config
|
self.core_config = config
|
||||||
|
self.__wait_to_show -= 1
|
||||||
|
if not self.__wait_to_show:
|
||||||
|
self._show()
|
||||||
|
|
||||||
def _on_get_available_plugins(self, plugins):
|
def _on_get_available_plugins(self, plugins):
|
||||||
self.all_plugins = plugins
|
self.all_plugins = plugins
|
||||||
|
self.__wait_to_show -= 1
|
||||||
|
if not self.__wait_to_show:
|
||||||
|
self._show()
|
||||||
|
|
||||||
def _on_get_enabled_plugins(self, plugins):
|
def _on_get_enabled_plugins(self, plugins):
|
||||||
self.enabled_plugins = plugins
|
self.enabled_plugins = plugins
|
||||||
|
self.__wait_to_show -= 1
|
||||||
|
if not self.__wait_to_show:
|
||||||
|
self._show()
|
||||||
|
|
||||||
def _on_get_listen_port(self, port):
|
def _on_get_listen_port(self, port):
|
||||||
self.active_port = port
|
self.active_port = port
|
||||||
|
self.__wait_to_show -= 1
|
||||||
|
if not self.__wait_to_show:
|
||||||
|
self._show()
|
||||||
|
|
||||||
def show(self, page=None):
|
def show(self, page=None):
|
||||||
"""Page should be the string in the left list.. ie, 'Network' or 'Bandwidth'"""
|
"""Page should be the string in the left list.. ie, 'Network' or 'Bandwidth'"""
|
||||||
|
@ -175,6 +187,8 @@ class Preferences(component.Component):
|
||||||
# Update the preferences dialog to reflect current config settings
|
# Update the preferences dialog to reflect current config settings
|
||||||
self.core_config = {}
|
self.core_config = {}
|
||||||
if client.connected():
|
if client.connected():
|
||||||
|
# We use a counter to know when to show the dialog
|
||||||
|
self.__wait_to_show = 4
|
||||||
client.core.get_config().addCallback(self._on_get_config)
|
client.core.get_config().addCallback(self._on_get_config)
|
||||||
client.core.get_available_plugins().addCallback(self._on_get_available_plugins)
|
client.core.get_available_plugins().addCallback(self._on_get_available_plugins)
|
||||||
client.core.get_enabled_plugins().addCallback(self._on_get_enabled_plugins)
|
client.core.get_enabled_plugins().addCallback(self._on_get_enabled_plugins)
|
||||||
|
@ -182,6 +196,7 @@ class Preferences(component.Component):
|
||||||
# Force these calls and block until we've done them all
|
# Force these calls and block until we've done them all
|
||||||
client.force_call()
|
client.force_call()
|
||||||
|
|
||||||
|
def _show(self):
|
||||||
if self.core_config != {} and self.core_config != None:
|
if self.core_config != {} and self.core_config != None:
|
||||||
core_widgets = {
|
core_widgets = {
|
||||||
"download_path_button": \
|
"download_path_button": \
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue