[gnome-utils] [dictionary] Port to GtkBuilder



commit 89211104b17eb12da660f688d5e0adfb7e00c9d5
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Fri Apr 17 21:38:24 2009 +0200

    [dictionary] Port to GtkBuilder
    
    Remove the deprecated dependency on libglade and port gnome-dictionary
    to GtkBuilder.
---
 gnome-dictionary/data/Makefile.am                  |    7 +-
 .../data/gnome-dictionary-preferences.glade        |  629 --------------------
 .../data/gnome-dictionary-preferences.ui           |  230 +++++++
 gnome-dictionary/data/gnome-dictionary-source.ui   |  332 +++++++++++
 gnome-dictionary/src/Makefile.am                   |    4 -
 gnome-dictionary/src/gdict-pref-dialog.c           |   40 +-
 gnome-dictionary/src/gdict-source-dialog.c         |   75 ++--
 gnome-dictionary/src/gdict-window.h                |    1 -
 po/POTFILES.in                                     |    3 +-
 9 files changed, 630 insertions(+), 691 deletions(-)

diff --git a/gnome-dictionary/data/Makefile.am b/gnome-dictionary/data/Makefile.am
index 394490d..00d3ea8 100644
--- a/gnome-dictionary/data/Makefile.am
+++ b/gnome-dictionary/data/Makefile.am
@@ -21,8 +21,9 @@ dictsource_in_files = \
 dictsource_DATA = $(dictsource_in_files:.desktop.in=.desktop)
 @INTLTOOL_DESKTOP_RULE@
 
-gladedir        = $(datadir)/gnome-dictionary
-glade_DATA      = gnome-dictionary-preferences.glade
+builderdir        = $(datadir)/gnome-dictionary
+builder_DATA      = gnome-dictionary-preferences.ui \
+		    gnome-dictionary-source.ui
 
 uidir           = $(datadir)/gnome-dictionary
 ui_DATA         = gnome-dictionary-ui.xml
@@ -55,7 +56,7 @@ EXTRA_DIST = \
 	$(dictsource_in_files)			\
 	$(man_MANS) 				\
 	$(schemas_in_file) 			\
-	$(glade_DATA) 				\
+	$(builder_DATA) 				\
 	$(ui_DATA)				\
 	$(appletui_DATA)			\
 	$(NULL)
