Fixed handling actions in chmod dialog

...in according with 7e6ff9caf9

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2012-03-14 11:44:11 +03:00 committed by Slava Zanko
parent 4f5c2e1649
commit 7b28a01feb

View File

@ -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;