diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2009-09-25 06:04:36 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2009-11-17 08:33:32 +0800 |
commit | 054c0881696a85f537e93b4950a28f505a3dc0f7 (patch) | |
tree | e63cfece426e2de5898c926eb6737cff229bb38b /widgets/menus | |
parent | 6348266ee635db59a12d75497f980dd85d0fcf58 (diff) | |
download | gsoc2013-evolution-054c0881696a85f537e93b4950a28f505a3dc0f7.tar gsoc2013-evolution-054c0881696a85f537e93b4950a28f505a3dc0f7.tar.gz gsoc2013-evolution-054c0881696a85f537e93b4950a28f505a3dc0f7.tar.bz2 gsoc2013-evolution-054c0881696a85f537e93b4950a28f505a3dc0f7.tar.lz gsoc2013-evolution-054c0881696a85f537e93b4950a28f505a3dc0f7.tar.xz gsoc2013-evolution-054c0881696a85f537e93b4950a28f505a3dc0f7.tar.zst gsoc2013-evolution-054c0881696a85f537e93b4950a28f505a3dc0f7.zip |
BugĀ 589153 - Use GtkBuilder instead of libglade
Diffstat (limited to 'widgets/menus')
-rw-r--r-- | widgets/menus/Makefile.am | 12 | ||||
-rw-r--r-- | widgets/menus/gal-define-views-dialog.c | 32 | ||||
-rw-r--r-- | widgets/menus/gal-define-views-dialog.h | 3 | ||||
-rw-r--r-- | widgets/menus/gal-define-views.ui (renamed from widgets/menus/gal-define-views.glade) | 79 | ||||
-rw-r--r-- | widgets/menus/gal-view-instance-save-as-dialog.c | 29 | ||||
-rw-r--r-- | widgets/menus/gal-view-instance-save-as-dialog.glade | 174 | ||||
-rw-r--r-- | widgets/menus/gal-view-instance-save-as-dialog.h | 3 | ||||
-rw-r--r-- | widgets/menus/gal-view-instance-save-as-dialog.ui | 174 | ||||
-rw-r--r-- | widgets/menus/gal-view-instance.c | 6 | ||||
-rw-r--r-- | widgets/menus/gal-view-new-dialog.c | 26 | ||||
-rw-r--r-- | widgets/menus/gal-view-new-dialog.glade | 185 | ||||
-rw-r--r-- | widgets/menus/gal-view-new-dialog.h | 3 | ||||
-rw-r--r-- | widgets/menus/gal-view-new-dialog.ui | 179 |
13 files changed, 443 insertions, 462 deletions
diff --git a/widgets/menus/Makefile.am b/widgets/menus/Makefile.am index 920dae4685..3a33e64651 100644 --- a/widgets/menus/Makefile.am +++ b/widgets/menus/Makefile.am @@ -4,7 +4,7 @@ libmenus_la_CPPFLAGS = \ $(AM_CPPFLAGS) \ -I$(top_srcdir) \ -I$(top_srcdir)/widgets \ - -DEVOLUTION_GLADEDIR=\""$(gladedir)"\" \ + -DEVOLUTION_UIDIR=\""$(uidir)"\" \ -DG_LOG_DOMAIN=\"menus\" \ $(GNOME_PLATFORM_CFLAGS) \ $(E_UTIL_CFLAGS) @@ -21,10 +21,10 @@ libmenus_la_SOURCES = \ gal-view-new-dialog.c \ gal-view.c -glade_DATA = \ - gal-define-views.glade \ - gal-view-new-dialog.glade \ - gal-view-instance-save-as-dialog.glade +ui_DATA = \ + gal-define-views.ui \ + gal-view-new-dialog.ui \ + gal-view-instance-save-as-dialog.ui libmenusincludedir = $(privincludedir)/menus @@ -52,6 +52,6 @@ libmenus_la_LIBADD = \ icons = EXTRA_DIST = \ $(icons) \ - $(glade_DATA) + $(ui_DATA) -include $(top_srcdir)/git.mk diff --git a/widgets/menus/gal-define-views-dialog.c b/widgets/menus/gal-define-views-dialog.c index 148960e4d5..ade534bc02 100644 --- a/widgets/menus/gal-define-views-dialog.c +++ b/widgets/menus/gal-define-views-dialog.c @@ -186,7 +186,7 @@ gdvd_button_copy_callback(GtkWidget *widget, GalDefineViewsDialog *dialog) GtkWidget *scrolled; ETable *etable; - scrolled = glade_xml_get_widget(dialog->gui, "custom-table"); + scrolled = e_builder_get_widget(dialog->builder, "custom-table"); etable = e_table_scrolled_get_table(E_TABLE_SCROLLED(scrolled)); row = e_table_get_cursor_row (E_TABLE(etable)); @@ -210,10 +210,10 @@ gdvd_cursor_changed_callback (GtkWidget *widget, GalDefineViewsDialog *dialog) &iter)) { gtk_tree_model_get (dialog->model, &iter, COL_GALVIEW_DATA, &item, -1); - button = glade_xml_get_widget (dialog->gui, "button-delete"); + button = e_builder_get_widget (dialog->builder, "button-delete"); gtk_widget_set_sensitive (GTK_WIDGET (button), !item->built_in); - button = glade_xml_get_widget (dialog->gui, "button-modify"); + button = e_builder_get_widget (dialog->builder, "button-modify"); gtk_widget_set_sensitive (GTK_WIDGET (button), !item->built_in); } } @@ -223,7 +223,7 @@ gdvd_connect_signal(GalDefineViewsDialog *dialog, const gchar *widget_name, cons { GtkWidget *widget; - widget = glade_xml_get_widget (dialog->gui, widget_name); + widget = e_builder_get_widget (dialog->builder, widget_name); if (widget) g_signal_connect (widget, signal, handler, dialog); @@ -238,20 +238,14 @@ dialog_response (GalDefineViewsDialog *dialog, gint response_id, gpointer data) static void gal_define_views_dialog_init (GalDefineViewsDialog *dialog) { - GladeXML *gui; GtkWidget *widget; - gchar *filename = g_build_filename (EVOLUTION_GLADEDIR, - "gal-define-views.glade", - NULL); - dialog->collection = NULL; - gui = glade_xml_new (filename, NULL, GETTEXT_PACKAGE); - g_free (filename); - dialog->gui = gui; + dialog->builder = gtk_builder_new (); + e_load_ui_builder_definition (dialog->builder, "gal-define-views.ui"); - widget = glade_xml_get_widget (gui, "table-top"); + widget = e_builder_get_widget (dialog->builder, "table-top"); if (!widget) { return; } @@ -268,7 +262,7 @@ gal_define_views_dialog_init (GalDefineViewsDialog *dialog) GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, NULL); - dialog->treeview = GTK_TREE_VIEW (glade_xml_get_widget (dialog->gui, "treeview1")); + dialog->treeview = GTK_TREE_VIEW (e_builder_get_widget (dialog->builder, "treeview1")); gtk_tree_view_set_reorderable (GTK_TREE_VIEW (dialog->treeview), FALSE); gtk_tree_view_set_headers_visible (dialog->treeview, TRUE); @@ -291,9 +285,9 @@ gal_define_views_dialog_dispose (GObject *object) { GalDefineViewsDialog *gal_define_views_dialog = GAL_DEFINE_VIEWS_DIALOG(object); - if (gal_define_views_dialog->gui) - g_object_unref(gal_define_views_dialog->gui); - gal_define_views_dialog->gui = NULL; + if (gal_define_views_dialog->builder) + g_object_unref(gal_define_views_dialog->builder); + gal_define_views_dialog->builder = NULL; if (G_OBJECT_CLASS (gal_define_views_dialog_parent_class)->dispose) (* G_OBJECT_CLASS (gal_define_views_dialog_parent_class)->dispose) (object); @@ -349,8 +343,8 @@ gal_define_views_dialog_set_collection(GalDefineViewsDialog *dialog, gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (dialog->model), COL_GALVIEW_NAME, GTK_SORT_ASCENDING); - if (dialog->gui) { - GtkWidget *widget = glade_xml_get_widget(dialog->gui, "label-views"); + if (dialog->builder) { + GtkWidget *widget = e_builder_get_widget(dialog->builder, "label-views"); if (widget && GTK_IS_LABEL (widget)) { if (collection->title) { gchar *text = g_strdup_printf (_("Define Views for %s"), diff --git a/widgets/menus/gal-define-views-dialog.h b/widgets/menus/gal-define-views-dialog.h index a510679567..c4b79a7834 100644 --- a/widgets/menus/gal-define-views-dialog.h +++ b/widgets/menus/gal-define-views-dialog.h @@ -24,7 +24,6 @@ #define __GAL_DEFINE_VIEWS_DIALOG_H__ #include <gtk/gtk.h> -#include <glade/glade.h> #include <widgets/menus/gal-view-collection.h> @@ -52,7 +51,7 @@ struct _GalDefineViewsDialog GtkDialog parent; /* item specific fields */ - GladeXML *gui; + GtkBuilder *builder; GtkTreeView *treeview; GtkTreeModel *model; diff --git a/widgets/menus/gal-define-views.glade b/widgets/menus/gal-define-views.ui index 26976c4857..b3314aa4ee 100644 --- a/widgets/menus/gal-define-views.glade +++ b/widgets/menus/gal-define-views.ui @@ -1,39 +1,38 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd"> +<?xml version="1.0"?> <!--*- mode: xml -*--> -<glade-interface> - <widget class="GtkDialog" id="dialog1"> +<interface> + <object class="GtkDialog" id="dialog1"> <property name="title" translatable="yes">Define Views for "%s"</property> <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property> <child internal-child="vbox"> - <widget class="GtkVBox" id="dialog-vbox1"> + <object class="GtkVBox" id="dialog-vbox1"> <property name="visible">True</property> <property name="spacing">6</property> <child> - <widget class="GtkTable" id="table-top"> + <object class="GtkTable" id="table-top"> <property name="visible">True</property> <property name="n_rows">2</property> <property name="n_columns">1</property> <property name="column_spacing">6</property> <property name="row_spacing">6</property> <child> - <widget class="GtkLabel" id="label-views"> + <object class="GtkLabel" id="label-views"> <property name="visible">True</property> <property name="xalign">0</property> <property name="label" translatable="yes">Define Views for %s</property> - </widget> + </object> <packing> <property name="x_options">GTK_FILL</property> <property name="y_options"/> </packing> </child> <child> - <widget class="GtkHBox" id="hbox1"> + <object class="GtkHBox" id="hbox1"> <property name="visible">True</property> <property name="border_width">6</property> <property name="spacing">6</property> <child> - <widget class="GtkScrolledWindow" id="scrolledwindow1"> + <object class="GtkScrolledWindow" id="scrolledwindow1"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> @@ -41,77 +40,77 @@ <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property> <property name="shadow_type">GTK_SHADOW_IN</property> <child> - <widget class="GtkTreeView" id="treeview1"> + <object class="GtkTreeView" id="treeview1"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> <property name="headers_clickable">True</property> <property name="reorderable">True</property> <property name="fixed_height_mode">True</property> - </widget> + </object> </child> - </widget> + </object> </child> <child> - <widget class="GtkVButtonBox" id="vbuttonbox1"> + <object class="GtkVButtonBox" id="vbuttonbox1"> <property name="visible">True</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> <property name="spacing">6</property> <property name="layout_style">GTK_BUTTONBOX_START</property> <child> - <widget class="GtkButton" id="button-new"> + <object class="GtkButton" id="button-new"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="label">gtk-new</property> <property name="use_stock">True</property> - </widget> + </object> <packing> <property name="expand">False</property> <property name="fill">False</property> </packing> </child> <child> - <widget class="GtkButton" id="button-modify"> + <object class="GtkButton" id="button-modify"> <property name="visible">True</property> <property name="sensitive">False</property> <property name="can_focus">True</property> <property name="can_default">True</property> <child> - <widget class="GtkAlignment" id="alignment33"> + <object class="GtkAlignment" id="alignment33"> <property name="visible">True</property> <property name="xscale">0</property> <property name="yscale">0</property> <child> - <widget class="GtkHBox" id="hbox224"> + <object class="GtkHBox" id="hbox224"> <property name="visible">True</property> <property name="spacing">2</property> <child> - <widget class="GtkImage" id="image8"> + <object class="GtkImage" id="image8"> <property name="visible">True</property> <property name="stock">gtk-properties</property> - </widget> + </object> <packing> <property name="expand">False</property> <property name="fill">False</property> </packing> </child> <child> - <widget class="GtkLabel" id="label557"> + <object class="GtkLabel" id="label557"> <property name="visible">True</property> <property name="label" translatable="yes">_Edit</property> <property name="use_underline">True</property> - </widget> + </object> <packing> <property name="expand">False</property> <property name="fill">False</property> <property name="position">1</property> </packing> </child> - </widget> + </object> </child> - </widget> + </object> </child> - </widget> + </object> <packing> <property name="expand">False</property> <property name="fill">False</property> @@ -119,58 +118,60 @@ </packing> </child> <child> - <widget class="GtkButton" id="button-delete"> + <object class="GtkButton" id="button-delete"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="label">gtk-delete</property> <property name="use_stock">True</property> - </widget> + </object> <packing> <property name="expand">False</property> <property name="fill">False</property> <property name="position">2</property> </packing> </child> - </widget> + </object> <packing> <property name="expand">False</property> <property name="fill">False</property> <property name="position">1</property> </packing> </child> - </widget> + </object> <packing> <property name="top_attach">1</property> <property name="bottom_attach">2</property> </packing> </child> - </widget> + </object> <packing> <property name="padding">12</property> <property name="position">2</property> </packing> </child> <child internal-child="action_area"> - <widget class="GtkHButtonBox" id="dialog-action_area1"> + <object class="GtkHButtonBox" id="dialog-action_area1"> <property name="visible">True</property> <property name="layout_style">GTK_BUTTONBOX_END</property> <child> - <widget class="GtkButton" id="button7"> + <object class="GtkButton" id="button7"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="can_default">True</property> <property name="label">gtk-close</property> <property name="use_stock">True</property> - <property name="response_id">-5</property> - </widget> + </object> </child> - </widget> + </object> <packing> <property name="expand">False</property> <property name="pack_type">GTK_PACK_END</property> </packing> </child> - </widget> + </object> </child> - </widget> -</glade-interface>
\ No newline at end of file + <action-widgets> + <action-widget response="-5">button7</action-widget> + </action-widgets> + </object> +</interface> diff --git a/widgets/menus/gal-view-instance-save-as-dialog.c b/widgets/menus/gal-view-instance-save-as-dialog.c index 76871594e2..37d903c630 100644 --- a/widgets/menus/gal-view-instance-save-as-dialog.c +++ b/widgets/menus/gal-view-instance-save-as-dialog.c @@ -198,9 +198,9 @@ gal_view_instance_save_as_dialog_dispose (GObject *object) { GalViewInstanceSaveAsDialog *gal_view_instance_save_as_dialog = GAL_VIEW_INSTANCE_SAVE_AS_DIALOG (object); - if (gal_view_instance_save_as_dialog->gui) - g_object_unref (gal_view_instance_save_as_dialog->gui); - gal_view_instance_save_as_dialog->gui = NULL; + if (gal_view_instance_save_as_dialog->builder) + g_object_unref (gal_view_instance_save_as_dialog->builder); + gal_view_instance_save_as_dialog->builder = NULL; if (G_OBJECT_CLASS (gal_view_instance_save_as_dialog_parent_class)->dispose) (* G_OBJECT_CLASS (gal_view_instance_save_as_dialog_parent_class)->dispose) (object); @@ -229,22 +229,17 @@ gal_view_instance_save_as_dialog_class_init (GalViewInstanceSaveAsDialogClass *k static void gal_view_instance_save_as_dialog_init (GalViewInstanceSaveAsDialog *dialog) { - GladeXML *gui; GtkWidget *widget; - gchar *filename = g_build_filename (EVOLUTION_GLADEDIR, - "gal-view-instance-save-as-dialog.glade", - NULL); - dialog->instance = NULL; dialog->model = NULL; dialog->collection = NULL; - gui = glade_xml_new_with_domain (filename , NULL, GETTEXT_PACKAGE); - g_free (filename); - dialog->gui = gui; + dialog->builder = gtk_builder_new (); + e_load_ui_builder_definition ( + dialog->builder, "gal-view-instance-save-as-dialog.ui"); - widget = glade_xml_get_widget (gui, "vbox-top"); + widget = e_builder_get_widget (dialog->builder, "vbox-top"); if (!widget) { return; } @@ -262,11 +257,11 @@ gal_view_instance_save_as_dialog_init (GalViewInstanceSaveAsDialog *dialog) GTK_STOCK_OK, GTK_RESPONSE_OK, NULL); - dialog->scrolledwindow = glade_xml_get_widget (dialog->gui, "scrolledwindow2"); - dialog->treeview = GTK_TREE_VIEW (glade_xml_get_widget (dialog->gui, "custom-replace")); - dialog->entry_create = glade_xml_get_widget (dialog->gui, "entry-create"); - dialog->radiobutton_replace = glade_xml_get_widget (dialog->gui, "radiobutton-replace"); - dialog->radiobutton_create = glade_xml_get_widget (dialog->gui, "radiobutton-create"); + dialog->scrolledwindow = e_builder_get_widget (dialog->builder, "scrolledwindow2"); + dialog->treeview = GTK_TREE_VIEW (e_builder_get_widget (dialog->builder, "custom-replace")); + dialog->entry_create = e_builder_get_widget (dialog->builder, "entry-create"); + dialog->radiobutton_replace = e_builder_get_widget (dialog->builder, "radiobutton-replace"); + dialog->radiobutton_create = e_builder_get_widget (dialog->builder, "radiobutton-create"); gtk_tree_view_set_reorderable (GTK_TREE_VIEW (dialog->treeview), FALSE); gtk_tree_view_set_headers_visible (dialog->treeview, FALSE); diff --git a/widgets/menus/gal-view-instance-save-as-dialog.glade b/widgets/menus/gal-view-instance-save-as-dialog.glade deleted file mode 100644 index aa40910113..0000000000 --- a/widgets/menus/gal-view-instance-save-as-dialog.glade +++ /dev/null @@ -1,174 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd"> -<!--*- mode: xml -*--> -<glade-interface> -<widget class="GtkDialog" id="dialog1"> - <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property> - <child internal-child="vbox"> - <widget class="GtkVBox" id="dialog-vbox1"> - <property name="visible">True</property> - <property name="spacing">8</property> - <child> - <widget class="GtkVBox" id="vbox-top"> - <property name="visible">True</property> - <property name="border_width">18</property> - <property name="spacing">12</property> - <child> - <widget class="GtkVBox" id="vbox1"> - <property name="visible">True</property> - <property name="spacing">6</property> - <child> - <widget class="GtkRadioButton" id="radiobutton-create"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">_Create new view</property> - <property name="use_underline">True</property> - <property name="response_id">0</property> - <property name="active">True</property> - <property name="draw_indicator">True</property> - </widget> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - <child> - <widget class="GtkAlignment" id="alignment1"> - <property name="visible">True</property> - <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> - <property name="left_padding">24</property> - <child> - <widget class="GtkHBox" id="hbox1"> - <property name="visible">True</property> - <property name="spacing">6</property> - <child> - <widget class="GtkLabel" id="label8"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Name:</property> - <property name="use_underline">True</property> - <property name="mnemonic_widget">entry-create</property> - </widget> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - <child> - <widget class="GtkEntry" id="entry-create"> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="can_focus">True</property> - </widget> - <packing> - <property name="position">1</property> - </packing> - </child> - </widget> - </child> - </widget> - <packing> - <property name="position">1</property> - </packing> - </child> - </widget> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - <child> - <widget class="GtkVBox" id="vbox2"> - <property name="visible">True</property> - <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> - <property name="spacing">6</property> - <child> - <widget class="GtkRadioButton" id="radiobutton-replace"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">_Replace existing view</property> - <property name="use_underline">True</property> - <property name="response_id">0</property> - <property name="draw_indicator">True</property> - <property name="group">radiobutton-create</property> - </widget> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - <child> - <widget class="GtkAlignment" id="alignment2"> - <property name="visible">True</property> - <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> - <property name="left_padding">24</property> - <child> - <widget class="GtkScrolledWindow" id="scrolledwindow2"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> - <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property> - <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property> - <property name="shadow_type">GTK_SHADOW_IN</property> - <child> - <widget class="GtkTreeView" id="custom-replace"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> - <property name="headers_clickable">True</property> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="position">1</property> - </packing> - </child> - </widget> - <packing> - <property name="position">1</property> - </packing> - </child> - </widget> - <packing> - <property name="position">2</property> - </packing> - </child> - <child internal-child="action_area"> - <widget class="GtkHButtonBox" id="dialog-action_area1"> - <property name="visible">True</property> - <property name="layout_style">GTK_BUTTONBOX_END</property> - <child> - <widget class="GtkButton" id="button3"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="can_default">True</property> - <property name="label">gtk-cancel</property> - <property name="use_stock">True</property> - <property name="response_id">0</property> - </widget> - </child> - <child> - <widget class="GtkButton" id="button1"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="can_default">True</property> - <property name="label">gtk-ok</property> - <property name="use_stock">True</property> - <property name="response_id">0</property> - </widget> - <packing> - <property name="position">1</property> - </packing> - </child> - </widget> - <packing> - <property name="expand">False</property> - <property name="pack_type">GTK_PACK_END</property> - </packing> - </child> - </widget> - </child> -</widget> - -</glade-interface> diff --git a/widgets/menus/gal-view-instance-save-as-dialog.h b/widgets/menus/gal-view-instance-save-as-dialog.h index 64e97afde8..0f43666760 100644 --- a/widgets/menus/gal-view-instance-save-as-dialog.h +++ b/widgets/menus/gal-view-instance-save-as-dialog.h @@ -24,7 +24,6 @@ #define __GAL_VIEW_INSTANCE_SAVE_AS_DIALOG_H__ #include <gtk/gtk.h> -#include <glade/glade.h> #include <widgets/menus/gal-view-collection.h> #include <widgets/menus/gal-view-instance.h> @@ -57,7 +56,7 @@ struct _GalViewInstanceSaveAsDialog GtkDialog parent; /* item specific fields */ - GladeXML *gui; + GtkBuilder *builder; GtkTreeView *treeview; GtkTreeModel *model; diff --git a/widgets/menus/gal-view-instance-save-as-dialog.ui b/widgets/menus/gal-view-instance-save-as-dialog.ui new file mode 100644 index 0000000000..c7db68aa5f --- /dev/null +++ b/widgets/menus/gal-view-instance-save-as-dialog.ui @@ -0,0 +1,174 @@ +<?xml version="1.0"?> +<!--*- mode: xml -*--> +<interface> + <object class="GtkDialog" id="dialog1"> + <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property> + <child internal-child="vbox"> + <object class="GtkVBox" id="dialog-vbox1"> + <property name="visible">True</property> + <property name="spacing">8</property> + <child> + <object class="GtkVBox" id="vbox-top"> + <property name="visible">True</property> + <property name="border_width">18</property> + <property name="spacing">12</property> + <child> + <object class="GtkVBox" id="vbox1"> + <property name="visible">True</property> + <property name="spacing">6</property> + <child> + <object class="GtkRadioButton" id="radiobutton-create"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">_Create new view</property> + <property name="use_underline">True</property> + <property name="active">True</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + <child> + <object class="GtkAlignment" id="alignment1"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="left_padding">24</property> + <child> + <object class="GtkHBox" id="hbox1"> + <property name="visible">True</property> + <property name="spacing">6</property> + <child> + <object class="GtkLabel" id="label8"> + <property name="visible">True</property> + <property name="label" translatable="yes">_Name:</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">entry-create</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + <child> + <object class="GtkEntry" id="entry-create"> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">True</property> + </object> + <packing> + <property name="position">1</property> + </packing> + </child> + </object> + </child> + </object> + <packing> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + <child> + <object class="GtkVBox" id="vbox2"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="spacing">6</property> + <child> + <object class="GtkRadioButton" id="radiobutton-replace"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">_Replace existing view</property> + <property name="use_underline">True</property> + <property name="draw_indicator">True</property> + <property name="group">radiobutton-create</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + <child> + <object class="GtkAlignment" id="alignment2"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="left_padding">24</property> + <child> + <object class="GtkScrolledWindow" id="scrolledwindow2"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property> + <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property> + <property name="shadow_type">GTK_SHADOW_IN</property> + <child> + <object class="GtkTreeView" id="custom-replace"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="headers_clickable">True</property> + </object> + </child> + </object> + </child> + </object> + <packing> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="position">2</property> + </packing> + </child> + <child internal-child="action_area"> + <object class="GtkHButtonBox" id="dialog-action_area1"> + <property name="visible">True</property> + <property name="layout_style">GTK_BUTTONBOX_END</property> + <child> + <object class="GtkButton" id="button3"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="can_default">True</property> + <property name="label">gtk-cancel</property> + <property name="use_stock">True</property> + </object> + </child> + <child> + <object class="GtkButton" id="button1"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="can_default">True</property> + <property name="label">gtk-ok</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="pack_type">GTK_PACK_END</property> + </packing> + </child> + </object> + </child> + <action-widgets> + <action-widget response="0">radiobutton-create</action-widget> + <action-widget response="0">radiobutton-replace</action-widget> + <action-widget response="0">button3</action-widget> + <action-widget response="0">button1</action-widget> + </action-widgets> + </object> +</interface> diff --git a/widgets/menus/gal-view-instance.c b/widgets/menus/gal-view-instance.c index bd93b64034..7b903107fe 100644 --- a/widgets/menus/gal-view-instance.c +++ b/widgets/menus/gal-view-instance.c @@ -419,7 +419,11 @@ dialog_response(GtkWidget *dialog, gint id, GalViewInstance *instance) void gal_view_instance_save_as (GalViewInstance *instance) { - GtkWidget *dialog = gal_view_instance_save_as_dialog_new(instance); + GtkWidget *dialog; + + g_return_if_fail (instance != NULL); + + dialog = gal_view_instance_save_as_dialog_new (instance); g_signal_connect(dialog, "response", G_CALLBACK(dialog_response), instance); gtk_widget_show(dialog); diff --git a/widgets/menus/gal-view-new-dialog.c b/widgets/menus/gal-view-new-dialog.c index da90fb024d..328cc5e35e 100644 --- a/widgets/menus/gal-view-new-dialog.c +++ b/widgets/menus/gal-view-new-dialog.c @@ -74,17 +74,13 @@ gal_view_new_dialog_class_init (GalViewNewDialogClass *klass) static void gal_view_new_dialog_init (GalViewNewDialog *dialog) { - GladeXML *gui; GtkWidget *widget; - gchar *filename = g_build_filename (EVOLUTION_GLADEDIR, - "gal-view-new-dialog.glade", - NULL); - gui = glade_xml_new (filename, NULL, GETTEXT_PACKAGE); - g_free (filename); - dialog->gui = gui; + dialog->builder = gtk_builder_new (); + e_load_ui_builder_definition ( + dialog->builder, "gal-view-new-dialog.ui"); - widget = glade_xml_get_widget (gui, "table-top"); + widget = e_builder_get_widget (dialog->builder, "table-top"); if (!widget) { return; } @@ -111,9 +107,9 @@ gal_view_new_dialog_dispose (GObject *object) { GalViewNewDialog *gal_view_new_dialog = GAL_VIEW_NEW_DIALOG(object); - if (gal_view_new_dialog->gui) - g_object_unref(gal_view_new_dialog->gui); - gal_view_new_dialog->gui = NULL; + if (gal_view_new_dialog->builder) + g_object_unref(gal_view_new_dialog->builder); + gal_view_new_dialog->builder = NULL; if (G_OBJECT_CLASS (gal_view_new_dialog_parent_class)->dispose) (* G_OBJECT_CLASS (gal_view_new_dialog_parent_class)->dispose) (object); @@ -191,8 +187,8 @@ gal_view_new_dialog_construct (GalViewNewDialog *dialog, GtkCellRenderer *rend; dialog->collection = collection; - dialog->list = glade_xml_get_widget(dialog->gui,"list-type-list"); - dialog->entry = glade_xml_get_widget(dialog->gui, "entry-name"); + dialog->list = e_builder_get_widget(dialog->builder,"list-type-list"); + dialog->entry = e_builder_get_widget(dialog->builder, "entry-name"); dialog->list_store = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_POINTER); @@ -243,7 +239,7 @@ gal_view_new_dialog_set_property (GObject *object, guint prop_id, const GValue * switch (prop_id) { case PROP_NAME: - entry = glade_xml_get_widget(dialog->gui, "entry-name"); + entry = e_builder_get_widget(dialog->builder, "entry-name"); if (entry && GTK_IS_ENTRY(entry)) { gtk_entry_set_text(GTK_ENTRY(entry), g_value_get_string (value)); } @@ -264,7 +260,7 @@ gal_view_new_dialog_get_property (GObject *object, guint prop_id, GValue *value, switch (prop_id) { case PROP_NAME: - entry = glade_xml_get_widget(dialog->gui, "entry-name"); + entry = e_builder_get_widget(dialog->builder, "entry-name"); if (entry && GTK_IS_ENTRY(entry)) { g_value_set_string (value, gtk_entry_get_text (GTK_ENTRY (entry))); } diff --git a/widgets/menus/gal-view-new-dialog.glade b/widgets/menus/gal-view-new-dialog.glade deleted file mode 100644 index f182d63ab9..0000000000 --- a/widgets/menus/gal-view-new-dialog.glade +++ /dev/null @@ -1,185 +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="GtkDialog" id="dialog1"> - <property name="title" translatable="yes"></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_DIALOG</property> - <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> - <property name="has_separator">True</property> - - <child internal-child="vbox"> - <widget class="GtkVBox" id="dialog-vbox1"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">8</property> - - <child internal-child="action_area"> - <widget class="GtkHButtonBox" id="dialog-action_area1"> - <property name="visible">True</property> - <property name="layout_style">GTK_BUTTONBOX_END</property> - - <child> - <widget class="GtkButton" id="button1"> - <property name="visible">True</property> - <property name="can_default">True</property> - <property name="can_focus">True</property> - <property name="label">gtk-ok</property> - <property name="use_stock">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <property name="response_id">0</property> - </widget> - </child> - - <child> - <widget class="GtkButton" id="button3"> - <property name="visible">True</property> - <property name="can_default">True</property> - <property name="can_focus">True</property> - <property name="label">gtk-cancel</property> - <property name="use_stock">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <property name="response_id">0</property> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="pack_type">GTK_PACK_END</property> - </packing> - </child> - - <child> - <widget class="GtkTable" id="table-top"> - <property name="visible">True</property> - <property name="n_rows">4</property> - <property name="n_columns">1</property> - <property name="homogeneous">False</property> - <property name="row_spacing">6</property> - <property name="column_spacing">6</property> - - <child> - <widget class="GtkLabel" id="label1"> - <property name="visible">True</property> - <property name="label" translatable="yes">Name of new view:</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_CENTER</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">entry-name</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="GtkEntry" id="entry-name"> - <property name="visible">True</property> - <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" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char">*</property> - <property name="activates_default">False</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="y_options">fill</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label2"> - <property name="visible">True</property> - <property name="label" translatable="yes">Type of view:</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_CENTER</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> - </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="GtkScrolledWindow" id="scrolledwindow1"> - <property name="visible">True</property> - <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</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="list-type-list"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="headers_visible">False</property> - <property name="rules_hint">False</property> - <property name="reorderable">False</property> - <property name="enable_search">True</property> - <accessibility> - <atkproperty name="AtkObject::accessible_name" translatable="yes">Type of View</atkproperty> - </accessibility> - </widget> - </child> - </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> - </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/widgets/menus/gal-view-new-dialog.h b/widgets/menus/gal-view-new-dialog.h index 364e1ae472..6b7d2b0335 100644 --- a/widgets/menus/gal-view-new-dialog.h +++ b/widgets/menus/gal-view-new-dialog.h @@ -24,7 +24,6 @@ #define __GAL_VIEW_NEW_DIALOG_H__ #include <gtk/gtk.h> -#include <glade/glade.h> #include <gal-view-collection.h> G_BEGIN_DECLS @@ -51,7 +50,7 @@ struct _GalViewNewDialog GtkDialog parent; /* item specific fields */ - GladeXML *gui; + GtkBuilder *builder; GalViewCollection *collection; GalViewFactory *selected_factory; diff --git a/widgets/menus/gal-view-new-dialog.ui b/widgets/menus/gal-view-new-dialog.ui new file mode 100644 index 0000000000..290bc15c54 --- /dev/null +++ b/widgets/menus/gal-view-new-dialog.ui @@ -0,0 +1,179 @@ +<?xml version="1.0"?> +<!--*- mode: xml -*--> +<interface> + <object class="GtkDialog" id="dialog1"> + <property name="title" translatable="yes"/> + <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_DIALOG</property> + <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> + <property name="has_separator">True</property> + <child internal-child="vbox"> + <object class="GtkVBox" id="dialog-vbox1"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">8</property> + <child internal-child="action_area"> + <object class="GtkHButtonBox" id="dialog-action_area1"> + <property name="visible">True</property> + <property name="layout_style">GTK_BUTTONBOX_END</property> + <child> + <object class="GtkButton" id="button1"> + <property name="visible">True</property> + <property name="can_default">True</property> + <property name="can_focus">True</property> + <property name="label">gtk-ok</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="button3"> + <property name="visible">True</property> + <property name="can_default">True</property> + <property name="can_focus">True</property> + <property name="label">gtk-cancel</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> + <property name="pack_type">GTK_PACK_END</property> + </packing> + </child> + <child> + <object class="GtkTable" id="table-top"> + <property name="visible">True</property> + <property name="n_rows">4</property> + <property name="n_columns">1</property> + <property name="homogeneous">False</property> + <property name="row_spacing">6</property> + <property name="column_spacing">6</property> + <child> + <object class="GtkLabel" id="label1"> + <property name="visible">True</property> + <property name="label" translatable="yes">Name of new view:</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</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">entry-name</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="GtkEntry" id="entry-name"> + <property name="visible">True</property> + <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" translatable="yes"/> + <property name="has_frame">True</property> + <property name="invisible_char">*</property> + <property name="activates_default">False</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="y_options">fill</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="label2"> + <property name="visible">True</property> + <property name="label" translatable="yes">Type of view:</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</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> + </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="GtkScrolledWindow" id="scrolledwindow1"> + <property name="visible">True</property> + <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</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="list-type-list"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="headers_visible">False</property> + <property name="rules_hint">False</property> + <property name="reorderable">False</property> + <property name="enable_search">True</property> + <accessibility> + + </accessibility> + <child internal-child="accessible"> + <object class="AtkObject" id="a11y-list-type-list1"> + <property name="AtkObject::accessible_name" translatable="yes">Type of View</property> + </object> + </child> + </object> + </child> + </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> + </packing> + </child> + </object> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + </object> + </child> + <action-widgets> + <action-widget response="0">button1</action-widget> + <action-widget response="0">button3</action-widget> + </action-widgets> + </object> +</interface> |