diff --git a/gnome-dictionary/data/gnome-dictionary-preferences.glade b/gnome-dictionary/data/gnome-dictionary-preferences.glade
deleted file mode 100644
index 1792026..0000000
--- a/gnome-dictionary/data/gnome-dictionary-preferences.glade
+++ /dev/null
@@ -1,629 +0,0 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd";>
-
-<glade-interface>
-
-<widget class="GtkWindow" id="preferences">
-  <property name="visible">True</property>
-  <property name="title" translatable="yes">window1</property>
-  <property name="type">GTK_WINDOW_TOPLEVEL</property>
-  <property name="window_position">GTK_WIN_POS_NONE</property>
-  <property name="modal">False</property>
-  <property name="resizable">True</property>
-  <property name="destroy_with_parent">False</property>
-  <property name="decorated">True</property>
-  <property name="skip_taskbar_hint">False</property>
-  <property name="skip_pager_hint">False</property>
-  <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
-  <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
-  <property name="focus_on_map">True</property>
-  <property name="urgency_hint">False</property>
-
-  <child>
-    <widget class="GtkVBox" id="preferences_root">
-      <property name="visible">True</property>
-      <property name="homogeneous">False</property>
-      <property name="spacing">18</property>
-
-      <child>
-	<widget class="GtkNotebook" id="preferences_notebook">
-	  <property name="border_width">5</property>
-	  <property name="visible">True</property>
-	  <property name="can_focus">True</property>
-	  <property name="show_tabs">True</property>
-	  <property name="show_border">True</property>
-	  <property name="tab_pos">GTK_POS_TOP</property>
-	  <property name="scrollable">False</property>
-	  <property name="enable_popup">False</property>
-
-	  <child>
-	    <widget class="GtkVBox" id="vbox2">
-	      <property name="border_width">12</property>
-	      <property name="visible">True</property>
-	      <property name="homogeneous">False</property>
-	      <property name="spacing">6</property>
-
-	      <child>
-		<widget class="GtkLabel" id="label15">
-		  <property name="visible">True</property>
-		  <property name="label" translatable="yes">_Select a dictionary source for looking up words:</property>
-		  <property name="use_underline">True</property>
-		  <property name="use_markup">False</property>
-		  <property name="justify">GTK_JUSTIFY_LEFT</property>
-		  <property name="wrap">False</property>
-		  <property name="selectable">False</property>
-		  <property name="xalign">0</property>
-		  <property name="yalign">0.5</property>
-		  <property name="xpad">0</property>
-		  <property name="ypad">0</property>
-		  <property name="mnemonic_widget">sources_treeview</property>
-		  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
-		  <property name="width_chars">-1</property>
-		  <property name="single_line_mode">False</property>
-		  <property name="angle">0</property>
-		</widget>
-		<packing>
-		  <property name="padding">0</property>
-		  <property name="expand">False</property>
-		  <property name="fill">False</property>
-		</packing>
-	      </child>
-
-	      <child>
-		<widget class="GtkScrolledWindow" id="scrolledwindow1">
-		  <property name="height_request">100</property>
-		  <property name="visible">True</property>
-		  <property name="can_focus">True</property>
-		  <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
-		  <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
-		  <property name="shadow_type">GTK_SHADOW_IN</property>
-		  <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
-
-		  <child>
-		    <widget class="GtkTreeView" id="sources_treeview">
-		      <property name="visible">True</property>
-		      <property name="can_focus">True</property>
-		      <property name="headers_visible">True</property>
-		      <property name="rules_hint">False</property>
-		      <property name="reorderable">False</property>
-		      <property name="enable_search">True</property>
-		      <property name="fixed_height_mode">False</property>
-		      <property name="hover_selection">False</property>
-		      <property name="hover_expand">False</property>
-		    </widget>
-		  </child>
-		</widget>
-		<packing>
-		  <property name="padding">0</property>
-		  <property name="expand">True</property>
-		  <property name="fill">True</property>
-		</packing>
-	      </child>
-
-	      <child>
-		<widget class="GtkHButtonBox" id="hbuttonbox6">
-		  <property name="visible">True</property>
-		  <property name="layout_style">GTK_BUTTONBOX_END</property>
-		  <property name="spacing">6</property>
-
-		  <child>
-		    <widget class="GtkButton" id="add_button">
-		      <property name="visible">True</property>
-		      <property name="can_default">True</property>
-		      <property name="can_focus">True</property>
-		      <property name="label">gtk-add</property>
-		      <property name="use_stock">True</property>
-		      <property name="relief">GTK_RELIEF_NORMAL</property>
-		      <property name="focus_on_click">True</property>
-		    </widget>
-		  </child>
-
-		  <child>
-		    <widget class="GtkButton" id="remove_button">
-		      <property name="visible">True</property>
-		      <property name="can_default">True</property>
-		      <property name="can_focus">True</property>
-		      <property name="label">gtk-remove</property>
-		      <property name="use_stock">True</property>
-		      <property name="relief">GTK_RELIEF_NORMAL</property>
-		      <property name="focus_on_click">True</property>
-		    </widget>
-		  </child>
-		</widget>
-		<packing>
-		  <property name="padding">0</property>
-		  <property name="expand">False</property>
-		  <property name="fill">True</property>
-		</packing>
-	      </child>
-	    </widget>
-	    <packing>
-	      <property name="tab_expand">False</property>
-	      <property name="tab_fill">True</property>
-	    </packing>
-	  </child>
-
-	  <child>
-	    <widget class="GtkLabel" id="label15">
-	      <property name="visible">True</property>
-	      <property name="label" translatable="yes">Source</property>
-	      <property name="use_underline">False</property>
-	      <property name="use_markup">False</property>
-	      <property name="justify">GTK_JUSTIFY_LEFT</property>
-	      <property name="wrap">False</property>
-	      <property name="selectable">False</property>
-	      <property name="xalign">0.5</property>
-	      <property name="yalign">0.5</property>
-	      <property name="xpad">0</property>
-	      <property name="ypad">0</property>
-	      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
-	      <property name="width_chars">-1</property>
-	      <property name="single_line_mode">False</property>
-	      <property name="angle">0</property>
-	    </widget>
-	    <packing>
-	      <property name="type">tab</property>
-	    </packing>
-	  </child>
-
-	  <child>
-	    <widget class="GtkVBox" id="vbox3">
-	      <property name="border_width">12</property>
-	      <property name="visible">True</property>
-	      <property name="homogeneous">False</property>
-	      <property name="spacing">6</property>
-
-	      <child>
-		<widget class="GtkHBox" id="hbox1">
-		  <property name="visible">True</property>
-		  <property name="homogeneous">False</property>
-		  <property name="spacing">12</property>
-
-		  <child>
-		    <widget class="GtkLabel" id="label17">
-		      <property name="visible">True</property>
-		      <property name="label" translatable="yes">_Print font:</property>
-		      <property name="use_underline">True</property>
-		      <property name="use_markup">False</property>
-		      <property name="justify">GTK_JUSTIFY_LEFT</property>
-		      <property name="wrap">False</property>
-		      <property name="selectable">False</property>
-		      <property name="xalign">0.5</property>
-		      <property name="yalign">0.5</property>
-		      <property name="xpad">0</property>
-		      <property name="ypad">0</property>
-		      <property name="mnemonic_widget">print_font_button</property>
-		      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
-		      <property name="width_chars">-1</property>
-		      <property name="single_line_mode">False</property>
-		      <property name="angle">0</property>
-		    </widget>
-		    <packing>
-		      <property name="padding">0</property>
-		      <property name="expand">False</property>
-		      <property name="fill">False</property>
-		    </packing>
-		  </child>
-
-		  <child>
-		    <widget class="GtkFontButton" id="print_font_button">
-		      <property name="visible">True</property>
-		      <property name="can_focus">True</property>
-		      <property name="show_style">True</property>
-		      <property name="show_size">True</property>
-		      <property name="use_font">True</property>
-		      <property name="use_size">False</property>
-		      <property name="focus_on_click">True</property>
-		    </widget>
-		    <packing>
-		      <property name="padding">0</property>
-		      <property name="expand">True</property>
-		      <property name="fill">True</property>
-		    </packing>
-		  </child>
-		</widget>
-		<packing>
-		  <property name="padding">0</property>
-		  <property name="expand">False</property>
-		  <property name="fill">True</property>
-		</packing>
-	      </child>
-	    </widget>
-	    <packing>
-	      <property name="tab_expand">False</property>
-	      <property name="tab_fill">True</property>
-	    </packing>
-	  </child>
-
-	  <child>
-	    <widget class="GtkLabel" id="label16">
-	      <property name="visible">True</property>
-	      <property name="label" translatable="yes">Print</property>
-	      <property name="use_underline">False</property>
-	      <property name="use_markup">False</property>
-	      <property name="justify">GTK_JUSTIFY_LEFT</property>
-	      <property name="wrap">False</property>
-	      <property name="selectable">False</property>
-	      <property name="xalign">0.5</property>
-	      <property name="yalign">0.5</property>
-	      <property name="xpad">0</property>
-	      <property name="ypad">0</property>
-	      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
-	      <property name="width_chars">-1</property>
-	      <property name="single_line_mode">False</property>
-	      <property name="angle">0</property>
-	    </widget>
-	    <packing>
-	      <property name="type">tab</property>
-	    </packing>
-	  </child>
-	</widget>
-	<packing>
-	  <property name="padding">0</property>
-	  <property name="expand">True</property>
-	  <property name="fill">True</property>
-	</packing>
-      </child>
-    </widget>
-  </child>
-</widget>
-
-<widget class="GtkWindow" id="source">
-  <property name="visible">True</property>
-  <property name="title" translatable="yes">window2</property>
-  <property name="type">GTK_WINDOW_TOPLEVEL</property>
-  <property name="window_position">GTK_WIN_POS_NONE</property>
-  <property name="modal">False</property>
-  <property name="resizable">True</property>
-  <property name="destroy_with_parent">False</property>
-  <property name="decorated">True</property>
-  <property name="skip_taskbar_hint">False</property>
-  <property name="skip_pager_hint">False</property>
-  <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
-  <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
-  <property name="focus_on_map">True</property>
-  <property name="urgency_hint">False</property>
-
-  <child>
-    <widget class="GtkVBox" id="source_root">
-      <property name="visible">True</property>
-      <property name="homogeneous">False</property>
-      <property name="spacing">12</property>
-
-      <child>
-	<widget class="GtkNotebook" id="notebook1">
-	  <property name="visible">True</property>
-	  <property name="can_focus">True</property>
-	  <property name="show_tabs">True</property>
-	  <property name="show_border">True</property>
-	  <property name="tab_pos">GTK_POS_TOP</property>
-	  <property name="scrollable">False</property>
-	  <property name="enable_popup">False</property>
-
-	  <child>
-	    <widget class="GtkTable" id="table2">
-	      <property name="border_width">5</property>
-	      <property name="visible">True</property>
-	      <property name="n_rows">4</property>
-	      <property name="n_columns">2</property>
-	      <property name="homogeneous">False</property>
-	      <property name="row_spacing">6</property>
-	      <property name="column_spacing">12</property>
-
-	      <child>
-		<widget class="GtkLabel" id="description_label">
-		  <property name="visible">True</property>
-		  <property name="label" translatable="yes">_Description:</property>
-		  <property name="use_underline">True</property>
-		  <property name="use_markup">False</property>
-		  <property name="justify">GTK_JUSTIFY_LEFT</property>
-		  <property name="wrap">False</property>
-		  <property name="selectable">False</property>
-		  <property name="xalign">0</property>
-		  <property name="yalign">0.5</property>
-		  <property name="xpad">0</property>
-		  <property name="ypad">0</property>
-		  <property name="mnemonic_widget">description_entry</property>
-		  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
-		  <property name="width_chars">-1</property>
-		  <property name="single_line_mode">False</property>
-		  <property name="angle">0</property>
-		</widget>
-		<packing>
-		  <property name="left_attach">0</property>
-		  <property name="right_attach">1</property>
-		  <property name="top_attach">0</property>
-		  <property name="bottom_attach">1</property>
-		  <property name="x_options">fill</property>
-		  <property name="y_options"></property>
-		</packing>
-	      </child>
-
-	      <child>
-		<widget class="GtkLabel" id="transport_label">
-		  <property name="visible">True</property>
-		  <property name="label" translatable="yes">_Transport:</property>
-		  <property name="use_underline">True</property>
-		  <property name="use_markup">False</property>
-		  <property name="justify">GTK_JUSTIFY_LEFT</property>
-		  <property name="wrap">False</property>
-		  <property name="selectable">False</property>
-		  <property name="xalign">0</property>
-		  <property name="yalign">0.5</property>
-		  <property name="xpad">0</property>
-		  <property name="ypad">0</property>
-		  <property name="mnemonic_widget">transport_combo</property>
-		  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
-		  <property name="width_chars">-1</property>
-		  <property name="single_line_mode">False</property>
-		  <property name="angle">0</property>
-		</widget>
-		<packing>
-		  <property name="left_attach">0</property>
-		  <property name="right_attach">1</property>
-		  <property name="top_attach">1</property>
-		  <property name="bottom_attach">2</property>
-		  <property name="x_options">fill</property>
-		  <property name="y_options"></property>
-		</packing>
-	      </child>
-
-	      <child>
-		<widget class="GtkLabel" id="hostname_label">
-		  <property name="label" translatable="yes">H_ostname:</property>
-		  <property name="use_underline">True</property>
-		  <property name="use_markup">False</property>
-		  <property name="justify">GTK_JUSTIFY_LEFT</property>
-		  <property name="wrap">False</property>
-		  <property name="selectable">False</property>
-		  <property name="xalign">0</property>
-		  <property name="yalign">0.5</property>
-		  <property name="xpad">0</property>
-		  <property name="ypad">0</property>
-		  <property name="mnemonic_widget">hostname_entry</property>
-		  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
-		  <property name="width_chars">-1</property>
-		  <property name="single_line_mode">False</property>
-		  <property name="angle">0</property>
-		</widget>
-		<packing>
-		  <property name="left_attach">0</property>
-		  <property name="right_attach">1</property>
-		  <property name="top_attach">2</property>
-		  <property name="bottom_attach">3</property>
-		  <property name="x_options">fill</property>
-		  <property name="y_options"></property>
-		</packing>
-	      </child>
-
-	      <child>
-		<widget class="GtkLabel" id="port_label">
-		  <property name="label" translatable="yes">_Port:</property>
-		  <property name="use_underline">True</property>
-		  <property name="use_markup">False</property>
-		  <property name="justify">GTK_JUSTIFY_LEFT</property>
-		  <property name="wrap">False</property>
-		  <property name="selectable">False</property>
-		  <property name="xalign">0</property>
-		  <property name="yalign">0.5</property>
-		  <property name="xpad">0</property>
-		  <property name="ypad">0</property>
-		  <property name="mnemonic_widget">port_entry</property>
-		  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
-		  <property name="width_chars">-1</property>
-		  <property name="single_line_mode">False</property>
-		  <property name="angle">0</property>
-		</widget>
-		<packing>
-		  <property name="left_attach">0</property>
-		  <property name="right_attach">1</property>
-		  <property name="top_attach">3</property>
-		  <property name="bottom_attach">4</property>
-		  <property name="x_options">fill</property>
-		  <property name="y_options"></property>
-		</packing>
-	      </child>
-
-	      <child>
-		<widget class="GtkEntry" id="description_entry">
-		  <property name="visible">True</property>
-		  <property name="can_focus">True</property>
-		  <property name="has_focus">True</property>
-		  <property name="editable">True</property>
-		  <property name="visibility">True</property>
-		  <property name="max_length">0</property>
-		  <property name="text" translatable="yes">Source Name</property>
-		  <property name="has_frame">True</property>
-		  <property name="invisible_char">*</property>
-		  <property name="activates_default">False</property>
-		</widget>
-		<packing>
-		  <property name="left_attach">1</property>
-		  <property name="right_attach">2</property>
-		  <property name="top_attach">0</property>
-		  <property name="bottom_attach">1</property>
-		  <property name="y_options"></property>
-		</packing>
-	      </child>
-
-	      <child>
-		<widget class="GtkEntry" id="hostname_entry">
-		  <property name="can_focus">True</property>
-		  <property name="editable">True</property>
-		  <property name="visibility">True</property>
-		  <property name="max_length">0</property>
-		  <property name="text">dict.org</property>
-		  <property name="has_frame">True</property>
-		  <property name="invisible_char">*</property>
-		  <property name="activates_default">False</property>
-		</widget>
-		<packing>
-		  <property name="left_attach">1</property>
-		  <property name="right_attach">2</property>
-		  <property name="top_attach">2</property>
-		  <property name="bottom_attach">3</property>
-		  <property name="y_options"></property>
-		</packing>
-	      </child>
-
-	      <child>
-		<widget class="GtkEntry" id="port_entry">
-		  <property name="can_focus">True</property>
-		  <property name="editable">True</property>
-		  <property name="visibility">True</property>
-		  <property name="max_length">0</property>
-		  <property name="text">2628</property>
-		  <property name="has_frame">True</property>
-		  <property name="invisible_char">*</property>
-		  <property name="activates_default">False</property>
-		</widget>
-		<packing>
-		  <property name="left_attach">1</property>
-		  <property name="right_attach">2</property>
-		  <property name="top_attach">3</property>
-		  <property name="bottom_attach">4</property>
-		  <property name="y_options"></property>
-		</packing>
-	      </child>
-
-	      <child>
-		<widget class="GtkComboBox" id="transport_combo">
-		  <property name="visible">True</property>
-		  <property name="items" translatable="yes" context="yes" comments="Transport methods">Dictionary Server</property>
-		  <property name="add_tearoffs">False</property>
-		  <property name="focus_on_click">True</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="x_options">fill</property>
-		  <property name="y_options">fill</property>
-		</packing>
-	      </child>
-	    </widget>
-	    <packing>
-	      <property name="tab_expand">False</property>
-	      <property name="tab_fill">True</property>
-	    </packing>
-	  </child>
-
-	  <child>
-	    <widget class="GtkLabel" id="label18">
-	      <property name="visible">True</property>
-	      <property name="label" translatable="yes">Source</property>
-	      <property name="use_underline">False</property>
-	      <property name="use_markup">False</property>
-	      <property name="justify">GTK_JUSTIFY_LEFT</property>
-	      <property name="wrap">False</property>
-	      <property name="selectable">False</property>
-	      <property name="xalign">0.5</property>
-	      <property name="yalign">0.5</property>
-	      <property name="xpad">0</property>
-	      <property name="ypad">0</property>
-	      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
-	      <property name="width_chars">-1</property>
-	      <property name="single_line_mode">False</property>
-	      <property name="angle">0</property>
-	    </widget>
-	    <packing>
-	      <property name="type">tab</property>
-	    </packing>
-	  </child>
-
-	  <child>
-	    <widget class="GtkVBox" id="db-vbox">
-	      <property name="border_width">5</property>
-	      <property name="visible">True</property>
-	      <property name="homogeneous">False</property>
-	      <property name="spacing">0</property>
-
-	      <child>
-		<placeholder/>
-	      </child>
-
-	      <child>
-		<placeholder/>
-	      </child>
-	    </widget>
-	    <packing>
-	      <property name="tab_expand">False</property>
-	      <property name="tab_fill">True</property>
-	    </packing>
-	  </child>
-
-	  <child>
-	    <widget class="GtkLabel" id="label19">
-	      <property name="visible">True</property>
-	      <property name="label" translatable="yes">Dictionaries</property>
-	      <property name="use_underline">False</property>
-	      <property name="use_markup">False</property>
-	      <property name="justify">GTK_JUSTIFY_LEFT</property>
-	      <property name="wrap">False</property>
-	      <property name="selectable">False</property>
-	      <property name="xalign">0.5</property>
-	      <property name="yalign">0.5</property>
-	      <property name="xpad">0</property>
-	      <property name="ypad">0</property>
-	      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
-	      <property name="width_chars">-1</property>
-	      <property name="single_line_mode">False</property>
-	      <property name="angle">0</property>
-	    </widget>
-	    <packing>
-	      <property name="type">tab</property>
-	    </packing>
-	  </child>
-
-	  <child>
-	    <widget class="GtkVBox" id="strat-vbox">
-	      <property name="border_width">5</property>
-	      <property name="visible">True</property>
-	      <property name="homogeneous">False</property>
-	      <property name="spacing">0</property>
-
-	      <child>
-		<placeholder/>
-	      </child>
-	    </widget>
-	    <packing>
-	      <property name="tab_expand">False</property>
-	      <property name="tab_fill">True</property>
-	    </packing>
-	  </child>
-
-	  <child>
-	    <widget class="GtkLabel" id="label20">
-	      <property name="visible">True</property>
-	      <property name="label" translatable="yes">Strategies</property>
-	      <property name="use_underline">False</property>
-	      <property name="use_markup">False</property>
-	      <property name="justify">GTK_JUSTIFY_LEFT</property>
-	      <property name="wrap">False</property>
-	      <property name="selectable">False</property>
-	      <property name="xalign">0.5</property>
-	      <property name="yalign">0.5</property>
-	      <property name="xpad">0</property>
-	      <property name="ypad">0</property>
-	      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
-	      <property name="width_chars">-1</property>
-	      <property name="single_line_mode">False</property>
-	      <property name="angle">0</property>
-	    </widget>
-	    <packing>
-	      <property name="type">tab</property>
-	    </packing>
-	  </child>
-	</widget>
-	<packing>
-	  <property name="padding">0</property>
-	  <property name="expand">True</property>
-	  <property name="fill">True</property>
-	</packing>
-      </child>
-    </widget>
-  </child>
-</widget>
-
-</glade-interface>
diff --git a/gnome-dictionary/data/gnome-dictionary-preferences.ui b/gnome-dictionary/data/gnome-dictionary-preferences.ui
new file mode 100644
index 0000000..30d6b01
--- /dev/null
+++ b/gnome-dictionary/data/gnome-dictionary-preferences.ui
@@ -0,0 +1,230 @@
+<?xml version="1.0"?>
+<!--*- mode: xml -*-->
+<interface>
+  <object class="GtkVBox" id="preferences_root">
+    <property name="visible">True</property>
+    <property name="homogeneous">False</property>
+    <property name="spacing">18</property>
+    <child>
+      <object class="GtkNotebook" id="preferences_notebook">
+        <property name="border_width">5</property>
+        <property name="visible">True</property>
+        <property name="can_focus">True</property>
+        <property name="show_tabs">True</property>
+        <property name="show_border">True</property>
+        <property name="tab_pos">GTK_POS_TOP</property>
+        <property name="scrollable">False</property>
+        <property name="enable_popup">False</property>
+        <child>
+          <object class="GtkVBox" id="vbox2">
+            <property name="border_width">12</property>
+            <property name="visible">True</property>
+            <property name="homogeneous">False</property>
+            <property name="spacing">6</property>
+            <child>
+              <object class="GtkLabel" id="label15">
+                <property name="visible">True</property>
+                <property name="label" translatable="yes">_Select a dictionary source for looking up words:</property>
+                <property name="use_underline">True</property>
+                <property name="use_markup">False</property>
+                <property name="justify">GTK_JUSTIFY_LEFT</property>
+                <property name="wrap">False</property>
+                <property name="selectable">False</property>
+                <property name="xalign">0</property>
+                <property name="yalign">0.5</property>
+                <property name="xpad">0</property>
+                <property name="ypad">0</property>
+                <property name="mnemonic_widget">sources_treeview</property>
+                <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+                <property name="width_chars">-1</property>
+                <property name="single_line_mode">False</property>
+                <property name="angle">0</property>
+              </object>
+              <packing>
+                <property name="padding">0</property>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkScrolledWindow" id="scrolledwindow1">
+                <property name="height_request">100</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
+                <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+                <property name="shadow_type">GTK_SHADOW_IN</property>
+                <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
+                <child>
+                  <object class="GtkTreeView" id="sources_treeview">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="headers_visible">True</property>
+                    <property name="rules_hint">False</property>
+                    <property name="reorderable">False</property>
+                    <property name="enable_search">True</property>
+                    <property name="fixed_height_mode">False</property>
+                    <property name="hover_selection">False</property>
+                    <property name="hover_expand">False</property>
+                  </object>
+                </child>
+              </object>
+              <packing>
+                <property name="padding">0</property>
+                <property name="expand">True</property>
+                <property name="fill">True</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkHButtonBox" id="hbuttonbox6">
+                <property name="visible">True</property>
+                <property name="layout_style">GTK_BUTTONBOX_END</property>
+                <property name="spacing">6</property>
+                <child>
+                  <object class="GtkButton" id="add_button">
+                    <property name="visible">True</property>
+                    <property name="can_default">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="label">gtk-add</property>
+                    <property name="use_stock">True</property>
+                    <property name="relief">GTK_RELIEF_NORMAL</property>
+                    <property name="focus_on_click">True</property>
+                  </object>
+                </child>
+                <child>
+                  <object class="GtkButton" id="remove_button">
+                    <property name="visible">True</property>
+                    <property name="can_default">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="label">gtk-remove</property>
+                    <property name="use_stock">True</property>
+                    <property name="relief">GTK_RELIEF_NORMAL</property>
+                    <property name="focus_on_click">True</property>
+                  </object>
+                </child>
+              </object>
+              <packing>
+                <property name="padding">0</property>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="tab_expand">False</property>
+            <property name="tab_fill">True</property>
+          </packing>
+        </child>
+        <child type="tab">
+          <object class="GtkLabel" id="label15">
+            <property name="visible">True</property>
+            <property name="label" translatable="yes">Source</property>
+            <property name="use_underline">False</property>
+            <property name="use_markup">False</property>
+            <property name="justify">GTK_JUSTIFY_LEFT</property>
+            <property name="wrap">False</property>
+            <property name="selectable">False</property>
+            <property name="xalign">0.5</property>
+            <property name="yalign">0.5</property>
+            <property name="xpad">0</property>
+            <property name="ypad">0</property>
+            <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+            <property name="width_chars">-1</property>
+            <property name="single_line_mode">False</property>
+            <property name="angle">0</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkVBox" id="vbox3">
+            <property name="border_width">12</property>
+            <property name="visible">True</property>
+            <property name="homogeneous">False</property>
+            <property name="spacing">6</property>
+            <child>
+              <object class="GtkHBox" id="hbox1">
+                <property name="visible">True</property>
+                <property name="homogeneous">False</property>
+                <property name="spacing">12</property>
+                <child>
+                  <object class="GtkLabel" id="label17">
+                    <property name="visible">True</property>
+                    <property name="label" translatable="yes">_Print font:</property>
+                    <property name="use_underline">True</property>
+                    <property name="use_markup">False</property>
+                    <property name="justify">GTK_JUSTIFY_LEFT</property>
+                    <property name="wrap">False</property>
+                    <property name="selectable">False</property>
+                    <property name="xalign">0.5</property>
+                    <property name="yalign">0.5</property>
+                    <property name="xpad">0</property>
+                    <property name="ypad">0</property>
+                    <property name="mnemonic_widget">print_font_button</property>
+                    <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+                    <property name="width_chars">-1</property>
+                    <property name="single_line_mode">False</property>
+                    <property name="angle">0</property>
+                  </object>
+                  <packing>
+                    <property name="padding">0</property>
+                    <property name="expand">False</property>
+                    <property name="fill">False</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkFontButton" id="print_font_button">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="show_style">True</property>
+                    <property name="show_size">True</property>
+                    <property name="use_font">True</property>
+                    <property name="use_size">False</property>
+                    <property name="focus_on_click">True</property>
+                  </object>
+                  <packing>
+                    <property name="padding">0</property>
+                    <property name="expand">True</property>
+                    <property name="fill">True</property>
+                  </packing>
+                </child>
+              </object>
+              <packing>
+                <property name="padding">0</property>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="tab_expand">False</property>
+            <property name="tab_fill">True</property>
+          </packing>
+        </child>
+        <child type="tab">
+          <object class="GtkLabel" id="label16">
+            <property name="visible">True</property>
+            <property name="label" translatable="yes">Print</property>
+            <property name="use_underline">False</property>
+            <property name="use_markup">False</property>
+            <property name="justify">GTK_JUSTIFY_LEFT</property>
+            <property name="wrap">False</property>
+            <property name="selectable">False</property>
+            <property name="xalign">0.5</property>
+            <property name="yalign">0.5</property>
+            <property name="xpad">0</property>
+            <property name="ypad">0</property>
+            <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+            <property name="width_chars">-1</property>
+            <property name="single_line_mode">False</property>
+            <property name="angle">0</property>
+          </object>
+        </child>
+      </object>
+      <packing>
+        <property name="padding">0</property>
+        <property name="expand">True</property>
+        <property name="fill">True</property>
+      </packing>
+    </child>
+  </object>
+</interface>
+
diff --git a/gnome-dictionary/data/gnome-dictionary-source.ui b/gnome-dictionary/data/gnome-dictionary-source.ui
new file mode 100644
index 0000000..4ba2b6b
--- /dev/null
+++ b/gnome-dictionary/data/gnome-dictionary-source.ui
@@ -0,0 +1,332 @@
+<?xml version="1.0"?>
+<!--*- mode: xml -*-->
+<interface>
+  <object class="GtkListStore" id="model1">
+    <columns>
+      <column type="gchararray"/>
+    </columns>
+    <data>
+      <row>
+        <col id="0">Dictionary Server</col>
+      </row>
+    </data>
+  </object>
+  <object class="GtkVBox" id="source_root">
+    <property name="visible">True</property>
+    <property name="homogeneous">False</property>
+    <property name="spacing">12</property>
+    <child>
+      <object class="GtkNotebook" id="notebook1">
+        <property name="visible">True</property>
+        <property name="can_focus">True</property>
+        <property name="show_tabs">True</property>
+        <property name="show_border">True</property>
+        <property name="tab_pos">GTK_POS_TOP</property>
+        <property name="scrollable">False</property>
+        <property name="enable_popup">False</property>
+        <child>
+          <object class="GtkTable" id="table2">
+            <property name="border_width">5</property>
+            <property name="visible">True</property>
+            <property name="n_rows">4</property>
+            <property name="n_columns">2</property>
+            <property name="homogeneous">False</property>
+            <property name="row_spacing">6</property>
+            <property name="column_spacing">12</property>
+            <child>
+              <object class="GtkLabel" id="description_label">
+                <property name="visible">True</property>
+                <property name="label" translatable="yes">_Description:</property>
+                <property name="use_underline">True</property>
+                <property name="use_markup">False</property>
+                <property name="justify">GTK_JUSTIFY_LEFT</property>
+                <property name="wrap">False</property>
+                <property name="selectable">False</property>
+                <property name="xalign">0</property>
+                <property name="yalign">0.5</property>
+                <property name="xpad">0</property>
+                <property name="ypad">0</property>
+                <property name="mnemonic_widget">description_entry</property>
+                <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+                <property name="width_chars">-1</property>
+                <property name="single_line_mode">False</property>
+                <property name="angle">0</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="right_attach">1</property>
+                <property name="top_attach">0</property>
+                <property name="bottom_attach">1</property>
+                <property name="x_options">fill</property>
+                <property name="y_options"/>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="transport_label">
+                <property name="visible">True</property>
+                <property name="label" translatable="yes">_Transport:</property>
+                <property name="use_underline">True</property>
+                <property name="use_markup">False</property>
+                <property name="justify">GTK_JUSTIFY_LEFT</property>
+                <property name="wrap">False</property>
+                <property name="selectable">False</property>
+                <property name="xalign">0</property>
+                <property name="yalign">0.5</property>
+                <property name="xpad">0</property>
+                <property name="ypad">0</property>
+                <property name="mnemonic_widget">transport_combo</property>
+                <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+                <property name="width_chars">-1</property>
+                <property name="single_line_mode">False</property>
+                <property name="angle">0</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="right_attach">1</property>
+                <property name="top_attach">1</property>
+                <property name="bottom_attach">2</property>
+                <property name="x_options">fill</property>
+                <property name="y_options"/>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="hostname_label">
+                <property name="label" translatable="yes">H_ostname:</property>
+                <property name="use_underline">True</property>
+                <property name="use_markup">False</property>
+                <property name="justify">GTK_JUSTIFY_LEFT</property>
+                <property name="wrap">False</property>
+                <property name="selectable">False</property>
+                <property name="xalign">0</property>
+                <property name="yalign">0.5</property>
+                <property name="xpad">0</property>
+                <property name="ypad">0</property>
+                <property name="mnemonic_widget">hostname_entry</property>
+                <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+                <property name="width_chars">-1</property>
+                <property name="single_line_mode">False</property>
+                <property name="angle">0</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="right_attach">1</property>
+                <property name="top_attach">2</property>
+                <property name="bottom_attach">3</property>
+                <property name="x_options">fill</property>
+                <property name="y_options"/>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="port_label">
+                <property name="label" translatable="yes">_Port:</property>
+                <property name="use_underline">True</property>
+                <property name="use_markup">False</property>
+                <property name="justify">GTK_JUSTIFY_LEFT</property>
+                <property name="wrap">False</property>
+                <property name="selectable">False</property>
+                <property name="xalign">0</property>
+                <property name="yalign">0.5</property>
+                <property name="xpad">0</property>
+                <property name="ypad">0</property>
+                <property name="mnemonic_widget">port_entry</property>
+                <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+                <property name="width_chars">-1</property>
+                <property name="single_line_mode">False</property>
+                <property name="angle">0</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="right_attach">1</property>
+                <property name="top_attach">3</property>
+                <property name="bottom_attach">4</property>
+                <property name="x_options">fill</property>
+                <property name="y_options"/>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkEntry" id="description_entry">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="has_focus">True</property>
+                <property name="editable">True</property>
+                <property name="visibility">True</property>
+                <property name="max_length">0</property>
+                <property name="text" translatable="yes">Source Name</property>
+                <property name="has_frame">True</property>
+                <property name="invisible_char">*</property>
+                <property name="activates_default">False</property>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="right_attach">2</property>
+                <property name="top_attach">0</property>
+                <property name="bottom_attach">1</property>
+                <property name="y_options"/>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkEntry" id="hostname_entry">
+                <property name="can_focus">True</property>
+                <property name="editable">True</property>
+                <property name="visibility">True</property>
+                <property name="max_length">0</property>
+                <property name="text">dict.org</property>
+                <property name="has_frame">True</property>
+                <property name="invisible_char">*</property>
+                <property name="activates_default">False</property>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="right_attach">2</property>
+                <property name="top_attach">2</property>
+                <property name="bottom_attach">3</property>
+                <property name="y_options"/>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkEntry" id="port_entry">
+                <property name="can_focus">True</property>
+                <property name="editable">True</property>
+                <property name="visibility">True</property>
+                <property name="max_length">0</property>
+                <property name="text">2628</property>
+                <property name="has_frame">True</property>
+                <property name="invisible_char">*</property>
+                <property name="activates_default">False</property>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="right_attach">2</property>
+                <property name="top_attach">3</property>
+                <property name="bottom_attach">4</property>
+                <property name="y_options"/>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkComboBox" id="transport_combo">
+                <property name="visible">True</property>
+                <property name="add_tearoffs">False</property>
+                <property name="focus_on_click">True</property>
+                <property name="model">model1</property>
+                <child>
+                  <object class="GtkCellRendererText" id="renderer1"/>
+                  <attributes>
+                    <attribute name="text">0</attribute>
+                  </attributes>
+                </child>
+              </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="x_options">fill</property>
+                <property name="y_options">fill</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="tab_expand">False</property>
+            <property name="tab_fill">True</property>
+          </packing>
+        </child>
+        <child type="tab">
+          <object class="GtkLabel" id="label18">
+            <property name="visible">True</property>
+            <property name="label" translatable="yes">Source</property>
+            <property name="use_underline">False</property>
+            <property name="use_markup">False</property>
+            <property name="justify">GTK_JUSTIFY_LEFT</property>
+            <property name="wrap">False</property>
+            <property name="selectable">False</property>
+            <property name="xalign">0.5</property>
+            <property name="yalign">0.5</property>
+            <property name="xpad">0</property>
+            <property name="ypad">0</property>
+            <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+            <property name="width_chars">-1</property>
+            <property name="single_line_mode">False</property>
+            <property name="angle">0</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkVBox" id="db-vbox">
+            <property name="border_width">5</property>
+            <property name="visible">True</property>
+            <property name="homogeneous">False</property>
+            <property name="spacing">0</property>
+            <child>
+              <placeholder/>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+          </object>
+          <packing>
+            <property name="tab_expand">False</property>
+            <property name="tab_fill">True</property>
+          </packing>
+        </child>
+        <child type="tab">
+          <object class="GtkLabel" id="label19">
+            <property name="visible">True</property>
+            <property name="label" translatable="yes">Dictionaries</property>
+            <property name="use_underline">False</property>
+            <property name="use_markup">False</property>
+            <property name="justify">GTK_JUSTIFY_LEFT</property>
+            <property name="wrap">False</property>
+            <property name="selectable">False</property>
+            <property name="xalign">0.5</property>
+            <property name="yalign">0.5</property>
+            <property name="xpad">0</property>
+            <property name="ypad">0</property>
+            <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+            <property name="width_chars">-1</property>
+            <property name="single_line_mode">False</property>
+            <property name="angle">0</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkVBox" id="strat-vbox">
+            <property name="border_width">5</property>
+            <property name="visible">True</property>
+            <property name="homogeneous">False</property>
+            <property name="spacing">0</property>
+            <child>
+              <placeholder/>
+            </child>
+          </object>
+          <packing>
+            <property name="tab_expand">False</property>
+            <property name="tab_fill">True</property>
+          </packing>
+        </child>
+        <child type="tab">
+          <object class="GtkLabel" id="label20">
+            <property name="visible">True</property>
+            <property name="label" translatable="yes">Strategies</property>
+            <property name="use_underline">False</property>
+            <property name="use_markup">False</property>
+            <property name="justify">GTK_JUSTIFY_LEFT</property>
+            <property name="wrap">False</property>
+            <property name="selectable">False</property>
+            <property name="xalign">0.5</property>
+            <property name="yalign">0.5</property>
+            <property name="xpad">0</property>
+            <property name="ypad">0</property>
+            <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+            <property name="width_chars">-1</property>
+            <property name="single_line_mode">False</property>
+            <property name="angle">0</property>
+          </object>
+        </child>
+      </object>
+      <packing>
+        <property name="padding">0</property>
+        <property name="expand">True</property>
+        <property name="fill">True</property>
+      </packing>
+    </child>
+  </object>
+</interface>
+
diff --git a/gnome-dictionary/src/Makefile.am b/gnome-dictionary/src/Makefile.am
index bc87c6b..c3370c9 100644
--- a/gnome-dictionary/src/Makefile.am
+++ b/gnome-dictionary/src/Makefile.am
@@ -37,12 +37,10 @@ gnome_dictionary_CFLAGS = \
 	-I$(top_builddir)/gnome-dictionary \
 	-I$(top_srcdir)/gnome-dictionary \
 	$(GNOME_UTILS_CFLAGS) \
