Commit 6b5e38dd authored by Daniel Brötzmann's avatar Daniel Brötzmann Committed by Daniel Brötzmann
Browse files

Settings: Bind signals for ColorSetting and EntrySetting

parent c5dec94f
......@@ -417,8 +417,21 @@ def __init__(self, *args):
self.setting_box.pack_end(self.entry, True, True, 0)
app.settings.connect_signal(self.value,
self._on_setting_changed,
account=self.account,
jid=self.jid)
self.connect('destroy', self._on_destroy)
self.show_all()
def _on_setting_changed(self, value, *args):
self.entry.set_text(value)
def _on_destroy(self, *args):
app.settings.disconnect_signals(self)
def on_text_change(self, *args):
text = self.entry.get_text()
self.set_value(text)
......@@ -441,8 +454,23 @@ def __init__(self, *args):
self.setting_box.pack_end(self.color_button, True, True, 0)
app.settings.connect_signal(self.value,
self._on_setting_changed,
account=self.account,
jid=self.jid)
self.connect('destroy', self._on_destroy)
self.show_all()
def _on_setting_changed(self, value, *args):
rgba = Gdk.RGBA()
rgba.parse(value)
self.color_button.set_rgba(rgba)
def _on_destroy(self, *args):
app.settings.disconnect_signals(self)
def on_color_set(self, button):
rgba = button.get_rgba()
self.set_value(rgba.to_string())
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment