From 054c0881696a85f537e93b4950a28f505a3dc0f7 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Thu, 24 Sep 2009 18:04:36 -0400 Subject: =?UTF-8?q?Bug=C2=A0589153=20-=20Use=20GtkBuilder=20instead=20of?= =?UTF-8?q?=20libglade?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- widgets/e-timezone-dialog/Makefile.am | 6 +- widgets/e-timezone-dialog/e-timezone-dialog.c | 40 +-- widgets/e-timezone-dialog/e-timezone-dialog.glade | 319 ---------------------- widgets/e-timezone-dialog/e-timezone-dialog.ui | 303 ++++++++++++++++++++ 4 files changed, 321 insertions(+), 347 deletions(-) delete mode 100644 widgets/e-timezone-dialog/e-timezone-dialog.glade create mode 100644 widgets/e-timezone-dialog/e-timezone-dialog.ui (limited to 'widgets/e-timezone-dialog') diff --git a/widgets/e-timezone-dialog/Makefile.am b/widgets/e-timezone-dialog/Makefile.am index d08bef18c2..ebdb6e2c00 100644 --- a/widgets/e-timezone-dialog/Makefile.am +++ b/widgets/e-timezone-dialog/Makefile.am @@ -4,7 +4,7 @@ libetimezonedialog_la_CPPFLAGS = \ $(AM_CPPFLAGS) \ -I$(top_srcdir) \ -I$(top_srcdir)/widgets \ - -DEVOLUTION_GLADEDIR=\""$(gladedir)"\" \ + -DEVOLUTION_UIDIR=\""$(uidir)"\" \ -DG_LOG_DOMAIN=__FILE__ \ $(TZDIALOG_CFLAGS) @@ -19,8 +19,8 @@ libetimezonedialog_la_LIBADD = \ $(top_builddir)/widgets/misc/libemiscwidgets.la \ $(EVOLUTION_CALENDAR_LIBS) -glade_DATA = e-timezone-dialog.glade +ui_DATA = e-timezone-dialog.ui -EXTRA_DIST = $(glade_DATA) +EXTRA_DIST = $(ui_DATA) -include $(top_srcdir)/git.mk diff --git a/widgets/e-timezone-dialog/e-timezone-dialog.c b/widgets/e-timezone-dialog/e-timezone-dialog.c index 8f22695916..a7ea43d9e9 100644 --- a/widgets/e-timezone-dialog/e-timezone-dialog.c +++ b/widgets/e-timezone-dialog/e-timezone-dialog.c @@ -27,11 +27,11 @@ #include #include #include -#include #include #include #include +#include "e-util/e-util.h" #include "e-util/e-util-private.h" #include "e-timezone-dialog.h" @@ -58,8 +58,7 @@ struct _ETimezoneDialogPrivate { the displayed name is ""). */ icaltimezone *zone; - /* Glade XML data */ - GladeXML *xml; + GtkBuilder *builder; EMapPoint *point_selected; EMapPoint *point_hover; @@ -69,7 +68,7 @@ struct _ETimezoneDialogPrivate { /* The timeout used to flash the nearest point. */ guint timeout_id; - /* Widgets from the Glade file */ + /* Widgets from the UI file */ GtkWidget *app; GtkWidget *table; GtkWidget *map_window; @@ -161,9 +160,9 @@ e_timezone_dialog_dispose (GObject *object) priv->timeout_id = 0; } - if (priv->xml) { - g_object_unref (priv->xml); - priv->xml = NULL; + if (priv->builder) { + g_object_unref (priv->builder); + priv->builder = NULL; } (* G_OBJECT_CLASS (e_timezone_dialog_parent_class)->dispose) (object); @@ -261,7 +260,6 @@ e_timezone_dialog_construct (ETimezoneDialog *etd) { ETimezoneDialogPrivate *priv; GtkWidget *map; - gchar *filename; g_return_val_if_fail (etd != NULL, NULL); g_return_val_if_fail (E_IS_TIMEZONE_DIALOG (etd), NULL); @@ -270,16 +268,8 @@ e_timezone_dialog_construct (ETimezoneDialog *etd) /* Load the content widgets */ - filename = g_build_filename (EVOLUTION_GLADEDIR, - "e-timezone-dialog.glade", - NULL); - priv->xml = glade_xml_new (filename, NULL, NULL); - g_free (filename); - - if (!priv->xml) { - g_message ("e_timezone_dialog_construct(): Could not load the Glade XML file!"); - goto error; - } + priv->builder = gtk_builder_new (); + e_load_ui_builder_definition (priv->builder, "e-timezone-dialog.ui"); if (!get_widgets (etd)) { g_message ("e_timezone_dialog_construct(): Could not find all widgets in the XML file!"); @@ -364,16 +354,16 @@ static gboolean get_widgets (ETimezoneDialog *etd) { ETimezoneDialogPrivate *priv; + GtkBuilder *builder; priv = etd->priv; + builder = etd->priv->builder; -#define GW(name) glade_xml_get_widget (priv->xml, name) - - priv->app = GW ("timezone-dialog"); - priv->map_window = GW ("map-window"); - priv->timezone_combo = GW ("timezone-combo"); - priv->table = GW ("timezone-table"); - priv->preview_label = GW ("preview-label"); + priv->app = e_builder_get_widget (builder, "timezone-dialog"); + priv->map_window = e_builder_get_widget (builder, "map-window"); + priv->timezone_combo = e_builder_get_widget (builder, "timezone-combo"); + priv->table = e_builder_get_widget (builder, "timezone-table"); + priv->preview_label = e_builder_get_widget (builder, "preview-label"); return (priv->app && priv->map_window diff --git a/widgets/e-timezone-dialog/e-timezone-dialog.glade b/widgets/e-timezone-dialog/e-timezone-dialog.glade deleted file mode 100644 index f23ee27027..0000000000 --- a/widgets/e-timezone-dialog/e-timezone-dialog.glade +++ /dev/null @@ -1,319 +0,0 @@ - - - - - - - - Select a Time Zone - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - 500 - 400 - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_DIALOG - GDK_GRAVITY_NORTH_WEST - False - - - - True - False - 6 - - - - True - GTK_BUTTONBOX_END - - - - True - True - True - gtk-cancel - True - GTK_RELIEF_NORMAL - True - -2 - - - - - - True - True - True - True - gtk-ok - True - GTK_RELIEF_NORMAL - True - -3 - - - - - 0 - False - True - GTK_PACK_END - - - - - - 12 - True - False - 12 - - - - True - False - 12 - - - - True - gtk-dialog-info - 6 - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - True - Use the left mouse button to zoom in on an area of the map and select a time zone. -Use the right mouse button to zoom out. - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - 0 - False - False - - - - - - True - <b>Time Zones</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - True - False - 12 - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - True - False - 6 - - - - True - True - GTK_POLICY_ALWAYS - GTK_POLICY_ALWAYS - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT - - - - - - - 0 - True - True - - - - - - True - America/New_York - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - 0 - True - True - - - - - 0 - True - True - - - - - - True - <b>_Selection</b> - True - True - GTK_JUSTIFY_CENTER - False - False - 0 - 0.5 - 0 - 0 - timezone-combo - - - 0 - False - False - - - - - - True - False - 12 - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - True - False - True - - Timezone drop-down combination box - - - - 0 - True - True - - - - - 0 - False - False - - - - - 0 - True - True - - - - - - - diff --git a/widgets/e-timezone-dialog/e-timezone-dialog.ui b/widgets/e-timezone-dialog/e-timezone-dialog.ui new file mode 100644 index 0000000000..7ce81a176c --- /dev/null +++ b/widgets/e-timezone-dialog/e-timezone-dialog.ui @@ -0,0 +1,303 @@ + + + + + Select a Time Zone + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + 500 + 400 + True + False + True + False + False + GDK_WINDOW_TYPE_HINT_DIALOG + GDK_GRAVITY_NORTH_WEST + False + + + True + False + 6 + + + True + GTK_BUTTONBOX_END + + + True + True + True + gtk-cancel + True + GTK_RELIEF_NORMAL + True + + + + + True + True + True + True + gtk-ok + True + GTK_RELIEF_NORMAL + True + + + + + 0 + False + True + GTK_PACK_END + + + + + 12 + True + False + 12 + + + True + False + 12 + + + True + gtk-dialog-info + 6 + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + True + Use the left mouse button to zoom in on an area of the map and select a time zone. +Use the right mouse button to zoom out. + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + 0 + False + False + + + + + True + <b>Time Zones</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + True + False + 12 + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + True + False + 6 + + + True + True + GTK_POLICY_ALWAYS + GTK_POLICY_ALWAYS + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + + + 0 + True + True + + + + + True + America/New_York + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + 0 + True + True + + + + + 0 + True + True + + + + + True + <b>_Selection</b> + True + True + GTK_JUSTIFY_CENTER + False + False + 0 + 0.5 + 0 + 0 + timezone-combo + + + 0 + False + False + + + + + True + False + 12 + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + True + False + True + + + + + + Timezone drop-down combination box + + + + + 0 + True + True + + + + + 0 + False + False + + + + + 0 + True + True + + + + + + cancel-button + ok-button + + + -- cgit v1.2.3