diff options
Diffstat (limited to 'deluge/ui')
-rw-r--r-- | deluge/ui/gtkui/statusbar.py | 16 | ||||
-rw-r--r-- | deluge/ui/gtkui/systemtray.py | 9 | ||||
-rw-r--r-- | deluge/ui/sessionproxy.py | 18 |
3 files changed, 13 insertions, 30 deletions
diff --git a/deluge/ui/gtkui/statusbar.py b/deluge/ui/gtkui/statusbar.py index f4219900c..d89880782 100644 --- a/deluge/ui/gtkui/statusbar.py +++ b/deluge/ui/gtkui/statusbar.py @@ -194,16 +194,14 @@ class StatusBar(component.Component): self.health = False + def update_config_values(configs): + self._on_max_connections_global(configs["max_connections_global"]) + self._on_max_download_speed(configs["max_download_speed"]) + self._on_max_upload_speed(configs["max_upload_speed"]) + self._on_dht(configs["dht"]) # Get some config values - client.core.get_config_value( - "max_connections_global").addCallback(self._on_max_connections_global) - client.core.get_config_value( - "max_download_speed").addCallback(self._on_max_download_speed) - client.core.get_config_value( - "max_upload_speed").addCallback(self._on_max_upload_speed) - client.core.get_config_value("dht").addCallback(self._on_dht) - - self.send_status_request() + client.core.get_config_values(["max_connections_global", "max_download_speed", + "max_upload_speed", "dht"]).addCallback(update_config_values) def stop(self): # When stopped, we just show the not connected thingy diff --git a/deluge/ui/gtkui/systemtray.py b/deluge/ui/gtkui/systemtray.py index 553ebb354..33ad514fb 100644 --- a/deluge/ui/gtkui/systemtray.py +++ b/deluge/ui/gtkui/systemtray.py @@ -172,11 +172,10 @@ class SystemTray(component.Component): self.build_tray_bwsetsubmenu() # Get some config values - client.core.get_config_value( - "max_download_speed").addCallback(self._on_max_download_speed) - client.core.get_config_value( - "max_upload_speed").addCallback(self._on_max_upload_speed) - self.send_status_request() + def update_config_values(configs): + self._on_max_download_speed(configs["max_download_speed"]) + self._on_max_upload_speed(configs["max_upload_speed"]) + client.core.get_config_values(["max_download_speed", "max_upload_speed"]).addCallback(update_config_values) def start(self): self.__start() diff --git a/deluge/ui/sessionproxy.py b/deluge/ui/sessionproxy.py index b7acd890f..0b5234704 100644 --- a/deluge/ui/sessionproxy.py +++ b/deluge/ui/sessionproxy.py @@ -47,10 +47,8 @@ class SessionProxy(component.Component): The SessionProxy component is used to cache session information client-side to reduce the number of RPCs needed to provide a rich user interface. - On start-up it will query the Core for a full status of all the torrents in - the session. After that point, it will query the Core for only changes in - the status of the torrents and will try to satisfy client requests from the - cache. + It will query the Core for only changes in the status of the torrents + and will try to satisfy client requests from the cache. """ def __init__(self): @@ -78,18 +76,6 @@ class SessionProxy(component.Component): # so that upcoming queries or status updates don't throw errors. self.torrents.setdefault(torrent_id, [time.time(), {}]) self.cache_times.setdefault(torrent_id, {}) - # These initial keys are the ones used for the visible columns(by - # default) on the GTK UI torrent view. If either the console-ui - # or the web-ui needs additional keys, add them here; - # There's NO need to fetch every bit of status information from - # core if it's not going to be used. Additional status fields - # will be queried later, for example, when viewing the status tab - # of a torrent. - inital_keys = [ - 'queue', 'state', 'name', 'total_wanted', 'progress', 'state', - 'download_payload_rate', 'upload_payload_rate', 'eta', 'owner' - ] - self.get_torrents_status({'id': torrent_ids}, inital_keys) return client.core.get_session_state().addCallback(on_get_session_state) def stop(self): |