diff --git a/hledger-ui/Hledger/UI/AccountsScreen.hs b/hledger-ui/Hledger/UI/AccountsScreen.hs index ee883acb6..cfc6c6334 100644 --- a/hledger-ui/Hledger/UI/AccountsScreen.hs +++ b/hledger-ui/Hledger/UI/AccountsScreen.hs @@ -100,7 +100,7 @@ asInit d reset ui@UIState{ asInit _ _ _ = error "init function called with wrong screen type, should not happen" asDraw :: UIState -> [Widget] -asDraw UIState{aopts=UIOpts{cliopts_=CliOpts{reportopts_=ropts}} +asDraw UIState{aopts=UIOpts{cliopts_=copts@CliOpts{reportopts_=ropts}} ,ajournal=j ,aScreen=s@AccountsScreen{} ,aMode=mode @@ -110,18 +110,22 @@ asDraw UIState{aopts=UIOpts{cliopts_=CliOpts{reportopts_=ropts}} -- Minibuffer e -> [minibuffer e, maincontent] _ -> [maincontent] where - toplabel = files - <+> nonzero - <+> str " accounts" - <+> withAttr (borderAttr <> "query") (str (if flat_ ropts then " (flat)" else "")) - <+> borderQueryStr querystr - <+> togglefilters - <+> borderDepthStr mdepth - <+> str " (" - <+> cur - <+> str "/" - <+> total - <+> str ")" + toplabel = + files + <+> nonzero + <+> str " accounts" + <+> withAttr (borderAttr <> "query") (str (if flat_ ropts then " (flat)" else "")) + <+> borderQueryStr querystr + <+> togglefilters + <+> borderDepthStr mdepth + <+> str " (" + <+> cur + <+> str "/" + <+> total + <+> str ")" + <+> (if ignore_assertions_ copts + then withAttr (borderAttr <> "query") (str " ignoring balance assertions") + else str "") files = case journalFilePaths j of [] -> str "" f:_ -> withAttr ("border" <> "bold") $ str $ takeFileName f diff --git a/hledger-ui/Hledger/UI/ErrorScreen.hs b/hledger-ui/Hledger/UI/ErrorScreen.hs index 9640e2cd6..5ae7fbf4b 100644 --- a/hledger-ui/Hledger/UI/ErrorScreen.hs +++ b/hledger-ui/Hledger/UI/ErrorScreen.hs @@ -9,6 +9,7 @@ module Hledger.UI.ErrorScreen where import Brick +-- import Brick.Widgets.Border (borderAttr) import Control.Monad import Control.Monad.IO.Class (liftIO) import Data.Monoid @@ -36,15 +37,18 @@ esInit _ _ ui@UIState{aScreen=ErrorScreen{}} = ui esInit _ _ _ = error "init function called with wrong screen type, should not happen" esDraw :: UIState -> [Widget] -esDraw UIState{ -- aopts=_uopts@UIOpts{cliopts_=_copts@CliOpts{reportopts_=_ropts@ReportOpts{query_=querystr}}}, - aScreen=ErrorScreen{..} - ,aMode=mode} = +esDraw UIState{ --aopts=UIOpts{cliopts_=copts@CliOpts{}} + aScreen=ErrorScreen{..} + ,aMode=mode} = case mode of Help -> [helpDialog, maincontent] -- Minibuffer e -> [minibuffer e, maincontent] _ -> [maincontent] where - toplabel = withAttr ("border" <> "bold") (str "Oops. Please fix this problem then press g to reload") + toplabel = + withAttr ("border" <> "bold") (str "Oops. Please fix this problem then press g to reload") +-- <+> (if ignore_assertions_ copts then withAttr (borderAttr <> "query") (str " ignoring") else str " not ignoring") + maincontent = Widget Greedy Greedy $ do render $ defaultLayout toplabel bottomlabel $ withAttr "error" $ str $ esError where diff --git a/hledger-ui/Hledger/UI/RegisterScreen.hs b/hledger-ui/Hledger/UI/RegisterScreen.hs index 7a329560c..51d537721 100644 --- a/hledger-ui/Hledger/UI/RegisterScreen.hs +++ b/hledger-ui/Hledger/UI/RegisterScreen.hs @@ -99,7 +99,7 @@ rsInit d reset ui@UIState{aopts=UIOpts{cliopts_=CliOpts{reportopts_=ropts}}, ajo rsInit _ _ _ = error "init function called with wrong screen type, should not happen" rsDraw :: UIState -> [Widget] -rsDraw UIState{aopts=UIOpts{cliopts_=CliOpts{reportopts_=ropts}} +rsDraw UIState{aopts=UIOpts{cliopts_=copts@CliOpts{reportopts_=ropts}} ,aScreen=RegisterScreen{..} ,aMode=mode } = @@ -120,6 +120,7 @@ rsDraw UIState{aopts=UIOpts{cliopts_=CliOpts{reportopts_=ropts}} <+> str "/" <+> total <+> str ")" + <+> (if ignore_assertions_ copts then withAttr (borderAttr <> "query") (str " ignoring balance assertions") else str "") togglefilters = case concat [ if cleared_ ropts then ["cleared"] else [] diff --git a/hledger-ui/Hledger/UI/TransactionScreen.hs b/hledger-ui/Hledger/UI/TransactionScreen.hs index 65d3e0cf6..a2d6fb126 100644 --- a/hledger-ui/Hledger/UI/TransactionScreen.hs +++ b/hledger-ui/Hledger/UI/TransactionScreen.hs @@ -46,7 +46,7 @@ tsInit _d _reset ui@UIState{aopts=UIOpts{cliopts_=CliOpts{reportopts_=_ropts}} tsInit _ _ _ = error "init function called with wrong screen type, should not happen" tsDraw :: UIState -> [Widget] -tsDraw UIState{aopts=UIOpts{cliopts_=CliOpts{reportopts_=ropts}} +tsDraw UIState{aopts=UIOpts{cliopts_=copts@CliOpts{reportopts_=ropts}} ,aScreen=TransactionScreen{ tsTransaction=(i,t) ,tsTransactions=nts @@ -69,6 +69,7 @@ tsDraw UIState{aopts=UIOpts{cliopts_=CliOpts{reportopts_=ropts}} <+> togglefilters <+> borderQueryStr (query_ ropts) <+> str (" in "++T.unpack (replaceHiddenAccountsNameWith "All" acct)++")") + <+> (if ignore_assertions_ copts then withAttr (borderAttr <> "query") (str " ignoring balance assertions") else str "") togglefilters = case concat [ if cleared_ ropts then ["cleared"] else []