From 1e6b6298e55ce72f6da5d612876e70e392a2079a Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Sun, 29 Oct 2023 16:12:42 +0100 Subject: [PATCH] Added copy to clipboard --- sbapp/ui/objectdetails.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sbapp/ui/objectdetails.py b/sbapp/ui/objectdetails.py index 8735915..792378b 100644 --- a/sbapp/ui/objectdetails.py +++ b/sbapp/ui/objectdetails.py @@ -242,10 +242,18 @@ class RVDetails(MDRecycleView): if ts != None: ts_str = datetime.fromtimestamp(ts).strftime("%Y-%m-%d %H:%M:%S") formatted_values = f"Recorded [b]{RNS.prettytime(time.time()-ts, compact=True)} ago[/b] ({ts_str})" + def copy_info(e=None): + Clipboard.copy(ts_str) + toast("Copied to clipboard") + release_function = copy_info elif name == "Information": info = s["values"]["contents"] if info != None: istr = str(info) + def copy_info(e=None): + Clipboard.copy(istr) + toast("Copied to clipboard") + release_function = copy_info external_text = escape_markup(istr) formatted_values = f"[b]Information[/b]: {external_text}" elif name == "Received":