summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWill Thompson <will@willthompson.co.uk>2012-01-19 11:17:41 +0000
committerWill Thompson <will@willthompson.co.uk>2012-01-19 11:17:41 +0000
commit1d935e6fa85fe9e2adf06cfa8e0db75305646064 (patch)
tree355cb430fc26feaafb5a1248c42194bbe88745a1
parent5a8414c658f01d91f42f0d84bfe45d995d6f1c50 (diff)
OpenTwoDialog: open Glade file directly
-rw-r--r--Bustle/UI.hs2
-rw-r--r--Bustle/UI/OpenTwoDialog.hs8
2 files changed, 6 insertions, 4 deletions
diff --git a/Bustle/UI.hs b/Bustle/UI.hs
index ea43fda..7164105 100644
--- a/Bustle/UI.hs
+++ b/Bustle/UI.hs
@@ -337,7 +337,7 @@ emptyWindow = do
-- Open two logs dialog
openTwoDialog <- embedIO $ \r ->
- setupOpenTwoDialog xml window $ \f1 f2 ->
+ setupOpenTwoDialog window $ \f1 f2 ->
makeCallback (loadInInitialWindow (TwoLogs f1 f2)) r
withProgramIcon (windowSetIcon openTwoDialog)
diff --git a/Bustle/UI/OpenTwoDialog.hs b/Bustle/UI/OpenTwoDialog.hs
index 3b4a841..b800052 100644
--- a/Bustle/UI/OpenTwoDialog.hs
+++ b/Bustle/UI/OpenTwoDialog.hs
@@ -28,6 +28,7 @@ import Control.Monad (when)
import Graphics.UI.Gtk
import Graphics.UI.Gtk.Glade
+import Paths_bustle (getDataFileName)
import Bustle.Util
-- Propagates changes to d1's currently-selected folder to d2, if and only if
@@ -49,11 +50,12 @@ propagateCurrentFolder d1 d2 = d1 `onCurrentFolderChanged` do
fileChooserSetCurrentFolder d2 (fromJust f1)
return ()
-setupOpenTwoDialog :: GladeXML
- -> Window
+setupOpenTwoDialog :: Window
-> (FilePath -> FilePath -> IO ())
-> IO Dialog
-setupOpenTwoDialog xml parent callback = do
+setupOpenTwoDialog parent callback = do
+ Just xml <- xmlNew =<< getDataFileName "data/bustle.glade"
+
dialog <- xmlGetWidget xml castToDialog "openTwoDialog"
[sessionBusChooser, systemBusChooser] <-
mapM (xmlGetWidget xml castToFileChooserButton)