-	$(LIBGLADE_CFLAGS) \
 	$(NULL)
 gnome_dictionary_LDADD = \
 	$(top_builddir)/gnome-dictionary/libgdict/libgdict-1.0.la \
 	$(GNOME_UTILS_LIBS) \
-	$(LIBGLADE_LIBS) \
 	$(NULL)
 
 gnome_dictionary_applet_SOURCES = \
@@ -67,12 +65,10 @@ gnome_dictionary_applet_CFLAGS = \
 	-I$(top_builddir)/gnome-dictionary \
 	-I$(top_srcdir)/gnome-dictionary \
 	$(GNOME_UTILS_CFLAGS) \
-	$(LIBGLADE_CFLAGS) \
 	$(APPLET_CFLAGS) \
 	$(NULL)
 gnome_dictionary_applet_LDADD = \
 	$(top_builddir)/gnome-dictionary/libgdict/libgdict-1.0.la \
 	$(GNOME_UTILS_LIBS) \
-	$(LIBGLADE_LIBS) \
 	$(APPLET_LIBS) \
 	$(NULL)
diff --git a/gnome-dictionary/src/gdict-pref-dialog.c b/gnome-dictionary/src/gdict-pref-dialog.c
index 433250d..009483d 100644
--- a/gnome-dictionary/src/gdict-pref-dialog.c
+++ b/gnome-dictionary/src/gdict-pref-dialog.c
@@ -34,14 +34,13 @@
 #endif
 
 #include <glib/gi18n.h>
