add quit & shutdown daemon to tray
This commit is contained in:
parent
f2f73b8539
commit
1ce3eb7099
|
@ -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 & 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>
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue