summaryrefslogtreecommitdiffhomepage
path: root/UI/Zenity.hs
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2016-08-17 15:03:33 -0400
committerJoey Hess <joeyh@joeyh.name>2016-08-17 15:03:33 -0400
commit78c71badb458f3709f4689641dbb9efd53d962cf (patch)
treec00689a389ad0598f136566c0acbf0efabf8da76 /UI/Zenity.hs
parentf60ac335e4e827fd242ab22539adb49f26e2c319 (diff)
downloadkeysafe-78c71badb458f3709f4689641dbb9efd53d962cf.tar.gz
progress display for storing
Diffstat (limited to 'UI/Zenity.hs')
-rw-r--r--UI/Zenity.hs13
1 files changed, 13 insertions, 0 deletions
diff --git a/UI/Zenity.hs b/UI/Zenity.hs
index 228b11a..a419b62 100644
--- a/UI/Zenity.hs
+++ b/UI/Zenity.hs
@@ -23,6 +23,7 @@ zenityUI = UI
loc <- filterM (\p -> doesFileExist (p </> "zenity")) ps
return (not (null loc))
, showError = myShowError
+ , showInfo = myShowInfo
, promptQuestion = myPromptQuestion
, promptName = myPromptName
, promptPassword = myPromptPassword
@@ -42,6 +43,18 @@ myShowError desc = bracket go cleanup (\_ -> return ())
_ <- waitZenity h
return ()
+myShowInfo :: Title -> Desc -> IO ()
+myShowInfo title desc = bracket go cleanup (\_ -> return ())
+ where
+ go = runZenity
+ [ "--info"
+ , "--title", title
+ , "--text", desc
+ ]
+ cleanup h = do
+ _ <- waitZenity h
+ return ()
+
myPromptQuestion :: Title -> Desc -> Question -> IO Bool
myPromptQuestion title desc question = do
h <- runZenity