PsppireDictView: Change "dictionary" property to "model".
authorJohn Darrington <john@darrington.wattle.id.au>
Mon, 16 Nov 2009 18:29:25 +0000 (19:29 +0100)
committerJohn Darrington <john@darrington.wattle.id.au>
Mon, 16 Nov 2009 18:29:25 +0000 (19:29 +0100)
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.

23 files changed:
src/ui/gui/compute-dialog.c
src/ui/gui/crosstabs-dialog.c
src/ui/gui/descriptives-dialog.c
src/ui/gui/examine-dialog.c
src/ui/gui/find-dialog.c
src/ui/gui/frequencies-dialog.c
src/ui/gui/oneway-anova-dialog.c
src/ui/gui/psppire-dictview.c
src/ui/gui/psppire-selector.c
src/ui/gui/rank-dialog.c
src/ui/gui/recode-dialog.c
src/ui/gui/regression-dialog.c
src/ui/gui/reliability-dialog.c
src/ui/gui/select-cases-dialog.c
src/ui/gui/sort-cases-dialog.c
src/ui/gui/split-file-dialog.c
src/ui/gui/t-test-independent-samples-dialog.c
src/ui/gui/t-test-one-sample.c
src/ui/gui/t-test-paired-samples.c
src/ui/gui/transpose-dialog.c
src/ui/gui/val-labs-dialog.c
src/ui/gui/variable-info-dialog.c
src/ui/gui/weight-cases-dialog.c

index 34f686162b44db3e94edbf08c826a0c10ea42bb4..bac6216729350cd040ab447a4191e09b6f49e168 100644 (file)
@@ -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);
 
index 1fa3bff21a3c50dccf791daaa2ffd468c209dc93..791eea2563871ec7768e5356d8b619632fd7c6b8 100644 (file)
@@ -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);
index 1b49d92130839f9db49f0d3cc8d57390043bd1b7..5af2e71ab4d1ae1239495fdb2aeae923587afc85 100644 (file)
@@ -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);
index 85505f72bbb349c607a50721f900cfd658b00a2f..79ba48e9b45bc05edbbf604f3b48919c2fed804d 100644 (file)
@@ -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);
 
index 608a4d187cf8e5ce653674ad8e2be941538541bc..39b12bb51c163b9e10b756eee22f64765d46b50d 100644 (file)
@@ -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);
 
index 2f74e9d2636f03daca2627c0c414eafcb18b85b6..0ec5a73f9915bfd2ba58520b04281fce6b29a860 100644 (file)
@@ -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);
index ea390c334275f797b4069fd793b994d02b3827fa..3234c32325b544140676080aa1ab94802e6fb14a 100644 (file)
@@ -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);
 
index f1a168de9f39081dc4110f03a9943d54bf0531e7..4c07d1fdc9a79291a34df4768fe2a505c35b2a62 100644 (file)
@@ -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;
 
index 8e0be3a3590b37015877e4b7ebb452c006f6e900..7e0ade25009dd019125f8e7cc8b4a96df4c2f967 100644 (file)
@@ -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);
 
index ec3cccfaa3afa97a8feb3e65a97d4f6f43751feb..e0d764842d57bd039e645e514d7258d7315139fe 100644 (file)
@@ -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);
 
index c3e48a882b72b7bb3966f3649ebd51241b5fb55f..e7fcc6c81f6c2ac4e6cb51df08fd756ec88e1196 100644 (file)
@@ -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 )
     {
index 87101397be361c27e37d1183a72807f82d5bc9f4..7d3420afe43c05b227c388950c0fb200b5371b29 100644 (file)
@@ -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);
index 6b8243610e25aad4f8925011836478911cc5b3f3..d087ed840db21557bd9f4d1c14ded406f1180bcf 100644 (file)
@@ -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);
 
index c46595c65ef8d12e76669d4863673c254e890402..f9d0631ea221602bee6f93258dd065ffd3a3dcdc 100644 (file)
@@ -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);
index 242b7d3c07392b8ecca08bb46cb67ad91eb26238..7db07bcdc8d35ca1cfebd517e54b4577ba3469a0 100644 (file)
@@ -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);
 
index 8ae69213c2ebb630b81c80b5f324e43fa9e02e02..57de568ac24ce855c9198fff9a2ea3af6570217a 100644 (file)
@@ -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);
 
index 03cce8d4430291930859cae982a499ed5f1ededd..6e6e678f85711c4889e253baa9d7502b820f2e4f 100644 (file)
@@ -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);
 
index 5e5f35e4c7359249c6a18941c1010e4984937f04..53f92e1d8e18bf6a25dea8c2f15f887a49fd471b 100644 (file)
@@ -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);
index 1e14dfa17767f196007057f7b18505e10bf81b75..1eee1de6584f5666e567dcb40f96e92b4fb134f2 100644 (file)
@@ -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);
 
index 1d8744d5ee3232429735ee26b89606393533ab52..83a75cba322c3b613973ab51d8ad9a19200b7702 100644 (file)
@@ -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);
 
index 14eacabfadddb5842e81f444855233b0e903ec03..549abf337f17db2741ff300922640fb370370286 100644 (file)
@@ -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");
index 11cee3e5d78a84b73d4e6ff63f5e85d9eed89cf3..cbc4d5cadb97eedc10b929e4532da9e820d7df3d 100644 (file)
@@ -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);
 
index b43d49c3f50d64c244b4ff17ee62877def5a68cf..03aea92def8045748c846bfd75626bb01e50d362 100644 (file)
@@ -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);