projects
/
pspp-builds.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
44c2b03
)
Fix bug in value labels dialog box
author
John Darrington
<john@darrington.wattle.id.au>
Tue, 7 Jul 2009 04:52:45 +0000
(12:52 +0800)
committer
John Darrington
<john@darrington.wattle.id.au>
Tue, 7 Jul 2009 04:52:45 +0000
(12:52 +0800)
src/ui/gui/helper.c
patch
|
blob
|
history
src/ui/gui/helper.h
patch
|
blob
|
history
src/ui/gui/missing-val-dialog.h
patch
|
blob
|
history
src/ui/gui/psppire-var-sheet.c
patch
|
blob
|
history
src/ui/gui/val-labs-dialog.c
patch
|
blob
|
history
src/ui/gui/val-labs-dialog.h
patch
|
blob
|
history
diff --git
a/src/ui/gui/helper.c
b/src/ui/gui/helper.c
index 31633de9fff3ae8ded4105b44cab4d3d682f41cd..b4b3872df3abecf00de49e2e36979a333cb7e2f1 100644
(file)
--- a/
src/ui/gui/helper.c
+++ b/
src/ui/gui/helper.c
@@
-49,11
+49,11
@@
/* Formats a value according to FORMAT
The returned string must be freed when no longer required */
gchar *
/* Formats a value according to FORMAT
The returned string must be freed when no longer required */
gchar *
-value_to_text (union value v,
const struct dictionary
*dict, struct fmt_spec format)
+value_to_text (union value v,
PsppireDict
*dict, struct fmt_spec format)
{
gchar *s = 0;
{
gchar *s = 0;
- s = data_out (&v, dict_get_encoding (dict), &format);
+ s = data_out (&v, dict_get_encoding (dict
->dict
), &format);
g_strchug (s);
return s;
g_strchug (s);
return s;
diff --git
a/src/ui/gui/helper.h
b/src/ui/gui/helper.h
index 0cd1f5557eebec051223756312e2fe314bd01d3c..6706df20701e39bd9705ffbe17c6579e2c587966 100644
(file)
--- a/
src/ui/gui/helper.h
+++ b/
src/ui/gui/helper.h
@@
-25,16
+25,16
@@
#include <gtk/gtk.h>
#include <gtk/gtk.h>
-
+#include "psppire-dict.h"
void paste_syntax_in_new_window (const gchar *syntax);
struct fmt_spec;
void paste_syntax_in_new_window (const gchar *syntax);
struct fmt_spec;
-struct dictionary;
+
/* Formats a value according to FORMAT
The returned string must be freed when no longer required */
/* Formats a value according to FORMAT
The returned string must be freed when no longer required */
-gchar * value_to_text (union value v,
const struct dictionary
*dict, struct fmt_spec format);
+gchar * value_to_text (union value v,
PsppireDict
*dict, struct fmt_spec format);
gboolean text_to_value (const gchar *text, union value *v,
gboolean text_to_value (const gchar *text, union value *v,
diff --git
a/src/ui/gui/missing-val-dialog.h
b/src/ui/gui/missing-val-dialog.h
index bbf36f26bf2d8de811f759441eaa2c1f3d3117d6..82acf9757f0738eea85ec186a9a51047c18ebad3 100644
(file)
--- a/
src/ui/gui/missing-val-dialog.h
+++ b/
src/ui/gui/missing-val-dialog.h
@@
-33,7
+33,7
@@
struct missing_val_dialog
struct variable *pv;
/* The dictionary to which that value belongs */
struct variable *pv;
/* The dictionary to which that value belongs */
-
const struct dictionary
*dict;
+
PsppireDict
*dict;
/* local copy */
struct missing_values mvl;
/* 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 c0d0059bd7b0a371fd51ba33aa47b30a44d1a95f..dfd62bb6737f1dbc78a605a6aaf62e2e7189a757 100644
(file)
--- a/
src/ui/gui/psppire-var-sheet.c
+++ b/
src/ui/gui/psppire-var-sheet.c
@@
-384,7
+384,7
@@
var_sheet_change_active_cell (PsppireVarSheet *vs,
vs->missing_val_dialog->pv =
psppire_var_store_get_var (var_store, row);
vs->missing_val_dialog->pv =
psppire_var_store_get_var (var_store, row);
- vs->missing_val_dialog->dict = var_store->dict
->dict
;
+ vs->missing_val_dialog->dict = var_store->dict;
g_signal_connect_swapped (customEntry,
"clicked",
g_signal_connect_swapped (customEntry,
"clicked",
@@
-481,7
+481,8
@@
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),
GtkWidget *toplevel = gtk_widget_get_toplevel (GTK_WIDGET (vs));
vs->val_labs_dialog = val_labs_dialog_create (GTK_WINDOW (toplevel),
- PSPPIRE_SHEET (vs));
+ PSPPIRE_VAR_STORE (psppire_sheet_get_model (PSPPIRE_SHEET (vs))));
+
vs->missing_val_dialog = missing_val_dialog_create (GTK_WINDOW (toplevel));
vs->var_type_dialog = var_type_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));
diff --git
a/src/ui/gui/val-labs-dialog.c
b/src/ui/gui/val-labs-dialog.c
index 04f9534d55dd9f45f8163b07678ba065c977767b..92a7fe8e0c77c7a5096e46c23cd6e45b4a2b4088 100644
(file)
--- a/
src/ui/gui/val-labs-dialog.c
+++ b/
src/ui/gui/val-labs-dialog.c
@@
-34,7
+34,7
@@
struct val_labs_dialog
{
GtkWidget *window;
{
GtkWidget *window;
- Psppire
Sheet *vs
;
+ Psppire
VarStore *var_store
;
/* The variable to be updated */
struct variable *pv;
/* The variable to be updated */
struct variable *pv;
@@
-345,7
+345,7
@@
on_select_row (GtkTreeView *treeview, gpointer data)
gchar *text;
get_selected_tuple (dialog, &value, &label);
gchar *text;
get_selected_tuple (dialog, &value, &label);
- text = value_to_text (value,
NULL
, *var_get_write_format (dialog->pv));
+ text = value_to_text (value,
dialog->var_store->dict
, *var_get_write_format (dialog->pv));
g_signal_handler_block (GTK_ENTRY (dialog->value_entry),
dialog->value_handler_id);
g_signal_handler_block (GTK_ENTRY (dialog->value_entry),
dialog->value_handler_id);
@@
-374,7
+374,7
@@
on_select_row (GtkTreeView *treeview, gpointer data)
/* Create a new dialog box
(there should normally be only one)*/
struct val_labs_dialog *
/* Create a new dialog box
(there should normally be only one)*/
struct val_labs_dialog *
-val_labs_dialog_create (GtkWindow *toplevel, Psppire
Sheet *sheet
)
+val_labs_dialog_create (GtkWindow *toplevel, Psppire
VarStore *var_store
)
{
GtkTreeViewColumn *column;
{
GtkTreeViewColumn *column;
@@
-384,10
+384,10
@@
val_labs_dialog_create (GtkWindow *toplevel, PsppireSheet *sheet)
struct val_labs_dialog *dialog = g_malloc (sizeof (*dialog));
struct val_labs_dialog *dialog = g_malloc (sizeof (*dialog));
+ dialog->var_store = var_store;
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");
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");
- dialog->vs = sheet;
gtk_window_set_transient_for
(GTK_WINDOW (dialog->window), toplevel);
gtk_window_set_transient_for
(GTK_WINDOW (dialog->window), toplevel);
@@
-497,7
+497,7
@@
repopulate_dialog (struct val_labs_dialog *dialog)
const struct val_lab *vl = labels[i];
gchar *const vstr =
const struct val_lab *vl = labels[i];
gchar *const vstr =
- value_to_text (vl->value,
NULL
,
+ value_to_text (vl->value,
dialog->var_store->dict
,
*var_get_write_format (dialog->pv));
gchar *const text = g_strdup_printf ("%s = \"%s\"",
*var_get_write_format (dialog->pv));
gchar *const text = g_strdup_printf ("%s = \"%s\"",
diff --git
a/src/ui/gui/val-labs-dialog.h
b/src/ui/gui/val-labs-dialog.h
index 3a09f1ca410e0f2f6b775741d9e62dde48e4aae7..745e0a0ae5f795b2786a078d9e435ca633ad242c 100644
(file)
--- a/
src/ui/gui/val-labs-dialog.h
+++ b/
src/ui/gui/val-labs-dialog.h
@@
-24,13
+24,13
@@
#include <gtk/gtk.h>
#include <data/variable.h>
#include <gtk/gtk.h>
#include <data/variable.h>
-#include <gtk-contrib/psppire-sheet.h>
-
+
//
#include <gtk-contrib/psppire-sheet.h>
+#include "psppire-var-store.h"
struct val_labs;
struct val_labs;
-struct val_labs_dialog * val_labs_dialog_create (GtkWindow *, Psppire
Sheet
*);
+struct val_labs_dialog * val_labs_dialog_create (GtkWindow *, Psppire
VarStore
*);
void val_labs_dialog_show (struct val_labs_dialog *);
void val_labs_dialog_show (struct val_labs_dialog *);