Skip to content

Commit

Permalink
Added copy address from conversations list
Browse files Browse the repository at this point in the history
  • Loading branch information
markqvist committed Oct 9, 2022
1 parent 9ec2ba9 commit 6db088f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions sbapp/ui/conversations.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
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
Expand Down Expand Up @@ -187,6 +188,12 @@ def dl_no(s):
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 = [
Expand All @@ -196,6 +203,12 @@ def dl_no(s):
"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",
Expand Down

0 comments on commit 6db088f

Please sign in to comment.