From 7b28a01feb07ea918869f857e44c3228f4b70f15 Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Wed, 14 Mar 2012 11:44:11 +0300 Subject: [PATCH] Fixed handling actions in chmod dialog ...in according with 7e6ff9caf952fae6fd7e0b19d1efb486aed7ebba Signed-off-by: Andrew Borodin --- src/filemanager/chmod.c | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/src/filemanager/chmod.c b/src/filemanager/chmod.c index c2e435cbe..a51b47ebc 100644 --- a/src/filemanager/chmod.c +++ b/src/filemanager/chmod.c @@ -232,12 +232,26 @@ chmod_callback (Dlg_head * h, Widget * sender, dlg_msg_t msg, int parm, void *da /* handle checkboxes */ if (id >= 0) { - c_stat ^= check_perm[id].mode; - g_snprintf (buffer, sizeof (buffer), "%o", (unsigned int) c_stat); - label_set_text (statl, buffer); - chmod_toggle_select (h, id); - mode_change = TRUE; - return MSG_HANDLED; + gboolean sender_is_checkbox = FALSE; + unsigned int i; + + /* whether action was sent by checkbox? */ + for (i = 0; i < check_perm_num; i++) + if (sender == (Widget *) check_perm[i].check) + { + sender_is_checkbox = TRUE; + break; + } + + if (sender_is_checkbox) + { + c_stat ^= check_perm[id].mode; + g_snprintf (buffer, sizeof (buffer), "%o", (unsigned int) c_stat); + label_set_text (statl, buffer); + chmod_toggle_select (h, id); + mode_change = TRUE; + return MSG_HANDLED; + } } return MSG_NOT_HANDLED;