Fix showing system tray icon in windows

This commit is contained in:
Andrew Resch 2008-07-15 00:50:50 +00:00
parent 2030ba5e84
commit 38fc6ba9e3
1 changed files with 9 additions and 5 deletions

View File

@ -78,11 +78,15 @@ class SystemTray(component.Component):
pkg_resources.resource_filename("deluge.ui.gtkui", pkg_resources.resource_filename("deluge.ui.gtkui",
"glade/tray_menu.glade")) "glade/tray_menu.glade"))
try: if deluge.common.windows_check():
self.tray = gtk.status_icon_new_from_icon_name("deluge") self.tray = gtk.status_icon_new_from_pixbuf(
except: deluge.common.get_logo(32))
log.warning("Update PyGTK to 2.10 or greater for SystemTray..") else:
return 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("activate", self.on_tray_clicked)
self.tray.connect("popup-menu", self.on_tray_popup) self.tray.connect("popup-menu", self.on_tray_popup)