Ticket #307: gtkui_update_main_window_torrents_menu.patch
File gtkui_update_main_window_torrents_menu.patch, 2.9 KB (added by sadrul, 15 years ago) |
---|
-
deluge/ui/gtkui/torrentview.py
330 330 331 331 # Update the toolbar buttons just in case some state has changed 332 332 component.get("ToolBar").update_buttons() 333 component.get("MenuBar").update() 333 334 334 335 def _on_get_torrents_status(self, status): 335 336 """Callback function for get_torrents_status(). 'status' should be a … … 431 432 log.debug("on_selection_changed") 432 433 component.get("TorrentDetails").update() 433 434 component.get("ToolBar").update_buttons() 434 435 component.get("MenuBar").update() 436 -
deluge/ui/gtkui/menubar.py
201 201 self.window.main_glade.get_widget("separatormenuitem").hide() 202 202 self.window.main_glade.get_widget("menuitem_quitdaemon").hide() 203 203 204 def update(self): 205 selected = component.get('TorrentView').get_selected_torrents() 206 if not selected or len(selected) == 0: 207 # No torrent is selected. Disable the 'Torrents' menu 208 self.menu_torrent.set_sensitive(False) 209 return 210 211 self.menu_torrent.set_sensitive(True) 212 # XXX: Should also update Pause/Resume/Remove menuitems. 213 # Any better way than duplicating toolbar.py:update_buttons in here? 214 204 215 def add_torrentmenu_separator(self): 205 216 sep = gtk.SeparatorMenuItem() 206 217 self.torrentmenu.append(sep) -
deluge/ui/gtkui/signals.py
92 92 log.debug("torrent_paused signal received..") 93 93 component.get("TorrentView").update() 94 94 component.get("ToolBar").update_buttons() 95 component.get("MenuBar").update() 95 96 96 97 def torrent_resumed(self, torrent_id): 97 98 log.debug("torrent_resumed signal received..") 98 99 component.get("TorrentView").update() 99 100 component.get("ToolBar").update_buttons() 101 component.get("MenuBar").update() 100 102 101 103 def torrent_all_paused(self): 102 104 log.debug("torrent_all_paused signal received..") 103 105 component.get("TorrentView").update() 104 106 component.get("ToolBar").update_buttons() 107 component.get("MenuBar").update() 105 108 106 109 def torrent_all_resumed(self): 107 110 log.debug("torrent_all_resumed signal received..") 108 111 component.get("TorrentView").update() 109 112 component.get("ToolBar").update_buttons() 113 component.get("MenuBar").update() 110 114 111 115 def config_value_changed(self, key, value): 112 116 log.debug("config_value_changed signal received..")