diff options
Diffstat (limited to 'tests/Monitor.hs')
-rw-r--r-- | tests/Monitor.hs | 36 |
1 files changed, 3 insertions, 33 deletions
diff --git a/tests/Monitor.hs b/tests/Monitor.hs index 1736594..4ea0a71 100644 --- a/tests/Monitor.hs +++ b/tests/Monitor.hs @@ -1,7 +1,7 @@ {-# LANGUAGE ForeignFunctionInterface #-} module Main where -import Bustle.Monitor +import Bustle.UI.Recorder import Graphics.UI.Gtk import System.Glib.GError @@ -12,35 +12,5 @@ main = do let filename = case args of x:xs -> x _ -> error "gimme a filename" - handleGError (\(GError _ _ message) -> error message) $ do - monitor <- monitorNew BusTypeSession filename DebugOutput - - window <- windowNew - - label <- labelNew Nothing - let updateLabel n = labelSetMarkup label $ - "Logged <b>" ++ show n ++ "</b> messages to <i>" ++ filename ++ "</i>…" - n <- newMVar 0 - updateLabel 0 - monitor `on` monitorMessageLogged $ do - i <- takeMVar n - let j = i + 1 :: Integer - updateLabel j - putMVar n j - - bar <- progressBarNew - id <- timeoutAdd (progressBarPulse bar >> return True) 100 - - vbox <- vBoxNew False 6 - boxPackStart vbox label PackGrow 0 - boxPackStart vbox bar PackNatural 0 - - set window [ containerBorderWidth := 6 - , containerChild := vbox - ] - onDestroy window mainQuit - widgetShowAll window - - mainGUI - - monitorStop monitor + recorderRun filename Nothing $ \_ -> mainQuit + mainGUI |