Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
48 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
----------------------------------------------------------------------------- | ||
-- | | ||
-- Module : Application.HXournal.Script | ||
-- Copyright : (c) 2012 Ian-Woo Kim | ||
-- | ||
-- License : BSD3 | ||
-- Maintainer : Ian-Woo Kim <ianwookim@gmail.com> | ||
-- Stability : experimental | ||
-- Portability : GHC | ||
-- | ||
----------------------------------------------------------------------------- | ||
|
||
module Application.HXournal.Script where | ||
|
||
import Application.HXournal.Script.Hook | ||
import Config.Dyre.Relaunch | ||
|
||
-- | | ||
|
||
data ScriptConfig = ScriptConfig { message :: Maybe String | ||
, hook :: Maybe Hook | ||
, errorMsg :: Maybe String | ||
} | ||
|
||
-- | | ||
|
||
defaultScriptConfig :: ScriptConfig | ||
defaultScriptConfig = ScriptConfig Nothing Nothing Nothing | ||
|
||
-- | | ||
|
||
showError :: ScriptConfig -> String -> ScriptConfig | ||
showError cfg msg = cfg { errorMsg = Just msg } | ||
|
||
|
||
-- | | ||
|
||
relaunchApplication :: IO () | ||
relaunchApplication = do | ||
putStrLn "relaunching hxournal!" | ||
relaunchMaster Nothing | ||
|
||
|