summaryrefslogtreecommitdiffhomepage
path: root/UI.hs
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2016-08-12 11:36:44 -0400
committerJoey Hess <joeyh@joeyh.name>2016-08-12 11:36:44 -0400
commita58aea595a780c91bbbe26d2d24a63abcd835994 (patch)
treea75ad4761c57874863616749112990070a7f25fe /UI.hs
parentd813bbc0dc7357f23b647a3a05ef61067c53195f (diff)
downloadkeysafe-a58aea595a780c91bbbe26d2d24a63abcd835994.tar.gz
add readline UI
Diffstat (limited to 'UI.hs')
-rw-r--r--UI.hs18
1 files changed, 6 insertions, 12 deletions
diff --git a/UI.hs b/UI.hs
index 7e583cf..0ce87db 100644
--- a/UI.hs
+++ b/UI.hs
@@ -5,16 +5,10 @@
module UI where
-import Types
+import Types.UI
+import Control.Monad
+import UI.Zenity
+import UI.Readline
-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
+availableUI :: IO [UI]
+availableUI = filterM isAvailable [zenityUI, readlineUI]