Philipp Hörist pushed to branch master at gajim / gajim
Commits: 878a1e47 by lovetox at 2020-09-17T07:13:15+02:00 Settings: Allow context to be defined per setting
- - - - -
2 changed files:
- gajim/gtk/const.py - gajim/gtk/settings.py
Changes:
===================================== gajim/gtk/const.py ===================================== @@ -22,7 +22,7 @@ from enum import unique Filter = namedtuple('Filter', 'name pattern default')
Setting = namedtuple('Setting', 'kind label type value name callback data desc ' - 'bind inverted enabled_func props') + 'bind inverted enabled_func context props') Setting.__new__.__defaults__ = (None,) * len(Setting._fields) # type: ignore
@unique
===================================== gajim/gtk/settings.py ===================================== @@ -73,12 +73,11 @@ class SettingsDialog(Gtk.ApplicationWindow):
class SettingsBox(Gtk.ListBox): - def __init__(self, account=None, jid=None, context=None, extend=None): + def __init__(self, account=None, jid=None, extend=None): Gtk.ListBox.__init__(self) self.get_style_context().add_class('settings-box') self.account = account self.jid = jid - self.context = context self.named_settings = {}
self.map = { @@ -116,13 +115,11 @@ class SettingsBox(Gtk.ListBox): if setting.props is not None: listitem = self.map[setting.kind](self.account, self.jid, - self.context, *setting[1:-1], **setting.props) else: listitem = self.map[setting.kind](self.account, self.jid, - self.context, *setting[1:-1])
if setting.name is not None: @@ -141,7 +138,6 @@ class GenericSetting(Gtk.ListBoxRow): def __init__(self, account, jid, - context, label, type_, value, @@ -151,7 +147,9 @@ class GenericSetting(Gtk.ListBoxRow): desc, bind, inverted, - enabled_func): + enabled_func, + context): + Gtk.ListBoxRow.__init__(self) self._grid = Gtk.Grid() self._grid.set_size_request(-1, 30)
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/878a1e47cc6597c501c5ca8df5497b9e5...