summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Resch <andrewresch@gmail.com>2009-05-25 06:07:26 +0000
committerAndrew Resch <andrewresch@gmail.com>2009-05-25 06:07:26 +0000
commit85a41715b20d47c7054e0a66f9fba0d9187ba045 (patch)
tree2c080a7172f5fa0d461a6e126f75c28fc6b901b7
parent1505b1704b965d77fcae5e69f0eaa3982e98a303 (diff)
downloaddeluge-85a41715b20d47c7054e0a66f9fba0d9187ba045.tar.gz
deluge-85a41715b20d47c7054e0a66f9fba0d9187ba045.tar.bz2
deluge-85a41715b20d47c7054e0a66f9fba0d9187ba045.zip
Prevent some uncaught exceptions when systemtray is not enabled
-rw-r--r--deluge/ui/gtkui/systemtray.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/deluge/ui/gtkui/systemtray.py b/deluge/ui/gtkui/systemtray.py
index 49751df78..0b70d6d3f 100644
--- a/deluge/ui/gtkui/systemtray.py
+++ b/deluge/ui/gtkui/systemtray.py
@@ -154,15 +154,17 @@ class SystemTray(component.Component):
self.__start()
def stop(self):
- try:
- # Hide widgets in hide list because we're not connected to a host
- for widget in self.hide_widget_list:
- self.tray_glade.get_widget(widget).hide()
- except Exception, e:
- log.debug("Unable to hide system tray menu widgets: %s", e)
+ if self.config["enable_system_tray"]:
+ try:
+ # Hide widgets in hide list because we're not connected to a host
+ for widget in self.hide_widget_list:
+ self.tray_glade.get_widget(widget).hide()
+ except Exception, e:
+ log.debug("Unable to hide system tray menu widgets: %s", e)
def shutdown(self):
- self.tray.set_visible(False)
+ if self.config["enable_system_tray"]:
+ self.tray.set_visible(False)
def send_status_request(self):
client.get_download_rate(self._on_get_download_rate)