#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-encoding-selector.h"
#include "ui/gui/psppire-empty-list-store.h"
#include "ui/gui/psppire-var-sheet.h"
static void on_close (GtkAssistant *assistant, struct import_assistant *);
static void on_paste (GtkButton *button, struct import_assistant *);
static void on_reset (GtkButton *button, struct import_assistant *);
static void on_close (GtkAssistant *assistant, struct import_assistant *);
static void on_paste (GtkButton *button, struct import_assistant *);
static void on_reset (GtkButton *button, struct import_assistant *);
/* Initializes IA's asst substructure. PARENT_WINDOW must be the
window to use as the assistant window's parent. */
/* Initializes IA's asst substructure. PARENT_WINDOW must be the
window to use as the assistant window's parent. */
a->builder = builder_new ("text-data-import.ui");
a->assistant = GTK_ASSISTANT (gtk_assistant_new ());
a->builder = builder_new ("text-data-import.ui");
a->assistant = GTK_ASSISTANT (gtk_assistant_new ());
a->prop_renderer = gtk_cell_renderer_text_new ();
g_object_ref_sink (a->prop_renderer);
a->fixed_renderer = gtk_cell_renderer_text_new ();
a->prop_renderer = gtk_cell_renderer_text_new ();
g_object_ref_sink (a->prop_renderer);
a->fixed_renderer = gtk_cell_renderer_text_new ();
g_signal_connect (a->assistant, "prepare", G_CALLBACK (on_prepare), ia);
g_signal_connect (a->assistant, "cancel", G_CALLBACK (on_cancel), ia);
g_signal_connect (a->assistant, "close", G_CALLBACK (on_close), ia);
g_signal_connect (a->assistant, "prepare", G_CALLBACK (on_prepare), ia);
g_signal_connect (a->assistant, "cancel", G_CALLBACK (on_cancel), ia);
g_signal_connect (a->assistant, "close", G_CALLBACK (on_close), ia);
gtk_window_set_transient_for (GTK_WINDOW (a->assistant), parent_window);
gtk_window_set_icon_name (GTK_WINDOW (a->assistant), "pspp");
gtk_window_set_transient_for (GTK_WINDOW (a->assistant), parent_window);
gtk_window_set_icon_name (GTK_WINDOW (a->assistant), "pspp");
on_prepare (GtkAssistant *assistant, GtkWidget *page,
struct import_assistant *ia)
{
on_prepare (GtkAssistant *assistant, GtkWidget *page,
struct import_assistant *ia)
{
- if (gtk_assistant_get_page_type (assistant, page)
- == GTK_ASSISTANT_PAGE_CONFIRM)
- gtk_widget_grab_focus (assistant->apply);
+ if ( ia->spreadsheet)
+ {
+ if (pn == 0)
+ {
+ prepare_sheet_spec_page (ia);
+ }
+ else if (pn == 1)
+ {
+ post_sheet_spec_page (ia);
+ prepare_formats_page (ia);
+ }
+ }
- gtk_widget_grab_focus (assistant->forward);
-
-
- /* Prepare .... */
- if (page == ia->separators->page)
- prepare_separators_page (ia);
- else if (page == ia->formats->page)
- prepare_formats_page (ia);
- else if (page == ia->sheet_spec->page && ssp->spreadsheet)
-#endif
-
- gtk_widget_show (ia->asst.reset_button);
- if (page == ia->formats->page)
- gtk_widget_show (ia->asst.paste_button);
+ if (gtk_assistant_get_page_type (assistant, page)
+ == GTK_ASSISTANT_PAGE_CONFIRM)
+ gtk_widget_grab_focus (assistant->apply);
/* Called when the Reset button is clicked. */
static void
on_reset (GtkButton *button, struct import_assistant *ia)
{
/* Called when the Reset button is clicked. */
static void
on_reset (GtkButton *button, struct import_assistant *ia)
{
gint page_num = gtk_assistant_get_current_page (ia->asst.assistant);
GtkWidget *page = gtk_assistant_get_nth_page (ia->asst.assistant, page_num);
gint page_num = gtk_assistant_get_current_page (ia->asst.assistant);
GtkWidget *page = gtk_assistant_get_nth_page (ia->asst.assistant, page_num);
close_assistant (struct import_assistant *ia, int response)
{
ia->asst.response = response;
close_assistant (struct import_assistant *ia, int response)
{
ia->asst.response = response;