rvv001 - Issue 0085 - URI support implemented in GUI
- "Processing URI ..." message added - QR image Display for Transparent, Sapling and Unified address added.
This commit is contained in:
parent
ee71b7acbb
commit
c1f0d86f14
1 changed files with 29 additions and 6 deletions
|
@ -175,6 +175,7 @@ data AppEvent
|
||||||
| PrepareURIString
|
| PrepareURIString
|
||||||
| CloseShowURIOverlay
|
| CloseShowURIOverlay
|
||||||
| ShowURIOverlay !(Maybe URIQrCode) !T.Text
|
| ShowURIOverlay !(Maybe URIQrCode) !T.Text
|
||||||
|
| QRImageLoaded
|
||||||
| CopyURIString !T.Text
|
| CopyURIString !T.Text
|
||||||
| DisplayPayUsingURI
|
| DisplayPayUsingURI
|
||||||
| ClosePayUsingURI
|
| ClosePayUsingURI
|
||||||
|
@ -252,6 +253,7 @@ data AppModel = AppModel
|
||||||
, _uriString :: !T.Text
|
, _uriString :: !T.Text
|
||||||
, _uriAddr :: !T.Text
|
, _uriAddr :: !T.Text
|
||||||
, _uriQRImage :: !(Maybe URIQrCode)
|
, _uriQRImage :: !(Maybe URIQrCode)
|
||||||
|
, _uriQRInProgress :: !Bool
|
||||||
} deriving (Eq, Show)
|
} deriving (Eq, Show)
|
||||||
|
|
||||||
makeLenses ''AppModel
|
makeLenses ''AppModel
|
||||||
|
@ -318,6 +320,7 @@ buildUI wenv model = widgetTree
|
||||||
, dfBalOverlay `nodeVisible` model ^. displayFIATBalance
|
, dfBalOverlay `nodeVisible` model ^. displayFIATBalance
|
||||||
, showVKOverlay `nodeVisible` model ^. viewingKeyDisplay
|
, showVKOverlay `nodeVisible` model ^. viewingKeyDisplay
|
||||||
, paymentURIOverlay `nodeVisible` model ^. paymentURIDisplay
|
, paymentURIOverlay `nodeVisible` model ^. paymentURIDisplay
|
||||||
|
, showURIInProgress `nodeVisible` model ^. uriQRInProgress
|
||||||
, showURIOverlay `nodeVisible` model ^. showURIDisplay
|
, showURIOverlay `nodeVisible` model ^. showURIDisplay
|
||||||
, pmtUsingURIOverlay `nodeVisible` model ^. usepmtURIOverlay
|
, pmtUsingURIOverlay `nodeVisible` model ^. usepmtURIOverlay
|
||||||
, msgAdrBookOverlay `nodeVisible` isJust (model ^. msgAB)
|
, msgAdrBookOverlay `nodeVisible` isJust (model ^. msgAB)
|
||||||
|
@ -1323,6 +1326,20 @@ buildUI wenv model = widgetTree
|
||||||
]) `styleBasic`
|
]) `styleBasic`
|
||||||
[bgColor (white & L.a .~ 0.5)]
|
[bgColor (white & L.a .~ 0.5)]
|
||||||
--
|
--
|
||||||
|
showURIInProgress =
|
||||||
|
box
|
||||||
|
(vstack
|
||||||
|
[ filler
|
||||||
|
, hstack
|
||||||
|
[ filler
|
||||||
|
, label "Processing Payment URI, it will take a moment ....."
|
||||||
|
`styleBasic` [textFont "Bold", textSize 14]
|
||||||
|
, filler
|
||||||
|
]
|
||||||
|
, filler
|
||||||
|
]) `styleBasic`
|
||||||
|
[bgColor (white & L.a .~ 0.5)]
|
||||||
|
--
|
||||||
showURIOverlay =
|
showURIOverlay =
|
||||||
box
|
box
|
||||||
(vstack
|
(vstack
|
||||||
|
@ -1345,9 +1362,9 @@ buildUI wenv model = widgetTree
|
||||||
[ filler
|
[ filler
|
||||||
, box_
|
, box_
|
||||||
[alignMiddle]
|
[alignMiddle]
|
||||||
-- (image_ (T.pack ((model ^. home) </> "Zenith/assets/qr_image.png")) [fitFill])
|
|
||||||
(case model ^. uriQRImage of
|
(case model ^. uriQRImage of
|
||||||
Just img -> imageMem_ "URIQRCode" (uriBytes img) (Size (uriWidth img) (uriHeight img) ) [fitWidth]
|
Just img -> imageMem_ "URIQRCode" (uriBytes img) (Size (uriWidth img) (uriHeight img) )
|
||||||
|
[fitWidth]
|
||||||
Nothing -> image_
|
Nothing -> image_
|
||||||
(T.pack $ (model ^. home) </> "Zenith/assets/cracked_qr.png")
|
(T.pack $ (model ^. home) </> "Zenith/assets/cracked_qr.png")
|
||||||
[fitHeight] )
|
[fitHeight] )
|
||||||
|
@ -1910,15 +1927,20 @@ handleEvent wenv node model evt =
|
||||||
--
|
--
|
||||||
-- Generate URI
|
-- Generate URI
|
||||||
--
|
--
|
||||||
PrepareURIString -> [ Task $ genURIString (model ^. uriAddr) (model ^. sendAmount) (model ^. sendMemo) ]
|
PrepareURIString -> [ Task $ genURIString (model ^. uriAddr) (model ^. sendAmount) (model ^. sendMemo)
|
||||||
|
, Model $ model & uriQRInProgress .~ True
|
||||||
|
]
|
||||||
ShowURIOverlay qr uStr ->
|
ShowURIOverlay qr uStr ->
|
||||||
[ Model $
|
[ Model $
|
||||||
model & uriString .~ uStr
|
model & uriString .~ uStr
|
||||||
& uriQRImage .~ qr
|
& uriQRImage .~ qr
|
||||||
|
& uriQRInProgress .~ True
|
||||||
& paymentURIDisplay .~ False
|
& paymentURIDisplay .~ False
|
||||||
& showURIDisplay .~ True
|
& showURIDisplay .~ True
|
||||||
|
& uriQRInProgress .~ False
|
||||||
]
|
]
|
||||||
CloseShowURIOverlay -> [ Model $ model & showURIDisplay .~ False & uriString .~ "" & uriQRImage .~ Nothing]
|
CloseShowURIOverlay -> [ Model $ model & showURIDisplay .~ False & uriString .~ "" & uriQRInProgress .~ False & uriQRImage .~ Nothing]
|
||||||
|
QRImageLoaded -> [ Model $ model & uriQRInProgress .~ False ]
|
||||||
--
|
--
|
||||||
-- Display Pay using URI Form
|
-- Display Pay using URI Form
|
||||||
--
|
--
|
||||||
|
@ -2557,6 +2579,7 @@ runZenithGUI config = do
|
||||||
""
|
""
|
||||||
""
|
""
|
||||||
Nothing
|
Nothing
|
||||||
|
False
|
||||||
startApp model handleEvent buildUI (params hD)
|
startApp model handleEvent buildUI (params hD)
|
||||||
Left _e -> print "Zebra not available"
|
Left _e -> print "Zebra not available"
|
||||||
where
|
where
|
||||||
|
|
Loading…
Reference in a new issue