From 1ce3eb709977e3d2e98a6b21b8c62298d7b5aa72 Mon Sep 17 00:00:00 2001 From: Marcos Pinto Date: Sun, 30 Sep 2007 06:07:55 +0000 Subject: [PATCH] add quit & shutdown daemon to tray --- deluge/ui/gtkui/glade/tray_menu.glade | 9 +++++++++ deluge/ui/gtkui/systemtray.py | 8 +++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/deluge/ui/gtkui/glade/tray_menu.glade b/deluge/ui/gtkui/glade/tray_menu.glade index 6caae77ed..8c0155fdb 100644 --- a/deluge/ui/gtkui/glade/tray_menu.glade +++ b/deluge/ui/gtkui/glade/tray_menu.glade @@ -121,6 +121,15 @@ GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + Quit & Shutdown Daemon + True + + + True diff --git a/deluge/ui/gtkui/systemtray.py b/deluge/ui/gtkui/systemtray.py index 115dce987..2f44d6168 100644 --- a/deluge/ui/gtkui/systemtray.py +++ b/deluge/ui/gtkui/systemtray.py @@ -67,7 +67,8 @@ class SystemTray: self.on_menuitem_pause_all_activate, "on_menuitem_resume_all_activate": \ self.on_menuitem_resume_all_activate, - "on_menuitem_quit_activate": self.on_menuitem_quit_activate + "on_menuitem_quit_activate": self.on_menuitem_quit_activate, + "on_menuitem_quit_daemon": self.on_menuitem_quitdaemon_activate }) self.tray_menu = self.tray_glade.get_widget("tray_menu") @@ -173,6 +174,11 @@ class SystemTray: def on_menuitem_quit_activate(self, menuitem): log.debug("on_menuitem_quit_activate") self.window.quit() + + def on_menuitem_quitdaemon_activate(self, menuitem): + log.debug("on_menuitem_quitdaemon_activate") + functions.shutdown() + self.window.quit() def build_menu_radio_list(self, value_list, callback, pref_value=None, suffix=None, show_notset=False, notset_label=None, notset_lessthan=0,