b47680d14e861b093bfb7819762b334374b396ce
diff --git a/configure.ac b/configure.ac
index e7da2e9..c8f6fe6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -97,7 +97,7 @@ GECKO_WARN_CXXFLAGS="-Wno-ctor-dtor-privacy -Wno-non-virtual-dtor"
 if test "$enable_maintainer_mode" = "yes"; then
 	AC_DEFINE([MAINTAINER_MODE],[1],[Define to enable 'maintainer-only' behaviour])
 	enable_debug=yes
-	DEPRECATION_FLAGS="-DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DGCONF_DISABLE_DEPRECATED -DLIBGLADE_DISABLE_DEPRECATED -DPANGO_DISABLE_DEPRECATED -DGNOME_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"
+	DEPRECATION_FLAGS="-DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DGCONF_DISABLE_DEPRECATED -DPANGO_DISABLE_DEPRECATED -DGNOME_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"
 	GECKO_WARN_CXXFLAGS="-Wall -Wconversion -Wpointer-arith -Wcast-align -Woverloaded-virtual -Wsynth $GECKO_WARN_CXXFLAGS"
 fi
 
@@ -105,7 +105,6 @@ GLIB_REQUIRED=2.16.0
 GTK_REQUIRED=2.15.0
 LIBXML_REQUIRED=2.6.12
 LIBXSLT_REQUIRED=1.1.7
-LIBGLADE_REQUIRED=2.3.1
 LIBSTARTUP_NOTIFICATION_REQUIRED=0.5
 LIBNOTIFY_REQUIRED=0.4
 DBUS_GLIB_REQUIRED=0.35
