diff --git a/hledger-ui/Hledger/UI/AccountsScreen.hs b/hledger-ui/Hledger/UI/AccountsScreen.hs index 5678bc10f..6d0a7521d 100644 --- a/hledger-ui/Hledger/UI/AccountsScreen.hs +++ b/hledger-ui/Hledger/UI/AccountsScreen.hs @@ -58,19 +58,19 @@ initAccountsScreen _ _ _ = error "init function called with wrong screen type, s drawAccountsScreen :: AppState -> [Widget] drawAccountsScreen st@AppState{aopts=uopts, ajournal=j, aScreen=AccountsScreen{asState=is}} = [ui] where - label = str "Accounts in " - <+> withAttr ("border" <> "bold") files + label = files + <+> str " accounts" <+> borderQuery querystr <+> str " (" <+> cur <+> str " of " <+> total <+> str ")" - files = str $ case journalFilePaths j of - [] -> "" - [f] -> takeFileName f - [f,_] -> takeFileName f ++ " (& 1 included file)" - f:fs -> takeFileName f ++ " (& " ++ show (length fs) ++ " included files)" + files = case journalFilePaths j of + [] -> str "" + [f] -> withAttr ("border" <> "bold") $ str $ takeFileName f + [f,_] -> (withAttr ("border" <> "bold") $ str $ takeFileName f) <+> str " (& 1 included file)" + f:fs -> (withAttr ("border" <> "bold") $ str $ takeFileName f) <+> str (" (& " ++ show (length fs) ++ " included files)") querystr = query_ $ reportopts_ $ cliopts_ uopts cur = str (case is^.listSelectedL of Nothing -> "-" diff --git a/hledger-ui/Hledger/UI/RegisterScreen2.hs b/hledger-ui/Hledger/UI/RegisterScreen2.hs index e3d8be2ad..8557f8bf5 100644 --- a/hledger-ui/Hledger/UI/RegisterScreen2.hs +++ b/hledger-ui/Hledger/UI/RegisterScreen2.hs @@ -48,13 +48,19 @@ initRegisterScreen2 d args st@AppState{aopts=opts, ajournal=j, aScreen=s@Registe balancetype_=HistoricalBalance } -- XXX temp - thisacctq = Acct $ accountNameToAccountRegex acct -- XXX why is this excluding subs: accountNameToAccountRegex curacct + thisacctq = Acct $ accountNameToAccountRegex acct -- includes subs q = queryFromOpts d ropts -- query_="cur:\\$"} -- XXX limit to one commodity to ensure one-line items --{query_=unwords' $ locArgs l} -- run a transactions report, most recent last - (_label,items') = accountTransactionsReport ropts j q thisacctq + q' = + -- ltrace "q" + q + thisacctq' = + -- ltrace "thisacctq" + thisacctq + (_label,items') = accountTransactionsReport ropts j q' thisacctq' items = reverse items' -- pre-render all items; these will be the List elements. This helps calculate column widths. @@ -82,8 +88,8 @@ drawRegisterScreen2 :: AppState -> [Widget] drawRegisterScreen2 AppState{aopts=_uopts@UIOpts{cliopts_=_copts@CliOpts{reportopts_=_ropts@ReportOpts{query_=querystr}}}, aargs=_args, aScreen=RegisterScreen2{rs2State=l,rs2Acct=acct}} = [ui] where - label = str "Transactions in " - <+> withAttr ("border" <> "bold") (str acct) + label = withAttr ("border" <> "bold") (str acct) + <+> str " transactions" <+> borderQuery querystr -- <+> str " and subs" <+> str " (" diff --git a/hledger-ui/Hledger/UI/UIUtils.hs b/hledger-ui/Hledger/UI/UIUtils.hs index 472b802b7..3fa3c9227 100644 --- a/hledger-ui/Hledger/UI/UIUtils.hs +++ b/hledger-ui/Hledger/UI/UIUtils.hs @@ -125,4 +125,4 @@ withBorderAttr attr = updateAttrMap (applyAttrMappings [(borderAttr, attr)]) borderQuery :: String -> Widget borderQuery "" = str "" -borderQuery qry = str " filtered by: " <+> withAttr (borderAttr <> "query") (str qry) +borderQuery qry = str " matching " <+> withAttr (borderAttr <> "query") (str qry)