projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Whitespace changes only
[pspp]
/
src
/
ui
/
gui
/
page-formats.c
diff --git
a/src/ui/gui/page-formats.c
b/src/ui/gui/page-formats.c
index eb863bdd12e12f308ce05efaa960ec812206f2c4..f5a190c78c3d1f21ffcb07882ec77a94c2b9fb90 100644
(file)
--- a/
src/ui/gui/page-formats.c
+++ b/
src/ui/gui/page-formats.c
@@
-20,7
+20,6
@@
#include <errno.h>
#include <fcntl.h>
#include <errno.h>
#include <fcntl.h>
-#include <gtk-contrib/psppire-sheet.h>
#include <gtk/gtk.h>
#include <limits.h>
#include <stdlib.h>
#include <gtk/gtk.h>
#include <limits.h>
#include <stdlib.h>
@@
-36,7
+35,6
@@
#include "libpspp/i18n.h"
#include "libpspp/line-reader.h"
#include "libpspp/message.h"
#include "libpspp/i18n.h"
#include "libpspp/line-reader.h"
#include "libpspp/message.h"
-#include "ui/gui/checkbox-treeview.h"
#include "ui/gui/dialog-common.h"
#include "ui/gui/executor.h"
#include "ui/gui/helper.h"
#include "ui/gui/dialog-common.h"
#include "ui/gui/executor.h"
#include "ui/gui/helper.h"
@@
-46,10
+44,8
@@
#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"
-#include "ui/gui/psppire-var-store.h"
#include "ui/gui/psppire-scanf.h"
#include "ui/gui/psppire-scanf.h"
-#include "gl/error.h"
#include "gl/intprops.h"
#include "gl/xalloc.h"
#include "gl/intprops.h"
#include "gl/xalloc.h"
@@
-61,7
+57,7
@@
struct formats_page
{
GtkWidget *page;
struct formats_page
{
GtkWidget *page;
-
GtkTree
View *data_tree_view;
+
PsppSheet
View *data_tree_view;
PsppireDict *psppire_dict;
struct variable **modified_vars;
size_t modified_var_cnt;
PsppireDict *psppire_dict;
struct variable **modified_vars;
size_t modified_var_cnt;
@@
-70,7
+66,10
@@
struct formats_page
/* The "formats" page of the assistant. */
static void on_variable_change (PsppireDict *dict, int idx,
/* The "formats" page of the assistant. */
static void on_variable_change (PsppireDict *dict, int idx,
+ unsigned int what,
+ const struct variable *oldvar,
struct import_assistant *);
struct import_assistant *);
+
static void clear_modified_vars (struct import_assistant *);
/* Initializes IA's formats substructure. */
static void clear_modified_vars (struct import_assistant *);
/* Initializes IA's formats substructure. */
@@
-84,7
+83,7
@@
formats_page_create (struct import_assistant *ia)
p->page = add_page_to_assistant (ia, get_widget_assert (builder, "Formats"),
GTK_ASSISTANT_PAGE_CONFIRM);
p->page = add_page_to_assistant (ia, get_widget_assert (builder, "Formats"),
GTK_ASSISTANT_PAGE_CONFIRM);
- p->data_tree_view =
GTK_TREE
_VIEW (get_widget_assert (builder, "data"));
+ p->data_tree_view =
PSPP_SHEET
_VIEW (get_widget_assert (builder, "data"));
p->modified_vars = NULL;
p->modified_var_cnt = 0;
p->modified_vars = NULL;
p->modified_var_cnt = 0;
@@
-112,7
+111,6
@@
prepare_formats_page (struct import_assistant *ia)
{
struct dictionary *dict;
PsppireDict *psppire_dict;
{
struct dictionary *dict;
PsppireDict *psppire_dict;
- PsppireVarStore *var_store;
GtkBin *vars_scroller;
GtkWidget *old_var_sheet;
PsppireVarSheet *var_sheet;
GtkBin *vars_scroller;
GtkWidget *old_var_sheet;
PsppireVarSheet *var_sheet;
@@
-166,7
+164,7
@@
prepare_formats_page (struct import_assistant *ia)
fmt_guesser_destroy (fg);
psppire_dict = psppire_dict_new_from_dict (dict);
fmt_guesser_destroy (fg);
psppire_dict = psppire_dict_new_from_dict (dict);
- g_signal_connect (psppire_dict, "variable
_
changed",
+ g_signal_connect (psppire_dict, "variable
-
changed",
G_CALLBACK (on_variable_change), ia);
ia->dict = dict;
ia->formats->psppire_dict = psppire_dict;
G_CALLBACK (on_variable_change), ia);
ia->dict = dict;
ia->formats->psppire_dict = psppire_dict;
@@
-175,14
+173,13
@@
prepare_formats_page (struct import_assistant *ia)
psppire_dict for now, but it should. After it does, we
should g_object_ref the psppire_dict here, since we also
hold a reference via ia->formats->dict. */
psppire_dict for now, but it should. After it does, we
should g_object_ref the psppire_dict here, since we also
hold a reference via ia->formats->dict. */
- var_store = psppire_var_store_new (psppire_dict);
- g_object_set (var_store,
- "format-type", PSPPIRE_VAR_STORE_INPUT_FORMATS,
- (void *) NULL);
var_sheet = PSPPIRE_VAR_SHEET (psppire_var_sheet_new ());
g_object_set (var_sheet,
var_sheet = PSPPIRE_VAR_SHEET (psppire_var_sheet_new ());
g_object_set (var_sheet,
- "
model", var_store
,
+ "
dictionary", psppire_dict
,
"may-create-vars", FALSE,
"may-create-vars", FALSE,
+ "may-delete-vars", FALSE,
+ "format-use", FMT_FOR_INPUT,
+ "enable-grid-lines", PSPP_SHEET_VIEW_GRID_LINES_BOTH,
(void *) NULL);
vars_scroller = GTK_BIN (get_widget_assert (ia->asst.builder, "vars-scroller"));
(void *) NULL);
vars_scroller = GTK_BIN (get_widget_assert (ia->asst.builder, "vars-scroller"));
@@
-198,6
+195,8
@@
prepare_formats_page (struct import_assistant *ia)
GTK_CONTAINER (get_widget_assert (ia->asst.builder, "data-scroller")),
ia);
GTK_CONTAINER (get_widget_assert (ia->asst.builder, "data-scroller")),
ia);
+ gtk_widget_show (ia->asst.paste_button);
+
pop_watch_cursor (ia);
}
pop_watch_cursor (ia);
}
@@
-233,18
+232,19
@@
reset_formats_page (struct import_assistant *ia)
dictionary. */
static void
on_variable_change (PsppireDict *dict, int dict_idx,
dictionary. */
static void
on_variable_change (PsppireDict *dict, int dict_idx,
+ unsigned int what, const struct variable *oldvar,
struct import_assistant *ia)
{
struct formats_page *p = ia->formats;
struct import_assistant *ia)
{
struct formats_page *p = ia->formats;
-
GtkTree
View *tv = ia->formats->data_tree_view;
+
PsppSheet
View *tv = ia->formats->data_tree_view;
gint column_idx = dict_idx + 1;
push_watch_cursor (ia);
/* Remove previous column and replace with new column. */
gint column_idx = dict_idx + 1;
push_watch_cursor (ia);
/* Remove previous column and replace with new column. */
-
gtk_tree_view_remove_column (tv, gtk_tree
_view_get_column (tv, column_idx));
-
gtk_tree
_view_insert_column (tv, make_data_column (ia, tv, false, dict_idx),
- column_idx);
+
pspp_sheet_view_remove_column (tv, pspp_sheet
_view_get_column (tv, column_idx));
+
pspp_sheet
_view_insert_column (tv, make_data_column (ia, tv, false, dict_idx),
+
column_idx);
/* Save a copy of the modified variable in modified_vars, so
that its attributes will be preserved if we back up to the
/* Save a copy of the modified variable in modified_vars, so
that its attributes will be preserved if we back up to the