Re-enabled the reset buttons
authorJohn Darrington <john@darrington.wattle.id.au>
Sat, 9 Mar 2013 13:38:29 +0000 (14:38 +0100)
committerJohn Darrington <john@darrington.wattle.id.au>
Sat, 9 Mar 2013 13:38:29 +0000 (14:38 +0100)
src/ui/gui/page-assistant.c
src/ui/gui/text-data-import-dialog.h

index dd9745cc282f6a07a7a4c1b49f6f59136878fcb5..f1a965d5684b41fb5a3250cbf67442bb37e35e73 100644 (file)
@@ -206,25 +206,32 @@ on_paste (GtkButton *button, struct import_assistant *ia)
   close_assistant (ia, PSPPIRE_RESPONSE_PASTE);
 }
 
+static GtkWidget *
+assist_get_page (struct assist_page *ap)
+{
+  if (ap == NULL)
+    return NULL;
+
+  return ap->page;
+}
+
 /* Called when the Reset button is clicked. */
 static void
 on_reset (GtkButton *button, struct import_assistant *ia)
 {
-#if 0
   gint page_num = gtk_assistant_get_current_page (ia->asst.assistant);
   GtkWidget *page = gtk_assistant_get_nth_page (ia->asst.assistant, page_num);
 
-  if (page == ia->intro->page)
+  if (page == assist_get_page ((struct assist_page *) ia->intro))
     reset_intro_page (ia);
-  else if (page == ia->first_line->page)
+  else if (page == assist_get_page ((struct assist_page *) ia->first_line))
     reset_first_line_page (ia);
-  else if (page == ia->separators->page)
+  else if (page == assist_get_page ((struct assist_page *) ia->separators))
     reset_separators_page (ia);
-  else if (page == ia->formats->page)
+  else if (page == assist_get_page ((struct assist_page *) ia->formats))
     reset_formats_page (ia);
-  else if (page == ia->sheet_spec->page)
+  else if (page == assist_get_page ((struct assist_page *) ia->sheet_spec))
     reset_sheet_spec_page (ia);
-#endif
 }
 
 /* Causes the assistant to close, returning RESPONSE for
index dc8bef03c79aada7caf67b48ad446c490e5e52f5..0c026858fe04665f59331ba63ec372474773a2a5 100644 (file)
 
 enum { MAX_PREVIEW_LINES = 1000 }; /* Max number of lines to read. */
 
+struct assist_page
+{
+  GtkWidget *page;
+};
+
 /* The file to be imported. */
 struct file
   {
@@ -145,6 +150,8 @@ void post_sheet_spec_page (struct import_assistant *ia);
 void prepare_first_line_page (struct import_assistant *ia);
 void reset_first_line_page (struct import_assistant *);
 
+void reset_intro_page (struct import_assistant *ia);
+
 void prepare_separators_page (struct import_assistant *ia);
 void reset_separators_page (struct import_assistant *);
 void destroy_separators_page (struct import_assistant *ia);