X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fpage-sheet-spec.c;h=76b3ff6436279836879f4ef127d9afbbc74f90b3;hb=03a7b96a587a58bda342b4eb5ce5f935880ba2b7;hp=9aa16b592544e8e1ed34f7a27ad5a45cb7390926;hpb=3c6287003e07308c727d9ca13f759bfce33e0693;p=pspp diff --git a/src/ui/gui/page-sheet-spec.c b/src/ui/gui/page-sheet-spec.c index 9aa16b5925..76b3ff6436 100644 --- a/src/ui/gui/page-sheet-spec.c +++ b/src/ui/gui/page-sheet-spec.c @@ -22,7 +22,6 @@ #include #include -#include #include #include #include @@ -41,7 +40,6 @@ #include "libpspp/i18n.h" #include "libpspp/line-reader.h" #include "libpspp/message.h" -#include "ui/gui/checkbox-treeview.h" #include "ui/gui/dialog-common.h" #include "ui/gui/executor.h" #include "ui/gui/helper.h" @@ -51,7 +49,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" @@ -59,7 +56,6 @@ #include -#include "gl/error.h" #include "gl/intprops.h" #include "gl/xalloc.h" @@ -78,7 +74,6 @@ struct sheet_spec_page struct casereader *reader; struct dictionary *dict; - struct spreadsheet_read_info sri; struct spreadsheet_read_options opts; }; @@ -102,7 +97,7 @@ sheet_spec_gen_syntax (const struct import_assistant *ia) (ia->spreadsheet->type == SPREADSHEET_GNUMERIC) ? "GNM" : "ODS", ia->file.file_name, ssp->opts.sheet_index, - ssp->sri.read_names ? "ON" : "OFF"); + ssp->opts.read_names ? "ON" : "OFF"); if (range && 0 != strcmp ("", range)) @@ -167,11 +162,14 @@ prepare_sheet_spec_page (struct import_assistant *ia) { GtkBuilder *builder = ia->asst.builder; GtkWidget *sheet_entry = get_widget_assert (builder, "sheet-entry"); + GtkWidget *readnames_checkbox = get_widget_assert (builder, "readnames-checkbox"); gtk_combo_box_set_model (GTK_COMBO_BOX (sheet_entry), psppire_spreadsheet_model_new (ia->spreadsheet)); gtk_combo_box_set_active (GTK_COMBO_BOX (sheet_entry), 0); + + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (readnames_checkbox), FALSE); } @@ -179,7 +177,13 @@ prepare_sheet_spec_page (struct import_assistant *ia) void reset_sheet_spec_page (struct import_assistant *ia) { - printf ("%s\n", __FUNCTION__); + GtkBuilder *builder = ia->asst.builder; + GtkWidget *sheet_entry = get_widget_assert (builder, "sheet-entry"); + GtkWidget *readnames_checkbox = get_widget_assert (builder, "readnames-checkbox"); + + gtk_combo_box_set_active (GTK_COMBO_BOX (sheet_entry), 0); + + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (readnames_checkbox), FALSE); } /* Called when the Forward button is clicked, @@ -212,23 +216,18 @@ post_sheet_spec_page (struct import_assistant *ia) if ( convert_cell_ref (range, &col_start, &row_start, &col_stop, &row_stop)) { - ssp->opts.cell_range = range; + ssp->opts.cell_range = g_strdup (range); } - ssp->sri.read_names = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (readnames_checkbox)); - ssp->sri.asw = -1; + ssp->opts.read_names = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (readnames_checkbox)); + ssp->opts.asw = -1; switch (ia->spreadsheet->type) { case SPREADSHEET_ODS: - { - creader = ods_make_reader (ia->spreadsheet, &ssp->sri, &ssp->opts); - dict = ia->spreadsheet->dict; - } - break; case SPREADSHEET_GNUMERIC: { - creader = gnumeric_make_reader (ia->spreadsheet, &ssp->sri, &ssp->opts); + creader = spreadsheet_make_reader (ia->spreadsheet, &ssp->opts); dict = ia->spreadsheet->dict; } break;