static void
on_cut (PsppireDataWindow *dw)
{
- #if 0
+#if SHEET_MERGE
int p = gtk_notebook_get_current_page (GTK_NOTEBOOK (dw->data_editor));
if (p == 0)
{
PsppireDataSheet *ds = psppire_data_editor_get_active_data_sheet (dw->data_editor);
psppire_data_sheet_edit_cut (ds);
}
- #endif
+#endif
}
static void
on_copy (PsppireDataWindow *dw)
{
- #if 0
+#if SHEET_MERGE
int p = gtk_notebook_get_current_page (GTK_NOTEBOOK (dw->data_editor));
if (p == 0)
{
PsppireDataSheet *ds = psppire_data_editor_get_active_data_sheet (dw->data_editor);
psppire_data_sheet_edit_copy (ds);
}
- #endif
+#endif
}
static void
on_paste (PsppireDataWindow *dw)
{
- #if 0
+#if SHEET_MERGE
int p = gtk_notebook_get_current_page (GTK_NOTEBOOK (dw->data_editor));
if (p == 0)
{
PsppireDataSheet *ds = psppire_data_editor_get_active_data_sheet (dw->data_editor);
psppire_data_sheet_edit_paste (ds);
}
- #endif
+#endif
}
static void
on_clear_cases (PsppireDataWindow *dw)
{
- #if 0
+#if SHEET_MERGE
int p = gtk_notebook_get_current_page (GTK_NOTEBOOK (dw->data_editor));
if (p == 0)
{
PsppireDataSheet *ds = psppire_data_editor_get_active_data_sheet (dw->data_editor);
psppire_data_sheet_edit_clear_cases (ds);
}
- #endif
+#endif
}
static void
on_clear_variables (PsppireDataWindow *dw)
{
- #if 0
+#if SHEET_MERGE
int p = gtk_notebook_get_current_page (GTK_NOTEBOOK (dw->data_editor));
if (p == 0)
{
{
psppire_var_sheet_clear_variables (PSPPIRE_VAR_SHEET (dw->data_editor->var_sheet));
}
- #endif
+#endif
}
static void
insert_variable (PsppireDataWindow *dw)
{
-#if 0
+#if SHEET_MERGE
int p = gtk_notebook_get_current_page (GTK_NOTEBOOK (dw->data_editor));
if (p == 0)
{
static void
insert_case_at_row (PsppireDataWindow *dw)
{
-#if 0
+#if SHEET_MERGE
PsppireDataSheet *ds = psppire_data_editor_get_active_data_sheet (dw->data_editor);
psppire_data_sheet_insert_case (ds);
static void
goto_case (PsppireDataWindow *dw)
{
- #if 0
+#if SHEET_MERGE
PsppireDataSheet *ds = psppire_data_editor_get_active_data_sheet (dw->data_editor);
goto_case_dialog (ds);
- #endif
+#endif
}
return NULL;
}
-#if 0
+#if SHEET_MERGE
PsppireDataWindow *
psppire_data_window_for_data_store (PsppireDataStore *data_store)
#define _(msgid) gettext (msgid)
#define N_(msgid) msgid
-GType psppire_import_assistant_get_type (void)
-{
- return 0;
-}
-
-#if 0
enum { MAX_LINE_LEN = 16384 }; /* Max length of an acceptable line. */
close_assistant (ia, PSPPIRE_RESPONSE_PASTE);
}
+
/* Revises the contents of the fields tree view based on the
currently chosen set of separators. */
static void
return TRUE;
}
+#if SHEET_MERGE
+
static void
render_line_number (PsppSheetViewColumn *tree_column,
}
-
static gint
get_string_width (GtkWidget *treeview, GtkCellRenderer *renderer,
const char *string)
return tree_view;
}
+#endif
+
static GtkWidget *
add_page_to_assistant (PsppireImportAssistant *ia,
GtkWidget *page, GtkAssistantPageType type, const gchar *);
}
-
/* Initializes IA's sheet_spec substructure. */
static void
sheet_spec_page_create (PsppireImportAssistant *ia)
g_object_set_data (G_OBJECT (page), "on-entering", prepare_sheet_spec_page);
}
-
static void
on_chosen (PsppireImportAssistant *ia, GtkWidget *page)
{
on_chosen (ia, page);
}
+
+
static void
chooser_page_enter (PsppireImportAssistant *ia, GtkWidget *page)
{
on_chosen (ia, page);
}
+
+
static void
chooser_page_create (PsppireImportAssistant *ia)
{
}
+
static void
psppire_import_assistant_init (PsppireImportAssistant *ia)
{
}
+#if SHEET_MERGE
+
static void
render_line (PsppSheetViewColumn *tree_column,
GtkCellRenderer *cell,
g_object_set (cell, "text", ds_cstr (&lines[row]), NULL);
}
+#endif
+
/* 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);
-
+#if SHEET_MERGE
set_model_on_treeview (ia, ia->tree_view, 0);
-
pspp_sheet_view_set_cursor (PSPP_SHEET_VIEW (ia->tree_view),
path, NULL, false);
+#endif
gtk_tree_path_free (path);
gtk_toggle_button_set_active (
ia->skip_lines > 0);
}
+#if SHEET_MERGE
/* Creates and returns a tree view that contains each of the
lines in IA's file as a row. */
}
+
/* Sets IA's first_line substructure to match the widgets. */
static void
set_first_line_options (PsppireImportAssistant *ia)
gtk_widget_set_sensitive (ia->variable_names_cb, ia->skip_lines > 0);
}
+
+
static void
reset_first_line_page (PsppireImportAssistant *ia)
{
gtk_widget_set_sensitive (ia->variable_names_cb, FALSE);
}
-
+#endif
/* Initializes IA's first_line substructure. */
static void
first_line_page_create (PsppireImportAssistant *ia)
add_page_to_assistant (ia, w,
GTK_ASSISTANT_PAGE_CONTENT, _("Select the First Line"));
+#if SHEET_MERGE
+
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");
g_object_set_data (G_OBJECT (w), "on-reset", reset_first_line_page);
+#endif
}
+
+
static void
intro_on_enter (PsppireImportAssistant *ia)
{
g_object_set_data (G_OBJECT (w), "on-reset", reset_intro_page);
}
-#endif
GtkWidget *
psppire_import_assistant_new (GtkWindow *toplevel)
NULL));
}
-#if 0
+
\f
free (ia->columns);
}
+#if SHEET_MERGE
+
/* Called to render one of the cells in the fields preview tree
view. */
static void
(void *) NULL);
}
+#endif
/* Parses the contents of the field at (ROW,COLUMN) according to
its variable format. If OUTPUTP is non-null, then *OUTPUTP
return ok;
}
+#if SHEET_MERGE
/* Called to render one of the cells in the data preview tree
view. */
}
+
\f
free (text);
return TRUE;
}
-
+#endif
\f
}
}
+
+#if SHEET_MERGE
static PsppSheetViewColumn *
make_data_column (PsppireImportAssistant *ia, GtkWidget *tree_view,
bool input, gint dict_idx)
return tree_column;
}
+#endif
static GtkWidget *
create_data_tree_view (gboolean input, GtkContainer *parent,
PsppireImportAssistant *ia)
{
gint i;
+#if SHEET_MERGE
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);
gtk_widget_show (tree_view);
return tree_view;
+#endif
}
+
/* Chooses a name for each column on the separators page */
static void
choose_column_names (PsppireImportAssistant *ia)
\f
+
+#if SHEET_MERGE
+
/* Called when the user changes one of the variables in the
dictionary. */
static void
pop_watch_cursor (ia);
}
-
+#endif
/* Called just before the formats page of the assistant is
return ds_cstr (&s);
}
-#endif
gchar *
psppire_import_assistant_generate_syntax (PsppireImportAssistant *ia)
{
struct string s = DS_EMPTY_INITIALIZER;
-#if 0
+#if SHEET_MERGE
if (!ia->spreadsheet)
{
if (ia->file_name == NULL)