--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.18.3 -->
+<interface>
+ <requires lib="gtk+" version="3.4.2"/>
+ <requires lib="psppire" version="2054.17080"/>
+ <object class="GtkAdjustment" id="lower-limit-adjustment">
+ <property name="page-size">0</property>
+ <property name="step_increment">1</property>
+ </object>
+
+ <object class="GtkAdjustment" id="upper-limit-adjustment">
+ <property name="page-size">0</property>
+ <property name="step_increment">1</property>
+ </object>
+
+ <object class="PsppireDialog" id="define-groups-dialog">
+ <property name="can_focus">False</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="title" translatable="yes">Define Groups</property>
+ <property name="modal">True</property>
+ <child>
+ <object class="GtkBox" id="dialog-hbox2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="margin_left">5</property>
+ <property name="margin_right">5</property>
+ <property name="margin_top">5</property>
+ <property name="margin_bottom">5</property>
+ <property name="spacing">2</property>
+ <child>
+ <object class="GtkGrid" id="table2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="row_spacing">5</property>
+ <property name="column_spacing">5</property>
+ <property name="row_homogeneous">True</property>
+ <child>
+ <object class="GtkLabel" id="label2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="label" translatable="yes">_Upper limit:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">upper-limit-entry</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="dglabel1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="label" translatable="yes">_Lower limit:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">lower-limit-entry</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="PsppireValueEntry" id="upper-limit-entry">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="hexpand">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="PsppireValueEntry" id="lower-limit-entry">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+
+
+
+ <child>
+ <object class="PsppireButtonbox" id="psppire-vbuttonbox1">
+ <property name="orientation">vertical</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="border_width">5</property>
+ <property name="orientation">vertical</property>
+ <property name="buttons">PSPPIRE_BUTTON_CONTINUE_MASK | PSPPIRE_BUTTON_CANCEL_MASK | PSPPIRE_BUTTON_HELP_MASK</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="pack_type">end</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ <object class="PsppireDialog" id="k-independent-dialog">
+ <property name="can_focus">False</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="title" translatable="yes">Tests for Several Independent Samples</property>
+ <property name="modal">True</property>
+ <child>
+ <object class="GtkBox" id="dialog-hbox15">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="spacing">2</property>
+ <child>
+ <object class="GtkGrid" id="table4">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="margin_start">5</property>
+ <property name="margin_top">5</property>
+ <property name="margin_bottom">5</property>
+ <child>
+ <object class="GtkBox" id="vbox30">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkLabel" id="label36">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">_Grouping Variable:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">k-independent-entry</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="k-independent-entry">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="invisible_char">●</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="top_attach">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="vbox29">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkLabel" id="label35">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Test _Variable List:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">k-independent-treeview2</property>
+ <property name="track_visited_links">False</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkScrolledWindow" id="scrolledwindow15">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="shadow_type">etched-in</property>
+ <child>
+ <object class="PsppireVarView" id="k-independent-treeview2">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="border_width">0</property>
+ <property name="headers_visible">False</property>
+ <property name="headers_clickable">False</property>
+ <child internal-child="selection">
+ <object class="GtkTreeSelection" id="psppire-var-view-selection1"/>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="PsppireSelector" id="k-independent-selector2">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="border_width">5</property>
+ <property name="source_widget">k-independent-treeview1</property>
+ <property name="dest_widget">k-independent-entry</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="PsppireSelector" id="k-independent-selector1">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="valign">center</property>
+ <property name="border_width">5</property>
+ <property name="source_widget">k-independent-treeview1</property>
+ <property name="dest_widget">k-independent-treeview2</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkScrolledWindow" id="scrolledwindow2">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="hscrollbar_policy">never</property>
+ <property name="shadow_type">etched-in</property>
+ <child>
+ <object class="PsppireDictView" id="k-independent-treeview1">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="border_width">0</property>
+ <property name="headers_visible">False</property>
+ <property name="headers_clickable">False</property>
+ <child internal-child="selection">
+ <object class="GtkTreeSelection" id="psppire-dictview-selection1"/>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ <property name="height">4</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButtonBox" id="vbuttonbox11">
+ <property name="orientation">vertical</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="margin_top">5</property>
+ <property name="margin_bottom">5</property>
+ <property name="layout_style">center</property>
+ <child>
+ <object class="GtkButton" id="define-groups-button">
+ <property name="label" translatable="yes">_Define Groups</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="use_underline">True</property>
+ <property name="xalign">0.5</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="hbox2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="valign">center</property>
+ <property name="hexpand">True</property>
+ <property name="spacing">5</property>
+ <child>
+ <object class="GtkFrame" id="frame2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="hexpand">True</property>
+ <property name="label_xalign">0</property>
+ <child>
+ <object class="GtkButtonBox" id="vbuttonbox1">
+ <property name="orientation">vertical</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="margin_start">12</property>
+ <child>
+ <object class="GtkCheckButton" id="kruskal-wallis">
+ <property name="label" translatable="yes">_Kruskal-Wallis H</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="use_underline">True</property>
+ <property name="xalign">0.5</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="median">
+ <property name="label" translatable="yes">_Median</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="use_underline">True</property>
+ <property name="xalign">0.5</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="label" translatable="yes">Test Type</property>
+ <property name="use_markup">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="top_attach">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEventBox" id="eventbox1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">2</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="PsppireButtonbox" id="psppire-vbuttonbox2">
+ <property name="orientation">vertical</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="border_width">5</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="pack_type">end</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+</interface>
--- /dev/null
+/* PSPPIRE - a graphical user interface for PSPP.
+ Copyright (C) 2017 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
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+
+#include <config.h>
+
+#include "psppire-dialog-action-k-independent.h"
+
+#include "psppire-var-view.h"
+#include "psppire-value-entry.h"
+#include "psppire-acr.h"
+
+#include "psppire-dialog.h"
+#include "builder-wrapper.h"
+#include "helper.h"
+
+
+#include "gettext.h"
+#define _(msgid) gettext (msgid)
+#define N_(msgid) msgid
+
+
+
+static void psppire_dialog_action_k_independent_init (PsppireDialogActionKIndependent *act);
+static void psppire_dialog_action_k_independent_class_init (PsppireDialogActionKIndependentClass *class);
+
+G_DEFINE_TYPE (PsppireDialogActionKIndependent, psppire_dialog_action_k_independent, PSPPIRE_TYPE_DIALOG_ACTION);
+
+const static char *keyword[n_KIDS] =
+ {
+ "KRUSKAL-WALLIS",
+ "MEDIAN"
+ };
+
+static char *
+generate_syntax (const PsppireDialogAction *act)
+{
+ gchar *text;
+ PsppireDialogActionKIndependent *kid = PSPPIRE_DIALOG_ACTION_K_INDEPENDENT (act);
+
+ GString *string = g_string_new ("NPAR TEST");
+ int i;
+ for (i = 0; i < n_KIDS; ++i)
+ {
+ g_string_append (string, "\n\t");
+
+ if ( gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (kid->checkbutton[i])))
+ {
+ g_string_append_printf (string, "/%s = ", keyword[i]);
+ psppire_var_view_append_names (PSPPIRE_VAR_VIEW (kid->vars_treeview),
+ 0, string);
+
+ g_string_append (string, " BY ");
+
+ g_string_append (string,
+ gtk_entry_get_text (GTK_ENTRY (kid->groupvar_entry)));
+
+
+ g_string_append_printf (string, " (%g, %g)",
+ kid->lower_limit_value.f,
+ kid->upper_limit_value.f);
+ }
+ }
+
+ g_string_append (string, ".\n");
+
+ text = string->str;
+
+ g_string_free (string, FALSE);
+
+ return text;
+}
+
+
+static gboolean
+dialog_state_valid (gpointer data)
+{
+ PsppireDialogActionKIndependent *kid = PSPPIRE_DIALOG_ACTION_K_INDEPENDENT (data);
+
+ GtkTreeModel *vars =
+ gtk_tree_view_get_model (GTK_TREE_VIEW (kid->vars_treeview));
+
+ GtkTreeIter notused;
+
+ if ( !gtk_tree_model_get_iter_first (vars, ¬used) )
+ return FALSE;
+
+ if ( 0 == strcmp ("", gtk_entry_get_text (GTK_ENTRY (kid->groupvar_entry))))
+ return FALSE;
+
+ gboolean method_set = FALSE;
+ gint i;
+ for (i = 0; i < n_KIDS; ++i)
+ {
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (kid->checkbutton[i])))
+ method_set = TRUE;
+ }
+
+ return method_set;
+}
+
+static void
+refresh (PsppireDialogAction *rd_)
+{
+ PsppireDialogActionKIndependent *kid = PSPPIRE_DIALOG_ACTION_K_INDEPENDENT (rd_);
+
+ GtkTreeModel *model =
+ gtk_tree_view_get_model (GTK_TREE_VIEW (kid->vars_treeview));
+
+ gtk_entry_set_text (GTK_ENTRY (kid->groupvar_entry), "");
+
+ gtk_list_store_clear (GTK_LIST_STORE (model));
+
+ gint i;
+ for (i = 0; i < n_KIDS; ++i)
+ {
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (kid->checkbutton[i]),
+ FALSE);
+ }
+}
+
+static void
+run_define_groups_dialog (PsppireDialogActionKIndependent *kid)
+{
+ if (kid->lower_limit_value.f != SYSMIS)
+ psppire_value_entry_set_value (PSPPIRE_VALUE_ENTRY (kid->lower_limit_entry),
+ &kid->lower_limit_value, 0);
+
+ if (kid->upper_limit_value.f != SYSMIS)
+ psppire_value_entry_set_value (PSPPIRE_VALUE_ENTRY (kid->upper_limit_entry),
+ &kid->upper_limit_value, 0);
+
+ if (PSPPIRE_RESPONSE_CONTINUE == psppire_dialog_run (kid->subdialog))
+ {
+ psppire_value_entry_get_value (PSPPIRE_VALUE_ENTRY (kid->lower_limit_entry),
+ &kid->lower_limit_value, 0);
+
+ psppire_value_entry_get_value (PSPPIRE_VALUE_ENTRY (kid->upper_limit_entry),
+ &kid->upper_limit_value, 0);
+ }
+}
+
+
+static void
+set_value_entry_variable (PsppireDialogActionKIndependent *kid, GtkEntry *entry)
+{
+ PsppireDialogAction *da = PSPPIRE_DIALOG_ACTION (kid);
+ const gchar *text = gtk_entry_get_text (entry);
+
+ const struct variable *v = da->dict ?
+ psppire_dict_lookup_var (da->dict, text) : NULL;
+
+ psppire_value_entry_set_variable (kid->lower_limit_entry, v);
+ psppire_value_entry_set_variable (kid->upper_limit_entry, v);
+}
+
+
+static void
+psppire_dialog_action_k_independent_activate (PsppireDialogAction *a)
+{
+ PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
+ PsppireDialogActionKIndependent *kid = PSPPIRE_DIALOG_ACTION_K_INDEPENDENT (a);
+
+ GHashTable *thing = psppire_dialog_action_get_hash_table (pda);
+ GtkBuilder *xml = g_hash_table_lookup (thing, a);
+ if (!xml)
+ {
+ xml = builder_new ("k-independent.ui");
+ g_hash_table_insert (thing, a, xml);
+
+ pda->dialog = get_widget_assert (xml, "k-independent-dialog");
+ pda->source = get_widget_assert (xml, "k-independent-treeview1");
+
+ kid->vars_treeview = get_widget_assert (xml, "k-independent-treeview2");
+ kid->groupvar_entry = get_widget_assert (xml, "k-independent-entry");
+
+ kid->subdialog = get_widget_assert (xml, "define-groups-dialog");
+
+ kid->lower_limit_entry = get_widget_assert (xml, "lower-limit-entry");
+ kid->upper_limit_entry = get_widget_assert (xml, "upper-limit-entry");
+
+ kid->checkbutton[KID_KRUSKAL_WALLIS] = get_widget_assert (xml,
+ "kruskal-wallis");
+
+ kid->checkbutton[KID_MEDIAN] = get_widget_assert (xml, "median");
+
+ g_signal_connect_swapped (get_widget_assert (xml, "define-groups-button"),
+ "clicked",
+ G_CALLBACK (run_define_groups_dialog), kid);
+
+ g_signal_connect_swapped (kid->groupvar_entry, "changed",
+ G_CALLBACK (set_value_entry_variable), kid);
+ }
+
+ psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid);
+ psppire_dialog_action_set_refresh (pda, refresh);
+}
+
+static void
+psppire_dialog_action_k_independent_class_init (PsppireDialogActionKIndependentClass *class)
+{
+ psppire_dialog_action_set_activation (class, psppire_dialog_action_k_independent_activate);
+ PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
+}
+
+static void
+psppire_dialog_action_k_independent_init (PsppireDialogActionKIndependent *kid)
+{
+ kid->lower_limit_value.f = SYSMIS;
+ kid->upper_limit_value.f = SYSMIS;
+}