From 44c6b324abee64b0d8f3bf837c396657ef4f93ab Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Sat, 10 Jun 2017 10:48:55 -0700 Subject: [PATCH] ui: add P key to toggle pending mode (#564) --- hledger-ui/Hledger/UI/AccountsScreen.hs | 1 + hledger-ui/Hledger/UI/RegisterScreen.hs | 1 + hledger-ui/Hledger/UI/UIUtils.hs | 1 + hledger-ui/doc/hledger-ui.1.m4.md | 16 +++++++--------- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/hledger-ui/Hledger/UI/AccountsScreen.hs b/hledger-ui/Hledger/UI/AccountsScreen.hs index d1461e3d1..86f362467 100644 --- a/hledger-ui/Hledger/UI/AccountsScreen.hs +++ b/hledger-ui/Hledger/UI/AccountsScreen.hs @@ -319,6 +319,7 @@ asHandle ui0@UIState{ VtyEvent (EvKey (KChar 'F') []) -> continue $ regenerateScreens j d $ toggleFlat ui VtyEvent (EvKey (KChar 'Z') []) -> scrollTop >> (continue $ regenerateScreens j d $ toggleEmpty ui) VtyEvent (EvKey (KChar 'C') []) -> scrollTop >> (continue $ regenerateScreens j d $ toggleCleared ui) + VtyEvent (EvKey (KChar 'P') []) -> scrollTop >> (continue $ regenerateScreens j d $ togglePending ui) VtyEvent (EvKey (KChar 'U') []) -> scrollTop >> (continue $ regenerateScreens j d $ toggleUncleared ui) VtyEvent (EvKey (KChar 'R') []) -> scrollTop >> (continue $ regenerateScreens j d $ toggleReal ui) VtyEvent (EvKey (KDown) [MShift]) -> continue $ regenerateScreens j d $ shrinkReportPeriod d ui diff --git a/hledger-ui/Hledger/UI/RegisterScreen.hs b/hledger-ui/Hledger/UI/RegisterScreen.hs index 303348179..d79039c01 100644 --- a/hledger-ui/Hledger/UI/RegisterScreen.hs +++ b/hledger-ui/Hledger/UI/RegisterScreen.hs @@ -289,6 +289,7 @@ rsHandle ui@UIState{ VtyEvent (EvKey (KChar 'F') []) -> scrollTop >> (continue $ regenerateScreens j d $ toggleFlat ui) VtyEvent (EvKey (KChar 'Z') []) -> scrollTop >> (continue $ regenerateScreens j d $ toggleEmpty ui) VtyEvent (EvKey (KChar 'C') []) -> scrollTop >> (continue $ regenerateScreens j d $ toggleCleared ui) + VtyEvent (EvKey (KChar 'P') []) -> scrollTop >> (continue $ regenerateScreens j d $ togglePending ui) VtyEvent (EvKey (KChar 'U') []) -> scrollTop >> (continue $ regenerateScreens j d $ toggleUncleared ui) VtyEvent (EvKey (KChar 'R') []) -> scrollTop >> (continue $ regenerateScreens j d $ toggleReal ui) VtyEvent (EvKey (KChar '/') []) -> (continue $ regenerateScreens j d $ showMinibuffer ui) diff --git a/hledger-ui/Hledger/UI/UIUtils.hs b/hledger-ui/Hledger/UI/UIUtils.hs index ac5c0cf65..cf23502d4 100644 --- a/hledger-ui/Hledger/UI/UIUtils.hs +++ b/hledger-ui/Hledger/UI/UIUtils.hs @@ -78,6 +78,7 @@ helpDialog = ,str " " ,renderKey ("/", "set a filter query") ,renderKey ("C", "toggle cleared/all") + ,renderKey ("P", "toggle pending/all") ,renderKey ("U", "toggle uncleared/all") ,renderKey ("R", "toggle real/all") ,renderKey ("Z", "toggle nonzero/all") diff --git a/hledger-ui/doc/hledger-ui.1.m4.md b/hledger-ui/doc/hledger-ui.1.m4.md index e95aadc75..8008fe2c4 100644 --- a/hledger-ui/doc/hledger-ui.1.m4.md +++ b/hledger-ui/doc/hledger-ui.1.m4.md @@ -112,7 +112,7 @@ To set a non-standard period, you can use `/` and a `date:` query. using the same [query terms](/hledger.html#queries) as in hledger and hledger-web. While editing the query, you can use [CTRL-a/e/d/k, BS, cursor keys](http://hackage.haskell.org/package/brick-0.7/docs/Brick-Widgets-Edit.html#t:Editor); press `ENTER` to set it, or `ESCAPE`to cancel. -There are also keys for quickly adjusting some common filters like account depth and cleared/uncleared (see below). +There are also keys for quickly adjusting some common filters like account depth and transaction status (see below). `BACKSPACE` or `DELETE` removes all filters, showing all transactions. `ESCAPE` removes all filters and jumps back to the top screen. @@ -163,10 +163,9 @@ balances are what you would see on a bank statement for that account (unless dis a filter query). Period balances ignore transactions before the report start date, so they show the change in balance during the report period. They are more useful eg when viewing a time log. -`C` toggles cleared mode, in which -[uncleared transactions and postings](/journal.html#transactions) are -not shown. `U` toggles uncleared mode, in which only uncleared -transactions/postings are shown. +`C` toggles cleared mode, which shows balances for postings with [cleared status](/journal.html#status) only. +Similarly, `P` toggles pending mode, which shows balances for pending postings only, +and `U` toggles uncleared mode, which shows balances for unmarked postings only. `R` toggles real mode, in which [virtual postings](/journal.html#virtual-postings) are ignored. @@ -203,10 +202,9 @@ In other words, the register always shows the transactions responsible for the p shown on the accounts screen. As on the accounts screen, this can be toggled with `F`. -`C` toggles cleared mode, in which -[uncleared transactions and postings](/journal.html#transactions) are -not shown. `U` toggles uncleared mode, in which only uncleared -transactions/postings are shown. +`C` toggles cleared mode, which shows transactions with [cleared status](/journal.html#status) only. +Similarly, `P` toggles pending mode, which shows only pending transactions, +and `U` toggles uncleared mode, which shows only unmarked transactions. `R` toggles real mode, in which [virtual postings](/journal.html#virtual-postings) are ignored.