Made more buttons to use clicked signal.

This commit is contained in:
Alex Dedul 2007-08-08 02:03:28 +00:00
parent ce513e5725
commit a1c252dbbe
11 changed files with 31 additions and 29 deletions

View File

@ -127,7 +127,7 @@
<property name="label">gtk-close</property> <property name="label">gtk-close</property>
<property name="use_stock">True</property> <property name="use_stock">True</property>
<property name="response_id">0</property> <property name="response_id">0</property>
<signal name="clicked" handler="on_close_pressed"/> <signal name="clicked" handler="on_close_clicked"/>
</widget> </widget>
</child> </child>
</widget> </widget>

View File

@ -73,8 +73,8 @@ class EventLogging:
self.dialog = self.glade.get_widget("dialog") self.dialog = self.glade.get_widget("dialog")
self.dialog.set_position(gtk.WIN_POS_CENTER) self.dialog.set_position(gtk.WIN_POS_CENTER)
self.glade.signal_autoconnect({ self.glade.signal_autoconnect({
'on_button_cancel_pressed': self.cancel_pressed, 'on_button_cancel_clicked': self.cancel_clicked,
'on_button_ok_pressed': self.ok_pressed 'on_button_ok_clicked': self.ok_clicked
}) })
self.viewport = gtk.Viewport() self.viewport = gtk.Viewport()
self.scrolledWindow = gtk.ScrolledWindow() self.scrolledWindow = gtk.ScrolledWindow()
@ -257,7 +257,7 @@ class EventLogging:
else: else:
self.manager.disconnect_event(event_id, self.tab_log.handle_event) 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.dialog.hide()
self.update_config(self.manager.constants['EVENT_FINISHED'], self.glade.get_widget("chk_finished").get_active()) 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()) 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.tab_log.disable_log_files()
self.config.set("enable_log_files", self.glade.get_widget("chk_log_files").get_active()) 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() self.dialog.hide()

View File

@ -307,7 +307,7 @@
<property name="label">gtk-cancel</property> <property name="label">gtk-cancel</property>
<property name="use_stock">True</property> <property name="use_stock">True</property>
<property name="response_id">0</property> <property name="response_id">0</property>
<signal name="pressed" handler="on_button_cancel_pressed"/> <signal name="clicked" handler="on_button_cancel_clicked"/>
</widget> </widget>
</child> </child>
<child> <child>
@ -316,7 +316,7 @@
<property name="label">gtk-ok</property> <property name="label">gtk-ok</property>
<property name="use_stock">True</property> <property name="use_stock">True</property>
<property name="response_id">1</property> <property name="response_id">1</property>
<signal name="pressed" handler="on_button_ok_pressed"/> <signal name="clicked" handler="on_button_ok_clicked"/>
</widget> </widget>
<packing> <packing>
<property name="position">1</property> <property name="position">1</property>

View File

@ -89,8 +89,8 @@ class plugin_SimpleRSS:
"torrents_fcc_changed" : self.torrents_fcc_changed, "torrents_fcc_changed" : self.torrents_fcc_changed,
"torrents_view_row_activated" : self.torrents_view_row_activated, "torrents_view_row_activated" : self.torrents_view_row_activated,
"chkfeeds_clicked" : self.chkfeeds_clicked, "chkfeeds_clicked" : self.chkfeeds_clicked,
"cancel_pressed" : self.dialog_cancel, "cancel_clicked" : self.dialog_cancel,
"ok_pressed" : self.dialog_ok } "ok_clicked" : self.dialog_ok }
glade.signal_autoconnect(dic) glade.signal_autoconnect(dic)
self.feeds_view.get_selection().set_select_function(self.row_clicked) self.feeds_view.get_selection().set_select_function(self.row_clicked)
self.timer = 0 self.timer = 0

View File

