Updated hledger-ui to use brick-0.16 (#479)

brick-0.16 uses Brick.BChan.BChan instead of Control.Concurrent.Chan.Chan.
This commit is contained in:
Joshua Chia 2017-01-15 02:41:46 +08:00 committed by Simon Michael
parent 8bc67d5ee8
commit d3883bad1f
4 changed files with 22 additions and 6 deletions

View File

@ -3,6 +3,7 @@ hledger-ui - a hledger add-on providing a curses-style interface.
Copyright (c) 2007-2015 Simon Michael <simon@joyful.com>
Released under GPL version 3 or later.
-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE MultiParamTypeClasses #-}
@ -11,12 +12,12 @@ module Hledger.UI.Main where
-- import Control.Applicative
-- import Lens.Micro.Platform ((^.))
import Control.Concurrent
import Control.Concurrent (threadDelay)
import Control.Concurrent.Async
import Control.Monad
-- import Control.Monad.IO.Class (liftIO)
import Data.Default (def)
-- import Data.Monoid --
-- import Data.Monoid --
import Data.List
import Data.Maybe
-- import Data.Text (Text)
@ -30,6 +31,12 @@ import System.FilePath
import System.FSNotify
import Brick
#if MIN_VERSION_brick(0,16,0)
import qualified Brick.BChan as BC
#else
import Control.Concurrent.Chan (newChan, writeChan)
#endif
import Hledger
import Hledger.Cli hiding (progname,prognameandversion,green)
import Hledger.UI.UIOptions
@ -41,6 +48,15 @@ import Hledger.UI.RegisterScreen
----------------------------------------------------------------------
#if MIN_VERSION_brick(0,16,0)
newChan :: IO (BC.BChan a)
newChan = BC.newBChan 10
writeChan :: BC.BChan a -> a -> IO ()
writeChan = BC.writeBChan
#endif
main :: IO ()
main = do
opts <- getHledgerUIOpts
@ -129,7 +145,7 @@ runBrickUi uopts@UIOpts{cliopts_=copts@CliOpts{reportopts_=ropts}} j = do
,aPrevScreens=[]
,aMode=Normal
}
ui =
(sInit scr) d True $
(if change_ uopts' then toggleHistorical else id) $ -- XXX

View File

@ -85,7 +85,7 @@ executable hledger-ui
buildable: False
else
build-depends:
brick >= 0.12 && < 0.16
brick >= 0.12 && < 0.17
, vty >= 5.5 && < 5.15
if flag(threaded)
ghc-options: -threaded

View File

@ -88,7 +88,7 @@ executables:
buildable: false
else:
dependencies:
- brick >= 0.12 && < 0.16
- brick >= 0.12 && < 0.17
- vty >= 5.5 && < 5.15
- condition: flag(threaded)
ghc-options: -threaded

View File

@ -11,7 +11,7 @@ packages:
extra-deps:
# for hledger-ui:
- brick-0.15.2
- brick-0.16
- vty-5.14
- text-zipper-0.8.1
# for hledger-web: