rvv041 #82

Merged
pitmutt merged 30 commits from rvv041 into milestone2 2024-06-07 20:03:06 +00:00
Showing only changes of commit 4f0fa9bc34 - Show all commits

View file

@ -195,7 +195,6 @@ data State = State
, _abAddresses :: !(L.List Name (Entity AddressBook))
pitmutt marked this conversation as resolved Outdated

The field should be named _abAddresses

The field should be named `_abAddresses`
, _abForm :: !(Form AdrBookEntry () Name)
, _abCurAdrs :: !T.Text -- used for address book CRUD operations
pitmutt marked this conversation as resolved Outdated

What is this field for?

What is this field for?
, _abTxt :: !T.Text -- Holds the Address Book entry data to show
}
pitmutt marked this conversation as resolved Outdated

What is this field for?

What is this field for?
makeLenses ''State
@ -549,14 +548,21 @@ drawUI s = [splashDialog s, helpDialog s, displayDialog s, inputDialog s, ui s]
(strWrapWith
(WrapSettings False True NoFill FillAfterFirst)
(st ^. msg)))
AdrBookEntryDisplay ->
withBorderStyle unicodeBold $
D.renderDialog
(D.dialog (Just $ txt " Address Book Entry ") Nothing 60)
(padAll 1 $
txtWrapWith (WrapSettings False True NoFill FillAfterFirst) $
(st ^. abTxt))
AdrBookEntryDisplay -> do
case L.listSelectedElement $ st ^. abAddresses of
Just (_, a) -> do
let abentry = T.pack $
" Descr: " ++
T.unpack (addressBookAbdescrip (entityVal a)) ++
"\n Address: " ++
T.unpack (addressBookAbaddress (entityVal a))
withBorderStyle unicodeBold $
D.renderDialog
(D.dialog (Just $ txt " Address Book Entry ") Nothing 60)
(padAll 1 $
txtWrapWith (WrapSettings False True NoFill FillAfterFirst) $
abentry)
_ -> emptyWidget
BlankDisplay -> emptyWidget
mkInputForm :: DialogInput -> Form DialogInput e Name
@ -1099,16 +1105,11 @@ appEvent (BT.VtyEvent e) = do
BT.modify $ set dialogBox AdrBookForm
-- Show AddressBook entry data
V.EvKey V.KEnter [] -> do
case L.listSelectedElement $ s ^. abAddresses of
Just (_, a) -> do
BT.modify $ set abTxt $ T.pack $
" Descr: " ++
T.unpack (addressBookAbdescrip (entityVal a)) ++
"\n Address: " ++
T.unpack (addressBookAbaddress (entityVal a))
-- case L.listSelectedElement $ s ^. abAddresses of
-- Just (_, a) -> do
BT.modify $ set displayBox AdrBookEntryDisplay
_ -> do
BT.modify $ set dialogBox Blank
-- _ -> do
--q BT.modify $ set dialogBox Blank
-- Process any other event
ev -> BT.zoom abAddresses $ L.handleListEvent ev
-- Process new address book entry
@ -1336,7 +1337,6 @@ runZenithCLI config = do
(mkSendForm 0 $ SendInput "" 0.0 "")
(L.list ABList (Vec.fromList abookList) 1)
(mkNewABForm (AdrBookEntry "" ""))
" "
""
Left e -> print $
"No Zebra node available on port " <>