hzenity 0.3 → 0.4
raw patch · 3 files changed
+17/−13 lines, 3 filesdep ~containersdep ~data-defaultdep ~processPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: containers, data-default, process, process-extras, text, time
API changes (from Hackage documentation)
+ Zenity: [$sel:debug:Config] :: Config -> Bool
- Zenity: Config :: Maybe Text -> Maybe FilePath -> Maybe Int -> Maybe Int -> Maybe Int -> Config
+ Zenity: Config :: Maybe Text -> Maybe FilePath -> Maybe Int -> Maybe Int -> Maybe Int -> Bool -> Config
Files
- examples/Simple.hs +5/−4
- hzenity.cabal +9/−7
- src/Zenity.hs +3/−2
examples/Simple.hs view
@@ -4,17 +4,18 @@ module Simple where import Control.Monad-import Data.Monoid import System.Process import Zenity +config = def {debug = True}+ -- Ask for a name and display a greeting greeting = do Just name <-- zenity def {title = Just "Name entry"} $+ zenity config {title = Just "Name entry"} $ Entry $ def {text = Just "What's your name?"}- zenity def $ Info def {text = Just $ "Greetings, " <> name <> "!"}+ zenity config $ Info def {text = Just $ "Greetings, " <> name <> "!"} data SystemCommand = Ls@@ -27,7 +28,7 @@ -- `keyedList` allows associating each option with a value of some type. We can -- then scrutinize the result by matching on the associated values. systemOperation = do- op <- keyedList def radio def+ op <- keyedList config radio def "Select a command" [ (Ls, "List files") , (Pwd, "Show current directory")
hzenity.cabal view
@@ -1,5 +1,5 @@ name: hzenity-version: 0.3+version: 0.4 synopsis: Haskell interface to Zenity dialogs description: This is a Haskell wrapper around the <https://en.wikipedia.org/wiki/Zenity Zenity> dialog@@ -27,12 +27,14 @@ library exposed-modules: Zenity build-depends: base <5,- containers,- data-default,- process,- process-extras,- text,- time+ containers < 0.7,+ data-default < 0.8,+ process < 1.7,+ process-extras < 0.8,+ text < 1.3,+ time < 1.10+ -- `time-1.10` is currently incompatible with `process`+ -- so I can't test it. hs-source-dirs: src default-language: Haskell2010 default-extensions: DeriveFunctor
src/Zenity.hs view
@@ -98,6 +98,7 @@ , width :: Maybe Int -- ^ Dialog width , height :: Maybe Int -- ^ Dialog height , timeout :: Maybe Int -- ^ Dialog timeout in seconds+ , debug :: Bool -- ^ Print the system call to Zenity with flags } instance Default Config where@@ -107,6 +108,7 @@ , width = Nothing , height = Nothing , timeout = Nothing+ , debug = False } data CmdFlag where@@ -387,8 +389,7 @@ -> [String] -- ^ Additional command-line flags -> IO Text callZenity cfg flags = do- -- Set to `True` for logging:- when False $ putStrLn $ showCommandForUser "zenity" flags'+ when (debug cfg) $ putStrLn $ showCommandForUser "zenity" flags' (\(_, o, _) -> o) <$> Text.readProcessWithExitCode "zenity" flags' "" where flags' = configFlags cfg ++ flags