epiphany r8678 - in trunk: . data/glade embed lib src
- From: xan svn gnome org
- To: svn-commits-list gnome org
- Subject: epiphany r8678 - in trunk: . data/glade embed lib src
- Date: Mon, 12 Jan 2009 15:22:58 +0000 (UTC)
Author: xan
Date: Mon Jan 12 15:22:58 2009
New Revision: 8678
URL: http://svn.gnome.org/viewvc/epiphany?rev=8678&view=rev
Log:
Port to use GtkBuilder.
Bug #567490
We keep the old glade files as master source and convert them to
GtkBuilder format at compile-time because glade-3 is not ready yet for
day-to-day edition of GtkBuilder files.
Modified:
trunk/configure.ac
trunk/data/glade/Makefile.am
trunk/embed/downloader-view.c
trunk/lib/ephy-dialog.c
trunk/src/ephy-encoding-dialog.c
trunk/src/pdm-dialog.c
trunk/src/prefs-dialog.c
Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac (original)
+++ trunk/configure.ac Mon Jan 12 15:22:58 2009
@@ -97,7 +97,7 @@
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 @@
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 @@
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_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
# ************
Modified: trunk/data/glade/Makefile.am
==============================================================================
--- trunk/data/glade/Makefile.am (original)
+++ trunk/data/glade/Makefile.am Mon Jan 12 15:22:58 2009
@@ -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)
Modified: trunk/embed/downloader-view.c
==============================================================================
--- trunk/embed/downloader-view.c (original)
+++ trunk/embed/downloader-view.c Mon Jan 12 15:22:58 2009
@@ -712,7 +712,7 @@
ephy_dialog_construct (d,
properties,
- ephy_file ("epiphany.glade"),
+ ephy_file ("epiphany.ui"),
"download_manager_dialog",
NULL);
Modified: trunk/lib/ephy-dialog.c
==============================================================================
--- trunk/lib/ephy-dialog.c (original)
+++ trunk/lib/ephy-dialog.c Mon Jan 12 15:22:58 2009
@@ -30,7 +30,6 @@
#include <stdlib.h>
#include <string.h>
#include <gtk/gtk.h>
-#include <glade/glade.h>
enum
{
@@ -920,7 +919,7 @@
}
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 @@
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 @@
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 @@
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
Modified: trunk/src/ephy-encoding-dialog.c
==============================================================================
--- trunk/src/ephy-encoding-dialog.c (original)
+++ trunk/src/ephy-encoding-dialog.c Mon Jan 12 15:22:58 2009
@@ -296,7 +296,7 @@
ephy_dialog_construct (EPHY_DIALOG (dialog),
properties,
- ephy_file ("epiphany.glade"),
+ ephy_file ("epiphany.ui"),
"encoding_dialog",
NULL);
Modified: trunk/src/pdm-dialog.c
==============================================================================
--- trunk/src/pdm-dialog.c (original)
+++ trunk/src/pdm-dialog.c Mon Jan 12 15:22:58 2009
@@ -1440,7 +1440,7 @@
ephy_dialog_construct (EPHY_DIALOG(dialog),
properties,
- ephy_file ("epiphany.glade"),
+ ephy_file ("epiphany.ui"),
"pdm_dialog",
NULL);
Modified: trunk/src/prefs-dialog.c
==============================================================================
--- trunk/src/prefs-dialog.c (original)
+++ trunk/src/prefs-dialog.c Mon Jan 12 15:22:58 2009
@@ -710,7 +710,7 @@
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 @@
ephy_dialog_construct (dialog,
properties,
- ephy_file ("prefs-dialog.glade"),
+ ephy_file ("prefs-dialog.ui"),
"prefs_dialog",
NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]