diff src/cagou/plugins/plugin_wid_chat.kv @ 117:f0291755b07c

chat: OTR integration first draft: an encryption button is added in Chat header, launching the start/refresh, end session and authenticate menus.
author Goffi <goffi@goffi.org>
date Thu, 26 Jan 2017 20:39:35 +0100
parents 8576d70ff803
children dcd6fbb3f010
line wrap: on
line diff
--- a/src/cagou/plugins/plugin_wid_chat.kv	Thu Jan 26 20:39:32 2017 +0100
+++ b/src/cagou/plugins/plugin_wid_chat.kv	Thu Jan 26 20:39:35 2017 +0100
@@ -112,3 +112,34 @@
             size_hint: None, 1
             width: max(self.texture_size[0], dp(40))
             on_release: TransferMenu(callback=root.onTransferOK).show(self)
+
+<EncryptionButton>:
+    size_hint: None, 1
+    width: dp(30)
+    source: app.expand("{media}/icons/muchoslava/png/cadenas_ouvert_30.png")
+
+<OtrButton@Button>:
+    size_hint: None, None
+    size: self.texture_size
+    padding: 5, 5
+
+<OtrMenu>:
+    size_hint_x: None
+    width: start_btn.width
+    auto_width: False
+    canvas.before:
+        Color:
+            rgba: 0, 0, 0, 1
+        Rectangle:
+            pos: self.pos
+            size: self.size
+    OtrButton:
+        id: start_btn
+        text: _(u"Start/Refresh encrypted session")
+        on_release: root.otr_start()
+    OtrButton:
+        text: _(u"Finish encrypted session")
+        on_release: root.otr_end()
+    OtrButton:
+        text: _(u"Authenticate destinee")
+        on_release: root.otr_authenticate()