From a1c252dbbe4fa2b9a98cca42ea27a9c9ff14d073 Mon Sep 17 00:00:00 2001 From: Alex Dedul Date: Wed, 8 Aug 2007 02:03:28 +0000 Subject: [PATCH] Made more buttons to use clicked signal. --- glade/plugin_dialog.glade | 2 +- plugins/EventLogging/__init__.py | 8 ++++---- .../EventLogging/event_logging_preferences.glade | 4 ++-- plugins/SimpleRSS/plugin.py | 4 ++-- plugins/SimpleRSS/rss.glade | 8 ++++---- .../notification_preferences.glade | 4 ++-- plugins/TorrentPeers/__init__.py | 8 ++++---- plugins/TorrentPeers/peers_preferences.glade | 4 ++-- plugins/TorrentSearch/searchdlg.glade | 2 +- src/dialogs.py | 14 ++++++++------ src/interface.py | 2 +- 11 files changed, 31 insertions(+), 29 deletions(-) diff --git a/glade/plugin_dialog.glade b/glade/plugin_dialog.glade index 228057f2f..a496604fc 100644 --- a/glade/plugin_dialog.glade +++ b/glade/plugin_dialog.glade @@ -127,7 +127,7 @@ gtk-close True 0 - + diff --git a/plugins/EventLogging/__init__.py b/plugins/EventLogging/__init__.py index 133b4bbd8..7f5b55550 100644 --- a/plugins/EventLogging/__init__.py +++ b/plugins/EventLogging/__init__.py @@ -73,8 +73,8 @@ class EventLogging: self.dialog = self.glade.get_widget("dialog") self.dialog.set_position(gtk.WIN_POS_CENTER) self.glade.signal_autoconnect({ - 'on_button_cancel_pressed': self.cancel_pressed, - 'on_button_ok_pressed': self.ok_pressed + 'on_button_cancel_clicked': self.cancel_clicked, + 'on_button_ok_clicked': self.ok_clicked }) self.viewport = gtk.Viewport() self.scrolledWindow = gtk.ScrolledWindow() @@ -257,7 +257,7 @@ class EventLogging: else: self.manager.disconnect_event(event_id, self.tab_log.handle_event) - def ok_pressed(self, src): + def ok_clicked(self, src): self.dialog.hide() self.update_config(self.manager.constants['EVENT_FINISHED'], self.glade.get_widget("chk_finished").get_active()) self.config.set("enable_finished", self.glade.get_widget("chk_finished").get_active()) @@ -299,5 +299,5 @@ class EventLogging: self.tab_log.disable_log_files() self.config.set("enable_log_files", self.glade.get_widget("chk_log_files").get_active()) - def cancel_pressed(self, src): + def cancel_clicked(self, src): self.dialog.hide() diff --git a/plugins/EventLogging/event_logging_preferences.glade b/plugins/EventLogging/event_logging_preferences.glade index fc6a96d4e..1ac47c1b0 100644 --- a/plugins/EventLogging/event_logging_preferences.glade +++ b/plugins/EventLogging/event_logging_preferences.glade @@ -307,7 +307,7 @@ gtk-cancel True 0 - + @@ -316,7 +316,7 @@ gtk-ok True 1 - + 1 diff --git a/plugins/SimpleRSS/plugin.py b/plugins/SimpleRSS/plugin.py index a3143bfb2..cf16508cc 100644 --- a/plugins/SimpleRSS/plugin.py +++ b/plugins/SimpleRSS/plugin.py @@ -89,8 +89,8 @@ class plugin_SimpleRSS: "torrents_fcc_changed" : self.torrents_fcc_changed, "torrents_view_row_activated" : self.torrents_view_row_activated, "chkfeeds_clicked" : self.chkfeeds_clicked, - "cancel_pressed" : self.dialog_cancel, - "ok_pressed" : self.dialog_ok } + "cancel_clicked" : self.dialog_cancel, + "ok_clicked" : self.dialog_ok } glade.signal_autoconnect(dic) self.feeds_view.get_selection().set_select_function(self.row_clicked) self.timer = 0 diff --git a/plugins/SimpleRSS/rss.glade b/plugins/SimpleRSS/rss.glade index 49cdfc03c..6da77ed49 100644 --- a/plugins/SimpleRSS/rss.glade +++ b/plugins/SimpleRSS/rss.glade @@ -217,7 +217,7 @@ gtk-add True 0 - + @@ -348,7 +348,7 @@ gtk-add True 0 - + @@ -858,7 +858,7 @@ gtk-cancel True 0 - + @@ -867,7 +867,7 @@ gtk-ok True 1 - + 1 diff --git a/plugins/TorrentNotification/notification_preferences.glade b/plugins/TorrentNotification/notification_preferences.glade index 5432e039c..775ead519 100644 --- a/plugins/TorrentNotification/notification_preferences.glade +++ b/plugins/TorrentNotification/notification_preferences.glade @@ -95,7 +95,7 @@ gtk-cancel True 0 - + @@ -104,7 +104,7 @@ gtk-ok True 1 - + 1 diff --git a/plugins/TorrentPeers/__init__.py b/plugins/TorrentPeers/__init__.py index 09ef91472..b6afa5d38 100644 --- a/plugins/TorrentPeers/__init__.py +++ b/plugins/TorrentPeers/__init__.py @@ -55,8 +55,8 @@ class TorrentPeers: self.dialog = self.glade.get_widget("dialog") self.glade.signal_autoconnect({ 'toggle_ui': self.toggle_ui, - 'on_button_cancel_pressed': self.cancel_pressed, - 'on_button_ok_pressed': self.ok_pressed + 'on_button_cancel_clicked': self.cancel_clicked, + 'on_button_ok_clicked': self.ok_clicked }) tree_view = gtk.TreeView() scrolled_window = gtk.ScrolledWindow() @@ -155,7 +155,7 @@ class TorrentPeers: else: self.tab_peers.update_peer_store() - def ok_pressed(self, src): + def ok_clicked(self, src): self.dialog.hide() needs_store_update = False @@ -173,5 +173,5 @@ class TorrentPeers: self.tab_peers.update_peer_store() self.tab_peers.ip_column_queue_resize() - def cancel_pressed(self, src): + def cancel_clicked(self, src): self.dialog.hide() diff --git a/plugins/TorrentPeers/peers_preferences.glade b/plugins/TorrentPeers/peers_preferences.glade index a2e260d65..55d33c70a 100644 --- a/plugins/TorrentPeers/peers_preferences.glade +++ b/plugins/TorrentPeers/peers_preferences.glade @@ -88,7 +88,7 @@ gtk-cancel True 0 - + @@ -97,7 +97,7 @@ gtk-ok True 1 - + 1 diff --git a/plugins/TorrentSearch/searchdlg.glade b/plugins/TorrentSearch/searchdlg.glade index 133d31a05..9e409df5c 100644 --- a/plugins/TorrentSearch/searchdlg.glade +++ b/plugins/TorrentSearch/searchdlg.glade @@ -21,7 +21,7 @@ True gtk-add True - + diff --git a/src/dialogs.py b/src/dialogs.py index 8f90c7e48..9be68f309 100644 --- a/src/dialogs.py +++ b/src/dialogs.py @@ -141,8 +141,10 @@ class PreferencesDlg: self.glade.get_widget('spin_port_min').set_sensitive(True) self.glade.get_widget('spin_port_max').set_sensitive(True) - self.glade.get_widget("ok_button").connect("clicked", self.ok_pressed, interface) - self.glade.get_widget("cancel_button").connect("clicked", self.cancel_pressed) + self.glade.get_widget("ok_button").connect("clicked", + self.ok_clicked, interface) + self.glade.get_widget("cancel_button").connect("clicked", + self.cancel_clicked) except KeyError: pass @@ -150,7 +152,7 @@ class PreferencesDlg: self.dialog.set_transient_for(window) self.dialog.show() - def ok_pressed(self, source, interface): + def ok_clicked(self, source, interface): self.dialog.hide() self.preferences.set("encin_state", self.glade.get_widget("combo_encin").get_active()) self.preferences.set("encout_state", self.glade.get_widget("combo_encout").get_active()) @@ -214,7 +216,7 @@ class PreferencesDlg: interface.apply_prefs() interface.config.save() - def cancel_pressed(self, source): + def cancel_clicked(self, source): self.dialog.hide() def TestPort(self, widget): @@ -337,7 +339,7 @@ class PluginDlg: name_col.set_expand(True) dgtk.add_toggle_column(self.view, _("Enabled"), 1, toggled_signal=self.plugin_toggled) signals = {'plugin_pref': self.plugin_pref, - 'on_close_pressed': self.close_pressed} + 'on_close_clicked': self.close_clicked} self.glade.signal_autoconnect(signals) self.plugins = plugins @@ -354,7 +356,7 @@ class PluginDlg: self.dialog.set_transient_for(window) self.dialog.show() - def close_pressed(self, source): + def close_clicked(self, source): self.dialog.hide() def old_clicked(self, path): diff --git a/src/interface.py b/src/interface.py index a0f33df60..fc5859b67 100644 --- a/src/interface.py +++ b/src/interface.py @@ -683,7 +683,7 @@ class DelugeGTK: def show_preferences_dialog(self): active_port = self.manager.get_state()['port'] preferences_dialog = dialogs.PreferencesDlg(self.config, active_port) - # Only apply the prefs if the user pressed OK in the prefs dialog + # Only apply the prefs if the user clicked OK in the prefs dialog preferences_dialog.show(self, self.window) def show_preferences_dialog_clicked(self, arg=None):