[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[sheet prep 4/6] gui: Eliminate some dependencies on the dictionary.
From: |
Ben Pfaff |
Subject: |
[sheet prep 4/6] gui: Eliminate some dependencies on the dictionary. |
Date: |
Wed, 22 Jun 2011 20:33:13 -0700 |
Previously all of the dialog boxes used by the variable sheet
kept around a pointer to the dictionary solely to obtain the
dictionary's encoding. Previous commits have eliminated that
use, so this commit gets rid of the dictionary members.
---
src/ui/gui/missing-val-dialog.h | 5 +----
src/ui/gui/psppire-var-sheet.c | 8 ++------
src/ui/gui/val-labs-dialog.c | 7 +------
src/ui/gui/val-labs-dialog.h | 4 ++--
src/ui/gui/var-type-dialog.c | 4 +---
src/ui/gui/var-type-dialog.h | 8 ++------
6 files changed, 9 insertions(+), 27 deletions(-)
diff --git a/src/ui/gui/missing-val-dialog.h b/src/ui/gui/missing-val-dialog.h
index 82acf97..2322b84 100644
--- a/src/ui/gui/missing-val-dialog.h
+++ b/src/ui/gui/missing-val-dialog.h
@@ -1,5 +1,5 @@
/* PSPPIRE - a graphical user interface for PSPP.
- Copyright (C) 2005 Free Software Foundation
+ Copyright (C) 2005, 2011 Free Software Foundation
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -32,9 +32,6 @@ struct missing_val_dialog
/* The variable whose missing values are to be updated */
struct variable *pv;
- /* The dictionary to which that value belongs */
- PsppireDict *dict;
-
/* local copy */
struct missing_values mvl;
diff --git a/src/ui/gui/psppire-var-sheet.c b/src/ui/gui/psppire-var-sheet.c
index bf0c012..dcec70b 100644
--- a/src/ui/gui/psppire-var-sheet.c
+++ b/src/ui/gui/psppire-var-sheet.c
@@ -387,8 +387,6 @@ var_sheet_change_active_cell (PsppireVarSheet *vs,
vs->missing_val_dialog->pv =
psppire_var_store_get_var (var_store, row);
- vs->missing_val_dialog->dict = var_store->dictionary;
-
g_signal_connect_swapped (customEntry,
"clicked",
G_CALLBACK (missing_val_dialog_show),
@@ -483,12 +481,10 @@ psppire_var_sheet_realize (GtkWidget *w)
GtkWidget *toplevel = gtk_widget_get_toplevel (GTK_WIDGET (vs));
- vs->val_labs_dialog = val_labs_dialog_create (GTK_WINDOW (toplevel),
- PSPPIRE_VAR_STORE
(psppire_sheet_get_model (PSPPIRE_SHEET (vs))));
+ vs->val_labs_dialog = val_labs_dialog_create (GTK_WINDOW (toplevel));
vs->missing_val_dialog = missing_val_dialog_create (GTK_WINDOW (toplevel));
- vs->var_type_dialog = var_type_dialog_create (GTK_WINDOW (toplevel),
- PSPPIRE_VAR_STORE
(psppire_sheet_get_model (PSPPIRE_SHEET (vs))));
+ vs->var_type_dialog = var_type_dialog_create (GTK_WINDOW (toplevel));
/* Chain up to the parent class */
GTK_WIDGET_CLASS (parent_class)->realize (w);
diff --git a/src/ui/gui/val-labs-dialog.c b/src/ui/gui/val-labs-dialog.c
index bd2cf0b..6126afc 100644
--- a/src/ui/gui/val-labs-dialog.c
+++ b/src/ui/gui/val-labs-dialog.c
@@ -38,9 +38,6 @@ struct val_labs_dialog
{
GtkWidget *window;
- PsppireVarStore *var_store;
- PsppireDict *dict;
-
/* The variable to be updated */
struct variable *pv;
@@ -385,7 +382,7 @@ on_select_row (GtkTreeView *treeview, gpointer data)
/* Create a new dialog box
(there should normally be only one)*/
struct val_labs_dialog *
-val_labs_dialog_create (GtkWindow *toplevel, PsppireVarStore *var_store)
+val_labs_dialog_create (GtkWindow *toplevel)
{
GtkTreeViewColumn *column;
@@ -395,8 +392,6 @@ val_labs_dialog_create (GtkWindow *toplevel,
PsppireVarStore *var_store)
struct val_labs_dialog *dialog = g_malloc (sizeof (*dialog));
- dialog->var_store = var_store;
- g_object_get (var_store, "dictionary", &dialog->dict, NULL);
dialog->window = get_widget_assert (xml,"val_labs_dialog");
dialog->value_entry = get_widget_assert (xml,"value_entry");
dialog->label_entry = get_widget_assert (xml,"label_entry");
diff --git a/src/ui/gui/val-labs-dialog.h b/src/ui/gui/val-labs-dialog.h
index 745e0a0..85feaac 100644
--- a/src/ui/gui/val-labs-dialog.h
+++ b/src/ui/gui/val-labs-dialog.h
@@ -1,5 +1,5 @@
/* PSPPIRE - a graphical user interface for PSPP.
- Copyright (C) 2005 Free Software Foundation
+ Copyright (C) 2005, 2011 Free Software Foundation
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -30,7 +30,7 @@
struct val_labs;
-struct val_labs_dialog * val_labs_dialog_create (GtkWindow *, PsppireVarStore
*);
+struct val_labs_dialog * val_labs_dialog_create (GtkWindow *);
void val_labs_dialog_show (struct val_labs_dialog *);
diff --git a/src/ui/gui/var-type-dialog.c b/src/ui/gui/var-type-dialog.c
index 0f12c46..a4c2a22 100644
--- a/src/ui/gui/var-type-dialog.c
+++ b/src/ui/gui/var-type-dialog.c
@@ -317,15 +317,13 @@ set_format_type_from_treeview (GtkTreeView *treeview,
gpointer data)
/* Create the structure */
struct var_type_dialog *
-var_type_dialog_create (GtkWindow *toplevel, PsppireVarStore *vs)
+var_type_dialog_create (GtkWindow *toplevel)
{
gint i;
struct var_type_dialog *dialog = g_malloc (sizeof (struct var_type_dialog));
GtkBuilder *xml = builder_new ("var-sheet-dialogs.ui");
- dialog->vs = vs;
-
dialog->window = get_widget_assert (xml,"var_type_dialog");
dialog->active_button = -1;
diff --git a/src/ui/gui/var-type-dialog.h b/src/ui/gui/var-type-dialog.h
index 4bb681a..e194771 100644
--- a/src/ui/gui/var-type-dialog.h
+++ b/src/ui/gui/var-type-dialog.h
@@ -1,5 +1,5 @@
/* PSPPIRE - a graphical user interface for PSPP.
- Copyright (C) 2005 Free Software Foundation
+ Copyright (C) 2005, 2011 Free Software Foundation
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -47,10 +47,6 @@ struct var_type_dialog
/* Variable to be updated */
struct variable *pv;
- /* The variable store to which this dialog relates */
- PsppireVarStore *vs;
-
-
/* Local copy of format specifier */
struct fmt_spec fmt_l;
@@ -88,7 +84,7 @@ struct var_type_dialog
};
-struct var_type_dialog * var_type_dialog_create (GtkWindow *, PsppireVarStore
*vs);
+struct var_type_dialog * var_type_dialog_create (GtkWindow *);
void var_type_dialog_show (struct var_type_dialog *dialog);
--
1.7.2.5
- [sheet prep 0/6] preparatory commits for sheet rewrite, Ben Pfaff, 2011/06/22
- [sheet prep 1/6] gui: Drop 'dict' parameter from text_to_value()., Ben Pfaff, 2011/06/22
- [sheet prep 6/6] gui: Move some formatting functions into PSPP core., Ben Pfaff, 2011/06/22
- [sheet prep 4/6] gui: Eliminate some dependencies on the dictionary.,
Ben Pfaff <=
- [sheet prep 2/6] gui: Consistently use print format instead of write format., Ben Pfaff, 2011/06/22
- [sheet prep 3/6] gui: Simplify value_to_text() parameters., Ben Pfaff, 2011/06/23
- [sheet prep 5/6] gui: Strip numerics and strings differently in value_to_text()., Ben Pfaff, 2011/06/23
- Re: [sheet prep 0/6] preparatory commits for sheet rewrite, John Darrington, 2011/06/23