Spreadsheet Import Dialog: Implement reset button
[pspp] / src / ui / gui / page-sheet-spec.c
index 3d92bfe4100929a074d6718a76c98115b23b1de0..20e17b37fcd6527d7c146f8abc1ad929463794de 100644 (file)
@@ -22,7 +22,6 @@
 
 #include <errno.h>
 #include <fcntl.h>
-#include <gtk-contrib/psppire-sheet.h>
 #include <gtk/gtk.h>
 #include <limits.h>
 #include <stdlib.h>
@@ -51,7 +50,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"
 
@@ -166,11 +164,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);
 }
 
 
@@ -178,7 +179,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,