From: John Darrington Date: Sat, 16 Jan 2016 08:32:30 +0000 (+0100) Subject: Populate select dialog's dialog_is_valid function X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?p=pspp;a=commitdiff_plain;h=6ade38440fe2fa866e6dda407ab09555a3052f21 Populate select dialog's dialog_is_valid function Closes bug #46901 --- diff --git a/src/ui/gui/psppire-dialog-action-select.c b/src/ui/gui/psppire-dialog-action-select.c index d3eee6570d..376cc9f59c 100644 --- a/src/ui/gui/psppire-dialog-action-select.c +++ b/src/ui/gui/psppire-dialog-action-select.c @@ -47,6 +47,18 @@ G_DEFINE_TYPE (PsppireDialogActionSelect, psppire_dialog_action_select, PSPPIRE_ static gboolean dialog_state_valid (gpointer data) { + PsppireDialogActionSelect *act = PSPPIRE_DIALOG_ACTION_SELECT (data); + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (act->radiobutton_all))) + { + return TRUE; + } + else if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (act->radiobutton_filter_variable))) + { + const gchar *text = gtk_entry_get_text (GTK_ENTRY (act->entry)); + if (!psppire_dict_lookup_var (PSPPIRE_DIALOG_ACTION (act)->dict, text)) + return FALSE; + } + return TRUE; }