hpage 0.7.6 → 0.8.0
raw patch · 6 files changed
+78/−10 lines, 6 files
Files
- hpage.cabal +2/−1
- res/help/about.html +44/−0
- src/HPage/Control.hs +5/−1
- src/HPage/GUI/Dialogs.hs +12/−5
- src/HPage/GUI/FreeTextWindow.hs +12/−1
- src/HPage/IOServer.hs +3/−2
hpage.cabal view
@@ -1,5 +1,5 @@ name: hpage-version: 0.7.6+version: 0.8.0 cabal-version: >=1.6 build-type: Custom license: BSD3@@ -21,6 +21,7 @@ res/images/icon/hpage.icns res/images/icon/hpage.tif res/help/helpPage.hs+ res/help/about.html res/test/*.hs data-dir: "" extra-source-files: Setup.hs
+ res/help/about.html view
@@ -0,0 +1,44 @@+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-EN" lang="en-EN">+<body bgcolor="rgb(33, 34, 38)">+<font color="white">+ <!-- Modal for Copyright -->+ <div id="copyright" border="1">+ <div color="white">+ <dl>+ <h3>λPage is a thesis project by</h3>+ <blockquote>+ Fernando "Brujo" Benavides+ <a href="http://www.google.com/profiles/greenmellon">google</a> + <a href="http://twitter.com/elbrujohalcon">twitter</a> + <a href="http://www.linkedin.com/in/elbrujohalcon">linkedIn</a>+ </blockquote>++ <h3>λPage thesis project is directed by</h3>+ <blockquote>+ Daniel Gorín and Diego Garverbetsky+ <a href="http://www-2.dc.uba.ar/exclusivos/garbervetsky/">web</a>+ </blockquote>+ + <h3>Project developed at</h3>+ <blockquote>+ Computer Sciences Department+ <a href="http://www.dc.uba.ar">web</a><br>+ Faculty of Exact and Natural Sciences+ <a href="http://exactas.uba.ar/">web</a><br>+ University of Buenos Aires+ <a href="http://www.uba.ar/">web</a>+ </blockquote>++ <h3>λPage webpage design courtesy of</h3>+ <blockquote>+ Darío Ruellan+ <a href="http://www.google.com/profiles/dario.ruellan">google</a> + <a href="http://www.twitter.com/druellan">twitter</a> + <a href="http://www.linkedin.com/in/darioruellan">linkedIn</a>+ </blockquote>+ </dl>+ </div>+ </div>+</font>+</body>+</html>
src/HPage/Control.hs view
@@ -467,7 +467,11 @@ do ctx <- get iores <- liftIO $ HPIO.runIn (ioServer ctx) ioAction- return $ Right iores+ case iores of+ Left err ->+ return . Left . Hint.UnknownError $ show err+ Right r ->+ return . Right $ r Left err -> return $ Left err _ ->
src/HPage/GUI/Dialogs.hs view
@@ -6,25 +6,32 @@ import Graphics.UI.WXCore import HPage.GUI.IDs import qualified HPage.Control as HP+import HPage.Utils.Log data Preferences = Prefs {languageExtensions :: [HP.Extension], sourceDirs :: [FilePath], ghcOptions :: String} deriving (Eq, Show) +aboutDialog :: Window a -> FilePath -> IO ()+aboutDialog win aboutFile =+ htmlDialog win "About \955Page" (sz 400 500) $ "file://" ++ aboutFile+ hayooDialog :: Window a -> String -> IO () hayooDialog win query =- htmlDialog win "Hayoo!" $ "http://holumbus.fh-wedel.de/hayoo/hayoo.html?query=" ++ query+ htmlDialog win "Hayoo!" (sz 640 480) $ "http://holumbus.fh-wedel.de/hayoo/hayoo.html?query=" ++ query -htmlDialog :: Window a -> String -> String -> IO ()-htmlDialog win caption url =+htmlDialog :: Window a -> String -> Size -> String -> IO ()+htmlDialog win caption size url = do dlg <- dialog win [text := caption]- htmlw <- htmlWindowCreate dlg idAny (rect (point 0 0) (sz 640 480)) 0 ""+ htmlw <- htmlWindowCreate dlg idAny (rect (point 0 0) size) 0 ""+ debugIO ("url:", url) htmlWindowLoadPage htmlw url set dlg [layout := fill $ widget htmlw, visible := True,- clientSize := sz 640 480]+ clientSize := size]+ windowCenter dlg wxCENTRE_ON_SCREEN return () preferencesDialog :: Window a -> String -> Preferences -> IO (Maybe Preferences)
src/HPage/GUI/FreeTextWindow.hs view
@@ -56,6 +56,16 @@ return $ dropFileName progPath </> "Resources" </> "helpPage.hs" _ -> getDataFileName "res/help/helpPage.hs"+ +aboutFile :: IO FilePath+aboutFile =+ do+ progPath <- getProgPath+ case takeBaseName progPath of+ "MacOS" ->+ return $ dropFileName progPath </> "Resources" </> "about.html"+ _ ->+ getDataFileName "res/help/about.html" data GUIBottom = GUIBtm { bottomDesc :: String, bottomSource :: String }@@ -228,7 +238,8 @@ mnuHelp <- menuHelp [] menuAppend mnuHelp wxId_HELP "&Help page\tCtrl-h" "Open the Help Page" False- menuAbout mnuHelp [on command := infoDialog win "About \955Page" "Author: Fernando Brujo Benavides\nWebsite: http://haskell.hpage.com"]+ about <- aboutFile+ menuAbout mnuHelp [on command := aboutDialog win about] set win [menuBar := [mnuPage, mnuEdit, mnuHask, mnuHelp]] evtHandlerOnMenuCommand win wxId_NEW $ onCmd "runHP' addPage" $ runHP' HP.addPage
src/HPage/IOServer.hs view
@@ -3,6 +3,7 @@ start, stop, runIn, ServerHandle ) where +import Control.Exception (try, SomeException) import Control.Monad import Control.Monad.Trans import Control.Concurrent.Process@@ -13,10 +14,10 @@ start = spawn ioRunner >>= return . SH where ioRunner = forever $ recv >>= liftIO -runIn :: ServerHandle -> IO a -> IO a+runIn :: ServerHandle -> IO a -> IO (Either SomeException a) runIn server action = runHere $ do me <- self- sendTo (handle server) $ action >>= sendTo me+ sendTo (handle server) $ try action >>= sendTo me recv stop :: ServerHandle -> IO ()