psppire-dictview: Generalize psppire_dict_view_get_var_measurement_stock_id().
[pspp] / src / ui / gui / psppire-dialog-action-examine.c
index 904beec1e810b2abc416bb483a7461c6a7ee39ef..7698adfe6be32d50bdbc6cc3864098a431bff579 100644 (file)
@@ -20,6 +20,8 @@
 #include "psppire-dialog-action-examine.h"
 
 #include "psppire-var-view.h"
+#include "dialog-common.h"
+#include "psppire-selector.h"
 #include "psppire-dict.h"
 #include "psppire-dialog.h"
 #include "builder-wrapper.h"
@@ -206,6 +208,8 @@ psppire_dialog_action_examine_activate (GtkAction *a)
   GtkWidget *stats_button = get_widget_assert (xml, "stats-button");
   GtkWidget *opts_button = get_widget_assert (xml, "opts-button");
 
+  GtkWidget *dep_sel = get_widget_assert (xml, "psppire-selector1");
+
   pda->dialog    = get_widget_assert   (xml, "examine-dialog");
   pda->source    = get_widget_assert   (xml, "treeview1");
   act->variables = get_widget_assert   (xml, "treeview2");
@@ -224,9 +228,10 @@ psppire_dialog_action_examine_activate (GtkAction *a)
 
   g_object_set (pda->source,
                "model", pda->dict,
-               "predicate", var_is_numeric,
                NULL);
 
+  psppire_selector_set_allow (PSPPIRE_SELECTOR (dep_sel), numeric_only);
+
   psppire_dialog_action_set_valid_predicate (pda, (void *) dialog_state_valid);
   psppire_dialog_action_set_refresh (pda, dialog_refresh);
 
@@ -237,6 +242,8 @@ psppire_dialog_action_examine_activate (GtkAction *a)
                            G_CALLBACK (run_opts_dialog), act);
 
   PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_examine_parent_class)->activate (pda);
+  
+  g_object_unref (xml);
 }
 
 static void