add select all torrents to torrent_menu

This commit is contained in:
Marcos Pinto 2007-07-30 01:34:30 +00:00
parent e62942c0b4
commit b9831e2e48
2 changed files with 15 additions and 1 deletions

View file

@ -4,6 +4,16 @@
<glade-interface>
<widget class="GtkMenu" id="torrent_menu">
<property name="visible">True</property>
<child>
<widget class="GtkImageMenuItem" id="menu_select_all">
<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">gtk-select-all</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
<signal name="activate" handler="select_all_torrents"/>
</widget>
</child>
<child>
<widget class="GtkImageMenuItem" id="menu_resume">
<property name="visible">True</property>
@ -21,7 +31,7 @@
</widget>
</child>
<child>
<widget class="GtkImageMenuItem" id="menu_resume">
<widget class="GtkImageMenuItem" id="menu_pause">
<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">Pause</property>

View file

@ -434,6 +434,7 @@ class DelugeGTK:
self.torrent_glade = gtk.glade.XML(common.get_glade_file("torrent_menu.glade"), domain='deluge')
self.torrent_menu = self.torrent_glade.get_widget("torrent_menu")
self.torrent_glade.signal_autoconnect({
"select_all_torrents": self.select_all_torrents,
"remove_torrent": self.remove_torrent_clicked,
"edit_trackers": self.list_of_trackers,
"tor_start": self.tor_start,
@ -1187,6 +1188,9 @@ class DelugeGTK:
print "Clearing completed torrents"
self.manager.clear_completed()
self.update()
def select_all_torrents(self, widget):
self.torrent_view.get_selection().select_all()
def q_torrent_up(self, obj=None):
for torrent in self.get_selected_torrent_rows():