#include "psppire-import-assistant.h"
#include "psppire-scanf.h"
#include "psppire-dialog.h"
#include "psppire-empty-list-store.h"
#include "psppire-encoding-selector.h"
#include "psppire-spreadsheet-model.h"
#include "psppire-import-assistant.h"
#include "psppire-scanf.h"
#include "psppire-dialog.h"
#include "psppire-empty-list-store.h"
#include "psppire-encoding-selector.h"
#include "psppire-spreadsheet-model.h"
static GtkWidget *
add_page_to_assistant (PsppireImportAssistant *ia,
GtkWidget *page, GtkAssistantPageType type, const gchar *);
static GtkWidget *
add_page_to_assistant (PsppireImportAssistant *ia,
GtkWidget *page, GtkAssistantPageType type, const gchar *);
gtk_assistant_set_forward_page_func (GTK_ASSISTANT (ia), next_page_func, NULL, NULL);
gtk_assistant_set_forward_page_func (GTK_ASSISTANT (ia), next_page_func, NULL, NULL);
g_object_set (cell, "text", ds_cstr (&lines[row]), NULL);
}
g_object_set (cell, "text", ds_cstr (&lines[row]), NULL);
}
/* Sets the widgets to match IA's first_line substructure. */
static void
set_first_line (PsppireImportAssistant *ia)
{
GtkTreePath *path = gtk_tree_path_new_from_indices (ia->skip_lines, -1);
/* Sets the widgets to match IA's first_line substructure. */
static void
set_first_line (PsppireImportAssistant *ia)
{
GtkTreePath *path = gtk_tree_path_new_from_indices (ia->skip_lines, -1);
/* Sets IA's first_line substructure to match the widgets. */
static void
set_first_line_options (PsppireImportAssistant *ia)
/* Sets IA's first_line substructure to match the widgets. */
static void
set_first_line_options (PsppireImportAssistant *ia)
add_page_to_assistant (ia, w,
GTK_ASSISTANT_PAGE_CONTENT, _("Select the First Line"));
add_page_to_assistant (ia, w,
GTK_ASSISTANT_PAGE_CONTENT, _("Select the First Line"));
ia->tree_view = GTK_WIDGET (create_lines_tree_view (
GTK_CONTAINER (get_widget_assert (ia->builder, "first-line-scroller")), ia));
ia->variable_names_cb = get_widget_assert (ia->builder, "variable-names");
ia->tree_view = GTK_WIDGET (create_lines_tree_view (
GTK_CONTAINER (get_widget_assert (ia->builder, "first-line-scroller")), ia));
ia->variable_names_cb = get_widget_assert (ia->builder, "variable-names");
/* Parses the contents of the field at (ROW,COLUMN) according to
its variable format. If OUTPUTP is non-null, then *OUTPUTP
/* Parses the contents of the field at (ROW,COLUMN) according to
its variable format. If OUTPUTP is non-null, then *OUTPUTP
static PsppSheetViewColumn *
make_data_column (PsppireImportAssistant *ia, GtkWidget *tree_view,
bool input, gint dict_idx)
{
struct variable *var = NULL;
struct column *column = NULL;
static PsppSheetViewColumn *
make_data_column (PsppireImportAssistant *ia, GtkWidget *tree_view,
bool input, gint dict_idx)
{
struct variable *var = NULL;
struct column *column = NULL;
gint content_width, header_width;
PsppSheetViewColumn *tree_column;
gint content_width, header_width;
PsppSheetViewColumn *tree_column;
- var = dict_get_var (ia->dict, dict_idx);
+ {
+ var = dict_get_var (ia->dict, dict_idx);
+ name = escape_underscores (var_get_name (var));
+ char_cnt = var_get_print_format (var)->w;
+ }
content_width = get_monospace_width (tree_view, ia->fixed_renderer,
char_cnt);
header_width = get_string_width (tree_view, ia->prop_renderer,
content_width = get_monospace_width (tree_view, ia->fixed_renderer,
char_cnt);
header_width = get_string_width (tree_view, ia->prop_renderer,
static GtkWidget *
create_data_tree_view (gboolean input, GtkContainer *parent,
PsppireImportAssistant *ia)
{
gint i;
static GtkWidget *
create_data_tree_view (gboolean input, GtkContainer *parent,
PsppireImportAssistant *ia)
{
gint i;
GtkWidget *tree_view = make_tree_view (ia);
set_model_on_treeview (ia, tree_view, ia->skip_lines);
GtkWidget *tree_view = make_tree_view (ia);
set_model_on_treeview (ia, tree_view, ia->skip_lines);
pspp_sheet_selection_set_mode (pspp_sheet_view_get_selection (PSPP_SHEET_VIEW (tree_view)),
PSPP_SHEET_SELECTION_NONE);
pspp_sheet_selection_set_mode (pspp_sheet_view_get_selection (PSPP_SHEET_VIEW (tree_view)),
PSPP_SHEET_SELECTION_NONE);
/* Chooses a name for each column on the separators page */
static void
choose_column_names (PsppireImportAssistant *ia)
/* Chooses a name for each column on the separators page */
static void
choose_column_names (PsppireImportAssistant *ia)
gchar *
psppire_import_assistant_generate_syntax (PsppireImportAssistant *ia)
{
struct string s = DS_EMPTY_INITIALIZER;
gchar *
psppire_import_assistant_generate_syntax (PsppireImportAssistant *ia)
{
struct string s = DS_EMPTY_INITIALIZER;