-#include <glade/glade.h>
 #include <gconf/gconf-client.h>
 
 #include "gdict-source-dialog.h"
 #include "gdict-pref-dialog.h"
 #include "gdict-common.h"
 
-#define GDICT_PREFERENCES_GLADE 	PKGDATADIR "/gnome-dictionary-preferences.glade"
+#define GDICT_PREFERENCES_UI 	PKGDATADIR "/gnome-dictionary-preferences.ui"
 
 #define DEFAULT_MIN_WIDTH 	220
 #define DEFAULT_MIN_HEIGHT 	330
@@ -65,8 +64,8 @@ struct _GdictPrefDialog
 {
   GtkDialog parent_instance;
 
-  GladeXML *xml;
-  
+  GtkBuilder *builder;
+
   GConfClient *gconf_client;
   guint notify_id;
   
@@ -539,8 +538,8 @@ gdict_pref_dialog_finalize (GObject *object)
   if (dialog->gconf_client)
     g_object_unref (dialog->gconf_client);
   
-  if (dialog->xml)
-    g_object_unref (dialog->xml);
+  if (dialog->builder)
+    g_object_unref (dialog->builder);
 
   if (dialog->active_source)
     g_free (dialog->active_source);
@@ -609,6 +608,7 @@ static void
 gdict_pref_dialog_init (GdictPrefDialog *dialog)
 {
   gchar *font;
+  GError *error = NULL;
 
   gtk_window_set_default_size (GTK_WINDOW (dialog),
   			       DEFAULT_MIN_WIDTH,
@@ -638,33 +638,37 @@ gdict_pref_dialog_init (GdictPrefDialog *dialog)
   					       NULL,
   					       NULL);
 
-  /* get the UI from the glade file */
-  dialog->xml = glade_xml_new (GDICT_PREFERENCES_GLADE,
-  			       "preferences_root",
-  			       NULL);
-  g_assert (dialog->xml);
-  
+  /* get the UI from the GtkBuilder file */
+  dialog->builder = gtk_builder_new ();
+  gtk_builder_add_from_file (dialog->builder, GDICT_PREFERENCES_UI, &error);
+
+  if (error) {
+    g_critical ("Unable to load the preferences user interface: %s", error->message);
+    g_error_free (error);
+    g_assert_not_reached ();
+  }
+
   /* the main widget */
   gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox),
-                     glade_xml_get_widget (dialog->xml, "preferences_root"));
+                     GTK_WIDGET (gtk_builder_get_object (dialog->builder, "preferences_root")));
 
   /* keep all the interesting widgets around */  
