From: John Darrington Date: Mon, 16 Nov 2009 18:29:25 +0000 (+0100) Subject: PsppireDictView: Change "dictionary" property to "model". X-Git-Tag: sid-i386-build122~22 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?p=pspp-builds.git;a=commitdiff_plain;h=a9a69251edd625a50f271af5d64c157533b5fe48 PsppireDictView: Change "dictionary" property to "model". Previously, PsppireDictView, which derives from GtkTreeView, had a property "dictionary", and a trap on the GtkTreeView's "model" property. This change removes the trap and changes the "dictionary" property to an override of the "model" property. --- diff --git a/src/ui/gui/compute-dialog.c b/src/ui/gui/compute-dialog.c index 34f68616..bac62167 100644 --- a/src/ui/gui/compute-dialog.c +++ b/src/ui/gui/compute-dialog.c @@ -398,7 +398,7 @@ compute_dialog (GObject *o, gpointer data) gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (de)); - g_object_set (dict_view, "dictionary", scd.dict, + g_object_set (dict_view, "model", scd.dict, "selection-mode", GTK_SELECTION_SINGLE, NULL); diff --git a/src/ui/gui/crosstabs-dialog.c b/src/ui/gui/crosstabs-dialog.c index 1fa3bff2..791eea25 100644 --- a/src/ui/gui/crosstabs-dialog.c +++ b/src/ui/gui/crosstabs-dialog.c @@ -424,7 +424,7 @@ crosstabs_dialog (GObject *o, gpointer data) gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (de)); g_object_get (vs, "dictionary", &dict, NULL); - g_object_set (source, "dictionary", dict, NULL); + g_object_set (source, "model", dict, NULL); set_dest_model (GTK_TREE_VIEW (dest_rows), dict); set_dest_model (GTK_TREE_VIEW (dest_cols), dict); diff --git a/src/ui/gui/descriptives-dialog.c b/src/ui/gui/descriptives-dialog.c index 1b49d921..5af2e71a 100644 --- a/src/ui/gui/descriptives-dialog.c +++ b/src/ui/gui/descriptives-dialog.c @@ -226,7 +226,7 @@ descriptives_dialog (GObject *o, gpointer data) gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (de)); - g_object_set (source, "dictionary", dict, + g_object_set (source, "model", dict, "predicate", var_is_numeric, NULL); set_dest_model (GTK_TREE_VIEW (dest), dict); diff --git a/src/ui/gui/examine-dialog.c b/src/ui/gui/examine-dialog.c index 85505f72..79ba48e9 100644 --- a/src/ui/gui/examine-dialog.c +++ b/src/ui/gui/examine-dialog.c @@ -280,7 +280,7 @@ examine_dialog (GObject *o, gpointer data) gtk_window_set_transient_for (GTK_WINDOW (ex_d.opts_dialog), GTK_WINDOW (de)); g_object_get (vs, "dictionary", &ex_d.dict, NULL); - g_object_set (source, "dictionary", ex_d.dict, NULL); + g_object_set (source, "model", ex_d.dict, NULL); set_dest_model (GTK_TREE_VIEW (ex_d.dep_list), ex_d.dict); diff --git a/src/ui/gui/find-dialog.c b/src/ui/gui/find-dialog.c index 608a4d18..39b12bb5 100644 --- a/src/ui/gui/find-dialog.c +++ b/src/ui/gui/find-dialog.c @@ -242,7 +242,7 @@ find_dialog (GObject *o, gpointer data) gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (de)); - g_object_set (source, "dictionary", fd.dict, + g_object_set (source, "model", fd.dict, "selection-mode", GTK_SELECTION_SINGLE, NULL); diff --git a/src/ui/gui/frequencies-dialog.c b/src/ui/gui/frequencies-dialog.c index 2f74e9d2..0ec5a73f 100644 --- a/src/ui/gui/frequencies-dialog.c +++ b/src/ui/gui/frequencies-dialog.c @@ -334,7 +334,7 @@ frequencies_dialog (GObject *o, gpointer data) gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (de)); g_object_get (vs, "dictionary", &fd.dict, NULL); - g_object_set (source, "dictionary", fd.dict, NULL); + g_object_set (source, "model", fd.dict, NULL); set_dest_model (GTK_TREE_VIEW (dest), fd.dict); diff --git a/src/ui/gui/oneway-anova-dialog.c b/src/ui/gui/oneway-anova-dialog.c index ea390c33..3234c323 100644 --- a/src/ui/gui/oneway-anova-dialog.c +++ b/src/ui/gui/oneway-anova-dialog.c @@ -171,7 +171,7 @@ oneway_anova_dialog (GObject *o, gpointer data) gtk_window_set_transient_for (ow.dialog, GTK_WINDOW (de)); - g_object_set (dict_view, "dictionary", ow.dict, NULL); + g_object_set (dict_view, "model", ow.dict, NULL); set_dest_model (GTK_TREE_VIEW (ow.vars_treeview), ow.dict); diff --git a/src/ui/gui/psppire-dictview.c b/src/ui/gui/psppire-dictview.c index f1a168de..4c07d1fd 100644 --- a/src/ui/gui/psppire-dictview.c +++ b/src/ui/gui/psppire-dictview.c @@ -75,7 +75,6 @@ psppire_dict_view_finalize (GObject *object) enum { PROP_0, - PROP_MODEL, PROP_DICTIONARY, PROP_PREDICATE, PROP_SELECTION_MODE @@ -137,11 +136,6 @@ psppire_dict_view_set_property (GObject *object, case PROP_DICTIONARY: dict_view->dict = g_value_get_object (value); break; - case PROP_MODEL: - g_critical ("Don't set the \"model\" property on %s. " - "Use the \"dictionary\" property instead.", - G_OBJECT_TYPE_NAME (dict_view)); - break; case PROP_PREDICATE: dict_view->predicate = g_value_get_pointer (value); break; @@ -201,13 +195,6 @@ psppire_dict_view_class_init (PsppireDictViewClass *class) { GObjectClass *object_class = G_OBJECT_CLASS (class); - GParamSpec *dictionary_spec = - g_param_spec_object ("dictionary", - "Dictionary", - _("The dictionary to be displayed by this widget"), - PSPPIRE_TYPE_DICT, - G_PARAM_READABLE | G_PARAM_WRITABLE); - GParamSpec *predicate_spec = g_param_spec_pointer ("predicate", "Predicate", @@ -223,23 +210,12 @@ psppire_dict_view_class_init (PsppireDictViewClass *class) GTK_SELECTION_MULTIPLE, G_PARAM_CONSTRUCT | G_PARAM_READABLE | G_PARAM_WRITABLE); - - GParamSpec *dummy_spec = - g_param_spec_pointer ("model", - "Model", - "Don't set the property", - G_PARAM_WRITABLE); - object_class->set_property = psppire_dict_view_set_property; object_class->get_property = psppire_dict_view_get_property; - g_object_class_install_property (object_class, - PROP_MODEL, - dummy_spec); - - g_object_class_install_property (object_class, - PROP_DICTIONARY, - dictionary_spec); + g_object_class_override_property (object_class, + PROP_DICTIONARY, + "model"); g_object_class_install_property (object_class, PROP_PREDICATE, @@ -271,8 +247,7 @@ psppire_dict_view_base_finalize (PsppireDictViewClass *class, static void dv_get_base_model (GtkTreeModel *top_model, GtkTreeIter *top_iter, - GtkTreeModel **model, GtkTreeIter *iter - ) + GtkTreeModel **model, GtkTreeIter *iter) { *model = top_model; diff --git a/src/ui/gui/psppire-selector.c b/src/ui/gui/psppire-selector.c index 8e0be3a3..7e0ade25 100644 --- a/src/ui/gui/psppire-selector.c +++ b/src/ui/gui/psppire-selector.c @@ -866,9 +866,6 @@ update_subjects (PsppireSelector *selector) if ( NULL == selector->source ) return; - g_signal_connect_swapped (selector->source, "notify::dictionary", - G_CALLBACK (update_subjects), selector); - g_signal_connect_swapped (selector->source, "notify::model", G_CALLBACK (update_subjects), selector); diff --git a/src/ui/gui/rank-dialog.c b/src/ui/gui/rank-dialog.c index ec3cccfa..e0d76484 100644 --- a/src/ui/gui/rank-dialog.c +++ b/src/ui/gui/rank-dialog.c @@ -306,7 +306,7 @@ rank_dialog (GObject *o, gpointer data) gtk_window_set_transient_for (GTK_WINDOW (rd.dialog), GTK_WINDOW (de)); - g_object_set (vars, "dictionary", rd.dict, NULL); + g_object_set (vars, "model", rd.dict, NULL); set_dest_model (GTK_TREE_VIEW (rd.rank_vars), rd.dict); diff --git a/src/ui/gui/recode-dialog.c b/src/ui/gui/recode-dialog.c index c3e48a88..e7fcc6c8 100644 --- a/src/ui/gui/recode-dialog.c +++ b/src/ui/gui/recode-dialog.c @@ -888,7 +888,7 @@ recode_dialog (PsppireDataWindow *de, gboolean diff) gtk_window_set_transient_for (GTK_WINDOW (rd.dialog), GTK_WINDOW (de)); - g_object_set (rd.dict_treeview, "dictionary", rd.dict, NULL); + g_object_set (rd.dict_treeview, "model", rd.dict, NULL); if ( ! rd.different ) { diff --git a/src/ui/gui/regression-dialog.c b/src/ui/gui/regression-dialog.c index 87101397..7d3420af 100644 --- a/src/ui/gui/regression-dialog.c +++ b/src/ui/gui/regression-dialog.c @@ -254,7 +254,7 @@ regression_dialog (GObject *o, gpointer data) gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (de)); g_object_get (vs, "dictionary", &rd.dict, NULL); - g_object_set (source, "dictionary", rd.dict, NULL); + g_object_set (source, "model", rd.dict, NULL); set_dest_model (GTK_TREE_VIEW (dest_dep), rd.dict); set_dest_model (GTK_TREE_VIEW (dest_indep), rd.dict); diff --git a/src/ui/gui/reliability-dialog.c b/src/ui/gui/reliability-dialog.c index 6b824361..d087ed84 100644 --- a/src/ui/gui/reliability-dialog.c +++ b/src/ui/gui/reliability-dialog.c @@ -138,7 +138,7 @@ reliability_dialog (GObject *o, gpointer data) gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (de)); g_object_get (vs, "dictionary", &rd.dict, NULL); - g_object_set (source, "dictionary", rd.dict, NULL); + g_object_set (source, "model", rd.dict, NULL); set_dest_model (GTK_TREE_VIEW (rd.variables), rd.dict); diff --git a/src/ui/gui/select-cases-dialog.c b/src/ui/gui/select-cases-dialog.c index c46595c6..f9d0631e 100644 --- a/src/ui/gui/select-cases-dialog.c +++ b/src/ui/gui/select-cases-dialog.c @@ -326,7 +326,7 @@ select_cases_dialog (GObject *o, gpointer data) { GtkWidget *source = get_widget_assert (scd.xml, "select-cases-treeview"); - g_object_set (source, "dictionary", + g_object_set (source, "model", scd.data_store->dict, "selection-mode", GTK_SELECTION_SINGLE, NULL); diff --git a/src/ui/gui/sort-cases-dialog.c b/src/ui/gui/sort-cases-dialog.c index 242b7d3c..7db07bcd 100644 --- a/src/ui/gui/sort-cases-dialog.c +++ b/src/ui/gui/sort-cases-dialog.c @@ -112,7 +112,7 @@ sort_cases_dialog (GObject *o, gpointer data) gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (de)); g_object_get (vs, "dictionary", &scd.dict, NULL); - g_object_set (source, "dictionary", scd.dict, NULL); + g_object_set (source, "model", scd.dict, NULL); set_dest_model (GTK_TREE_VIEW (dest), scd.dict); diff --git a/src/ui/gui/split-file-dialog.c b/src/ui/gui/split-file-dialog.c index 8ae69213..57de568a 100644 --- a/src/ui/gui/split-file-dialog.c +++ b/src/ui/gui/split-file-dialog.c @@ -191,7 +191,7 @@ split_file_dialog (GObject *o, gpointer data) sfd.selector = PSPPIRE_SELECTOR ( get_widget_assert (sfd.xml, "split-file-selector")); - g_object_set (source, "dictionary", sfd.dict, NULL); + g_object_set (source, "model", sfd.dict, NULL); g_signal_connect (on_off, "toggled", G_CALLBACK(on_off_toggled), sfd.xml); diff --git a/src/ui/gui/t-test-independent-samples-dialog.c b/src/ui/gui/t-test-independent-samples-dialog.c index 03cce8d4..6e6e678f 100644 --- a/src/ui/gui/t-test-independent-samples-dialog.c +++ b/src/ui/gui/t-test-independent-samples-dialog.c @@ -426,7 +426,7 @@ t_test_independent_samples_dialog (GObject *o, gpointer data) gtk_window_set_transient_for (GTK_WINDOW (tt_d.dialog), GTK_WINDOW (de)); - g_object_set (dict_view, "dictionary", tt_d.dict, NULL); + g_object_set (dict_view, "model", tt_d.dict, NULL); set_dest_model (GTK_TREE_VIEW (test_variables_treeview), tt_d.dict); diff --git a/src/ui/gui/t-test-one-sample.c b/src/ui/gui/t-test-one-sample.c index 5e5f35e4..53f92e1d 100644 --- a/src/ui/gui/t-test-one-sample.c +++ b/src/ui/gui/t-test-one-sample.c @@ -148,7 +148,7 @@ t_test_one_sample_dialog (GObject *o, gpointer data) gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (de)); - g_object_set (dict_view, "dictionary", + g_object_set (dict_view, "model", tt_d.dict, "predicate", var_is_numeric, NULL); diff --git a/src/ui/gui/t-test-paired-samples.c b/src/ui/gui/t-test-paired-samples.c index 1e14dfa1..1eee1de6 100644 --- a/src/ui/gui/t-test-paired-samples.c +++ b/src/ui/gui/t-test-paired-samples.c @@ -207,7 +207,7 @@ t_test_paired_samples_dialog (GObject *o, gpointer data) gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (de)); - g_object_set (dict_view, "dictionary", tt_d.dict, + g_object_set (dict_view, "model", tt_d.dict, "predicate", var_is_numeric, NULL); diff --git a/src/ui/gui/transpose-dialog.c b/src/ui/gui/transpose-dialog.c index 1d8744d5..83a75cba 100644 --- a/src/ui/gui/transpose-dialog.c +++ b/src/ui/gui/transpose-dialog.c @@ -95,7 +95,7 @@ transpose_dialog (GObject *o, gpointer data) g_object_get (de->data_editor, "var-store", &vs, NULL); g_object_get (vs, "dictionary", &dict, NULL); - g_object_set (source, "dictionary", dict, NULL); + g_object_set (source, "model", dict, NULL); set_dest_model (GTK_TREE_VIEW (dest), dict); diff --git a/src/ui/gui/val-labs-dialog.c b/src/ui/gui/val-labs-dialog.c index 14eacabf..549abf33 100644 --- a/src/ui/gui/val-labs-dialog.c +++ b/src/ui/gui/val-labs-dialog.c @@ -392,7 +392,7 @@ 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); + g_object_get (var_store, "model", &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/variable-info-dialog.c b/src/ui/gui/variable-info-dialog.c index 11cee3e5..cbc4d5ca 100644 --- a/src/ui/gui/variable-info-dialog.c +++ b/src/ui/gui/variable-info-dialog.c @@ -65,7 +65,7 @@ populate_text (PsppireDictView *treeview, gpointer data) if ( var == NULL) return; - g_object_get (treeview, "dictionary", &dict, + g_object_get (treeview, "model", &dict, NULL); gstring = g_string_sized_new (200); @@ -165,7 +165,7 @@ variable_info_dialog (GObject *o, gpointer data) gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (de)); g_object_get (vs, "dictionary", &dict, NULL); - g_object_set (treeview, "dictionary", dict, + g_object_set (treeview, "model", dict, "selection-mode", GTK_SELECTION_SINGLE, NULL); diff --git a/src/ui/gui/weight-cases-dialog.c b/src/ui/gui/weight-cases-dialog.c index b43d49c3..03aea92d 100644 --- a/src/ui/gui/weight-cases-dialog.c +++ b/src/ui/gui/weight-cases-dialog.c @@ -132,7 +132,7 @@ weight_cases_dialog (GObject *o, gpointer data) radiobutton1); - g_object_set (source, "dictionary", wcd.dict, + g_object_set (source, "model", wcd.dict, "selection-mode", GTK_SELECTION_SINGLE, "predicate", var_is_numeric, NULL);