Add base addressbook to GUI #102
1 changed files with 15 additions and 5 deletions
|
@ -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 $
|
||||
|
|
Loading…
Reference in a new issue