diff options
author | Will Thompson <will@willthompson.co.uk> | 2012-01-13 09:31:31 +0000 |
---|---|---|
committer | Will Thompson <will@willthompson.co.uk> | 2012-01-13 09:31:31 +0000 |
commit | 7c3e68990291bb9fd48426fcde447e0701c44d5b (patch) | |
tree | 92096c2bb0504b3e065afbb0dbb447c1084c0ad3 /Bustle | |
parent | 32a657779d1b6f6de19b3af04d7254e57ab2ea4a (diff) |
Flip to the canvas page while recording logs
Diffstat (limited to 'Bustle')
-rw-r--r-- | Bustle/UI.hs | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/Bustle/UI.hs b/Bustle/UI.hs index 5be79a2..538f0a8 100644 --- a/Bustle/UI.hs +++ b/Bustle/UI.hs @@ -72,6 +72,12 @@ data LogDetails = | SingleLog FilePath | TwoLogs FilePath FilePath +data Page = + InstructionsPage + | CanvasPage + deriving + (Enum) + data WindowInfo = WindowInfo { wiWindow :: Window , wiSave :: ImageMenuItem @@ -216,6 +222,7 @@ startRecording = do cacheDir <- io $ getCacheDir let filename = cacheDir </> yyyy_mm_dd_hh_mm_ss <.> "bustle" + io $ setPage wi CanvasPage embedIO $ \r -> recorderRun filename (Just (wiWindow wi)) $ makeCallback (finishedRecording wi filename) r @@ -338,6 +345,9 @@ emptyWindow = do -- message. widgetHide top + -- The stats start off hidden. + io $ widgetHide statsBook + showBounds <- asks debugEnabled canvas <- io $ canvasNew xml showBounds (updateDetailsView details) @@ -427,6 +437,11 @@ wiSetLogDetails wi logDetails = do writeIORef (wiLogDetails wi) (Just logDetails) windowSetTitle (wiWindow wi) (logWindowTitle logDetails ++ " — Bustle") +setPage :: WindowInfo + -> Page + -> IO () +setPage wi page = notebookSetCurrentPage (wiNotebook wi) (fromEnum page) + displayLog :: WindowInfo -> LogDetails -> Log @@ -438,7 +453,6 @@ displayLog wi@(WindowInfo { wiWindow = window , wiViewStatistics = viewStatistics , wiFilterNames = filterNames , wiCanvas = canvas - , wiNotebook = nb , wiStatsBook = statsBook , wiStatsPane = statsPane }) @@ -458,7 +472,7 @@ displayLog wi@(WindowInfo { wiWindow = window shapes <- canvasGetShapes canvas saveToPDFDialogue wi shapes - notebookSetCurrentPage nb 1 + setPage wi CanvasPage canvasFocus canvas -- FIXME: this currently shows stats for all messages, not post-filtered messages @@ -482,9 +496,6 @@ displayLog wi@(WindowInfo { wiWindow = window updateDisplayedLog wi rr' - -- The stats start off hidden. - widgetHide statsBook - return () withProgramIcon :: (Maybe Pixbuf -> IO a) -> B a |