#include <gtk/gtk.h>
#include <language/syntax-string-source.h>
-#include <ui/gui/data-editor.h>
+#include <ui/gui/psppire-data-window.h>
#include <ui/gui/dialog-common.h>
#include <ui/gui/dict-display.h>
#include <ui/gui/helper.h>
#include <ui/gui/psppire-dialog.h>
#include <ui/gui/psppire-var-store.h>
-#include <ui/gui/syntax-editor.h>
-#include <libpspp/syntax-gen.h>
+#include <ui/gui/helper.h>
+#include <ui/syntax-gen.h>
#include "psppire-acr.h"
gtk_widget_set_sensitive (target, state);
}
-static void recode_dialog (struct data_editor *de, gboolean diff);
+static void recode_dialog (PsppireDataWindow *de, gboolean diff);
/* Pops up the Recode Same version of the dialog box */
void
recode_same_dialog (GObject *o, gpointer data)
{
- struct data_editor *de = data;
+ PsppireDataWindow *de = PSPPIRE_DATA_WINDOW (data);
recode_dialog (de, FALSE);
}
void
recode_different_dialog (GObject *o, gpointer data)
{
- struct data_editor *de = data;
+ PsppireDataWindow *de = PSPPIRE_DATA_WINDOW (data);
recode_dialog (de, TRUE);
}
}
static void
-recode_dialog (struct data_editor *de, gboolean diff)
+recode_dialog (PsppireDataWindow *de, gboolean diff)
{
gint response;
rd.different = diff;
- gtk_window_set_transient_for (GTK_WINDOW (rd.dialog), de->parent.window);
+ gtk_window_set_transient_for (GTK_WINDOW (rd.dialog), GTK_WINDOW (de));
attach_dictionary_to_treeview (GTK_TREE_VIEW (rd.dict_treeview),
PSPPIRE_DIALOG (get_widget_assert (xml, "old-new-values-dialog"));
gtk_window_set_transient_for (GTK_WINDOW (rd.old_and_new_dialog),
- de->parent.window);
+ GTK_WINDOW (de));
rd.acr = PSPPIRE_ACR (get_widget_assert (xml, "psppire-acr1"));
case GTK_RESPONSE_OK:
{
gchar *syntax = generate_syntax (&rd);
+
struct getl_interface *sss = create_syntax_string_source (syntax);
execute_syntax (sss);
case PSPPIRE_RESPONSE_PASTE:
{
gchar *syntax = generate_syntax (&rd);
-
- 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);
}
break;
case NV_STRING:
{
- struct string ds;
- ds_init_cstr (&ds, nv->v.s);
- gen_quoted_string (&ds);
+ struct string ds = DS_EMPTY_INITIALIZER;
+ syntax_gen_string (&ds, ss_cstr (nv->v.s));
g_string_append (str, ds_cstr (&ds));
ds_destroy (&ds);
}
break;
case OV_STRING:
{
- struct string ds;
- ds_init_cstr (&ds, ov->v.s);
- gen_quoted_string (&ds);
+ struct string ds = DS_EMPTY_INITIALIZER;
+ syntax_gen_string (&ds, ss_cstr (ov->v.s));
g_string_append (str, ds_cstr (&ds));
ds_destroy (&ds);
}
continue;
}
- ds_init_cstr (&ls, label);
+ ds_init_empty (&ls);
+ syntax_gen_string (&ls, ss_cstr (label));
g_free (label);
- gen_quoted_string (&ls);
g_string_append_printf (str, "\nVARIABLE LABELS %s %s.",
name, ds_cstr (&ls));