Examine dialog: Allow only numeric variables to be selected as the dependent variable
authorJohn Darrington <john@darrington.wattle.id.au>
Mon, 9 Apr 2012 19:50:20 +0000 (21:50 +0200)
committerJohn Darrington <john@darrington.wattle.id.au>
Tue, 10 Apr 2012 18:59:57 +0000 (20:59 +0200)
src/ui/gui/psppire-dialog-action-examine.c

index 5ecec171b9ac45760d910c8a80b995c14f3764d2..c5c8bd85dd42e76c391888f60a3c62fbba23591f 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");
@@ -226,6 +230,8 @@ psppire_dialog_action_examine_activate (GtkAction *a)
                "model", pda->dict,
                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);