X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fvariable-info-dialog.c;h=2f5495f137dd5a41f0e889cc847a210f7bf4b3e7;hb=8af88c0b7ea2fe75df7e45497988ed0371006a86;hp=d00fcd5d55d15c37b3a292141e7ae8ec3f4eb706;hpb=f82952d22e200e1b35cea23545857a2cf2f02c66;p=pspp-builds.git diff --git a/src/ui/gui/variable-info-dialog.c b/src/ui/gui/variable-info-dialog.c index d00fcd5d..2f5495f1 100644 --- a/src/ui/gui/variable-info-dialog.c +++ b/src/ui/gui/variable-info-dialog.c @@ -16,21 +16,19 @@ #include #include -#include -#include #include "dict-display.h" #include "var-display.h" #include +#include #include -#include "data-editor.h" +#include "psppire-data-window.h" #include "psppire-dialog.h" #include "psppire-var-store.h" #include "helper.h" -#include #include -#include "syntax-editor.h" +#include "helper.h" #include @@ -76,6 +74,8 @@ populate_text (GtkTreeView *treeview, gpointer data) GtkTextBuffer *textbuffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW(data)); const struct variable *var = get_selected_variable (treeview); + if ( var == NULL) + return; gstring = g_string_sized_new (200); text = name_to_string (var, NULL); @@ -163,11 +163,11 @@ static gchar * generate_syntax (GtkTreeView *treeview); void variable_info_dialog (GObject *o, gpointer data) { - struct data_editor *de = data; + PsppireDataWindow *de = PSPPIRE_DATA_WINDOW (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"); @@ -177,7 +177,7 @@ variable_info_dialog (GObject *o, gpointer data) g_object_get (de->data_editor, "var-store", &vs, NULL); - gtk_window_set_transient_for (GTK_WINDOW (dialog), de->parent.window); + gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (de)); attach_dictionary_to_treeview (GTK_TREE_VIEW (treeview), vs->dict, @@ -213,11 +213,7 @@ variable_info_dialog (GObject *o, gpointer data) case PSPPIRE_RESPONSE_PASTE: { gchar *syntax = generate_syntax (GTK_TREE_VIEW (treeview)); - - struct syntax_editor *se = - (struct syntax_editor *) window_create (WINDOW_SYNTAX, NULL); - - gtk_text_buffer_insert_at_cursor (se->buffer, syntax, -1); + paste_syntax_in_new_window (syntax); g_free (syntax); }