summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWill Thompson <will@willthompson.co.uk>2012-01-23 09:17:10 +0000
committerWill Thompson <will@willthompson.co.uk>2012-01-23 09:34:39 +0000
commit180f8697b71170c1274a466c22777e1688701186 (patch)
tree164a837973f90ea20baee87f4ca57cfcf4b05e7a
parentd9d201aad85762509073a4ceb38dc3d1c3b8ecb9 (diff)
OpenTwoDialog: port to GtkBuilder
-rw-r--r--Bustle/UI.hs2
-rw-r--r--Bustle/UI/OpenTwoDialog.hs12
-rw-r--r--bustle.cabal1
-rw-r--r--data/bustle.glade115
-rw-r--r--data/bustle.ui113
5 files changed, 119 insertions, 124 deletions
diff --git a/Bustle/UI.hs b/Bustle/UI.hs
index e557019..7139cb6 100644
--- a/Bustle/UI.hs
+++ b/Bustle/UI.hs
@@ -338,7 +338,7 @@ emptyWindow = do
-- Open two logs dialog
openTwoDialog <- embedIO $ \r ->
- setupOpenTwoDialog window $ \f1 f2 ->
+ setupOpenTwoDialog builder 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 b800052..bfbce33 100644
--- a/Bustle/UI/OpenTwoDialog.hs
+++ b/Bustle/UI/OpenTwoDialog.hs
@@ -26,7 +26,6 @@ import Data.Maybe (isJust, isNothing, fromJust)
import Control.Monad (when)
import Graphics.UI.Gtk
-import Graphics.UI.Gtk.Glade
import Paths_bustle (getDataFileName)
import Bustle.Util
@@ -50,15 +49,14 @@ propagateCurrentFolder d1 d2 = d1 `onCurrentFolderChanged` do
fileChooserSetCurrentFolder d2 (fromJust f1)
return ()
-setupOpenTwoDialog :: Window
+setupOpenTwoDialog :: Builder
+ -> Window
-> (FilePath -> FilePath -> IO ())
-> IO Dialog
-setupOpenTwoDialog parent callback = do
- Just xml <- xmlNew =<< getDataFileName "data/bustle.glade"
-
- dialog <- xmlGetWidget xml castToDialog "openTwoDialog"
+setupOpenTwoDialog builder parent callback = do
+ dialog <- builderGetObject builder castToDialog "openTwoDialog"
[sessionBusChooser, systemBusChooser] <-
- mapM (xmlGetWidget xml castToFileChooserButton)
+ mapM (builderGetObject builder castToFileChooserButton)
["sessionBusChooser", "systemBusChooser"]
windowSetTransientFor dialog parent
diff --git a/bustle.cabal b/bustle.cabal
index 988dcbb..04c01b3 100644
--- a/bustle.cabal
+++ b/bustle.cabal
@@ -11,7 +11,6 @@ Maintainer: Will Thompson <will.thompson@collabora.co.uk>
Data-files: data/bustle.png,
data/dfeet-method.png,
data/dfeet-signal.png,
- data/bustle.glade,
data/bustle.ui,
LICENSE
Build-type: Simple
diff --git a/data/bustle.glade b/data/bustle.glade
deleted file mode 100644
index d1f6156..0000000
--- a/data/bustle.glade
+++ /dev/null
@@ -1,115 +0,0 @@
-<?xml version="1.0"?>
-<glade-interface>
- <!-- interface-requires gtk+ 2.16 -->
- <!-- interface-naming-policy project-wide -->
- <widget class="GtkDialog" id="openTwoDialog">
- <property name="border_width">5</property>
- <property name="title" translatable="yes">Open a pair of logs</property>
- <property name="resizable">False</property>
- <property name="modal">True</property>
- <property name="type_hint">dialog</property>
- <child internal-child="vbox">
- <widget class="GtkVBox" id="dialog-vbox1">
- <property name="visible">True</property>
- <property name="orientation">vertical</property>
- <property name="spacing">2</property>
- <child>
- <widget class="GtkTable" id="table1">
- <property name="visible">True</property>
- <property name="n_rows">2</property>
- <property name="n_columns">2</property>
- <property name="column_spacing">6</property>
- <property name="row_spacing">6</property>
- <child>
- <widget class="GtkFileChooserButton" id="systemBusChooser">
- <property name="visible">True</property>
- <property name="title" translatable="yes">Select system bus log</property>
- <property name="width_chars">30</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="label4">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">System bus log:</property>
- </widget>
- <packing>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="label5">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Session bus log:</property>
- </widget>
- </child>
- <child>
- <widget class="GtkFileChooserButton" id="sessionBusChooser">
- <property name="visible">True</property>
- <property name="title" translatable="yes">Select session bus log</property>
- <property name="width_chars">30</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="y_options">GTK_EXPAND</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="dialog-action_area1">
- <property name="visible">True</property>
- <property name="layout_style">end</property>
- <child>
- <widget class="GtkButton" id="button2">
- <property name="label">gtk-cancel</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="use_stock">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="openTwoOpenButton">
- <property name="label">gtk-open</property>
- <property name="response_id">-3</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="use_stock">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="pack_type">end</property>
- <property name="position">0</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
-</glade-interface>
diff --git a/data/bustle.ui b/data/bustle.ui
index fbfb41f..d0696dc 100644
--- a/data/bustle.ui
+++ b/data/bustle.ui
@@ -368,4 +368,117 @@ You may also use the &lt;i&gt;bustle-pcap&lt;/i&gt; command-line tool to record
</object>
</child>
</object>
+ <object class="GtkDialog" id="openTwoDialog">
+ <property name="border_width">5</property>
+ <property name="title" translatable="yes">Open a pair of logs</property>
+ <property name="resizable">False</property>
+ <property name="modal">True</property>
+ <property name="type_hint">dialog</property>
+ <child internal-child="vbox">
+ <object class="GtkVBox" id="dialog-vbox1">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">2</property>
+ <child>
+ <object class="GtkTable" id="table1">
+ <property name="visible">True</property>
+ <property name="n_rows">2</property>
+ <property name="n_columns">2</property>
+ <property name="column_spacing">6</property>
+ <property name="row_spacing">6</property>
+ <child>
+ <object class="GtkFileChooserButton" id="systemBusChooser">
+ <property name="visible">True</property>
+ <property name="title" translatable="yes">Select system bus log</property>
+ <property name="width_chars">30</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label44">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">System bus log:</property>
+ </object>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label55">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Session bus log:</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkFileChooserButton" id="sessionBusChooser">
+ <property name="visible">True</property>
+ <property name="title" translatable="yes">Select session bus log</property>
+ <property name="width_chars">30</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="y_options">GTK_EXPAND</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child internal-child="action_area">
+ <object class="GtkHButtonBox" id="dialog-action_area1">
+ <property name="visible">True</property>
+ <property name="layout_style">end</property>
+ <child>
+ <object class="GtkButton" id="openTwoCancelButton">
+ <property name="label">gtk-cancel</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="openTwoOpenButton">
+ <property name="label">gtk-open</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <action-widgets>
+ <action-widget response="-6">openTwoCancelButton</action-widget>
+ <action-widget response="-3">openTwoOpenButton</action-widget>
+ </action-widgets>
+ </object>
</interface>