Commit d8bc3e35 authored by Jesse van den Kieboom's avatar Jesse van den Kieboom

Converted all uses of glade to GtkBuilder

        * gedit/dialogs/*.[ui|c]:
        * gedit/gedit-print-job.c:
        * gedit/gedit-window.c:
        * gedit/gedit-utils.[ch]:
        * gedit/Makefile.am:
        * plugins/*:
        * configure.ac:

        Converted all uses of glade to GtkBuilder

svn path=/trunk/; revision=6368
parent c6ec1de5
2008-08-09 Jesse van den Kieboom <jesse@icecrew.nl>
* gedit/dialogs/*.[ui|c]:
* gedit/gedit-print-job.c:
* gedit/gedit-window.c:
* gedit/gedit-utils.[ch]:
* gedit/Makefile.am:
* plugins/*:
* configure.ac:
Converted all uses of glade to GtkBuilder
2008-08-09 Jesse van den Kieboom <jesse@icecrew.nl>
* gedit/gedt-view.c: fixed correct handling of changing buffers
......
......@@ -14,9 +14,8 @@ INCLUDES = \
-DDATADIR=\""$(datadir)"\" \
-DGEDIT_DATADIR=\""$(datadir)/gedit-2"\" \
-DGEDIT_LOCALEDIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \
-DGEDIT_UI_DIR=\""$(datadir)/gedit-2/ui/"\" \
-DGEDIT_UIDIR=\""$(datadir)/gedit-2/ui/"\" \
-DGEDIT_PLUGINDIR=\""$(libdir)/gedit-2/plugins"\" \
-DGEDIT_GLADEDIR=\""$(datadir)/gedit-2/glade/"\" \
-DGEDIT_ICONDIR=\""$(datadir)/gedit-2/icons"\"
if ENABLE_PYTHON
......@@ -191,15 +190,12 @@ gedit-marshal.c: gedit-marshal.list $(GLIB_GENMARSHAL)
$(GLIB_GENMARSHAL) $< --body --prefix=gedit_marshal >> $@
uidir = $(datadir)/gedit-2/ui/
ui_DATA = gedit-ui.xml
gladedir = $(datadir)/gedit-2/glade/
glade_DATA = \
gedit-print-preferences.glade
ui_DATA = \
gedit-ui.xml \
gedit-print-preferences.ui
EXTRA_DIST = \
$(ui_DATA) \
$(glade_DATA) \
gedit-enum-types.h.template \
gedit-enum-types.c.template \
gedit-marshal.list
......
gladedir = $(datadir)/gedit-2/glade/
uidir = $(datadir)/gedit-2/ui/
INCLUDES = \
-I$(top_srcdir) \
......@@ -9,7 +9,7 @@ INCLUDES = \
$(WARN_CFLAGS) \
$(DISABLE_DEPRECATED_CFLAGS) \
-DGNOME_ICONDIR=\""$(datadir)/pixmaps"\" \
-DGEDIT_GLADEDIR=\""$(datadir)/gedit-2/glade/"\"
-DGEDIT_UIDIR=\""$(datadir)/gedit-2/ui/"\"
noinst_LTLIBRARIES = libdialogs.la
......@@ -25,13 +25,12 @@ libdialogs_la_SOURCES = \
gedit-search-dialog.h \
gedit-search-dialog.c
ui_DATA = \
gedit-encodings-dialog.ui \
gedit-open-location-dialog.ui \
gedit-preferences-dialog.ui \
gedit-search-dialog.ui
glade_DATA = \
gedit-encodings-dialog.glade \
gedit-open-location-dialog.glade \
gedit-preferences-dialog.glade \
gedit-search-dialog.glade
EXTRA_DIST = $(glade_DATA)
EXTRA_DIST = $(ui_DATA)
......@@ -300,6 +300,10 @@ gedit_encodings_dialog_init (GeditEncodingsDialog *dlg)
GtkWidget *error_widget;
int i;
gboolean ret;
gchar *root_objects[] = {
"encodings-dialog-contents",
NULL
};
dlg->priv = GEDIT_ENCODINGS_DIALOG_GET_PRIVATE (dlg);
......@@ -330,15 +334,15 @@ gedit_encodings_dialog_init (GeditEncodingsDialog *dlg)
G_CALLBACK (response_handler),
dlg);
ret = gedit_utils_get_glade_widgets (GEDIT_GLADEDIR "gedit-encodings-dialog.glade",
"encodings-dialog-contents",
&error_widget,
"encodings-dialog-contents", &content,
"add-button", &dlg->priv->add_button,
"remove-button", &dlg->priv->remove_button,
"available-treeview", &dlg->priv->available_treeview,
"displayed-treeview", &dlg->priv->displayed_treeview,
NULL);
ret = gedit_utils_get_ui_objects (GEDIT_UIDIR "gedit-encodings-dialog.ui",
root_objects,
&error_widget,
"encodings-dialog-contents", &content,
"add-button", &dlg->priv->add_button,
"remove-button", &dlg->priv->remove_button,
"available-treeview", &dlg->priv->available_treeview,
"displayed-treeview", &dlg->priv->displayed_treeview,
NULL);
if (!ret)
{
......
<?xml version="1.0"?>
<!--*- mode: xml -*-->
<interface>
<object class="GtkDialog" id="encodings-dialog">
<property name="width_request">650</property>
<property name="height_request">400</property>
<property name="title" translatable="yes">Character codings</property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_NONE</property>
<property name="modal">True</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">True</property>
<property name="has_separator">False</property>
<child internal-child="vbox">
<object class="GtkVBox" id="dialog-vbox3">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child internal-child="action_area">
<object class="GtkHButtonBox" id="dialog-action_area3">
<property name="visible">True</property>
<property name="layout_style">GTK_BUTTONBOX_END</property>
<child>
<object class="GtkButton" id="helpbutton1">
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-help</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
</object>
</child>
<child>
<object class="GtkButton" id="closebutton1">
<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>
</object>
</child>
<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>
</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="GtkHBox" id="encodings-dialog-contents">
<property name="border_width">6</property>
<property name="visible">True</property>
<property name="homogeneous">True</property>
<property name="spacing">6</property>
<child>
<object class="GtkVBox" id="vbox6">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">6</property>
<child>
<object class="GtkLabel" id="available-label">
<property name="visible">True</property>
<property name="label" translatable="yes">A_vailable encodings:</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">available-treeview</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="scrolledwindow2">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
<property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
<property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
<property name="window_placement">GTK_CORNER_TOP_LEFT</property>
<child>
<object class="GtkTreeView" id="available-treeview">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="headers_visible">True</property>
<property name="rules_hint">True</property>
<property name="reorderable">False</property>
<property name="enable_search">True</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="GtkHBox" id="hbox6">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<object class="GtkButton" id="add-button">
<property name="visible">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>
</object>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
</object>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<object class="GtkVBox" id="vbox7">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">6</property>
<child>
<object class="GtkLabel" id="displayed-label">
<property name="visible">True</property>
<property name="label" translatable="yes">E_ncodings shown in menu:</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">displayed-treeview</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="scrolledwindow3">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
<property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
<property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
<property name="window_placement">GTK_CORNER_TOP_LEFT</property>
<child>
<object class="GtkTreeView" id="displayed-treeview">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="headers_visible">True</property>
<property name="rules_hint">True</property>
<property name="reorderable">False</property>
<property name="enable_search">True</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="GtkHBox" id="hbox8">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<object class="GtkButton" id="remove-button">
<property name="visible">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>
</object>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
</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">True</property>
<property name="fill">True</property>
</packing>
</child>
</object>
</child>
<action-widgets>
<action-widget response="-11">helpbutton1</action-widget>
<action-widget response="-6">closebutton1</action-widget>
<action-widget response="-5">button1</action-widget>
</action-widgets>
</object>
</interface>
......@@ -82,7 +82,6 @@ response_handler (GeditOpenLocationDialog *dlg,
gint response_id,
gpointer data)
{
gchar *uri;
const gchar *text;
switch (response_id)
......@@ -118,6 +117,10 @@ gedit_open_location_dialog_init (GeditOpenLocationDialog *dlg)
GtkWidget *encoding_hbox;
GtkWidget *error_widget;
gboolean ret;
gchar *root_objects[] = {
"open_uri_dialog_content",
NULL
};
dlg->priv = GEDIT_OPEN_LOCATION_DIALOG_GET_PRIVATE (dlg);
......@@ -151,15 +154,15 @@ gedit_open_location_dialog_init (GeditOpenLocationDialog *dlg)
G_CALLBACK (response_handler),
NULL);
ret = gedit_utils_get_glade_widgets (GEDIT_GLADEDIR "gedit-open-location-dialog.glade",
"open_uri_dialog_content",
&error_widget,
"open_uri_dialog_content", &content,
"main_vbox", &vbox,
"location_label", &location_label,
"encoding_label", &encoding_label,
"encoding_hbox", &encoding_hbox,
NULL);
ret = gedit_utils_get_ui_objects (GEDIT_UIDIR "gedit-open-location-dialog.ui",
root_objects,
&error_widget,
"open_uri_dialog_content", &content,
"main_vbox", &vbox,
"location_label", &location_label,
"encoding_label", &encoding_label,
"encoding_hbox", &encoding_hbox,
NULL);
if (!ret)
{
......
<?xml version="1.0"?>
<!--*- mode: xml -*-->
<interface>
<object class="GtkDialog" id="open_uri_dialog">
<property name="title" translatable="yes">Open Location</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">False</property>
<property name="destroy_with_parent">True</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="focus_on_map">True</property>
<property name="urgency_hint">False</property>
<property name="has_separator">False</property>
<child internal-child="vbox">
<object class="GtkVBox" id="dialog-vbox2">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child internal-child="action_area">
<object class="GtkHButtonBox" id="dialog-action_area2">
<property name="visible">True</property>
<property name="layout_style">GTK_BUTTONBOX_END</property>
<child>
<object class="GtkButton" id="cancel_button">
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="has_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>
<child>
<object class="GtkButton" id="open_button">
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-open</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="help_button">
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-help</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="GtkVBox" id="open_uri_dialog_content">
<property name="border_width">6</property>
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">12</property>
<child>
<object class="GtkVBox" id="main_vbox">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">6</property>
<child>
<object class="GtkLabel" id="location_label">
<property name="visible">True</property>
<property name="label" translatable="yes">Enter the _location (URI) of the file you would like to open:</property>
<property name="use_underline">True</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">True</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="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>
<placeholder/>
</child>
</object>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<object class="GtkHBox" id="encoding_hbox">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">6</property>
<child>
<object class="GtkLabel" id="encoding_label">
<property name="visible">True</property>
<property name="label" translatable="yes">Ch_aracter coding:</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="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>
<placeholder/>
</child>
</object>
<packing>
<property name="padding">0</property>
<property name="expand">False</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>
</child>
<action-widgets>
<action-widget response="-6">cancel_button</action-widget>
<action-widget response="-5">open_button</action-widget>
<action-widget response="-11">help_button</action-widget>
</action-widgets>
</object>
</interface>
......@@ -1062,7 +1062,14 @@ gedit_preferences_dialog_init (GeditPreferencesDialog *dlg)
{
GtkWidget *error_widget;
gboolean ret;
gchar *root_objects[] = {
"notebook",
"adjustment1",
"adjustment2",
"adjustment3",
NULL
};
gedit_debug (DEBUG_PREFS);
dlg->priv = GEDIT_PREFERENCES_DIALOG_GET_PRIVATE (dlg);
......@@ -1089,9 +1096,9 @@ gedit_preferences_dialog_init (GeditPreferencesDialog *dlg)
"response",
G_CALLBACK (dialog_response_handler),
NULL);
ret = gedit_utils_get_glade_widgets (GEDIT_GLADEDIR "gedit-preferences-dialog.glade",
"notebook",
ret = gedit_utils_get_ui_objects (GEDIT_UIDIR "gedit-preferences-dialog.ui",
root_objects,
&error_widget,
"notebook", &dlg->priv->notebook,
......@@ -1126,6 +1133,7 @@ gedit_preferences_dialog_init (GeditPreferencesDialog *dlg)
"uninstall_scheme_button", &dlg->priv->uninstall_scheme_button,
"plugin_manager_place_holder", &dlg->priv->plugin_manager_place_holder,
NULL);
if (!ret)
......
This diff is collapsed.
......@@ -73,7 +73,7 @@ struct _GeditSearchDialogPrivate
GtkWidget *replace_button;
GtkWidget *replace_all_button;
gboolean glade_error;
gboolean ui_error;
};
G_DEFINE_TYPE(GeditSearchDialog, gedit_search_dialog, GTK_TYPE_DIALOG)
......@@ -321,6 +321,10 @@ gedit_search_dialog_init (GeditSearchDialog *dlg)
GtkWidget *content;
GtkWidget *error_widget;
gboolean ret;
gchar *root_objects[] = {
"search_dialog_content",
NULL
};
dlg->priv = GEDIT_SEARCH_DIALOG_GET_PRIVATE (dlg);
......@@ -338,18 +342,18 @@ gedit_search_dialog_init (GeditSearchDialog *dlg)
gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (dlg)->action_area), 5);
gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dlg)->action_area), 6);
ret = gedit_utils_get_glade_widgets (GEDIT_GLADEDIR "gedit-search-dialog.glade",
"search_dialog_content",
&error_widget,
"search_dialog_content", &content,
"table", &dlg->priv->table,
"search_label", &dlg->priv->search_label,
"replace_with_label", &dlg->priv->replace_label,
"match_case_checkbutton", &dlg->priv->match_case_checkbutton,
"entire_word_checkbutton", &dlg->priv->entire_word_checkbutton,
"search_backwards_checkbutton", &dlg->priv->backwards_checkbutton,
"wrap_around_checkbutton", &dlg->priv->wrap_around_checkbutton,
NULL);
ret = gedit_utils_get_ui_objects (GEDIT_UIDIR "gedit-search-dialog.ui",
root_objects,
&error_widget,
"search_dialog_content", &content,
"table", &dlg->priv->table,
"search_label", &dlg->priv->search_label,
"replace_with_label", &dlg->priv->replace_label,
"match_case_checkbutton", &dlg->priv->match_case_checkbutton,
"entire_word_checkbutton", &dlg->priv->entire_word_checkbutton,
"search_backwards_checkbutton", &dlg->priv->backwards_checkbutton,
"wrap_around_checkbutton", &dlg->priv->wrap_around_checkbutton,
NULL);
if (!ret)
{
......@@ -359,7 +363,7 @@ gedit_search_dialog_init (GeditSearchDialog *dlg)
error_widget);
gtk_container_set_border_width (GTK_CONTAINER (error_widget), 5);
dlg->priv->glade_error = TRUE;
dlg->priv->ui_error = TRUE;
return;
}
......@@ -486,7 +490,7 @@ gedit_search_dialog_set_show_replace (GeditSearchDialog *dialog,
{
g_return_if_fail (GEDIT_IS_SEARCH_DIALOG (dialog));
if (dialog->priv->glade_error)
if (dialog->priv->ui_error)
return;
dialog->priv->show_replace = show_replace != FALSE;
......
<?xml version="1.0"?>
<!--*- mode: xml -*-->
<interface>
<object class="GtkDialog" id="dialog">
<property name="title" translatable="yes">Replace</property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_NONE</property>
<property name="modal">False</property>