From: John Darrington Date: Sat, 12 Dec 2009 20:35:23 +0000 (+0100) Subject: ROC dialog: Disable reference button when curve is not drawn X-Git-Tag: sid-i386-build122~11 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?p=pspp-builds.git;a=commitdiff_plain;h=38a4aa5aaf58d39eafa0574416f36b16ebb9c4f6 ROC dialog: Disable reference button when curve is not drawn --- diff --git a/src/ui/gui/roc-dialog.c b/src/ui/gui/roc-dialog.c index 6896ef7b..4d1a7d30 100644 --- a/src/ui/gui/roc-dialog.c +++ b/src/ui/gui/roc-dialog.c @@ -100,6 +100,22 @@ dialog_state_valid (gpointer data) return TRUE; } +static void +on_curve_button_toggle (GtkCheckButton *curve, struct roc *rd) +{ + if ( !gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (curve))) + { + if ( gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (rd->reference))) + g_object_set (rd->reference, "inconsistent", TRUE, NULL); + g_object_set (rd->reference, "sensitive", FALSE, NULL); + } + else + { + g_object_set (rd->reference, "inconsistent", FALSE, NULL); + g_object_set (rd->reference, "sensitive", TRUE, NULL); + } +} + /* Pops up the Roc dialog box */ void @@ -132,6 +148,8 @@ roc_dialog (GObject *o, gpointer data) g_object_get (vs, "dictionary", &rd.dict, NULL); g_object_set (source, "model", rd.dict, NULL); + g_signal_connect (rd.curve, "toggled", G_CALLBACK (on_curve_button_toggle), &rd); + g_signal_connect_swapped (dialog, "refresh", G_CALLBACK (refresh), &rd); psppire_dialog_set_valid_predicate (PSPPIRE_DIALOG (dialog), diff --git a/src/ui/gui/roc.ui b/src/ui/gui/roc.ui index 8bb82cc8..a3aee25a 100644 --- a/src/ui/gui/roc.ui +++ b/src/ui/gui/roc.ui @@ -220,19 +220,29 @@ - - _With diagonal reference line + True - True - False - True - 0 - True + + + _With diagonal reference line + True + True + False + True + 0 + True + + + False + False + 12 + 0 + + False False - 12 1