packages feed

hledger-ui 0.27 → 0.27.1

raw patch · 3 files changed

+36/−9 lines, 3 filesdep ~hledgerdep ~hledger-libdep ~lens

Dependency ranges changed: hledger, hledger-lib, lens

Files

CHANGES view
@@ -1,7 +1,13 @@ User-visible changes in hledger-ui. See also hledger's change log. -0.27 (unreleased)+0.27.1 (2015/12/3)++- allow lens 4.13+- make reloading work on the transaction screen+++0.27 (2015/10/30)  - hledger-ui is a new curses-style UI, intended to be a standard part   of the hledger toolset for all users (except on native MS Windows,
Hledger/UI/TransactionScreen.hs view
@@ -71,7 +71,7 @@ handleTransactionScreen :: AppState -> Vty.Event -> EventM (Next AppState) handleTransactionScreen st@AppState{    aScreen=s@TransactionScreen{tsState=((i,t),nts,acct)}-  ,aopts=UIOpts{cliopts_=_copts}+  ,aopts=UIOpts{cliopts_=CliOpts{reportopts_=ropts}}   ,ajournal=j   } e = do   d <- liftIO getCurrentDay@@ -86,7 +86,28 @@       d <- liftIO getCurrentDay       ej <- liftIO $ journalReload j  -- (ej, changed) <- liftIO $ journalReloadIfChanged copts j       case ej of-        Right j' -> continue $ reload j' d st+        Right j' -> do+          -- got to redo the register screen's transactions report, to get the latest transactions list for this screen+          -- XXX duplicates initRegisterScreen+          let+            ropts' = ropts {depth_=Nothing+                           ,balancetype_=HistoricalBalance+                           }+            q = filterQuery (not . queryIsDepth) $ queryFromOpts d ropts'+            thisacctq = Acct $ accountNameToAccountRegex acct -- includes subs+            items = reverse $ snd $ accountTransactionsReport ropts j' q thisacctq+            ts = map first6 items+            numberedts = zip [1..] ts+            -- select the best current transaction from the new list+            -- stay at the same index if possible, or if we are now past the end, select the last, otherwise select the first+            (i',t') = case lookup i numberedts+                      of Just t'' -> (i,t'')+                         Nothing | null numberedts -> (0,nulltransaction)+                                 | i > fst (last numberedts) -> last numberedts+                                 | otherwise -> head numberedts+            st' = st{aScreen=s{tsState=((i',t'),numberedts,acct)}}+          continue $ reload j' d st'+         Left err -> continue $ screenEnter d ES.screen{esState=err} st      -- Vty.EvKey (Vty.KChar 'C') [] -> continue $ reload j d $ stToggleCleared st
hledger-ui.cabal view
@@ -3,7 +3,7 @@ -- see: https://github.com/sol/hpack  name:           hledger-ui-version:        0.27+version:        0.27.1 stability:      beta category:       Finance, Console synopsis:       Curses-style user interface for the hledger accounting tool@@ -25,7 +25,7 @@ bug-reports:    http://bugs.hledger.org cabal-version:  >= 1.10 build-type:     Simple-tested-with:    GHC==7.4.2, GHC==7.6.3, GHC==7.8.4, GHC==7.10.2+tested-with:    GHC==7.8.4, GHC==7.10.2  extra-source-files:     CHANGES@@ -54,10 +54,10 @@   ghc-options: -Wall -fno-warn-unused-do-bind -fno-warn-name-shadowing -fno-warn-missing-signatures -fno-warn-type-defaults -fno-warn-orphans   if flag(threaded)     ghc-options: -threaded-  cpp-options: -DVERSION="0.27"+  cpp-options: -DVERSION="0.27.1"   build-depends:-      hledger == 0.27-    , hledger-lib == 0.27+      hledger >= 0.27 && < 0.28+    , hledger-lib >= 0.27 && < 0.28     , base >= 3 && < 5     , base-compat >= 0.8.1     , brick >= 0.2 && < 0.3@@ -66,7 +66,7 @@     , data-default     , filepath     , HUnit-    , lens >= 4.12.3 && < 4.13+    , lens >= 4.12.3 && < 4.14     , safe >= 0.2     , split >= 0.1 && < 0.3     , transformers