-  dialog->notebook = glade_xml_get_widget (dialog->xml, "preferences_notebook");
+  dialog->notebook = GTK_WIDGET (gtk_builder_get_object (dialog->builder, "preferences_notebook"));
   
-  dialog->sources_view = glade_xml_get_widget (dialog->xml, "sources_treeview");
+  dialog->sources_view = GTK_WIDGET (gtk_builder_get_object (dialog->builder, "sources_treeview"));
   build_sources_view (dialog);
 
   dialog->active_source = gdict_gconf_get_string_with_default (dialog->gconf_client,
 							       GDICT_GCONF_SOURCE_KEY,
 							       GDICT_DEFAULT_SOURCE_NAME);
 
-  dialog->sources_add = glade_xml_get_widget (dialog->xml, "add_button");
+  dialog->sources_add = GTK_WIDGET (gtk_builder_get_object (dialog->builder, "add_button"));
   gtk_widget_set_tooltip_text (dialog->sources_add,
                                _("Add a new dictionary source"));
   g_signal_connect (dialog->sources_add, "clicked",
   		    G_CALLBACK (source_add_clicked_cb), dialog);
   		    
-  dialog->sources_remove = glade_xml_get_widget (dialog->xml, "remove_button");
+  dialog->sources_remove = GTK_WIDGET (gtk_builder_get_object (dialog->builder, "remove_button"));
   gtk_widget_set_tooltip_text (dialog->sources_remove,
                                _("Remove the currently selected dictionary source"));
   g_signal_connect (dialog->sources_remove, "clicked",
@@ -676,7 +680,7 @@ gdict_pref_dialog_init (GdictPrefDialog *dialog)
   if (!font)
     font = g_strdup (GDICT_DEFAULT_PRINT_FONT);
   
-  dialog->font_button = glade_xml_get_widget (dialog->xml, "print_font_button");
+  dialog->font_button = GTK_WIDGET (gtk_builder_get_object (dialog->builder, "print_font_button"));
   gtk_font_button_set_font_name (GTK_FONT_BUTTON (dialog->font_button), font);
   gtk_widget_set_tooltip_text (dialog->font_button,
                                _("Set the font used for printing the definitions"));
diff --git a/gnome-dictionary/src/gdict-source-dialog.c b/gnome-dictionary/src/gdict-source-dialog.c
index 6c73a20..9cef95c 100644
--- a/gnome-dictionary/src/gdict-source-dialog.c
+++ b/gnome-dictionary/src/gdict-source-dialog.c
@@ -34,12 +34,11 @@
 #endif
 
 #include <glib/gi18n.h>
-#include <glade/glade.h>
 #include <gconf/gconf-client.h>
 
 #include "gdict-source-dialog.h"
 
-#define GDICT_PREFERENCES_GLADE 	PKGDATADIR "/gnome-dictionary-preferences.glade"
+#define GDICT_SOURCE_UI 	PKGDATADIR "/gnome-dictionary-source.ui"
 
 /*********************
  * GdictSourceDialog *
@@ -48,8 +47,8 @@
 struct _GdictSourceDialog
 {
   GtkDialog parent_instance;
-  
-  GladeXML *xml;
+
+  GtkBuilder *builder; 
 
   GConfClient *gconf_client;
   guint notify_id;
@@ -113,10 +112,10 @@ transport_combo_changed_cb (GtkWidget *widget,
 
   if (transport == GDICT_SOURCE_TRANSPORT_DICTD)
     {
-      gtk_widget_show (glade_xml_get_widget (dialog->xml, "hostname_label"));
-      gtk_widget_show (glade_xml_get_widget (dialog->xml, "hostname_entry"));
-      gtk_widget_show (glade_xml_get_widget (dialog->xml, "port_label"));
-      gtk_widget_show (glade_xml_get_widget (dialog->xml, "port_entry"));
+      gtk_widget_show (GTK_WIDGET (gtk_builder_get_object (dialog->builder, "hostname_label")));
+      gtk_widget_show (GTK_WIDGET (gtk_builder_get_object (dialog->builder, "hostname_entry")));
+      gtk_widget_show (GTK_WIDGET (gtk_builder_get_object (dialog->builder, "port_label")));
+      gtk_widget_show (GTK_WIDGET (gtk_builder_get_object (dialog->builder, "port_entry")));
       
       if (dialog->action == GDICT_SOURCE_DIALOG_CREATE)
         {
@@ -127,10 +126,10 @@ transport_combo_changed_cb (GtkWidget *widget,
     }
   else
     {
-      gtk_widget_hide (glade_xml_get_widget (dialog->xml, "hostname_label"));
-      gtk_widget_hide (glade_xml_get_widget (dialog->xml, "hostname_entry"));
-      gtk_widget_hide (glade_xml_get_widget (dialog->xml, "port_label"));
-      gtk_widget_hide (glade_xml_get_widget (dialog->xml, "port_entry"));
+      gtk_widget_hide (GTK_WIDGET (gtk_builder_get_object (dialog->builder, "hostname_label")));
+      gtk_widget_hide (GTK_WIDGET (gtk_builder_get_object (dialog->builder, "hostname_entry")));
+      gtk_widget_hide (GTK_WIDGET (gtk_builder_get_object (dialog->builder, "port_label")));
+      gtk_widget_hide (GTK_WIDGET (gtk_builder_get_object (dialog->builder, "port_entry")));
 
       if (dialog->action == GDICT_SOURCE_DIALOG_CREATE)
         {
@@ -147,8 +146,8 @@ get_text_from_entry (GdictSourceDialog *dialog,
 {
   GtkWidget *entry;
   gchar *retval;
-  
-  entry = glade_xml_get_widget (dialog->xml, entry_name);
+
+  entry = GTK_WIDGET (gtk_builder_get_object (dialog->builder, entry_name));
   if (!entry)
     return NULL;
   
@@ -164,7 +163,7 @@ set_text_to_entry (GdictSourceDialog *dialog,
 {
   GtkWidget *entry;
 
-  entry = glade_xml_get_widget (dialog->xml, entry_name);
+  entry = GTK_WIDGET (gtk_builder_get_object (dialog->builder, entry_name));
   if (!entry)
     return;
 
@@ -178,7 +177,7 @@ get_text_from_combo (GdictSourceDialog *dialog,
   GtkWidget *combo;
   gchar *retval;
   
-  combo = glade_xml_get_widget (dialog->xml, combo_name);
+  combo = GTK_WIDGET (gtk_builder_get_object (dialog->builder, combo_name));
   if (!combo)
     return NULL;
   
@@ -207,10 +206,10 @@ set_transport_settings (GdictSourceDialog *dialog)
         set_text_to_entry (dialog, "hostname_entry", hostname);
         set_text_to_entry (dialog, "port_entry", port_str);
 
-        gtk_widget_show (glade_xml_get_widget (dialog->xml, "hostname_label"));
-        gtk_widget_show (glade_xml_get_widget (dialog->xml, "hostname_entry"));
-        gtk_widget_show (glade_xml_get_widget (dialog->xml, "port_label"));
-        gtk_widget_show (glade_xml_get_widget (dialog->xml, "port_entry"));
+        gtk_widget_show (GTK_WIDGET (gtk_builder_get_object (dialog->builder, "hostname_label")));
+        gtk_widget_show (GTK_WIDGET (gtk_builder_get_object (dialog->builder, "hostname_entry")));
+        gtk_widget_show (GTK_WIDGET (gtk_builder_get_object (dialog->builder, "port_label")));
+        gtk_widget_show (GTK_WIDGET (gtk_builder_get_object (dialog->builder, "port_entry")));
 
         g_free (port_str);
       }
@@ -518,8 +517,8 @@ gdict_source_dialog_finalize (GObject *object)
   if (dialog->gconf_client)
     g_object_unref (dialog->gconf_client);
   
-  if (dialog->xml)
-    g_object_unref (dialog->xml);
+  if (dialog->builder)
+    g_object_unref (dialog->builder);
 
   if (dialog->source_name)
     g_free (dialog->source_name);
@@ -590,6 +589,7 @@ gdict_source_dialog_constructor (GType                  type,
   GObject *object;
   GdictSourceDialog *dialog;
   GtkWidget *vbox;
+  GError *error = NULL;
 
   object = G_OBJECT_CLASS (gdict_source_dialog_parent_class)->constructor (type,
 									   n_construct_properties,
@@ -601,20 +601,25 @@ gdict_source_dialog_constructor (GType                  type,
   
   gtk_widget_push_composite_child ();
 
-  /* get the UI from the glade file */
-  dialog->xml = glade_xml_new (GDICT_PREFERENCES_GLADE,
-  			       "source_root",
-  			       NULL);
-  g_assert (dialog->xml);
+  /* get the UI from the GtkBuilder file */
+  dialog->builder = gtk_builder_new ();
+  gtk_builder_add_from_file (dialog->builder, GDICT_SOURCE_UI, &error);
+
+  if (error) {
+    g_critical ("Unable to load the user interface definition file: %s",
+                error->message);
+    g_error_free (error);
+    g_assert_not_reached ();
+  }
   
   /* the main widget */
   gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox),
