From: John Darrington Date: Tue, 10 Apr 2012 20:12:19 +0000 (+0200) Subject: PspppireSelector: Prevent selection of disallowed entries. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fbuilds%2F20120413030504%2Fpspp;p=pspp PspppireSelector: Prevent selection of disallowed entries. We had been relying on the deselected state of the widget to prevent selection with the "allow" predicate was false. But clicking the widget itself isn't the only way items can be selected (double clicking the item for example). This change adds a test at a lower level to prevent selection of disallowed items. --- diff --git a/src/ui/gui/psppire-selector.c b/src/ui/gui/psppire-selector.c index 7b30106013..a5ac034c88 100644 --- a/src/ui/gui/psppire-selector.c +++ b/src/ui/gui/psppire-selector.c @@ -584,6 +584,10 @@ select_selection (PsppireSelector *selector) g_return_if_fail (selector->select_items); + if (selector->allow_selection && + ! selector->allow_selection (selector->source, selector->dest)) + return; + selector->selecting = TRUE; for (item = g_list_first (selected_rows);