imp: ui: menu: move "All accounts" screen last

This commit is contained in:
Simon Michael 2023-03-24 08:03:04 -10:00
parent a4b3476e2f
commit 3705e4c15e
2 changed files with 7 additions and 5 deletions

View File

@ -37,10 +37,10 @@ uiflags = [
flagNone ["watch","w"] (setboolopt "watch") "watch for data and date changes and reload automatically"
,flagReq ["theme"] (\s opts -> Right $ setopt "theme" s opts) "THEME" ("use this custom display theme ("++intercalate ", " themeNames++")")
,flagNone ["menu"] (setboolopt "menu") "start in the menu screen"
,flagNone ["all"] (setboolopt "all") "start in the all accounts screen"
,flagNone ["cash"] (setboolopt "cash") "start in the cash accounts screen"
,flagNone ["bs"] (setboolopt "bs") "start in the balance sheet accounts screen"
,flagNone ["is"] (setboolopt "is") "start in the income statement accounts screen"
,flagNone ["all"] (setboolopt "all") "start in the all accounts screen"
,flagReq ["register"] (\s opts -> Right $ setopt "register" s opts) "ACCTREGEX" "start in the (first matched) account's register"
,flagNone ["change"] (setboolopt "change")
"show period balances (changes) at startup instead of historical balances"
@ -58,7 +58,7 @@ uiflags = [
--uimode :: Mode RawOpts
uimode = (mode "hledger-ui" (setopt "command" "ui" def)
"browse accounts, postings and entries in a full-window TUI"
(argsFlag "[--menu|--all|--cash|--bs|--is|--register=ACCT] [QUERY]") []){
(argsFlag "[--menu|--cash|--bs|--is|--all|--register=ACCT] [QUERY]") []){
modeGroupFlags = Group {
groupUnnamed = uiflags
,groupHidden = hiddenflags

View File

@ -84,14 +84,16 @@ msNew =
MS MSS {
_mssList = list MenuList (V.fromList [
-- keep initial screen stack setup in UI.Main synced with these
MenuScreenItem "All accounts" Accounts
,MenuScreenItem "Cash accounts" CashScreen
MenuScreenItem "Cash accounts" CashScreen
,MenuScreenItem "Balance sheet accounts" Balancesheet
,MenuScreenItem "Income statement accounts" Incomestatement
,MenuScreenItem "All accounts" Accounts
]) 1
& listMoveTo defaultscreenitem
,_mssUnused = ()
} where defaultscreenitem = 2 -- select this one at startup (currently this screen is constructed only then)
} where
-- select balance sheet accounts at startup (currently this screen is constructed only then)
defaultscreenitem = 1
-- | Update a menu screen. Currently a no-op since menu screen
-- has unchanging content.