rvv041 - Address Book - Copy ZEC Address to clipboard implemented

- Edit Adress Book entry in progress.
This commit is contained in:
Rene V. Vergara A. 2024-09-06 19:50:50 -04:00
parent 5ce0b5fa0f
commit 87feab284e

View file

@ -121,6 +121,7 @@ data AppEvent
| ShowMessage !T.Text
| ShowABAddress !T.Text !T.Text
| CloseShowABAddress
| CopyABAdress !T.Text
deriving (Eq, Show)
data AppModel = AppModel
@ -809,10 +810,6 @@ buildUI wenv model = widgetTree
, spacer
, hstack
[ button "New" NewAdrBkEntry
, spacer
, button "Edit" notImplemented
, spacer
, button "Copy" notImplemented
]
]
abookRow :: Int -> Entity AddressBook -> WidgetNode AppModel AppEvent
@ -875,7 +872,7 @@ buildUI wenv model = widgetTree
, spacer
, hstack
[ filler
, label_ (txtWrapN abd 64) [multiline]
, label (txtWrapN abd 64) `styleBasic` [textFont "Bold"]
, filler
]
, spacer
@ -884,6 +881,14 @@ buildUI wenv model = widgetTree
, label_ (txtWrapN aba 64) [multiline]
, filler
]
, spacer
, hstack
[ filler
, button "Edit Entry" NotImplemented
, spacer
, button "Copy address" $ CopyABAdress aba
, filler
]
]
msgAdrBookOverlay =
alert CloseMsgAB $
@ -1237,6 +1242,11 @@ handleEvent wenv node model evt =
[ Model $ model & abdescrip .~ d & abaddress .~ a & showABAddress .~ True & menuPopup .~ False ]
CloseShowABAddress ->
[Model $ model & showABAddress .~ False & inError .~ False]
CopyABAdress a ->
[ setClipboardData ClipboardEmpty
, setClipboardData $ ClipboardText a
, Event $ ShowMessage "Address copied!!"
]
ShowMessage a -> [Model $ model & msgAB ?~ a & menuPopup .~ False]
NotImplemented ->
[ Model $