X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=src%2Fui%2Fgui%2Fhelper.c;h=fc9105d75921456a8f94ea41e1246d7065c59a55;hb=a1efcf97ca2f75f4be6a0389ff2372c03ed2d4e1;hp=c96fddedc437089445bd197ad7675384948ba8b2;hpb=dacfe37faf6837e1e69b75e0f3791f06a3efa68d;p=pspp-builds.git diff --git a/src/ui/gui/helper.c b/src/ui/gui/helper.c index c96fdded..fc9105d7 100644 --- a/src/ui/gui/helper.c +++ b/src/ui/gui/helper.c @@ -25,12 +25,14 @@ #include #include "helper.h" #include "message-dialog.h" +#include #include #include #include #include #include +#include #include #include @@ -99,14 +101,35 @@ text_to_value (const gchar *text, union value *v, } +GtkBuilder * +builder_new_real (const gchar *name) +{ + GtkBuilder *builder = gtk_builder_new (); + + GError *err = NULL; + if ( ! gtk_builder_add_from_file (builder, name, &err)) + { + g_critical ("Couldnt open user interface file %s: %s", name, err->message); + g_clear_error (&err); + } + + return builder; +} + + + GtkWidget * -get_widget_assert (GladeXML *xml, const gchar *name) +get_widget_assert (gpointer x, const gchar *name) { - GtkWidget *w; - g_assert (xml); + GObject *obj = G_OBJECT (x); + GtkWidget *w = NULL; g_assert (name); - w = glade_xml_get_widget (xml, name); + if (GTK_IS_BUILDER (obj)) + w = GTK_WIDGET (gtk_builder_get_object (GTK_BUILDER (obj), name)); + + if (GLADE_IS_XML (obj)) + w = glade_xml_get_widget (GLADE_XML (obj), name); if ( !w ) g_critical ("Widget \"%s\" could not be found\n", name); @@ -149,6 +172,8 @@ connect_help (GladeXML *xml) GList *i; for ( i = g_list_first (helps); i ; i = g_list_next (i)) g_signal_connect (GTK_WIDGET (i->data), "clicked", give_help, 0); + + g_list_free (helps); } @@ -239,8 +264,7 @@ execute_syntax (struct getl_interface *sss) reader = proc_extract_active_file_data (the_dataset); if (!lazy_casereader_destroy (reader, lazy_serial)) - psppire_data_store_set_case_file (the_data_store, - psppire_case_file_new (reader)); + psppire_data_store_set_reader (the_data_store, reader); som_flush (); @@ -251,52 +275,6 @@ execute_syntax (struct getl_interface *sss) -#ifdef G_ENABLE_DEBUG -# define g_marshal_value_peek_int(v) g_value_get_int (v) -#else -# define g_marshal_value_peek_int(v) (v)->data[0].v_int -#endif - - -/* VOID:INT,INT,INT */ -void -marshaller_VOID__INT_INT_INT (GClosure *closure, - GValue *return_value, - guint n_param_values, - const GValue *param_values, - gpointer invocation_hint, - gpointer marshal_data) -{ - typedef void (*GMarshalFunc_VOID__INT_INT_INT) (gpointer data1, - gint arg_1, - gint arg_2, - gint arg_3, - gpointer data2); - register GMarshalFunc_VOID__INT_INT_INT callback; - register GCClosure *cc = (GCClosure*) closure; - register gpointer data1, data2; - - g_return_if_fail (n_param_values == 4); - - if (G_CCLOSURE_SWAP_DATA (closure)) - { - data1 = closure->data; - data2 = g_value_peek_pointer (param_values + 0); - } - else - { - data1 = g_value_peek_pointer (param_values + 0); - data2 = closure->data; - } - callback = (GMarshalFunc_VOID__INT_INT_INT) (marshal_data ? marshal_data : cc->callback); - - callback (data1, - g_marshal_value_peek_int (param_values + 1), - g_marshal_value_peek_int (param_values + 2), - g_marshal_value_peek_int (param_values + 3), - data2); -} - /* Create a deep copy of SRC */ GtkListStore * clone_list_store (const GtkListStore *src) @@ -341,3 +319,4 @@ clone_list_store (const GtkListStore *src) } +