From 49b2d74e2e70f6d468a64c24ead9b5d734058ca6 Mon Sep 17 00:00:00 2001 From: John Darrington Date: Sat, 9 Mar 2013 14:38:29 +0100 Subject: [PATCH] Re-enabled the reset buttons --- src/ui/gui/page-assistant.c | 21 ++++++++++++++------- src/ui/gui/text-data-import-dialog.h | 7 +++++++ 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/src/ui/gui/page-assistant.c b/src/ui/gui/page-assistant.c index dd9745cc28..f1a965d568 100644 --- a/src/ui/gui/page-assistant.c +++ b/src/ui/gui/page-assistant.c @@ -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 diff --git a/src/ui/gui/text-data-import-dialog.h b/src/ui/gui/text-data-import-dialog.h index dc8bef03c7..0c026858fe 100644 --- a/src/ui/gui/text-data-import-dialog.h +++ b/src/ui/gui/text-data-import-dialog.h @@ -25,6 +25,11 @@ 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); -- 2.30.2