From 332b7f5520597f797bcc3b2046a2ba4420c3ea77 Mon Sep 17 00:00:00 2001 From: "Rene V. Vergara" Date: Thu, 2 Jan 2025 13:41:12 -0500 Subject: [PATCH] rvv001 - Issue 085 - [Zenith GUI] Read a payment URI Processing Payment URI is working Display of error messages added to process --- src/Zenith/GUI.hs | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/Zenith/GUI.hs b/src/Zenith/GUI.hs index 292e9e6..966680a 100644 --- a/src/Zenith/GUI.hs +++ b/src/Zenith/GUI.hs @@ -273,7 +273,6 @@ buildUI wenv model = widgetTree [ mainWindow , confirmOverlay `nodeVisible` isJust (model ^. confirmTitle) , seedOverlay `nodeVisible` model ^. showSeed - , paymentURIOverlay `nodeVisible` model ^. paymentURIDisplay , txOverlay `nodeVisible` isJust (model ^. showTx) , sendTxOverlay `nodeVisible` model ^. openSend , txIdOverlay `nodeVisible` isJust (model ^. showId) @@ -289,6 +288,7 @@ buildUI wenv model = widgetTree model ^. updateABAddress , showVKOverlay `nodeVisible` model ^. viewingKeyDisplay + , paymentURIOverlay `nodeVisible` model ^. paymentURIDisplay , pmtUsingURIOverlay `nodeVisible` model ^. usepmtURIOverlay , shieldOverlay `nodeVisible` model ^. shieldZec , deShieldOverlay `nodeVisible` model ^. deShieldZec @@ -1735,14 +1735,18 @@ handleEvent wenv node model evt = -- DisplayPaymentURI -> [ Model $ model & paymentURIDisplay .~ True & uriString .~ "" & menuPopup .~ False] ClosePaymentURI -> [Model $ model & paymentURIDisplay .~ False] + -- + -- Display Pay using URI Form + -- + DisplayPayUsingURI -> [ Model $ model & usepmtURIOverlay.~ True & menuPopup .~ False] + ClosePayUsingURI -> [Model $ model & usepmtURIOverlay .~ False] ProcIfValidURI -> do - [Model $ model & paymentURIDisplay .~ False ] let zp = parseZcashPayment $ T.unpack (model ^. uriString) case zp of Right p -> do case uriAmount p of Just a -> - [ Model $ model & paymentURIDisplay .~ False + [ Model $ model & usepmtURIOverlay .~ False & openSend .~ True & privacyChoice .~ Full & recipientValid .~ False @@ -1752,22 +1756,17 @@ handleEvent wenv node model evt = , Event $ ClosePaymentURI ] Nothing -> - [ Model $ model & paymentURIDisplay .~ False + [ Model $ model & usepmtURIOverlay .~ False & openSend .~ False & uriString .~ "" , Event $ ShowError "Invalid URI" ] - Left e -> [ Model $ model & paymentURIDisplay .~ False + Left e -> [ Model $ model & usepmtURIOverlay .~ False & openSend .~ False & uriString .~ "" , Event $ ShowError "Invalid URI" ] -- - -- Display Pay using URI Form - -- - DisplayPayUsingURI -> [ Model $ model & usepmtURIOverlay.~ True & menuPopup .~ False] - ClosePayUsingURI -> [Model $ model & usepmtURIOverlay .~ False] - -- -- ShowShield -> if model ^. tBalance > 0