-                     glade_xml_get_widget (dialog->xml, "source_root"));
+                     GTK_WIDGET (gtk_builder_get_object (dialog->builder, "source_root")));
 
   /* the transport combo changes the UI by changing the visible widgets
    * bound to the transport's own options.
    */
-  dialog->transport_combo = glade_xml_get_widget (dialog->xml, "transport_combo");
+  dialog->transport_combo = GTK_WIDGET (gtk_builder_get_object (dialog->builder, "transport_combo"));
   g_signal_connect (dialog->transport_combo, "changed",
   		    G_CALLBACK (transport_combo_changed_cb),
   		    dialog);
@@ -624,12 +629,12 @@ gdict_source_dialog_constructor (GType                  type,
   					       GTK_STOCK_HELP,
 					       GTK_RESPONSE_HELP);
   
-  vbox = glade_xml_get_widget (dialog->xml, "db-vbox");
+  vbox = GTK_WIDGET (gtk_builder_get_object (dialog->builder, "db-vbox"));
   dialog->db_chooser = gdict_database_chooser_new ();
   gtk_box_pack_start (GTK_BOX (vbox), dialog->db_chooser, TRUE, TRUE, 0);
   gtk_widget_show (dialog->db_chooser);
 
-  vbox = glade_xml_get_widget (dialog->xml, "strat-vbox");
+  vbox = GTK_WIDGET (gtk_builder_get_object (dialog->builder, "strat-vbox"));
   dialog->strat_chooser = gdict_strategy_chooser_new ();
   gtk_box_pack_start (GTK_BOX (vbox), dialog->strat_chooser, TRUE, TRUE, 0);
   gtk_widget_show (dialog->strat_chooser);
