changeset 332:13bc00b9743a

chat: use `bind` for EncryptionButton events: binding them on init doesn't seem to work anymore
author Goffi <goffi@goffi.org>
date Fri, 20 Dec 2019 12:29:37 +0100
parents d36040493434
children 69d2a96ce26f
files cagou/plugins/plugin_wid_chat.py
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/cagou/plugins/plugin_wid_chat.py	Fri Dec 20 12:29:37 2019 +0100
+++ b/cagou/plugins/plugin_wid_chat.py	Fri Dec 20 12:29:37 2019 +0100
@@ -283,14 +283,19 @@
             selected=True,
             bold=False,
             )
+        btn.bind(
+            on_release=self.unencrypted,
+        )
         self.add_widget(btn)
         for plugin in G.host.encryption_plugins:
             btn = EncryptionButton(
                 text=plugin['name'],
+                trust_button=True,
+                )
+            btn.bind(
                 on_release=partial(self.startEncryption, plugin=plugin),
                 on_trust_release=partial(self.getTrustUI, plugin=plugin),
-                trust_button=True,
-                )
+            )
             self.add_widget(btn)
             log.info("added encryption: {}".format(plugin['name']))