From 95d0b657855e65dffdd7791ee5ca75c00e9df39f Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Mon, 19 May 2008 02:26:10 +0000 Subject: [PATCH] Remove unnecessary calls to update_buttons() --- deluge/ui/gtkui/signals.py | 5 ----- deluge/ui/gtkui/toolbar.py | 10 ++++------ 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/deluge/ui/gtkui/signals.py b/deluge/ui/gtkui/signals.py index 2da59af85..ede2dccf8 100644 --- a/deluge/ui/gtkui/signals.py +++ b/deluge/ui/gtkui/signals.py @@ -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..") diff --git a/deluge/ui/gtkui/toolbar.py b/deluge/ui/gtkui/toolbar.py index df8974e16..e86969241 100644 --- a/deluge/ui/gtkui/toolbar.py +++ b/deluge/ui/gtkui/toolbar.py @@ -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