diff options
author | Will Thompson <will.thompson@collabora.co.uk> | 2009-05-08 15:01:24 +0100 |
---|---|---|
committer | Will Thompson <will.thompson@collabora.co.uk> | 2009-05-08 15:01:24 +0100 |
commit | 446ef601d6d9c47702df484508426bec6171973b (patch) | |
tree | 33707e2dba51d390cf6c84ede0c3cdf06f4fb232 | |
parent | 1786af416e64a0034e5e57e29217d39ab714c9ee (diff) |
Always open at least one window.
Previously, if there were some arguments but they couldn't be loaded,
mainGUI wouldn't run and you'd never see the dialogue. I think opening
an empty window is probably the right thing to do.
-rw-r--r-- | Bustle.hs | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -126,14 +126,15 @@ mainB :: B () mainB = do io initGUI - fs <- io getArgs - - if null fs - then createInitialWindow - else mapM_ loadLog fs + -- Try to load arguments, if any. + mapM_ loadLog =<< io getArgs + -- If no windows are open (because none of the arguments, if any, were loaded + -- successfully) create an empty window n <- gets windows - when (n > 0) (io mainGUI) + when (n == 0) createInitialWindow + + io mainGUI createInitialWindow :: B () createInitialWindow = do |