add quit & shutdown daemon to tray

This commit is contained in:
Marcos Pinto 2007-09-30 06:07:55 +00:00
parent f2f73b8539
commit 1ce3eb7099
2 changed files with 16 additions and 1 deletions

View File

@ -121,6 +121,15 @@
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
</widget>
</child>
<child>
<widget class="GtkMenuItem" id="menuitem1">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="label" translatable="yes">Quit &amp; Shutdown Daemon</property>
<property name="use_underline">True</property>
<signal name="activate" handler="on_menuitem_quitdaemon_activate"/>
</widget>
</child>
<child>
<widget class="GtkImageMenuItem" id="menuitem_quit">
<property name="visible">True</property>

View File

@ -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,