Split MSG_ACTION into MSG_ACTION and MSG_NOTIFY.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Mooffie 2016-01-21 10:04:46 +02:00 committed by Andrew Borodin
parent 6b56cabf6f
commit 4e62be3b7e
11 changed files with 17 additions and 35 deletions

View File

@ -76,7 +76,7 @@ check_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *d
return MSG_NOT_HANDLED;
c->state ^= C_BOOL;
c->state ^= C_CHANGE;
send_message (WIDGET (w)->owner, w, MSG_ACTION, 0, NULL);
send_message (WIDGET (w)->owner, w, MSG_NOTIFY, 0, NULL);
send_message (w, sender, MSG_FOCUS, ' ', data);
return MSG_HANDLED;

View File

@ -391,7 +391,7 @@ static void
listbox_on_change (WListbox * l)
{
listbox_draw (l, TRUE);
send_message (WIDGET (l)->owner, l, MSG_ACTION, l->pos, NULL);
send_message (WIDGET (l)->owner, l, MSG_NOTIFY, l->pos, NULL);
}
/* --------------------------------------------------------------------------------------------- */

View File

@ -85,7 +85,7 @@ radio_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *d
{
case ' ':
r->sel = r->pos;
send_message (w->owner, w, MSG_ACTION, 0, NULL);
send_message (w->owner, w, MSG_NOTIFY, 0, NULL);
send_message (w, sender, MSG_FOCUS, ' ', data);
return MSG_HANDLED;
@ -110,7 +110,7 @@ radio_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *d
}
case MSG_CURSOR:
send_message (w->owner, w, MSG_ACTION, 0, NULL);
send_message (w->owner, w, MSG_NOTIFY, 0, NULL);
send_message (w, sender, MSG_FOCUS, ' ', data);
widget_move (r, r->pos, 1);
return MSG_HANDLED;

View File

@ -33,9 +33,9 @@ typedef enum
MSG_HOTKEY_HANDLED, /* A widget has got the hotkey */
MSG_UNHANDLED_KEY, /* Key that no widget handled */
MSG_POST_KEY, /* The key has been handled */
MSG_ACTION, /* Send to widget to handle command or
* state of check- and radiobuttons has changed
* and listbox current entry has changed */
MSG_ACTION, /* Send to widget to handle command */
MSG_NOTIFY, /* Typically sent to dialog to inform it of state-change
* of listboxes, check- and radiobuttons. */
MSG_CURSOR, /* Sent to widget to position the cursor */
MSG_IDLE, /* The idle state is active */
MSG_RESIZE, /* Screen size has changed */

View File

@ -160,7 +160,7 @@ edit_save_mode_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm
{
switch (msg)
{
case MSG_ACTION:
case MSG_NOTIFY:
if (sender != NULL && sender->id == edit_save_mode_radio_id)
{
Widget *ww;

View File

@ -128,7 +128,7 @@ configure_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, voi
{
switch (msg)
{
case MSG_ACTION:
case MSG_NOTIFY:
/* message from "Single press" checkbutton */
if (sender != NULL && sender->id == configure_old_esc_mode_id)
{
@ -250,7 +250,7 @@ panel_listing_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm,
switch (msg)
{
case MSG_ACTION:
case MSG_NOTIFY:
if (sender != NULL && sender->id == panel_listing_types_id)
{
WCheck *ch;
@ -371,7 +371,7 @@ confvfs_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void
{
switch (msg)
{
case MSG_ACTION:
case MSG_NOTIFY:
/* message from "Always use ftp proxy" checkbutton */
if (sender != NULL && sender->id == ftpfs_always_use_proxy_id)
{

View File

@ -220,16 +220,12 @@ chmod_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *d
switch (msg)
{
case MSG_ACTION:
case MSG_NOTIFY:
{
/* handle checkboxes */
int i;
/* close dialog due to SIGINT (ctrl-g) */
if (sender == NULL && parm == CK_Cancel)
return MSG_NOT_HANDLED;
/* whether action was sent by checkbox? */
/* whether notification was sent by checkbox? */
for (i = 0; i < check_perm_num; i++)
if (sender == WIDGET (check_perm[i].check))
break;

View File

@ -470,7 +470,7 @@ find_parm_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, voi
first_draw = TRUE;
return MSG_HANDLED;
case MSG_ACTION:
case MSG_NOTIFY:
if (sender == WIDGET (ignore_dirs_cbox))
{
gboolean disable = !(ignore_dirs_cbox->state & C_BOOL);

View File

@ -577,6 +577,7 @@ hotlist_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void
switch (msg)
{
case MSG_INIT:
case MSG_NOTIFY: /* MSG_NOTIFY is fired by the listbox to tell us the item has changed. */
update_path_name ();
return MSG_HANDLED;
@ -593,14 +594,6 @@ hotlist_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void
dlg_set_size (h, LINES - (h == hotlist_dlg ? 2 : 6), COLS - 6);
return MSG_HANDLED;
case MSG_ACTION:
if (sender == NULL)
return MSG_NOT_HANDLED;
/* The listbox tells us the item has changed. */
update_path_name ();
return MSG_HANDLED;
default:
return dlg_default_callback (w, sender, msg, parm, data);
}

View File

@ -369,7 +369,7 @@ layout_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *
}
return MSG_HANDLED;
case MSG_ACTION:
case MSG_NOTIFY:
if (sender == WIDGET (radio_widget))
{
if (panels_layout.horizontal_split != radio_widget->sel)

View File

@ -113,14 +113,7 @@ panelize_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void
switch (msg)
{
case MSG_INIT:
update_command ();
return MSG_HANDLED;
case MSG_ACTION:
if (sender == NULL)
return MSG_NOT_HANDLED;
/* The listbox tells us the item has changed. */
case MSG_NOTIFY: /* MSG_NOTIFY is fired by the listbox to tell us the item has changed. */
update_command ();
return MSG_HANDLED;