@@ -641,10 +646,10 @@ gdict_source_dialog_constructor (GType                  type,
     {
     case GDICT_SOURCE_DIALOG_VIEW:
       /* disable every editable widget */
-      gtk_editable_set_editable (GTK_EDITABLE (glade_xml_get_widget (dialog->xml, "name_entry")), FALSE);
-      gtk_editable_set_editable (GTK_EDITABLE (glade_xml_get_widget (dialog->xml, "description_entry")), FALSE);
-      gtk_editable_set_editable (GTK_EDITABLE (glade_xml_get_widget (dialog->xml, "hostname_entry")), FALSE);
-      gtk_editable_set_editable (GTK_EDITABLE (glade_xml_get_widget (dialog->xml, "port_entry")), FALSE);
+      gtk_editable_set_editable (GTK_EDITABLE (gtk_builder_get_object (dialog->builder, "name_entry")), FALSE);
+      gtk_editable_set_editable (GTK_EDITABLE (gtk_builder_get_object (dialog->builder, "description_entry")), FALSE);
+      gtk_editable_set_editable (GTK_EDITABLE (gtk_builder_get_object (dialog->builder, "hostname_entry")), FALSE);
+      gtk_editable_set_editable (GTK_EDITABLE (gtk_builder_get_object (dialog->builder, "port_entry")), FALSE);
       
       gtk_widget_set_sensitive (dialog->transport_combo, FALSE);
 
diff --git a/gnome-dictionary/src/gdict-window.h b/gnome-dictionary/src/gdict-window.h
index 8dcce23..a60e1fa 100644
--- a/gnome-dictionary/src/gdict-window.h
+++ b/gnome-dictionary/src/gdict-window.h
@@ -25,7 +25,6 @@
 
 #include <gdk-pixbuf/gdk-pixbuf.h>
 #include <gtk/gtk.h>
-#include <glade/glade.h>
 #include <gconf/gconf-client.h>
 #include <libgdict/gdict.h>
 
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 452f785..bd203a7 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -26,7 +26,8 @@ gnome-dictionary/data/GNOME_DictionaryApplet.server.in.in
 gnome-dictionary/data/GNOME_DictionaryApplet.xml
 gnome-dictionary/data/gnome-dictionary.desktop.in.in
 gnome-dictionary/data/gnome-dictionary.schemas.in
-gnome-dictionary/data/gnome-dictionary-preferences.glade
+[type: gettext/glade]gnome-dictionary/data/gnome-dictionary-preferences.ui
+[type: gettext/glade]gnome-dictionary/data/gnome-dictionary-source.ui
 gnome-dictionary/data/spanish.desktop.in
 gnome-dictionary/data/thai.desktop.in
 gnome-dictionary/libgdict/gdict-client-context.c



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]