rvv001 - TUI - Viewing Keys Display
Submenu created
This commit is contained in:
parent
62b6ee3f32
commit
cb927a0ab3
1 changed files with 47 additions and 2 deletions
|
@ -197,6 +197,8 @@ data DialogType
|
||||||
| DeshieldForm
|
| DeshieldForm
|
||||||
| ShieldForm
|
| ShieldForm
|
||||||
| ShowFIATBalance
|
| ShowFIATBalance
|
||||||
|
| ViewingKeyMenu
|
||||||
|
| ViewingKeyShow
|
||||||
|
|
||||||
data DisplayType
|
data DisplayType
|
||||||
= AddrDisplay
|
= AddrDisplay
|
||||||
|
@ -250,6 +252,8 @@ data State = State
|
||||||
, _sBalance :: !Integer
|
, _sBalance :: !Integer
|
||||||
, _currencyCode :: !T.Text
|
, _currencyCode :: !T.Text
|
||||||
, _zprice :: !Double
|
, _zprice :: !Double
|
||||||
|
, _vkName :: !T.Text
|
||||||
|
, _vkData :: !T.Text
|
||||||
}
|
}
|
||||||
|
|
||||||
makeLenses ''State
|
makeLenses ''State
|
||||||
|
@ -314,6 +318,7 @@ drawUI s = [splashDialog s, helpDialog s, displayDialog s, inputDialog s, ui s]
|
||||||
[ capCommand2 "Address " "B" "ook"
|
[ capCommand2 "Address " "B" "ook"
|
||||||
, capCommand2 "s" "H" "ield"
|
, capCommand2 "s" "H" "ield"
|
||||||
, capCommand "D" "e-shield"
|
, capCommand "D" "e-shield"
|
||||||
|
, capCommand2 "Viewing " "K" "eys"
|
||||||
, capCommand "Q" "uit"
|
, capCommand "Q" "uit"
|
||||||
, capCommand "?" " Help"
|
, capCommand "?" " Help"
|
||||||
, str $ show (st ^. timer)
|
, str $ show (st ^. timer)
|
||||||
|
@ -384,7 +389,7 @@ drawUI s = [splashDialog s, helpDialog s, displayDialog s, inputDialog s, ui s]
|
||||||
else emptyWidget
|
else emptyWidget
|
||||||
where
|
where
|
||||||
keyList =
|
keyList =
|
||||||
map (C.hCenter . str) ["?", "Esc", "w", "a", "v", "s", "b", "d", "l", "q"]
|
map (C.hCenter . str) ["?", "Esc", "w", "a", "v", "s", "b", "d", "k", "l", "q"]
|
||||||
actionList =
|
actionList =
|
||||||
map
|
map
|
||||||
(hLimit 40 . str)
|
(hLimit 40 . str)
|
||||||
|
@ -396,6 +401,7 @@ drawUI s = [splashDialog s, helpDialog s, displayDialog s, inputDialog s, ui s]
|
||||||
, "Send Tx"
|
, "Send Tx"
|
||||||
, "Address Book"
|
, "Address Book"
|
||||||
, "Shield/De-Shield"
|
, "Shield/De-Shield"
|
||||||
|
, "Viewing Keys"
|
||||||
, "Balance in Fiat"
|
, "Balance in Fiat"
|
||||||
, "Quit"
|
, "Quit"
|
||||||
]
|
]
|
||||||
|
@ -474,6 +480,19 @@ drawUI s = [splashDialog s, helpDialog s, displayDialog s, inputDialog s, ui s]
|
||||||
else displayTaz (st ^. tBalance) ++ "?") <=>
|
else displayTaz (st ^. tBalance) ++ "?") <=>
|
||||||
C.hCenter
|
C.hCenter
|
||||||
(hBox [capCommand "P" "roceed", capCommand "<esc> " "Cancel"]))
|
(hBox [capCommand "P" "roceed", capCommand "<esc> " "Cancel"]))
|
||||||
|
ViewingKeyShow ->
|
||||||
|
D.renderDialog
|
||||||
|
(D.dialog (Just ( str ( " " ++ ( T.unpack ( st ^. vkName ) ) ++ " Viewing Key ") ) ) Nothing 50)
|
||||||
|
-- (D.dialog (Just (str " Viewin Key ")) Nothing 50)
|
||||||
|
(C.hCenter
|
||||||
|
(hBox [capCommand "C" "opy to Clipoard", capCommand3 "" "E" "xit"]))
|
||||||
|
|
||||||
|
ViewingKeyMenu ->
|
||||||
|
D.renderDialog
|
||||||
|
(D.dialog (Just (str " Viewing Keys ")) Nothing 50)
|
||||||
|
(C.hCenter
|
||||||
|
(hBox [capCommand "F" "ull", capCommand "I" "ncoming", capCommand "O" "utgoing", capCommand3 "" "E" "xit"])
|
||||||
|
)
|
||||||
Blank -> emptyWidget
|
Blank -> emptyWidget
|
||||||
-- Address Book List
|
-- Address Book List
|
||||||
AdrBook ->
|
AdrBook ->
|
||||||
|
@ -555,7 +574,7 @@ drawUI s = [splashDialog s, helpDialog s, displayDialog s, inputDialog s, ui s]
|
||||||
(capCommand "R" "efresh" <+> capCommand3 "E" "x" "it")
|
(capCommand "R" "efresh" <+> capCommand3 "E" "x" "it")
|
||||||
]
|
]
|
||||||
])
|
])
|
||||||
--
|
--
|
||||||
splashDialog :: State -> Widget Name
|
splashDialog :: State -> Widget Name
|
||||||
splashDialog st =
|
splashDialog st =
|
||||||
if st ^. splashBox
|
if st ^. splashBox
|
||||||
|
@ -1035,6 +1054,8 @@ appEvent (BT.AppEvent t) = do
|
||||||
AdrBookDelForm -> return ()
|
AdrBookDelForm -> return ()
|
||||||
DeshieldForm -> return ()
|
DeshieldForm -> return ()
|
||||||
ShieldForm -> return ()
|
ShieldForm -> return ()
|
||||||
|
ViewingKeyShow -> return ()
|
||||||
|
ViewingKeyMenu -> return ()
|
||||||
ShowFIATBalance -> return()
|
ShowFIATBalance -> return()
|
||||||
Blank -> do
|
Blank -> do
|
||||||
if s ^. timer == 90
|
if s ^. timer == 90
|
||||||
|
@ -1631,6 +1652,25 @@ appEvent (BT.VtyEvent e) = do
|
||||||
-- Process any other event
|
-- Process any other event
|
||||||
ev -> BT.zoom abAddresses $ L.handleListEvent ev
|
ev -> BT.zoom abAddresses $ L.handleListEvent ev
|
||||||
--
|
--
|
||||||
|
--
|
||||||
|
ViewingKeyShow -> do
|
||||||
|
case e of
|
||||||
|
V.EvKey (V.KChar 'e') [] -> do
|
||||||
|
BT.modify $ set vkName ""
|
||||||
|
BT.modify $ set vkData ""
|
||||||
|
BT.modify $ set dialogBox ViewingKeyMenu
|
||||||
|
ev -> return ()
|
||||||
|
--
|
||||||
|
ViewingKeyMenu -> do
|
||||||
|
case e of
|
||||||
|
V.EvKey (V.KChar 'f') [] -> do
|
||||||
|
BT.modify $ set vkName "Full"
|
||||||
|
BT.modify $ set vkData "VKFull->ztestsapling1tgjr4zppwk4ne8xy6gdq4z2gwq7dmf5jq8z2ctpn8nlmtse0a74fa5z0m8z383gmpgqz6q6duu4"
|
||||||
|
BT.modify $ set dialogBox ViewingKeyShow
|
||||||
|
V.EvKey (V.KChar 'i') [] -> BT.modify $ set dialogBox Blank
|
||||||
|
V.EvKey (V.KChar 'o') [] -> BT.modify $ set dialogBox Blank
|
||||||
|
V.EvKey (V.KChar 'e') [] -> BT.modify $ set dialogBox Blank
|
||||||
|
ev -> return ()
|
||||||
-- Process any other event
|
-- Process any other event
|
||||||
Blank -> do
|
Blank -> do
|
||||||
case e of
|
case e of
|
||||||
|
@ -1724,6 +1764,9 @@ appEvent (BT.VtyEvent e) = do
|
||||||
msg
|
msg
|
||||||
"Not enough transparent funds in this account"
|
"Not enough transparent funds in this account"
|
||||||
BT.modify $ set displayBox MsgDisplay
|
BT.modify $ set displayBox MsgDisplay
|
||||||
|
-- >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
||||||
|
V.EvKey (V.KChar 'k') [] -> do
|
||||||
|
BT.modify $ set dialogBox ViewingKeyMenu
|
||||||
|
|
||||||
ev ->
|
ev ->
|
||||||
case r of
|
case r of
|
||||||
|
@ -1879,6 +1922,8 @@ runZenithTUI config = do
|
||||||
sBal
|
sBal
|
||||||
currencyCode
|
currencyCode
|
||||||
0
|
0
|
||||||
|
""
|
||||||
|
""
|
||||||
Left _e -> do
|
Left _e -> do
|
||||||
print $
|
print $
|
||||||
"No Zebra node available on port " <>
|
"No Zebra node available on port " <>
|
||||||
|
|
Loading…
Reference in a new issue