@ -217,7 +217,7 @@
<property name="label">gtk-add</property> <property name="label">gtk-add</property>
<property name="use_stock">True</property> <property name="use_stock">True</property>
<property name="response_id">0</property> <property name="response_id">0</property>
<signal name="pressed" handler="addfeed_clicked"/> <signal name="clicked" handler="addfeed_clicked"/>
<signal name="activate" handler="addfeed_clicked"/> <signal name="activate" handler="addfeed_clicked"/>
</widget> </widget>
<packing> <packing>
@ -348,7 +348,7 @@
<property name="label">gtk-add</property> <property name="label">gtk-add</property>
<property name="use_stock">True</property> <property name="use_stock">True</property>
<property name="response_id">0</property> <property name="response_id">0</property>
<signal name="pressed" handler="addfilter_clicked"/> <signal name="clicked" handler="addfilter_clicked"/>
<signal name="activate" handler="addfilter_clicked"/> <signal name="activate" handler="addfilter_clicked"/>
</widget> </widget>
<packing> <packing>
@ -858,7 +858,7 @@
<property name="label">gtk-cancel</property> <property name="label">gtk-cancel</property>
<property name="use_stock">True</property> <property name="use_stock">True</property>
<property name="response_id">0</property> <property name="response_id">0</property>
<signal name="pressed" handler="cancel_pressed"/> <signal name="clicked" handler="cancel_clicked"/>
</widget> </widget>
</child> </child>
<child> <child>
@ -867,7 +867,7 @@
<property name="label">gtk-ok</property> <property name="label">gtk-ok</property>
<property name="use_stock">True</property> <property name="use_stock">True</property>
<property name="response_id">1</property> <property name="response_id">1</property>
<signal name="pressed" handler="ok_pressed"/> <signal name="clicked" handler="ok_clicked"/>
</widget> </widget>
<packing> <packing>
<property name="position">1</property> <property name="position">1</property>

View File

@ -95,7 +95,7 @@
<property name="label">gtk-cancel</property> <property name="label">gtk-cancel</property>
<property name="use_stock">True</property> <property name="use_stock">True</property>
<property name="response_id">0</property> <property name="response_id">0</property>
<signal name="pressed" handler="dialog_cancel"/> <signal name="clicked" handler="dialog_cancel"/>
</widget> </widget>
</child> </child>
<child> <child>
@ -104,7 +104,7 @@
<property name="label">gtk-ok</property> <property name="label">gtk-ok</property>
<property name="use_stock">True</property> <property name="use_stock">True</property>
<property name="response_id">1</property> <property name="response_id">1</property>
<signal name="pressed" handler="dialog_ok"/> <signal name="clicked" handler="dialog_ok"/>
</widget> </widget>
<packing> <packing>
<property name="position">1</property> <property name="position">1</property>

View File

@ -55,8 +55,8 @@ class TorrentPeers:
self.dialog = self.glade.get_widget("dialog") self.dialog = self.glade.get_widget("dialog")
self.glade.signal_autoconnect({ self.glade.signal_autoconnect({
'toggle_ui': self.toggle_ui, 'toggle_ui': self.toggle_ui,
'on_button_cancel_pressed': self.cancel_pressed, 'on_button_cancel_clicked': self.cancel_clicked,
'on_button_ok_pressed': self.ok_pressed 'on_button_ok_clicked': self.ok_clicked
}) })
tree_view = gtk.TreeView() tree_view = gtk.TreeView()
scrolled_window = gtk.ScrolledWindow() scrolled_window = gtk.ScrolledWindow()
@ -155,7 +155,7 @@ class TorrentPeers:
else: else:
self.tab_peers.update_peer_store() self.tab_peers.update_peer_store()
def ok_pressed(self, src): def ok_clicked(self, src):
self.dialog.hide() self.dialog.hide()
needs_store_update = False needs_store_update = False
@ -173,5 +173,5 @@ class TorrentPeers:
self.tab_peers.update_peer_store() self.tab_peers.update_peer_store()
self.tab_peers.ip_column_queue_resize() self.tab_peers.ip_column_queue_resize()
def cancel_pressed(self, src): def cancel_clicked(self, src):
self.dialog.hide() self.dialog.hide()

View File

