Compare commits

..

No commits in common. "5339ea51c676dcd591b2a0f9dacda61202b47c33" and "c306d6bb0c7ee0324106eaf8ba322142894617de" have entirely different histories.

5 changed files with 110 additions and 139 deletions

View file

@ -28,7 +28,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed ### Changed
- Upgraded to GHC 9.6.5 - Upgraded to GHC 9.6.5
- Implemented config and data folder
### Fixed ### Fixed

View file

@ -202,7 +202,7 @@ processUri user pwd =
main :: IO () main :: IO ()
main = do main = do
config <- load ["$(HOME)/Zenith/zenith.cfg"] config <- load ["zenith.cfg"]
args <- getArgs args <- getArgs
dbFilePath <- require config "dbFilePath" dbFilePath <- require config "dbFilePath"
{-nodeUser <- require config "nodeUser"-} {-nodeUser <- require config "nodeUser"-}

View file

@ -25,8 +25,6 @@ import Lens.Micro ((&), (+~), (.~), (?~), (^.), set)
import Lens.Micro.TH import Lens.Micro.TH
import Monomer import Monomer
import qualified Monomer.Lens as L import qualified Monomer.Lens as L
import System.Directory (getHomeDirectory)
import System.FilePath ((</>))
import System.Hclip import System.Hclip
import Text.Printf import Text.Printf
import Text.Wrap (FillScope(..), FillStrategy(..), WrapSettings(..), wrapText) import Text.Wrap (FillScope(..), FillStrategy(..), WrapSettings(..), wrapText)
@ -143,7 +141,6 @@ data AppModel = AppModel
, _recipientValid :: !Bool , _recipientValid :: !Bool
, _amountValid :: !Bool , _amountValid :: !Bool
, _showId :: !(Maybe T.Text) , _showId :: !(Maybe T.Text)
, _home :: !FilePath
} deriving (Eq, Show) } deriving (Eq, Show)
makeLenses ''AppModel makeLenses ''AppModel
@ -443,11 +440,7 @@ buildUI wenv model = widgetTree
(fromIntegral $ qrCodeWidth qr)) (fromIntegral $ qrCodeWidth qr))
[fitWidth] [fitWidth]
Nothing -> Nothing ->
image_ image_ "./assets/1F928_color.png" [fitEither]) `styleBasic`
(T.pack $
(model ^. home) </>
"Zenith/assets/1F928_color.png")
[fitEither]) `styleBasic`
[bgColor white, height 100, width 100] [bgColor white, height 100, width 100]
, filler , filler
] `styleBasic` ] `styleBasic`
@ -511,9 +504,7 @@ buildUI wenv model = widgetTree
, spacer , spacer
, label (showt $ model ^. timer) `styleBasic` [padding 3, textSize 8] , label (showt $ model ^. timer) `styleBasic` [padding 3, textSize 8]
, filler , filler
, image_ , image_ "./assets/1F993.png" [fitHeight] `styleBasic`
(T.pack $ (model ^. home) </> "Zenith/assets/1F993.png")
[fitHeight] `styleBasic`
[height 24, width 24] `nodeVisible` [height 24, width 24] `nodeVisible`
(model ^. zebraOn) (model ^. zebraOn)
, label , label
@ -1251,10 +1242,6 @@ txtWrap = wrapText (WrapSettings False True NoFill FillAfterFirst) 32
runZenithGUI :: Config -> IO () runZenithGUI :: Config -> IO ()
runZenithGUI config = do runZenithGUI config = do
homeDir <- try getHomeDirectory :: IO (Either IOError FilePath)
case homeDir of
Left e -> print e
Right hD -> do
let host = c_zebraHost config let host = c_zebraHost config
let port = c_zebraPort config let port = c_zebraPort config
let dbFilePath = c_dbPath config let dbFilePath = c_dbPath config
@ -1273,13 +1260,11 @@ runZenithGUI config = do
walList <- getWallets pool $ zgb_net chainInfo walList <- getWallets pool $ zgb_net chainInfo
accList <- accList <-
if not (null walList) if not (null walList)
then runNoLoggingT $ then runNoLoggingT $ getAccounts pool $ entityKey $ head walList
getAccounts pool $ entityKey $ head walList
else return [] else return []
addrList <- addrList <-
if not (null accList) if not (null accList)
then runNoLoggingT $ then runNoLoggingT $ getAddresses pool $ entityKey $ head accList
getAddresses pool $ entityKey $ head accList
else return [] else return []
txList <- txList <-
if not (null addrList) if not (null addrList)
@ -1342,8 +1327,7 @@ runZenithGUI config = do
False False
False False
Nothing Nothing
hD startApp model handleEvent buildUI params
startApp model handleEvent buildUI (params hD)
Left e -> do Left e -> do
initDb dbFilePath initDb dbFilePath
let model = let model =
@ -1388,26 +1372,16 @@ runZenithGUI config = do
False False
False False
Nothing Nothing
hD startApp model handleEvent buildUI params
startApp model handleEvent buildUI (params hD)
where where
params hd = params =
[ appWindowTitle "Zenith - Zcash Full Node Wallet" [ appWindowTitle "Zenith - Zcash Full Node Wallet"
, appWindowState $ MainWindowNormal (1000, 700) , appWindowState $ MainWindowNormal (1000, 700)
, appTheme zenithTheme , appTheme zenithTheme
, appFontDef , appFontDef "Regular" "./assets/Atkinson-Hyperlegible-Regular-102.ttf" --"./assets/DejaVuSansMono.ttf"
"Regular" , appFontDef "Bold" "./assets/Atkinson-Hyperlegible-Bold-102.ttf"
(T.pack $ , appFontDef "Italic" "./assets/Atkinson-Hyperlegible-Italic-102.ttf"
hd </> , appFontDef "Remix" "./assets/remixicon.ttf"
"Zenith/assets/Atkinson-Hyperlegible-Regular-102.ttf" --"./assets/DejaVuSansMono.ttf"
)
, appFontDef
"Bold"
(T.pack $ hd </> "Zenith/assets/Atkinson-Hyperlegible-Bold-102.ttf")
, appFontDef
"Italic"
(T.pack $ hd </> "Zenith/assets/Atkinson-Hyperlegible-Italic-102.ttf")
, appFontDef "Remix" (T.pack $ hd </> "Zenith/assets/remixicon.ttf")
, appDisableAutoScale True , appDisableAutoScale True
, appScaleFactor 2.0 , appScaleFactor 2.0
, appInitEvent AppInit , appInitEvent AppInit

@ -1 +1 @@
Subproject commit e8074419cfb54559a4c09731ad2448d5930869a2 Subproject commit 90c8a7c3028bd6836dea5655221277a25d457653

View file

@ -47,8 +47,6 @@ library
, brick , brick
, bytestring , bytestring
, data-default , data-default
, directory
, filepath
, esqueleto , esqueleto
, resource-pool , resource-pool
, binary , binary