imp:ui: improve debug output
This commit is contained in:
parent
e9c1fc36a3
commit
d303e09603
@ -60,7 +60,7 @@ import Hledger.Cli.CliOptions
|
|||||||
import Hledger.UI.UITypes
|
import Hledger.UI.UITypes
|
||||||
import Hledger.UI.UIOptions (UIOpts(uoCliOpts))
|
import Hledger.UI.UIOptions (UIOpts(uoCliOpts))
|
||||||
import Hledger.UI.UIScreens (screenUpdate)
|
import Hledger.UI.UIScreens (screenUpdate)
|
||||||
import Hledger.UI.UIUtils (showScreenId)
|
import Hledger.UI.UIUtils (showScreenId, showScreenStack)
|
||||||
|
|
||||||
-- | Make an initial UI state with the given options, journal,
|
-- | Make an initial UI state with the given options, journal,
|
||||||
-- parent screen stack if any, and starting screen.
|
-- parent screen stack if any, and starting screen.
|
||||||
@ -341,17 +341,15 @@ setMode m ui = ui{aMode=m}
|
|||||||
|
|
||||||
pushScreen :: Screen -> UIState -> UIState
|
pushScreen :: Screen -> UIState -> UIState
|
||||||
pushScreen scr ui =
|
pushScreen scr ui =
|
||||||
dbg1Msg ("pushing screen " <> showScreenId scr)
|
dbg1Msg ("pushing screen " <> showScreenId scr <> ". " <> showScreenStack "" showScreenId ui1)
|
||||||
ui{aPrevScreens=aScreen ui:aPrevScreens ui
|
ui1
|
||||||
,aScreen=scr
|
where ui1 = ui{aPrevScreens=aScreen ui:aPrevScreens ui, aScreen=scr }
|
||||||
}
|
|
||||||
|
|
||||||
popScreen :: UIState -> UIState
|
popScreen :: UIState -> UIState
|
||||||
popScreen ui@UIState{aPrevScreens = s : ss} =
|
popScreen ui@UIState{aPrevScreens = s : ss} =
|
||||||
dbg1Msg ("popping screen " <> showScreenId (aScreen ui))
|
dbg1Msg ("popping screen " <> showScreenId (aScreen ui) <> ". " <> showScreenStack "" showScreenId ui1)
|
||||||
ui{aPrevScreens = ss
|
ui1
|
||||||
,aScreen = s
|
where ui1 = ui{aPrevScreens = ss ,aScreen = s }
|
||||||
}
|
|
||||||
popScreen ui = ui
|
popScreen ui = ui
|
||||||
|
|
||||||
-- | Reset options to their startup values, discard screen navigation history,
|
-- | Reset options to their startup values, discard screen navigation history,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user