pgdl 10.9 → 10.10
raw patch · 3 files changed
+3/−25 lines, 3 filesdep ~brickdep ~conduitdep ~http-conduit
Dependency ranges changed: brick, conduit, http-conduit
Files
- pgdl.cabal +3/−3
- src/DownloadInterface.hs +0/−13
- src/Main.hs +0/−9
pgdl.cabal view
@@ -1,6 +1,6 @@ name: pgdl-version: 10.9+version: 10.10 license: PublicDomain license-file: LICENSE author: mingchuan@@ -17,7 +17,7 @@ synopsis: browse directory listing webpages and download files from them.-tested-with: GHC == 7.10.3, GHC == 8.0.1+tested-with: GHC == 8.0.2, GHC == 8.2.2 source-repository head type: git@@ -38,7 +38,7 @@ filepath, directory, tagsoup, directory-listing-webpage-parser >= 0.1.1.0,- brick >= 0.17 && < 0.21, vty, microlens,+ brick >= 0.19 && < 0.34, vty, microlens, conduit, conduit-extra, http-conduit, http-types, resourcet, configurator >= 0.3,
src/DownloadInterface.hs view
@@ -1,7 +1,6 @@ {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE LambdaCase#-} {-# OPTIONS_GHC -fno-warn-unused-do-bind #-}-{-# LANGUAGE CPP #-} module DownloadInterface (downloadInterface, DownloadSettings(..)) where@@ -87,11 +86,7 @@ T.VtyEvent e -> case e of V.EvKey V.KEsc [] -> M.halt ds V.EvKey (V.KChar 'q') _ -> M.halt ds-#if MIN_VERSION_brick(0, 19, 0) V.EvKey (V.KChar 'o') [] -> M.continue $ UserInput ds (E.editor "command" (Just 1) "")-#else- V.EvKey (V.KChar 'o') [] -> M.continue $ UserInput ds (E.editor "command" (str . unlines) (Just 1) "")-#endif V.EvKey V.KEnter [] -> do liftIO $ localStoragePath dSettings `openBy` "" M.continue ds@@ -102,11 +97,7 @@ appEvent FinishedState be = case be of T.VtyEvent e -> case e of V.EvKey (V.KChar 'q') _ -> M.halt FinishedState-#if MIN_VERSION_brick(0, 19, 0) V.EvKey (V.KChar 'o') [] -> M.continue $ UserInput FinishedState (E.editor "command" (Just 1) "")-#else- V.EvKey (V.KChar 'o') [] -> M.continue $ UserInput FinishedState (E.editor "command" (str . unlines) (Just 1) "")-#endif V.EvKey V.KEnter [] -> do liftIO $ localStoragePath dSettings `openBy` "" M.halt FinishedState@@ -154,11 +145,7 @@ B.borderWithLabel (str "please input a program name") . forceAttr "input box" . hLimit 40 $-#if MIN_VERSION_brick(0, 19, 0) E.renderEditor (str . unlines) True ed-#else- E.renderEditor True ed-#endif M.customMain (V.mkVty mempty) (Just eventChan) theApp initialState return ()
src/Main.hs view
@@ -1,7 +1,6 @@ {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE LambdaCase #-} {-# OPTIONS_GHC -fno-warn-unused-do-bind #-}-{-# LANGUAGE CPP #-} module Main where@@ -106,11 +105,7 @@ V.EvKey V.KRight [] -> case extractSelectedDNode dlst of Nothing -> M.continue ls Just d -> M.suspendAndResume $ entryAttrViewer d >> return ls-#if MIN_VERSION_brick(0, 19, 0) V.EvKey (V.KChar '/') [] -> M.continue $ SearchState (dupDList dlst) (E.editor "searchBar" (Just 1) "")-#else- V.EvKey (V.KChar '/') [] -> M.continue $ SearchState (dupDList dlst) (E.editor "searchBar" (str . unlines) (Just 1) "")-#endif V.EvKey (V.KChar 'd') [] -> case extractSelectedDNode dlst of Nothing -> M.continue ls Just dnode -> case dnode of@@ -188,11 +183,7 @@ [] -> "" [singleLine] -> singleLine (x:_) -> x `T.append` "..."-#if MIN_VERSION_brick(0, 19, 0) searchBar ed = forceAttr "searchBar" $ hBox [txt " search: ", E.renderEditor (str . unlines) True ed]-#else- searchBar ed = forceAttr "searchBar" $ hBox [txt " search: ", E.renderEditor True ed]-#endif statusBar = withAttr "statusBar" . str . expand . info info Nothing = " Nothing selected by user" info (Just sel) = " " ++ show (lastModified etr) ++ " " ++ maybe "Directory" friendlySize (fileSize etr)