diff options
author | Joey Hess <joeyh@joeyh.name> | 2016-08-12 11:36:44 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2016-08-12 11:36:44 -0400 |
commit | a58aea595a780c91bbbe26d2d24a63abcd835994 (patch) | |
tree | a75ad4761c57874863616749112990070a7f25fe /UI.hs | |
parent | d813bbc0dc7357f23b647a3a05ef61067c53195f (diff) | |
download | keysafe-a58aea595a780c91bbbe26d2d24a63abcd835994.tar.gz |
add readline UI
Diffstat (limited to 'UI.hs')
-rw-r--r-- | UI.hs | 18 |
1 files changed, 6 insertions, 12 deletions
@@ -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] |