manatee 0.0.6 → 0.0.7
raw patch · 5 files changed
+72/−59 lines, 5 filesdep ~manatee-coresetup-changed
Dependency ranges changed: manatee-core
Files
- Manatee/Action/Tab.hs +8/−8
- Manatee/Daemon.hs +18/−39
- Setup.hs +18/−0
- manatee.cabal +22/−8
- repos.sh +6/−4
Manatee/Action/Tab.hs view
@@ -48,8 +48,8 @@ -- | New tab. -- If tab has created, switch to tab. -- Otherwise create tab.-newTab :: PageType -> PagePath -> Environment -> IO ()-newTab pType pPath env = do+newTab :: PageType -> PagePath -> [String] -> Environment -> IO ()+newTab pType pPath options env = do bufferList <- envGet env modeName <- getPageModeName pType pPath@@ -60,11 +60,11 @@ window <- envGet env notebookSetCurrentPage (windowNotebook window) i -- Otherwise create buffer.- Nothing -> newTabInternal pType pPath env+ Nothing -> newTabInternal pType pPath options env -- | New path.-newTabInternal :: PageType -> PagePath -> Environment -> IO ()-newTabInternal pType pPath env = do+newTabInternal :: PageType -> PagePath -> [String] -> Environment -> IO ()+newTabInternal pType pPath options env = do (PageTypeRule rule) <- readConfig pageTypeRulePath (PageTypeRule M.empty) case findMinMatch rule (\ typ _ -> typ == pType) of Nothing -> putStrLn $ "newTabInternal : Can't found rule for `" ++ pType ++ "`"@@ -97,7 +97,7 @@ modifyTVarIO tabbarTVar (tabbarAddTab windowId modeName (Tab 0 pageId 0 0 uiFrame)) -- Spawn render process.- runProcess_ binaryPath [show (SpawnRenderProcessArgs pageId pType (signalBoxId signalBox) pPath)] + runProcess_ binaryPath [show (SpawnRenderProcessArgs pageId pType (signalBoxId signalBox) pPath options)] return () @@ -299,7 +299,7 @@ unless (null history) $ do -- Open last close tab. let ([(_, pageType, pagePath)], restList) = splitAt 1 history- newTab pageType pagePath env + newTab pageType pagePath [] env -- Update history list. writeTVarIO tabCloseHistoryTVar (TabCloseHistory restList)@@ -324,7 +324,7 @@ unless (null filterList) $ do -- Open last close tab. let ([undoItem@(_, pageType, pagePath)], _) = splitAt 1 filterList- newTab pageType pagePath env + newTab pageType pagePath [] env -- Update history list. writeTVarIO tabCloseHistoryTVar (TabCloseHistory (snd $ partition (== undoItem) history))
Manatee/Daemon.hs view
@@ -27,7 +27,7 @@ import Control.Monad.Trans import DBus.Client hiding (Signal) import DBus.Types-import Data.Map (Map)+import Data.Map (Map, union) import Data.Text.Lazy (Text) import GHC.Conc import Graphics.UI.Gtk hiding (Window, windowNew, Frame, frameNew, @@ -39,6 +39,7 @@ import Manatee.Action.Tab import Manatee.Action.Tabbar import Manatee.Action.Window+import Manatee.Core.Config import Manatee.Core.DBus import Manatee.Core.Debug import Manatee.Core.PageMode@@ -93,6 +94,12 @@ ,("Interactive", callGetInteractive env) ,("GetBufferHistory", callGetBufferHistory env)] + -- Read extension global keymap. + (ExtensionGloalKeymap keymap) <- readConfig extensionGlobalKeymapPath (ExtensionGloalKeymap M.empty)+ let extensionGlobalKeymap = + M.fromList $ map (\ (key, (pType, pPath, pOptions)) -> + (T.pack key, Action (newTab pType pPath pOptions))) (M.toList keymap) + -- Handle key event. frame `on` keyPressEvent $ tryEvent $ do -- Remove tooltip when press key.@@ -124,7 +131,7 @@ -- Handle key press event. liftIO $ do -- Handle global keymap first.- case M.lookup keystoke globalKeymap of+ case M.lookup keystoke (globalKeymap `union` extensionGlobalKeymap) of -- Execute global command. Just action -> runAction env action Nothing -> @@ -162,21 +169,18 @@ -- Loop. mainGUI +-- | Global keymap. globalKeymap :: Keymap globalKeymap = M.fromList- ["F2" ==> startProcessManager- ,"F3" ==> startFeedReader- ,"F4" ==> startFileManager- ,"F5" ==> startBrowser- ,"F6" ==> loginIrcDefaultChannel- ,"F7" ==> startIrc+ ["F7" ==> startIrc ,"F11" ==> toggleFullscreen ,"F12" ==> lockScreen ,"C-'" ==> tabUndoCloseGlobal ,"C-\"" ==> tabUndoCloseLocal ] +-- | Interactivebar keymap. interactiveKeymap :: EditableClass ed => Map Text (ed -> IO ()) interactiveKeymap = M.fromList@@ -189,6 +193,7 @@ ,("M-c", editableCopyClipboard) ,("M-v", editablePasteClipboard)] +-- | Local keymap for extension. localKeymap :: Keymap localKeymap = M.fromList@@ -273,8 +278,8 @@ -- | Handle new tab signal. daemonHandleNewTab :: Environment -> DaemonSignalArgs -> IO () -daemonHandleNewTab env (NewTabArgs pageType pagePath) = - runAction env (Action (newTab pageType pagePath))+daemonHandleNewTab env (NewTabArgs pageType pagePath options) = + runAction env (Action (newTab pageType pagePath options)) -- | Handle new anything process confirm signal. daemonHandleNewAnythingProcessConfirm :: Environment -> DaemonSignalArgs -> IO ()@@ -794,10 +799,10 @@ ?>= \buffer -> do let path = getUpperDirectory $ bufferPath buffer if not (null path) && directoryDoesExist (UTF8.fromString path)- then newTab "PageFileManager" path env+ then newTab "PageFileManager" path [] env else do currentDir <- getCurrentDirectory- newTab "PageFileManager" currentDir env+ newTab "PageFileManager" currentDir [] env -- | Lock screen. lockScreen :: Environment -> IO ()@@ -807,32 +812,6 @@ -- Lock screen. (runCommand_ "xtrlock") --- | Startup process manager.-startProcessManager :: Environment -> IO ()-startProcessManager = - newTab "PageProcessManager" "ProcessManager"---- | Startup rss/atom reader.-startFeedReader :: Environment -> IO ()-startFeedReader =- newTab "PageReader" "Feed Reader"---- | Startup file manager.-startFileManager :: Environment -> IO ()-startFileManager env = do- dir <- getCurrentDirectory- newTab "PageFileManager" dir env---- | Startup browser.-startBrowser :: Environment -> IO ()-startBrowser = - newTab "PageBrowser" "http://www.google.com"---- | Login default channel.-loginIrcDefaultChannel :: Environment -> IO ()-loginIrcDefaultChannel =- newTab "PageIrc" "irc://"- -- | Start irc. startIrc :: Environment -> IO () startIrc env = @@ -841,5 +820,5 @@ "sServer : \nnPort : \nsChannel : \nsUserName : \n" $ \ [server, port, channel, user] -> do let info = "irc://" ++ user ++ "@" ++ server ++ ":" ++ port ++ "/" ++ channel- mkDaemonSignal (envDaemonClient env) NewTab (NewTabArgs "PageIrc" info)+ mkDaemonSignal (envDaemonClient env) NewTab (NewTabArgs "PageIrc" info [])
Setup.hs view
@@ -1,3 +1,21 @@+-- Author: Andy Stewart <lazycat.manatee@gmail.com>+-- Maintainer: Andy Stewart <lazycat.manatee@gmail.com>+-- +-- Copyright (C) 2010 Andy Stewart, all rights reserved.+-- +-- This program is free software: you can redistribute it and/or modify+-- it under the terms of the GNU General Public License as published by+-- the Free Software Foundation, either version 3 of the License, or+-- any later version.+-- +-- This program is distributed in the hope that it will be useful,+-- but WITHOUT ANY WARRANTY; without even the implied warranty of+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+-- GNU General Public License for more details.+-- +-- You should have received a copy of the GNU General Public License+-- along with this program. If not, see <http://www.gnu.org/licenses/>.+ import Distribution.Simple main = defaultMain
manatee.cabal view
@@ -1,5 +1,5 @@ name: manatee-version: 0.0.6+version: 0.0.7 Cabal-Version: >= 1.6 license: GPL-3 license-file: LICENSE@@ -19,25 +19,35 @@ You can find screenshots at : <http://goo.gl/MkVw> . Below is build step for Manatee:+ .+ 1) Install gold-linker to accelerate installation:+ .+ I suggest use gold-linker instead ld to accelerate installation.+ .+ In Debian system, you just need do below command:+ .+ > sudo aptitude install binutils-gold -y+ .+ This step is optional, it's okay use ld link program, just much slow. :) . - 1) Install GHC compiler <http://www.haskell.org/ghc/download_ghc_6_12_3.html>:+ 2) Install GHC compiler <http://www.haskell.org/ghc/download_ghc_6_12_3.html>: . Download ghc package for your system, then do below command : . > ./configure && sudo make install .- 2) Install C library:+ 3) Install C library: In Debian use below command: . > sudo aptitude install libgtksourceview2.0-dev libgconf2-dev libwebkit-dev libcurl4-openssl-dev libgtkimageview-dev libpoppler-glib-dev poppler-data libtagc0-dev -y .- 3) Install cabal:+ 4) Install cabal: . If you're haskell newbie, use below command to install cabal (haskell expert ignore this): . > sudo aptitude install cabal-install -y .- 4) Install dependent Haskell library:+ 5) Install dependent Haskell library: . First make sure `HOME/.cabal/bin/` in your PATH .@@ -47,9 +57,9 @@ . > cabal update && cabal install happy c2hs gtk2hs-buildtools glib gio pango cairo gtk .- 5) Install Manatee (same, don't use root permission):+ 6) Install Manatee (same, don't use root permission): .- > cabal install manatee-core manatee-anything manatee-browser manatee-editor manatee-filemanager manatee-imageviewer manatee-ircclient manatee-mplayer manatee-pdfviewer manatee-processmanager manatee-reader manatee+ > cabal install manatee-core manatee-anything manatee-browser manatee-editor manatee-filemanager manatee-imageviewer manatee-ircclient manatee-mplayer manatee-pdfviewer manatee-processmanager manatee-reader manatee-curl manatee . That's all, then type command "manatee" to play it! :) .@@ -59,6 +69,10 @@ . Unfortunately, Manatee can't work in XMonad, please let me know if some XMonad hacker know how to fix it. :) . + IRC channel: + .+ irc.freenode.net 6667 <##manatee>+ . author: Andy Stewart maintainer: Andy Stewart <lazycat.manatee@gmail.com> stability: provisional@@ -93,7 +107,7 @@ other-modules: executable manatee- build-depends: base >=4 && < 5, manatee-core >= 0.0.2, containers >= 0.3.0.0, unix >= 2.4.0.0,+ build-depends: base >=4 && < 5, manatee-core >= 0.0.3, containers >= 0.3.0.0, unix >= 2.4.0.0, mtl >= 1.1.0.2, gtk-serialized-event >= 0.12.0, text >= 0.7.1.0, utf8-string, gtk >= 0.12.0, dbus-client >= 0.3 && < 0.4, stm, cairo >= 0.12.0, directory, dbus-core, template-haskell
repos.sh view
@@ -2,7 +2,7 @@ set -e -USAGE="Usage: `basename $0` (get|pull|install|diff|record|revert|push|pushall|send|clean|whatsnew|changes|release) [pkg] .."+USAGE="Usage: `basename $0` (get|pull|install|diff|record|revert|push|pushall|send|clean|whatsnew|changes|haddock|release) [pkg] .." [ $# -lt 1 ] && echo $USAGE && exit 1 @@ -39,7 +39,7 @@ ;; pushall) darcs push AndyStewart@patch-tag.com:/r/AndyStewart/$PKG -a ;;- record) darcs record -l+ record) darcs record -l --delete-logfile --skip-long-comment ;; revert) darcs revert ;;@@ -49,14 +49,16 @@ ;; changes) darcs changes --last 10 ;;- release) rm ./dist/*.tar.gz || cabal sdist && cabal upload ./dist/*.tar.gz+ haddock) cabal configure --user && cabal build && cabal haddock ;;+ release) cabal sdist && cabal upload ./dist/*.tar.gz+ ;; *) echo "Unknown command: $CMD"; echo $USAGE; exit 1 ;; esac } -for pkg in ${*:-manatee-core manatee-anything manatee-browser manatee-editor manatee-filemanager manatee-pdfviewer manatee-mplayer manatee-ircclient manatee-processmanager manatee-imageviewer manatee-reader manatee};+for pkg in ${*:-manatee-core manatee-anything manatee-browser manatee-editor manatee-filemanager manatee-pdfviewer manatee-mplayer manatee-ircclient manatee-processmanager manatee-imageviewer manatee-reader manatee-curl manatee}; do repos_action $pkg done