From d813bbc0dc7357f23b647a3a05ef61067c53195f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 12 Aug 2016 07:52:36 -0400 Subject: pluggable UI using zenity for GUI in X --- UI.hs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 UI.hs (limited to 'UI.hs') diff --git a/UI.hs b/UI.hs new file mode 100644 index 0000000..7e583cf --- /dev/null +++ b/UI.hs @@ -0,0 +1,20 @@ +{- Copyright 2016 Joey Hess + - + - Licensed under the GNU AGPL version 3 or higher. + -} + +module UI where + +import Types + +data UI = UI + { isAvailable :: IO Bool + , promptName :: Title -> Desc -> (Name -> Maybe Problem) -> IO (Maybe Name) + , promptPassword :: Title -> Desc -> (Password -> Maybe Problem) -> IO (Maybe Password) + , withProgress :: Title -> Desc -> ((Percent -> IO ()) -> IO ()) -> IO () + } + +type Title = String +type Desc = String +type Percent = Int +type Problem = String -- cgit v1.2.3