Add base addressbook to GUI #102

Merged
pitmutt merged 21 commits from rvv041 into milestone3 2024-09-13 11:39:59 +00:00
Showing only changes of commit 87feab284e - Show all commits

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 $