Remove unnecessary calls to update_buttons()
This commit is contained in:
parent
6dca7958a2
commit
95d0b65785
|
@ -88,27 +88,22 @@ class Signals(component.Component):
|
|||
# Remove the torrent from the treeview
|
||||
component.get("TorrentView").remove_row(torrent_id)
|
||||
component.get("TorrentDetails").clear()
|
||||
component.get("ToolBar").update_buttons()
|
||||
|
||||
def torrent_paused(self, torrent_id):
|
||||
log.debug("torrent_paused signal received..")
|
||||
component.get("TorrentView").update()
|
||||
component.get("ToolBar").update_buttons("paused", torrent_id)
|
||||
|
||||
def torrent_resumed(self, torrent_id):
|
||||
log.debug("torrent_resumed signal received..")
|
||||
component.get("TorrentView").update()
|
||||
component.get("ToolBar").update_buttons("resumed", torrent_id)
|
||||
|
||||
def torrent_all_paused(self):
|
||||
log.debug("torrent_all_paused signal received..")
|
||||
component.get("TorrentView").update()
|
||||
component.get("ToolBar").update_buttons("paused")
|
||||
|
||||
def torrent_all_resumed(self):
|
||||
log.debug("torrent_all_resumed signal received..")
|
||||
component.get("TorrentView").update()
|
||||
component.get("ToolBar").update_buttons("resumed")
|
||||
|
||||
def config_value_changed(self, key, value):
|
||||
log.debug("config_value_changed signal received..")
|
||||
|
|
|
@ -78,8 +78,7 @@ class ToolBar(component.Component):
|
|||
for widget in self.change_sensitivity:
|
||||
self.window.main_glade.get_widget(widget).set_sensitive(True)
|
||||
self.update_buttons()
|
||||
gobject.idle_add(self.update_buttons)
|
||||
|
||||
|
||||
def stop(self):
|
||||
for widget in self.change_sensitivity:
|
||||
self.window.main_glade.get_widget(widget).set_sensitive(False)
|
||||
|
@ -103,9 +102,7 @@ class ToolBar(component.Component):
|
|||
toolbutton.set_icon_widget(image)
|
||||
# Set the tooltip
|
||||
if tooltip is not None:
|
||||
tip = gtk.Tooltips()
|
||||
tip.set_tip(toolbutton, tooltip)
|
||||
|
||||
toolbutton.set_tooltip_text(tooltip)
|
||||
# Connect the 'clicked' event callback
|
||||
toolbutton.connect("clicked", callback)
|
||||
|
||||
|
@ -172,7 +169,7 @@ class ToolBar(component.Component):
|
|||
def on_toolbutton_queue_down_clicked(self, data):
|
||||
log.debug("on_toolbutton_queue_down_clicked")
|
||||
component.get("MenuBar").on_menuitem_queue_down_activate(data)
|
||||
|
||||
|
||||
def update_buttons(self, action=None, torrent_id=None):
|
||||
if action == None:
|
||||
# If all the selected torrents are paused, then disable the 'Pause'
|
||||
|
@ -206,6 +203,7 @@ class ToolBar(component.Component):
|
|||
("toolbutton_resume", resume),
|
||||
("toolbutton_remove", remove)):
|
||||
self.window.main_glade.get_widget(name).set_sensitive(sensitive)
|
||||
|
||||
|
||||
return False
|
||||
|
||||
|
|
Loading…
Reference in New Issue