mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-05 07:58:38 +00:00
Changed the show/hide window option in the tray menu to a CheckMenuItem
and have it toggle accordingly.
This commit is contained in:
parent
c5fc69fa2e
commit
4fb4fb32f7
2 changed files with 14 additions and 9 deletions
|
@ -42,12 +42,12 @@
|
||||||
</widget>
|
</widget>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkMenuItem" id="show_hide_window">
|
<widget class="GtkCheckMenuItem" id="show_hide_window">
|
||||||
<property name="visible">True</property>
|
<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="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||||
<property name="label" translatable="yes">_Show/Hide Window</property>
|
<property name="label" translatable="yes">_Show Deluge</property>
|
||||||
<property name="use_underline">True</property>
|
<property name="use_underline">True</property>
|
||||||
<signal name="activate" handler="show_hide_window"/>
|
<signal name="activate" handler="show_hide_window_toggled"/>
|
||||||
</widget>
|
</widget>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
|
|
|
@ -166,7 +166,7 @@ class DelugeGTK:
|
||||||
"preferences": self.show_pref_dialog,
|
"preferences": self.show_pref_dialog,
|
||||||
"add_torrent": self.add_torrent_clicked,
|
"add_torrent": self.add_torrent_clicked,
|
||||||
"clear_finished": self.clear_finished,
|
"clear_finished": self.clear_finished,
|
||||||
"show_hide_window": self.force_show_hide,
|
"show_hide_window_toggled": self.show_hide_window_toggled
|
||||||
})
|
})
|
||||||
|
|
||||||
self.tray_glade.get_widget("download-limit-image").set_from_file(common.get_pixmap('downloading22.png'))
|
self.tray_glade.get_widget("download-limit-image").set_from_file(common.get_pixmap('downloading22.png'))
|
||||||
|
@ -177,6 +177,11 @@ class DelugeGTK:
|
||||||
self.tray_icon.connect("popup-menu", self.tray_popup)
|
self.tray_icon.connect("popup-menu", self.tray_popup)
|
||||||
|
|
||||||
def tray_popup(self, status_icon, button, activate_time):
|
def tray_popup(self, status_icon, button, activate_time):
|
||||||
|
if self.window.get_property("visible"):
|
||||||
|
self.tray_glade.get_widget("show_hide_window").set_active(True)
|
||||||
|
else:
|
||||||
|
self.tray_glade.get_widget("show_hide_window").set_active(False)
|
||||||
|
|
||||||
self.tray_menu.popup(None, None, gtk.status_icon_position_menu,
|
self.tray_menu.popup(None, None, gtk.status_icon_position_menu,
|
||||||
button, activate_time, status_icon)
|
button, activate_time, status_icon)
|
||||||
|
|
||||||
|
@ -357,14 +362,14 @@ class DelugeGTK:
|
||||||
self.load_window_geometry()
|
self.load_window_geometry()
|
||||||
self.window.show()
|
self.window.show()
|
||||||
|
|
||||||
def force_show_hide(self, arg=None):
|
def show_hide_window_toggled(self, widget):
|
||||||
if self.window.get_property("visible"):
|
if widget.get_active() and not self.window.get_property("visible"):
|
||||||
self.window.hide()
|
if self.config.get("lock_tray") == True:
|
||||||
else:
|
|
||||||
if self.config.get("lock_tray") == True:
|
|
||||||
self.unlock_tray("mainwinshow")
|
self.unlock_tray("mainwinshow")
|
||||||
else:
|
else:
|
||||||
self.window.show()
|
self.window.show()
|
||||||
|
elif not widget.get_active() and self.window.get_property("visible"):
|
||||||
|
self.window.hide()
|
||||||
|
|
||||||
def build_torrent_table(self):
|
def build_torrent_table(self):
|
||||||
## Create the torrent listview
|
## Create the torrent listview
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue