Philipp Hörist pushed to branch master at gajim / gajim
Commits: 4f5f110e by lovetox at 2020-08-31T21:38:38+02:00 Settings: Move row-activated handler into SettingsBox
- - - - -
2 changed files:
- gajim/gtk/accounts.py - gajim/gtk/settings.py
Changes:
===================================== gajim/gtk/accounts.py ===================================== @@ -585,8 +585,6 @@ class GenericSettingPage(Gtk.Box):
self.pack_end(self.listbox, True, True, 0)
- self.listbox.connect('row-activated', self.on_row_activated) - def connect_signal(self, stack): return stack.connect('notify::visible-child', self._on_visible_child_changed) @@ -595,10 +593,6 @@ class GenericSettingPage(Gtk.Box): if self == stack.get_visible_child(): self.listbox.update_states()
- @staticmethod - def on_row_activated(_listbox, row): - row.on_row_activated() -
class GeneralPage(GenericSettingPage):
===================================== gajim/gtk/settings.py ===================================== @@ -61,17 +61,12 @@ class SettingsDialog(Gtk.ApplicationWindow): self.add(self.listbox)
self.show_all() - self.listbox.connect('row-activated', self.on_row_activated) self.connect('key-press-event', self.on_key_press)
def on_key_press(self, _widget, event): if event.keyval == Gdk.KEY_Escape: self.destroy()
- @staticmethod - def on_row_activated(_listbox, row): - row.on_row_activated() - def get_setting(self, name): return self.listbox.get_setting(name)
@@ -105,6 +100,12 @@ class SettingsBox(Gtk.ListBox): for setting, callback in extend: self.map[setting] = callback
+ self.listbox.connect('row-activated', self.on_row_activated) + + @staticmethod + def on_row_activated(_listbox, row): + row.on_row_activated() + def add_setting(self, setting): if not isinstance(setting, Gtk.ListBoxRow): if setting.props is not None:
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/4f5f110e7ed95791da53642f5bb03495b...