Added copy address from conversations list

This commit is contained in:
Mark Qvist 2022-10-09 14:39:56 +02:00
parent 9ec2ba9cd5
commit 6db088f285
1 changed files with 13 additions and 0 deletions

View File

@ -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",