@ -88,7 +88,7 @@
<property name="label">gtk-cancel</property> <property name="label">gtk-cancel</property>
<property name="use_stock">True</property> <property name="use_stock">True</property>
<property name="response_id">0</property> <property name="response_id">0</property>
<signal name="pressed" handler="on_button_cancel_pressed"/> <signal name="clicked" handler="on_button_cancel_clicked"/>
</widget> </widget>
</child> </child>
<child> <child>
@ -97,7 +97,7 @@
<property name="label">gtk-ok</property> <property name="label">gtk-ok</property>
<property name="use_stock">True</property> <property name="use_stock">True</property>
<property name="response_id">1</property> <property name="response_id">1</property>
<signal name="pressed" handler="on_button_ok_pressed"/> <signal name="clicked" handler="on_button_ok_clicked"/>
</widget> </widget>
<packing> <packing>
<property name="position">1</property> <property name="position">1</property>

View File

@ -21,7 +21,7 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="label">gtk-add</property> <property name="label">gtk-add</property>
<property name="use_stock">True</property> <property name="use_stock">True</property>
<signal name="pressed" handler="add_clicked"/> <signal name="clicked" handler="add_clicked"/>
<signal name="activate" handler="add_clicked"/> <signal name="activate" handler="add_clicked"/>
</widget> </widget>
<packing> <packing>

View File

@ -141,8 +141,10 @@ class PreferencesDlg:
self.glade.get_widget('spin_port_min').set_sensitive(True) self.glade.get_widget('spin_port_min').set_sensitive(True)
self.glade.get_widget('spin_port_max').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("ok_button").connect("clicked",
self.glade.get_widget("cancel_button").connect("clicked", self.cancel_pressed) self.ok_clicked, interface)
self.glade.get_widget("cancel_button").connect("clicked",
self.cancel_clicked)
except KeyError: except KeyError:
pass pass
@ -150,7 +152,7 @@ class PreferencesDlg:
self.dialog.set_transient_for(window) self.dialog.set_transient_for(window)
self.dialog.show() self.dialog.show()
def ok_pressed(self, source, interface): def ok_clicked(self, source, interface):
self.dialog.hide() self.dialog.hide()
self.preferences.set("encin_state", self.glade.get_widget("combo_encin").get_active()) 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()) self.preferences.set("encout_state", self.glade.get_widget("combo_encout").get_active())
@ -214,7 +216,7 @@ class PreferencesDlg:
interface.apply_prefs() interface.apply_prefs()
interface.config.save() interface.config.save()
def cancel_pressed(self, source): def cancel_clicked(self, source):
self.dialog.hide() self.dialog.hide()
def TestPort(self, widget): def TestPort(self, widget):
@ -337,7 +339,7 @@ class PluginDlg:
name_col.set_expand(True) name_col.set_expand(True)
dgtk.add_toggle_column(self.view, _("Enabled"), 1, toggled_signal=self.plugin_toggled) dgtk.add_toggle_column(self.view, _("Enabled"), 1, toggled_signal=self.plugin_toggled)
signals = {'plugin_pref': self.plugin_pref, signals = {'plugin_pref': self.plugin_pref,
'on_close_pressed': self.close_pressed} 'on_close_clicked': self.close_clicked}
self.glade.signal_autoconnect(signals) self.glade.signal_autoconnect(signals)
self.plugins = plugins self.plugins = plugins
@ -354,7 +356,7 @@ class PluginDlg:
self.dialog.set_transient_for(window) self.dialog.set_transient_for(window)
self.dialog.show() self.dialog.show()
def close_pressed(self, source): def close_clicked(self, source):
self.dialog.hide() self.dialog.hide()
def old_clicked(self, path): def old_clicked(self, path):

View File

@ -683,7 +683,7 @@ class DelugeGTK:
def show_preferences_dialog(self): def show_preferences_dialog(self):
active_port = self.manager.get_state()['port'] active_port = self.manager.get_state()['port']
preferences_dialog = dialogs.PreferencesDlg(self.config, active_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) preferences_dialog.show(self, self.window)
def show_preferences_dialog_clicked(self, arg=None): def show_preferences_dialog_clicked(self, arg=None):