Fix SystemTray on systems with old PyGTK.

This commit is contained in:
Andrew Resch 2008-01-14 12:02:53 +00:00
parent 73c14b8c47
commit 8ae26b049c
1 changed files with 9 additions and 4 deletions

View File

@ -64,13 +64,18 @@ class SystemTray(component.Component):
def enable(self):
"""Enables the system tray icon."""
log.debug("Enabling the system tray icon..")
self.tray = gtk.status_icon_new_from_icon_name("deluge")
self.tray.connect("activate", self.on_tray_clicked)
self.tray.connect("popup-menu", self.on_tray_popup)
self.tray_glade = gtk.glade.XML(
pkg_resources.resource_filename("deluge.ui.gtkui",
"glade/tray_menu.glade"))
try:
self.tray = gtk.status_icon_new_from_icon_name("deluge")
except:
log.warning("Update PyGTK to 2.10 or greater for SystemTray..")
return
self.tray.connect("activate", self.on_tray_clicked)
self.tray.connect("popup-menu", self.on_tray_popup)
self.tray_glade.signal_autoconnect({
"on_menuitem_show_deluge_activate": \