From: Ben Pfaff Date: Sat, 11 Jun 2011 17:40:43 +0000 (-0700) Subject: gui: Eliminate some dependencies on the dictionary. X-Git-Tag: v0.7.9~269 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4994c34bb5a7d1da401b7b9552a91c9ccfd42566;p=pspp-builds.git gui: Eliminate some dependencies on the dictionary. 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. --- diff --git a/src/ui/gui/missing-val-dialog.h b/src/ui/gui/missing-val-dialog.h index 82acf975..2322b840 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 bf0c0126..dcec70bd 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 bd2cf0b3..6126afc1 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 745e0a0a..85feaaca 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 0f12c464..a4c2a227 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 4bb681aa..e1947716 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);