| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Hledger.UI.ErrorScreen
Synopsis
- esNew :: String -> Screen
- esUpdate :: ErrorScreenState -> ErrorScreenState
- esDraw :: ErrorScreenState -> UIState -> [Widget Name]
- esHandle :: ErrorScreenState -> BrickEvent Name AppEvent -> EventM Name UIState ()
- uiCheckBalanceAssertions :: Day -> UIState -> UIState
- uiReload :: CliOpts -> Day -> UIState -> EventM Name UIState UIState
- uiReloadIfFileChanged :: CliOpts -> Day -> Journal -> UIState -> IO UIState
- uiToggleBalanceAssertions :: Day -> UIState -> EventM Name UIState ()
- uiAdjustOpts :: UIOpts -> CliOpts -> CliOpts
Documentation
esNew :: String -> Screen Source #
Construct an error screen. Screen-specific arguments: the error message to show.
esUpdate :: ErrorScreenState -> ErrorScreenState Source #
Update an error screen. Currently a no-op since error screen depends only on its screen-specific state.
uiCheckBalanceAssertions :: Day -> UIState -> UIState Source #
uiReload :: CliOpts -> Day -> UIState -> EventM Name UIState UIState Source #
Reload the journal from its input files, then update the ui app state accordingly. This means regenerate the entire screen stack from top level down to the current screen, using the provided today-date. As a convenience (usually), if journal reloading fails, this enters the error screen, or if already there, updates its message.
The provided cli options can influence reloading; then if reloading succeeds they are saved in the ui state, otherwise the UIState keeps its old options. (XXX needed for.. ?)
Like at hledger-ui startup, --forecast is always enabled. A forecast period specified in the provided opts, or at startup, is preserved.
uiReloadIfFileChanged :: CliOpts -> Day -> Journal -> UIState -> IO UIState Source #
Like uiReload, except it skips re-reading the journal if its file(s) have not changed since it was last loaded. The up app state is always updated, since the options or today-date may have changed. Also, this one runs in IO, suitable for suspendAndResume.
uiToggleBalanceAssertions :: Day -> UIState -> EventM Name UIState () Source #
Toggle ignoring balance assertions and assert rules (when user presses I), and if no longer ignoring, recheck them. Normally the recheck is done quickly on the in-memory journal. But if --pivot or --obfuscate is active, a full journal reload is done instead (because they change account names, so the checks can't be done on the in-memory journal). In that case, this operation could be slower and could reveal other data changes (not just check failures).
uiAdjustOpts :: UIOpts -> CliOpts -> CliOpts Source #
Modify some input options for loading the journal in hledger-ui, given its startup options: always enable --forecast, so forecast transactions can be shown or hidden without reloading. If --forecast wasn't used at startup, mark the forecast as only for display, so assert rules ignore it.