mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-02 22:48:40 +00:00
Fix SystemTray on systems with old PyGTK.
This commit is contained in:
parent
73c14b8c47
commit
8ae26b049c
1 changed files with 9 additions and 4 deletions
|
@ -64,13 +64,18 @@ class SystemTray(component.Component):
|
||||||
def enable(self):
|
def enable(self):
|
||||||
"""Enables the system tray icon."""
|
"""Enables the system tray icon."""
|
||||||
log.debug("Enabling 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(
|
self.tray_glade = gtk.glade.XML(
|
||||||
pkg_resources.resource_filename("deluge.ui.gtkui",
|
pkg_resources.resource_filename("deluge.ui.gtkui",
|
||||||
"glade/tray_menu.glade"))
|
"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({
|
self.tray_glade.signal_autoconnect({
|
||||||
"on_menuitem_show_deluge_activate": \
|
"on_menuitem_show_deluge_activate": \
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue