packages feed

manatee-anything 0.0.5 → 0.0.6

raw patch · 6 files changed

+54/−19 lines, 6 filesdep ~manatee-core

Dependency ranges changed: manatee-core

Files

Manatee/Plugin/Anything/Anything.hs view
@@ -27,6 +27,8 @@ import Manatee.Core.DBus import Manatee.Core.Types  import Manatee.Plugin.Anything.Types+import Manatee.Toolkit.General.Basic+import Manatee.Toolkit.General.DBus import Manatee.Toolkit.General.List import Manatee.Toolkit.General.Typeable import Manatee.Toolkit.General.Url@@ -76,10 +78,23 @@                 mkDaemonSignal client NewTab (NewTabArgs "PageBrowser" (url ++ encodeFun keyword) [])  -- | Open uri.-anythingOpenUri :: String -> Client -> IO ()      -anythingOpenUri uri client = -  mkDaemonSignal client NewTab (NewTabArgs "PageBrowser" uri [])+anythingOpenUri :: String -> [(AnythingCommandName, AnythingAction)]+anythingOpenUri uri = +    [("Open URI",       open uri)]+    where open uri client = +              mkDaemonSignal client NewTab (NewTabArgs "PageBrowser" uri [])  -- | Concat keywords by "+". concatKeywords :: String -> String concatKeywords = addMap (++ "+") . words++-- | Download file.+anythingDownload :: String -> [(AnythingCommandName, AnythingAction)]+anythingDownload url = +    [("Download", download url)]+    where download url client = +            ifM (isBusNameExist $ packGenericBusName "curl") +                -- Send DBus signal if curl process exit.+                (mkGenericDaemonSignal client "curl" Generic (GenericArgs "Download" [url]))+                -- Otherwise start process and pass url.+                (mkDaemonSignal client NewTab (NewTabArgs "PageCurl" "Download" [url]))
Manatee/Plugin/Anything/AnythingBrowseHistory.hs view
@@ -73,9 +73,9 @@ anythingBrowseHistoryCommandFun :: AnythingCommandFun anythingBrowseHistoryCommandFun _ (AnythingCandidateWrap a) _ = do   let uri = candidateCommandName a-  return [("Open URI",                  anythingOpenUri uri)-         ,("Remove from history",       anythingBrowseHistoryRemove uri)-         ,("Clean History",             anythingBrowseHistoryClean)]+  return $ anythingOpenUri uri +           ++ [("Remove from history",       anythingBrowseHistoryRemove uri)+              ,("Clean History",             anythingBrowseHistoryClean)]  -- | Remove url from history. anythingBrowseHistoryRemove :: String -> Client -> IO ()
Manatee/Plugin/Anything/AnythingBrowser.hs view
@@ -50,12 +50,15 @@ anythingBrowserCommandFun _ (AnythingCandidateWrap a) _     | isURI input       = return $ -        [("Open URI", anythingOpenUri input)]+        anythingOpenUri input         ++ anythingSearchCommands input-    | isURI ("http://" ++ input)+        ++ anythingDownload input+    | isURI httpInput       = return $ -        [("Open URI", anythingOpenUri ("http://" ++ input))]+        anythingOpenUri httpInput         ++ anythingSearchCommands input+        ++ anythingDownload httpInput     | otherwise       = return $ anythingSearchCommands input       where input = candidateCommandName a+            httpInput = "http://" ++ input
Manatee/Plugin/Anything/AnythingGoogleSuggest.hs view
@@ -68,10 +68,17 @@ -- | Function for generate command list. anythingGoogleSuggestCommandFun :: AnythingCommandFun anythingGoogleSuggestCommandFun _ (AnythingCandidateWrap a) _ -    | isURI candidate-        = return $ [("Open URI", anythingOpenUri candidate)] ++ (anythingSearchCommands candidate) -    | isURI ("http://" ++ candidate)-        = return $ [("Open URI", anythingOpenUri ("http://" ++ candidate))] ++ (anythingSearchCommands candidate) +    | isURI input+        = return $ +          anythingOpenUri input+          ++ (anythingSearchCommands input) +          ++ anythingDownload input+    | isURI httpInput+        = return $ +          anythingOpenUri httpInput+          ++ (anythingSearchCommands input) +          ++ anythingDownload httpInput     | otherwise-        = return (anythingSearchCommands candidate)-          where candidate = candidateCommandName a+        = return (anythingSearchCommands input)+          where input = candidateCommandName a+                httpInput = "http://" ++ input
Manatee/Plugin/Anything/AnythingView.hs view
@@ -491,13 +491,21 @@ anythingViewFocusNextCommand :: AnythingView -> IO () anythingViewFocusNextCommand view = do   let (AnythingCommandView treeView _) = avCommandTab view-  treeViewFocusNextToplevelNode treeView+  ifM (treeViewAtLastToplevelNode treeView)+      -- Select first command if have reach last one.+      (treeViewFocusFirstToplevelNode treeView)+      -- Otherwise select next command.+      (treeViewFocusNextToplevelNode treeView)  -- | Focus prev command. anythingViewFocusPrevCommand :: AnythingView -> IO () anythingViewFocusPrevCommand view = do   let (AnythingCommandView treeView _) = avCommandTab view-  treeViewFocusPrevToplevelNode treeView+  ifM (treeViewAtFirstToplevelNode treeView)+      -- Select last command if have reach first one.+      (treeViewFocusLastToplevelNode treeView)+      -- Otherwise select previous command.+      (treeViewFocusPrevToplevelNode treeView)  -- | Show candidates. anythingViewShowCandidateTab :: AnythingView -> IO ()
manatee-anything.cabal view
@@ -1,5 +1,5 @@ name:			manatee-anything-version:		0.0.5+version:		0.0.6 Cabal-Version:	>= 1.6 license:		GPL-3 license-file:	LICENSE@@ -7,6 +7,8 @@ synopsis:		Multithread interactive input/search framework for Manatee description:    manatee-anything is interactive plugin for Manatee (Haskell/Gtk+ Integrated Live Environment)  . + Video at (Select 720p HD) at : <http://www.youtube.com/watch?v=weS6zys3U8k> <http://v.youku.com/v_show/id_XMjI2MDMzODI4.html>+ .  Screenshots at : <http://goo.gl/MkVw>  .  Manual at : <http://haskell.org/haskellwiki/Manatee>@@ -29,7 +31,7 @@    Library      build-depends: base >= 4 && < 5, gtk >= 0.12.0, containers >= 0.3.0.0, text >= 0.7.1.0,-                    gio >= 0.12.0, filepath >= 1.1.0.3, manatee-core >= 0.0.5, dbus-client >= 0.3 && < 0.4,+                    gio >= 0.12.0, filepath >= 1.1.0.3, manatee-core >= 0.0.6, dbus-client >= 0.3 && < 0.4,                     network >= 2.2.1.5, utf8-string >= 0.3.4, proc >= 0.0.8, mtl >= 1.1.0.2, stm >= 2.1.2.0,                     unix >= 2.4.0.0, regex-tdfa >= 1.1.2, bytestring, GoogleSuggest >= 0.0.3, dataenc,                     dbus-core, split