From 6db088f285e6fea96fdf20ba182ec787560fe59e Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Sun, 9 Oct 2022 14:39:56 +0200 Subject: [PATCH] Added copy address from conversations list --- sbapp/ui/conversations.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/sbapp/ui/conversations.py b/sbapp/ui/conversations.py index 8a24607..56e74a6 100644 --- a/sbapp/ui/conversations.py +++ b/sbapp/ui/conversations.py @@ -9,6 +9,7 @@ from kivymd.uix.menu import MDDropdownMenu from kivy.uix.gridlayout import GridLayout from kivy.uix.boxlayout import BoxLayout from kivy.clock import Clock +from kivy.core.clipboard import Clipboard from kivymd.uix.button import MDRectangleFlatButton from kivymd.uix.dialog import MDDialog @@ -187,6 +188,12 @@ class Conversations(): dialog.open() return x + def gen_copy_addr(dest, item): + def x(): + Clipboard.copy(RNS.hexrep(dest, delimit=False)) + item.dmenu.dismiss() + return x + if self.conversation_dropdown == None: dmi_h = 40 dm_items = [ @@ -196,6 +203,12 @@ class Conversations(): "height": dp(dmi_h), "on_release": gen_edit(context_dest, item) }, + { + "text": "Copy Address", + "viewclass": "OneLineListItem", + "height": dp(dmi_h), + "on_release": gen_copy_addr(context_dest, item) + }, { "text": "Clear Messages", "viewclass": "OneLineListItem",