From a2bd2e76dfd5b22649c624abfe56c1d6cb14c2d9 Mon Sep 17 00:00:00 2001 From: John Darrington Date: Sun, 4 Jan 2009 15:48:59 +0900 Subject: [PATCH] Convert psppire.glade to psppire.ui --- src/ui/gui/about.c | 3 +-- src/ui/gui/automake.mk | 3 ++- src/ui/gui/comments-dialog.c | 5 ++--- src/ui/gui/compute-dialog.c | 4 ++-- src/ui/gui/find-dialog.c | 5 ++--- src/ui/gui/goto-case-dialog.c | 4 ++-- src/ui/gui/message-dialog.c | 2 +- src/ui/gui/psppire-dialog.c | 2 +- src/ui/gui/select-cases-dialog.c | 5 ++--- src/ui/gui/select-cases-dialog.h | 1 - src/ui/gui/sort-cases-dialog.c | 2 +- src/ui/gui/split-file-dialog.c | 5 ++--- src/ui/gui/t-test-options.c | 2 +- src/ui/gui/t-test-options.h | 2 +- src/ui/gui/transpose-dialog.c | 11 +++++------ src/ui/gui/variable-info-dialog.c | 2 +- src/ui/gui/weight-cases-dialog.c | 3 +-- 17 files changed, 27 insertions(+), 34 deletions(-) diff --git a/src/ui/gui/about.c b/src/ui/gui/about.c index e743fcf6..23ae5b06 100644 --- a/src/ui/gui/about.c +++ b/src/ui/gui/about.c @@ -18,7 +18,6 @@ #include #include -#include #include #include @@ -31,7 +30,7 @@ const static gchar *artists[] = { "Patrick Brunier", "Dondi Bogusky", NULL}; void about_new (GtkMenuItem *m, GtkWindow *parent) { - GladeXML *xml = XML_NEW ("psppire.glade"); + GtkBuilder *xml = builder_new ("psppire.ui"); GtkWidget *about = get_widget_assert (xml, "aboutdialog1"); diff --git a/src/ui/gui/automake.mk b/src/ui/gui/automake.mk index d043b1a4..4e561ab0 100644 --- a/src/ui/gui/automake.mk +++ b/src/ui/gui/automake.mk @@ -69,6 +69,7 @@ nodist_src_ui_gui_psppire_DATA = \ $(top_srcdir)/src/ui/gui/examine.ui \ $(top_srcdir)/src/ui/gui/frequencies.ui \ $(top_srcdir)/src/ui/gui/message-dialog.ui \ + $(top_srcdir)/src/ui/gui/psppire.ui \ $(top_srcdir)/src/ui/gui/oneway.ui \ $(top_srcdir)/src/ui/gui/rank.ui \ $(top_srcdir)/src/ui/gui/recode.ui \ @@ -80,6 +81,7 @@ EXTRA_DIST += \ $(top_srcdir)/src/ui/gui/examine.glade \ $(top_srcdir)/src/ui/gui/frequencies.glade \ $(top_srcdir)/src/ui/gui/message-dialog.glade \ + $(top_srcdir)/src/ui/gui/psppire.glade \ $(top_srcdir)/src/ui/gui/oneway.glade \ $(top_srcdir)/src/ui/gui/rank.glade \ $(top_srcdir)/src/ui/gui/recode.glade \ @@ -90,7 +92,6 @@ dist_src_ui_gui_psppire_DATA = \ $(top_srcdir)/src/ui/gui/data-editor.glade \ $(top_srcdir)/src/ui/gui/descriptives-dialog.glade \ $(top_srcdir)/src/ui/gui/output-viewer.glade \ - $(top_srcdir)/src/ui/gui/psppire.glade \ $(top_srcdir)/src/ui/gui/syntax-editor.glade \ $(top_srcdir)/src/ui/gui/text-data-import.glade \ $(top_srcdir)/src/ui/gui/psppicon.png \ diff --git a/src/ui/gui/comments-dialog.c b/src/ui/gui/comments-dialog.c index f1a4936e..f425fac2 100644 --- a/src/ui/gui/comments-dialog.c +++ b/src/ui/gui/comments-dialog.c @@ -29,7 +29,6 @@ #include "dialog-common.h" #include -#include #include @@ -39,7 +38,7 @@ struct comment_dialog { - GladeXML *xml; + GtkBuilder *xml; PsppireDict *dict; }; @@ -98,7 +97,7 @@ comments_dialog (GObject *o, gpointer data) struct data_editor *de = data; struct comment_dialog cd; - GladeXML *xml = XML_NEW ("psppire.glade"); + GtkBuilder *xml = builder_new ("psppire.ui"); GtkWidget *dialog = get_widget_assert (xml, "comments-dialog"); GtkWidget *textview = get_widget_assert (xml, "comments-textview1"); diff --git a/src/ui/gui/compute-dialog.c b/src/ui/gui/compute-dialog.c index 5d40d216..e868d3cb 100644 --- a/src/ui/gui/compute-dialog.c +++ b/src/ui/gui/compute-dialog.c @@ -47,7 +47,7 @@ static void insert_source_row_into_text_view (GtkTreeIter iter, struct compute_dialog { - GladeXML *xml; /* The xml that generated the widgets */ + GtkBuilder *xml; /* The xml that generated the widgets */ PsppireDict *dict; gboolean use_type; }; @@ -370,7 +370,7 @@ compute_dialog (GObject *o, gpointer data) PsppireVarStore *vs = NULL; struct compute_dialog scd; - GladeXML *xml = XML_NEW ("psppire.glade"); + GtkBuilder *xml = builder_new ("psppire.ui"); GtkWidget *dialog = get_widget_assert (xml, "compute-variable-dialog"); diff --git a/src/ui/gui/find-dialog.c b/src/ui/gui/find-dialog.c index 332e2d8e..985e73fb 100644 --- a/src/ui/gui/find-dialog.c +++ b/src/ui/gui/find-dialog.c @@ -37,7 +37,6 @@ which match particular strings */ #include #include -#include #include #include "xalloc.h" @@ -52,7 +51,7 @@ which match particular strings */ struct find_dialog { - GladeXML *xml; + GtkBuilder *xml; PsppireDict *dict; struct datasheet *data; struct data_editor *de; @@ -200,7 +199,7 @@ find_dialog (GObject *o, gpointer data) PsppireVarStore *vs ; PsppireDataStore *ds ; - fd.xml = XML_NEW ("psppire.glade"); + fd.xml = builder_new ("psppire.ui"); fd.de = de; find_button = gtk_button_new_from_stock (GTK_STOCK_FIND); diff --git a/src/ui/gui/goto-case-dialog.c b/src/ui/gui/goto-case-dialog.c index 86e80c5d..a22b5cb0 100644 --- a/src/ui/gui/goto-case-dialog.c +++ b/src/ui/gui/goto-case-dialog.c @@ -24,7 +24,7 @@ static void -refresh (const struct data_editor *de, GladeXML *xml) +refresh (const struct data_editor *de, GtkBuilder *xml) { PsppireDataStore *ds = NULL; casenumber case_count ; @@ -43,7 +43,7 @@ void goto_case_dialog (GObject *o, gpointer data) { gint response; - GladeXML *xml = XML_NEW ("psppire.glade"); + GtkBuilder *xml = builder_new ("psppire.ui"); struct data_editor *de = data; GtkWidget *dialog = get_widget_assert (xml, "goto-case-dialog"); diff --git a/src/ui/gui/message-dialog.c b/src/ui/gui/message-dialog.c index 669504e8..866f8c6d 100644 --- a/src/ui/gui/message-dialog.c +++ b/src/ui/gui/message-dialog.c @@ -48,7 +48,7 @@ static GQueue *late_queue; static int error_cnt, warning_cnt, note_cnt; -static GladeXML *message_xml; +static GtkBuilder *message_xml; static GtkWidget *message_dialog; void diff --git a/src/ui/gui/psppire-dialog.c b/src/ui/gui/psppire-dialog.c index 99e0ad7c..c0c2641f 100644 --- a/src/ui/gui/psppire-dialog.c +++ b/src/ui/gui/psppire-dialog.c @@ -501,7 +501,7 @@ get_internal_child (GtkBuildable *buildable, { PsppireDialog *dialog = PSPPIRE_DIALOG (buildable); - if ( 0 == strcmp(childname, "hbox")) + if ( 0 == g_strcmp0 (childname, "hbox")) return G_OBJECT (dialog->box); return NULL; diff --git a/src/ui/gui/select-cases-dialog.c b/src/ui/gui/select-cases-dialog.c index f241c79d..143f7a6d 100644 --- a/src/ui/gui/select-cases-dialog.c +++ b/src/ui/gui/select-cases-dialog.c @@ -18,7 +18,6 @@ #include "select-cases-dialog.h" #include -#include #include "helper.h" #include "psppire-dialog.h" #include "data-editor.h" @@ -42,7 +41,7 @@ struct select_cases_dialog { /* The XML that created the dialog */ - GladeXML *xml; + GtkBuilder *xml; GtkWidget *spinbutton ; GtkWidget *spinbutton1 ; @@ -247,7 +246,7 @@ select_cases_dialog (GObject *o, gpointer data) GtkWidget *button_range; GtkWidget *button_sample; - scd.xml = XML_NEW ("psppire.glade"); + scd.xml = builder_new ("psppire.ui"); g_object_get (de->data_editor, "data-store", &scd.data_store, NULL); diff --git a/src/ui/gui/select-cases-dialog.h b/src/ui/gui/select-cases-dialog.h index 533992e0..b585b096 100644 --- a/src/ui/gui/select-cases-dialog.h +++ b/src/ui/gui/select-cases-dialog.h @@ -19,7 +19,6 @@ #include -#include void select_cases_dialog (GObject *o, gpointer data); diff --git a/src/ui/gui/sort-cases-dialog.c b/src/ui/gui/sort-cases-dialog.c index 4c83676f..dea226c7 100644 --- a/src/ui/gui/sort-cases-dialog.c +++ b/src/ui/gui/sort-cases-dialog.c @@ -95,7 +95,7 @@ sort_cases_dialog (GObject *o, gpointer data) struct sort_cases_dialog scd; - GladeXML *xml = XML_NEW ("psppire.glade"); + GtkBuilder *xml = builder_new ("psppire.ui"); GtkWidget *dialog = get_widget_assert (xml, "sort-cases-dialog"); diff --git a/src/ui/gui/split-file-dialog.c b/src/ui/gui/split-file-dialog.c index 22cdb914..57f5733c 100644 --- a/src/ui/gui/split-file-dialog.c +++ b/src/ui/gui/split-file-dialog.c @@ -27,7 +27,6 @@ #include #include -#include #include "dialog-common.h" @@ -39,7 +38,7 @@ struct split_file_dialog { /* The XML that created the dialog */ - GladeXML *xml; + GtkBuilder *xml; /* The dictionary to which this dialog pertains */ PsppireDict *dict; @@ -177,7 +176,7 @@ split_file_dialog (GObject *o, gpointer data) GtkWidget *selector ; GtkWidget *on_off ; - sfd.xml = XML_NEW ("psppire.glade"); + sfd.xml = builder_new ("psppire.ui"); dialog = get_widget_assert (sfd.xml, "split-file-dialog"); source = get_widget_assert (sfd.xml, "split-file-dict-treeview"); diff --git a/src/ui/gui/t-test-options.c b/src/ui/gui/t-test-options.c index eaf7c43f..ed8ac042 100644 --- a/src/ui/gui/t-test-options.c +++ b/src/ui/gui/t-test-options.c @@ -52,7 +52,7 @@ struct tt_options_dialog }; struct tt_options_dialog * -tt_options_dialog_create (GladeXML *xml, GtkWindow *parent) +tt_options_dialog_create (GtkBuilder *xml, GtkWindow *parent) { struct tt_options_dialog *tto = xmalloc (sizeof (*tto)); diff --git a/src/ui/gui/t-test-options.h b/src/ui/gui/t-test-options.h index fdb2d87c..e80ef444 100644 --- a/src/ui/gui/t-test-options.h +++ b/src/ui/gui/t-test-options.h @@ -24,7 +24,7 @@ struct tt_options_dialog; void tt_options_dialog_run (struct tt_options_dialog *); -struct tt_options_dialog * tt_options_dialog_create (GladeXML *, GtkWindow *); +struct tt_options_dialog * tt_options_dialog_create (GtkBuilder *, GtkWindow *); void tt_options_dialog_destroy (struct tt_options_dialog *); diff --git a/src/ui/gui/transpose-dialog.c b/src/ui/gui/transpose-dialog.c index 621e196c..272ef1b3 100644 --- a/src/ui/gui/transpose-dialog.c +++ b/src/ui/gui/transpose-dialog.c @@ -28,7 +28,6 @@ #include "dialog-common.h" #include -#include #include @@ -40,12 +39,12 @@ #include "psppire-var-store.h" -static gchar * generate_syntax (PsppireDict *dict, GladeXML *xml); +static gchar * generate_syntax (PsppireDict *dict, GtkBuilder *xml); static void refresh (PsppireDialog *dialog, gpointer data) { - GladeXML *xml = data; + GtkBuilder *xml = data; GtkWidget *dest = get_widget_assert (xml, "variables-treeview"); GtkWidget *entry = get_widget_assert (xml, "new-name-entry"); GtkTreeModel *dmodel = gtk_tree_view_get_model (GTK_TREE_VIEW (dest)); @@ -57,7 +56,7 @@ refresh (PsppireDialog *dialog, gpointer data) static gboolean dialog_state_valid (gpointer data) { - GladeXML *xml = data; + GtkBuilder *xml = data; GtkWidget *tv = get_widget_assert (xml, "variables-treeview"); GtkWidget *entry = get_widget_assert (xml, "new-name-entry"); @@ -82,7 +81,7 @@ transpose_dialog (GObject *o, gpointer data) gint response ; struct data_editor *de = data; - GladeXML *xml = XML_NEW ("psppire.glade"); + GtkBuilder *xml = builder_new ("psppire.ui"); PsppireVarStore *vs = NULL; @@ -159,7 +158,7 @@ transpose_dialog (GObject *o, gpointer data) FLIP /VARIABLES=var_list /NEWNAMES=var_name. */ static gchar * -generate_syntax (PsppireDict *dict, GladeXML *xml) +generate_syntax (PsppireDict *dict, GtkBuilder *xml) { const gchar *text; GString *string = g_string_new ("FLIP"); diff --git a/src/ui/gui/variable-info-dialog.c b/src/ui/gui/variable-info-dialog.c index 533021e7..a2583144 100644 --- a/src/ui/gui/variable-info-dialog.c +++ b/src/ui/gui/variable-info-dialog.c @@ -168,7 +168,7 @@ variable_info_dialog (GObject *o, gpointer data) gint response ; - GladeXML *xml = XML_NEW ("psppire.glade"); + GtkBuilder *xml = builder_new ("psppire.ui"); GtkWidget *dialog = get_widget_assert (xml, "variable-info-dialog"); GtkWidget *treeview = get_widget_assert (xml, "treeview2"); diff --git a/src/ui/gui/weight-cases-dialog.c b/src/ui/gui/weight-cases-dialog.c index 223568bf..8b46ca5e 100644 --- a/src/ui/gui/weight-cases-dialog.c +++ b/src/ui/gui/weight-cases-dialog.c @@ -26,7 +26,6 @@ #include "syntax-editor.h" #include -#include #include #define _(msgid) gettext (msgid) @@ -107,7 +106,7 @@ weight_cases_dialog (GObject *o, gpointer data) struct data_editor *de = data; struct weight_cases_dialog wcd; - GladeXML *xml = XML_NEW ("psppire.glade"); + GtkBuilder *xml = builder_new ("psppire.ui"); GtkWidget *dialog = get_widget_assert (xml, "weight-cases-dialog"); GtkWidget *source = get_widget_assert (xml, "weight-cases-treeview"); -- 2.30.2