From a58aea595a780c91bbbe26d2d24a63abcd835994 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 12 Aug 2016 11:36:44 -0400 Subject: add readline UI --- UI.hs | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'UI.hs') 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] -- cgit v1.2.3