X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=src%2Fui%2Fgui%2Ftext-data-import-dialog.h;h=0c026858fe04665f59331ba63ec372474773a2a5;hb=f1ecefd655dac8dd69c389bbcc3c354991801c68;hp=b7268235fbe49f2bb5ed263f48ec4000bd7cc61a;hpb=7a187ebfbb18802df6b5a11b2eaf244a209dff4f;p=pspp diff --git a/src/ui/gui/text-data-import-dialog.h b/src/ui/gui/text-data-import-dialog.h index b7268235fb..0c026858fe 100644 --- a/src/ui/gui/text-data-import-dialog.h +++ b/src/ui/gui/text-data-import-dialog.h @@ -23,6 +23,13 @@ #include "libpspp/str.h" +enum { MAX_PREVIEW_LINES = 1000 }; /* Max number of lines to read. */ + +struct assist_page +{ + GtkWidget *page; +}; + /* The file to be imported. */ struct file { @@ -45,6 +52,7 @@ struct assistant GtkBuilder *builder; GtkAssistant *assistant; GMainLoop *main_loop; + bool loop_done; GtkWidget *paste_button; GtkWidget *reset_button; int response; @@ -54,67 +62,6 @@ struct assistant GtkCellRenderer *fixed_renderer; }; - -/* The sheet_spec page of the assistant (only relevant for spreadsheet imports). */ -struct sheet_spec_page - { - GtkWidget *page; - struct casereader *reader; - struct dictionary *dict; - struct spreadsheet *spreadsheet; - - struct spreadsheet_read_info sri; - struct spreadsheet_read_options opts; - }; - - -/* Page where the user chooses the first line of data. */ -struct first_line_page - { - int skip_lines; /* Number of initial lines to skip? */ - bool variable_names; /* Variable names above first line of data? */ - - GtkWidget *page; - GtkTreeView *tree_view; - GtkWidget *variable_names_cb; - }; - - -/* Page where the user chooses field separators. */ -struct separators_page - { - /* How to break lines into columns. */ - struct string separators; /* Field separators. */ - struct string quotes; /* Quote characters. */ - bool escape; /* Doubled quotes yield a quote mark? */ - - /* The columns produced thereby. */ - struct column *columns; /* Information about each column. */ - size_t column_cnt; /* Number of columns. */ - - GtkWidget *page; - GtkWidget *custom_cb; - GtkWidget *custom_entry; - GtkWidget *quote_cb; - GtkWidget *quote_combo; - GtkEntry *quote_entry; - GtkWidget *escape_cb; - GtkTreeView *fields_tree_view; - }; - -/* Page where the user verifies and adjusts input formats. */ -struct formats_page - { - struct dictionary *dict; - - GtkWidget *page; - GtkTreeView *data_tree_view; - PsppireDict *psppire_dict; - struct variable **modified_vars; - size_t modified_var_cnt; - }; - - struct import_assistant { struct file file; @@ -125,10 +72,17 @@ struct import_assistant struct first_line_page *first_line; struct separators_page *separators; struct formats_page *formats; - }; + /* The columns produced. */ + struct column *columns; /* Information about each column. */ + size_t column_cnt; /* Number of columns. */ + int skip_lines; /* Number of initial lines to skip? */ + bool variable_names; /* Variable names above first line of data? */ + struct dictionary *dict; + struct spreadsheet *spreadsheet; + }; struct column { @@ -189,22 +143,19 @@ void update_assistant (struct import_assistant *ia); bool init_file (struct import_assistant *ia, GtkWindow *parent_window); void destroy_file (struct import_assistant *ia); - -void init_sheet_spec_page (struct import_assistant *); void prepare_sheet_spec_page (struct import_assistant *ia); void reset_sheet_spec_page (struct import_assistant *); void post_sheet_spec_page (struct import_assistant *ia); -void init_first_line_page (struct import_assistant *ia); void prepare_first_line_page (struct import_assistant *ia); void reset_first_line_page (struct import_assistant *); -void init_separators_page (struct import_assistant *ia); +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); -void init_formats_page (struct import_assistant *ia); void prepare_formats_page (struct import_assistant *ia); void reset_formats_page (struct import_assistant *); void destroy_formats_page (struct import_assistant *ia);