summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorWill Thompson <will@willthompson.co.uk>2012-01-11 14:54:07 +0000
committerWill Thompson <will@willthompson.co.uk>2012-01-12 11:13:00 +0000
commita8617a336298d1b9915f6a198dfa1ef0a232c492 (patch)
tree983b7c77ecc5c24dc143aa7ee18925170a9ad18d /tests
parent026a97acbe1c7ad6a9b7c8ab542fc46a032c2aad (diff)
Add and hook up File -> New
Diffstat (limited to 'tests')
-rw-r--r--tests/Monitor.hs36
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