X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fpage-intro.c;h=59c252b46cb2ade898b2808b2db41543a9e08c9f;hb=ae66d58a728d5f738b6be0a4c622bc6e3c50b9ef;hp=4034834c345957f2905f11d657e4fe4c22bfa5f5;hpb=a654213065a03c99b868ebad39286c1c5e06a38e;p=pspp diff --git a/src/ui/gui/page-intro.c b/src/ui/gui/page-intro.c index 4034834c34..59c252b46c 100644 --- a/src/ui/gui/page-intro.c +++ b/src/ui/gui/page-intro.c @@ -16,11 +16,12 @@ #include +#include "page-intro.h" + #include "ui/gui/text-data-import-dialog.h" #include #include -#include #include #include #include @@ -46,7 +47,6 @@ #include "ui/gui/psppire-encoding-selector.h" #include "ui/gui/psppire-empty-list-store.h" #include "ui/gui/psppire-var-sheet.h" -#include "ui/gui/psppire-var-store.h" #include "ui/gui/psppire-scanf.h" #include "ui/syntax-gen.h" @@ -64,6 +64,17 @@ struct import_assistant; /* The "intro" page of the assistant. */ +/* The introduction page of the assistant. */ +struct intro_page + { + GtkWidget *page; + GtkWidget *all_cases_button; + GtkWidget *n_cases_button; + GtkWidget *n_cases_spin; + GtkWidget *percent_button; + GtkWidget *percent_spin; + }; + static void on_intro_amount_changed (struct intro_page *); /* Initializes IA's intro substructure. */ @@ -171,3 +182,17 @@ on_intro_amount_changed (struct intro_page *p) gtk_toggle_button_get_active ( GTK_TOGGLE_BUTTON (p->percent_button))); } + + +void +intro_append_syntax (const struct intro_page *p, struct string *s) +{ + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (p->n_cases_button))) + ds_put_format (s, " /IMPORTCASES=FIRST %d\n", + gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (p->n_cases_spin))); + else if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (p->percent_button))) + ds_put_format (s, " /IMPORTCASES=PERCENT %d\n", + gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (p->percent_spin))); + else + ds_put_cstr (s, " /IMPORTCASES=ALL\n"); +}