manatee-curl 0.0.7 → 0.0.8
raw patch · 2 files changed
+21/−14 lines, 2 filesdep ~manatee-core
Dependency ranges changed: manatee-core
Files
- Manatee/Extension/Curl/CurlView.hs +19/−12
- manatee-curl.cabal +2/−2
Manatee/Extension/Curl/CurlView.hs view
@@ -32,6 +32,7 @@ import Manatee.Core.Config import Manatee.Core.DBus import Manatee.Core.FileOpenRule+import Manatee.Core.PageFrame import Manatee.Core.PageView import Manatee.Core.Types import Manatee.Extension.Curl.CurlBuffer@@ -44,7 +45,6 @@ import Manatee.Toolkit.Gtk.Concurrent import Manatee.Toolkit.Gtk.Gtk import Manatee.Toolkit.Gtk.ModelView-import Manatee.Toolkit.Gtk.ScrolledWindow import Paths_manatee_curl import System.Directory import System.FilePath@@ -55,7 +55,7 @@ data CurlView = CurlView {curlViewPlugId :: TVar PagePlugId- ,curlViewScrolledWindow :: ScrolledWindow+ ,curlViewFrame :: PageFrame ,curlViewBuffer :: CurlBuffer ,curlViewTreeView :: TreeView ,curlViewListStore :: ListStore DownloadFile@@ -75,8 +75,9 @@ instance PageView CurlView where pageViewBuffer = PageBufferWrap . curlViewBuffer pageViewPlugId = curlViewPlugId- pageViewFocus = treeViewFocus . curlViewTreeView+ pageViewBox = pageFrameBox . curlViewFrame pageViewScrolledWindow = curlViewScrolledWindow+ pageViewFocus = treeViewFocus . curlViewTreeView pageViewHandleKeyAction = curlViewHandleKeyAction pageViewScrollToTop = curlViewScrollToTop pageViewScrollToBottom = curlViewScrollToBottom@@ -90,12 +91,12 @@ pId <- newTVarIO plugId -- Create UI frame.- scrolledWindow <- scrolledWindowNew_+ pFrame <- pageFrameNewWithModeName (pageModeName $ curlBufferMode buffer) -- Tree view. treeView <- treeViewNew treeViewSetEnableTreeLines treeView True- scrolledWindow `containerAdd` treeView+ pageFrameAddChild pFrame treeView -- List store. listStore <- listStoreNew []@@ -107,7 +108,7 @@ channel <- createViewChannel (curlBufferBroadcastChannel buffer) treeView -- Curl view.- let curlView = CurlView pId scrolledWindow buffer treeView listStore sortModel channel+ let curlView = CurlView pId pFrame buffer treeView listStore sortModel channel -- Read channel. curlViewListenChannel curlView@@ -356,7 +357,7 @@ (curlViewListStore view) >?>= \ downloadFile -> do name <- readTVarIO (dfName downloadFile)- pageViewUpdateInfoStatus view "Filename" ("Filename : " ++ name)+ pageFrameUpdateStatusbar (curlViewFrame view) "Filename" ("Filename : " ++ name) -- | Sort column. curlViewSort :: CurlView -> DownloadFileOption -> IO ()@@ -426,7 +427,7 @@ localInteractive view "sURL : " $ \ [url] -> do files <- readTVarIO $ curlBufferFileInfos buffer if url `elem` map dfURL files- then pageViewUpdateOutputStatus view ("Has exist " ++ url) Nothing+ then pageFrameShowOutputbar (curlViewFrame view) ("Has exist " ++ url) Nothing else curlBufferAddDownload buffer url -- | Pause@@ -474,7 +475,7 @@ >?>= \ downloadFile -> do downloadStatus <- readTVarIO (dfDownloadStatus downloadFile) case downloadStatus of- Failed -> pageViewUpdateOutputStatus view "No file." Nothing+ Failed -> pageFrameShowOutputbar (curlViewFrame view) "No file." Nothing Finish -> do downloadDir <- fmap (</> defaultDownloadDir) getConfigDirectory mkDaemonSignal (pageViewClient view) NewTab (NewTabArgs "PageFileManager" downloadDir [])@@ -505,15 +506,20 @@ (_, fileType) <- contentTypeGuess filePath "" 0 openRule <- fileOpenRule filePath fileType if null openRule- then pageViewUpdateOutputStatus view ("Don't know how to open file : " ++ filePath) Nothing+ then pageFrameShowOutputbar (curlViewFrame view) ("Don't know how to open file : " ++ filePath) Nothing else do let rule = snd $ head openRule -- use default open rule. rule (pageViewClient view) -- Otherwise print information.- else pageViewUpdateOutputStatus view ("Can't find " ++ filePath) Nothing+ else pageFrameShowOutputbar (curlViewFrame view) ("Can't find " ++ filePath) Nothing -- Otherwise print information.- else pageViewUpdateOutputStatus view "Haven't download complete." Nothing+ else pageFrameShowOutputbar (curlViewFrame view) "Haven't download complete." Nothing +-- | Scrolled window.+curlViewScrolledWindow :: CurlView -> ScrolledWindow +curlViewScrolledWindow =+ pageFrameScrolledWindow . curlViewFrame+ -- | Keymap. curlViewKeymap :: Map Text (CurlView -> IO ()) curlViewKeymap = @@ -543,3 +549,4 @@ ,("8", curlViewSortByThread) ,("9", curlViewSortByUrl) ]+
manatee-curl.cabal view
@@ -1,5 +1,5 @@ name: manatee-curl-version: 0.0.7+version: 0.0.8 Cabal-Version: >= 1.6 license: GPL-3 license-file: LICENSE@@ -37,7 +37,7 @@ location: http://patch-tag.com/r/AndyStewart/manatee-curl Library- build-depends: base >= 4 && < 5, manatee-core >= 0.0.7, dbus-client >= 0.3 && < 0.4, stm >= 2.1.2.0,+ build-depends: base >= 4 && < 5, manatee-core >= 0.0.8, dbus-client >= 0.3 && < 0.4, stm >= 2.1.2.0, containers >= 0.3.0.0, gtk-serialized-event >= 0.12.0, gtk >= 0.12.0, text >= 0.7.1.0, mtl >= 1.1.0.2, old-time, old-locale, glib >= 0.12.0, gio >= 0.12.0, filepath >= 1.1.0.3, utf8-string >= 0.3.4, bytestring, network, curl >= 1.3.5, directory,