@@ -138,7 +137,6 @@ PKG_CHECK_MODULES([DEPENDENCIES], [
 		  sm
 		  libxml-2.0 >= $LIBXML_REQUIRED
 		  libxslt >= $LIBXSLT_REQUIRED
-		  libglade-2.0 >= $LIBGLADE_REQUIRED
 		  gconf-2.0
 		  libstartup-notification-1.0 >= $LIBSTARTUP_NOTIFICATION_REQUIRED
 		  $LIBNOTIFY_PACKAGE
@@ -511,6 +509,15 @@ AC_SUBST([SVN_ROOT],[http://svn.gnome.org/svn])
 AC_SUBST([SVN_MODULE],[epiphany])
 AC_SUBST([SVN_BRANCH],[epiphany_branch])
 
+# **************************
+# gtk-builder-convert binary
+# **************************
+
+AC_PATH_PROG([GTK_BUILDER_CONVERT],[gtk-builder-convert],[false])
+if test "$GTK_BUILDER_CONVERT" = "false"; then
+  AC_MSG_ERROR([gtk-builder-convert not found])
+fi
+
 # ************
 # Output files
 # ************
diff --git a/data/glade/Makefile.am b/data/glade/Makefile.am
index 08794e3..b6a36e6 100644
--- a/data/glade/Makefile.am
+++ b/data/glade/Makefile.am
@@ -1,9 +1,15 @@
 gladedir = $(pkgdatadir)/glade
-glade_DATA = \
+glade_in_files = \
 	certificate-dialogs.glade	\
 	epiphany.glade			\
 	form-signing-dialog.glade	\
 	prefs-dialog.glade		\
 	print.glade
 
+%.ui: %.glade
+	$(GTK_BUILDER_CONVERT) $< $@
+
+glade_DATA = $(glade_in_files:.glade=.ui)
+
+CLEAN_FILES= $(glade_DATA)
 EXTRA_DIST = $(glade_DATA)
diff --git a/embed/downloader-view.c b/embed/downloader-view.c
index 8650a54..2851b8e 100644
--- a/embed/downloader-view.c
+++ b/embed/downloader-view.c
@@ -712,7 +712,7 @@ downloader_view_build_ui (DownloaderView *dv)
 
 	ephy_dialog_construct (d,
 			       properties,
-			       ephy_file ("epiphany.glade"),
+			       ephy_file ("epiphany.ui"),
 			       "download_manager_dialog",
 			       NULL);
 
diff --git a/lib/ephy-dialog.c b/lib/ephy-dialog.c
index 07ada45..4cc66da 100644
--- a/lib/ephy-dialog.c
+++ b/lib/ephy-dialog.c
@@ -30,7 +30,6 @@
 #include <stdlib.h>
 #include <string.h>
 #include <gtk/gtk.h>
-#include <glade/glade.h>
 
 enum
 {
@@ -920,7 +919,7 @@ disconnect_signals (gpointer key, PropertyInfo *info, EphyDialog *dialog)
 }
 
 static void
-init_props (EphyDialog *dialog, const EphyDialogProperty *properties, GladeXML *gxml)
+init_props (EphyDialog *dialog, const EphyDialogProperty *properties, GtkBuilder *builder)
 {
 	int i;
 
@@ -935,7 +934,7 @@ init_props (EphyDialog *dialog, const EphyDialogProperty *properties, GladeXML *
 		info->string_enum = NULL;
 		info->data_col = -1;
 
-		info->widget = glade_xml_get_widget (gxml, info->id);
+		info->widget = (GtkWidget*)gtk_builder_get_object (builder, info->id);
 		
 		if (GTK_IS_COMBO_BOX (info->widget))
 		{
@@ -1068,12 +1067,20 @@ impl_construct (EphyDialog *dialog,
 		const char *domain)
 {
 	EphyDialogPrivate *priv = dialog->priv;
-	GladeXML *gxml;
+	GtkBuilder *builder;
+	GError *error = NULL;
 
-	gxml = glade_xml_new (file, name, domain);
-	g_return_if_fail (gxml != NULL);
+	builder = gtk_builder_new ();
+	gtk_builder_set_translation_domain (builder, domain);
+	gtk_builder_add_from_file (builder, file, &error);
+	if (error)
+	{
+		g_warning ("Unable to load UI file %s: %s", file, error->message);
+		g_error_free (error);
+		return;
+	}
 
-	priv->dialog = glade_xml_get_widget (gxml, name);
+	priv->dialog = (GtkWidget*)gtk_builder_get_object (builder, name);
 	g_return_if_fail (priv->dialog != NULL);
 
 	if (priv->name == NULL)
@@ -1083,13 +1090,13 @@ impl_construct (EphyDialog *dialog,
 
 	if (properties)
 	{
-		init_props (dialog, properties, gxml);
+		init_props (dialog, properties, builder);
 	}
 
 	g_signal_connect_object (dialog->priv->dialog, "destroy",
 				 G_CALLBACK(dialog_destroy_cb), dialog, 0);
 
-	g_object_unref (gxml);
+	g_object_unref (builder);
 }
 
 static void
diff --git a/src/ephy-encoding-dialog.c b/src/ephy-encoding-dialog.c
index bf029dd..554f0f7 100644
--- a/src/ephy-encoding-dialog.c
+++ b/src/ephy-encoding-dialog.c
@@ -296,7 +296,7 @@ ephy_encoding_dialog_init (EphyEncodingDialog *dialog)
 
 	ephy_dialog_construct (EPHY_DIALOG (dialog),
 			       properties,
-			       ephy_file ("epiphany.glade"),
+			       ephy_file ("epiphany.ui"),
 			       "encoding_dialog",
 			       NULL);
 
diff --git a/src/pdm-dialog.c b/src/pdm-dialog.c
index a1b41f3..df4f997 100644
--- a/src/pdm-dialog.c
+++ b/src/pdm-dialog.c
@@ -1440,7 +1440,7 @@ pdm_dialog_init (PdmDialog *dialog)
 
 	ephy_dialog_construct (EPHY_DIALOG(dialog),
 			       properties,
-			       ephy_file ("epiphany.glade"),
+			       ephy_file ("epiphany.ui"),
 			       "pdm_dialog",
 			       NULL);
 
diff --git a/src/prefs-dialog.c b/src/prefs-dialog.c
index 5e41978..2db3c9f 100644
--- a/src/prefs-dialog.c
+++ b/src/prefs-dialog.c
@@ -710,7 +710,7 @@ setup_add_language_dialog (PrefsDialog *pd)
 
 	ephy_dialog_construct (dialog, 
 			       add_lang_props,
-			       ephy_file ("prefs-dialog.glade"),
+			       ephy_file ("prefs-dialog.ui"),
 			       "add_language_dialog",
 			       NULL);
 
@@ -1167,7 +1167,7 @@ prefs_dialog_init (PrefsDialog *pd)
 
 	ephy_dialog_construct (dialog,
 			       properties,
-			       ephy_file ("prefs-dialog.glade"),
+			       ephy_file ("prefs-dialog.ui"),
 			       "prefs_dialog",
 			       NULL);
 
