Move WOP_WANT_IDLE option to widget_state_t flags
...and rename to WST_IDLE. Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Этот коммит содержится в:
родитель
b337287336
Коммит
0a2877edef
@ -119,7 +119,7 @@ dlg_widget_prev (WDialog * h, GList * l)
|
||||
*/
|
||||
|
||||
static void
|
||||
dlg_broadcast_msg_to (WDialog * h, widget_msg_t msg, gboolean reverse, int flags)
|
||||
dlg_broadcast_msg_to (WDialog * h, widget_msg_t msg, gboolean reverse, widget_options_t flags)
|
||||
{
|
||||
GList *p, *first;
|
||||
|
||||
@ -570,7 +570,7 @@ frontend_dlg_run (WDialog * h)
|
||||
if (idle_hook)
|
||||
execute_hooks (idle_hook);
|
||||
|
||||
while (widget_get_options (WIDGET (h), WOP_WANT_IDLE) && is_idle ())
|
||||
while (widget_get_state (WIDGET (h), WST_IDLE) && is_idle ())
|
||||
send_message (h, NULL, MSG_IDLE, 0, NULL);
|
||||
|
||||
/* Allow terminating the dialog from the idle handler */
|
||||
@ -791,7 +791,8 @@ dlg_default_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, v
|
||||
return MSG_NOT_HANDLED;
|
||||
|
||||
case MSG_IDLE:
|
||||
dlg_broadcast_msg_to (h, MSG_IDLE, FALSE, WOP_WANT_IDLE);
|
||||
/* we don't want endless loop */
|
||||
widget_idle (w, FALSE);
|
||||
return MSG_HANDLED;
|
||||
|
||||
case MSG_RESIZE:
|
||||
|
@ -18,7 +18,7 @@
|
||||
/* Sets/clear the specified flag in the options field */
|
||||
#define widget_want_cursor(w,i) widget_set_options(w, WOP_WANT_CURSOR, i)
|
||||
#define widget_want_hotkey(w,i) widget_set_options(w, WOP_WANT_HOTKEY, i)
|
||||
#define widget_want_idle(w,i) widget_set_options(w, WOP_WANT_IDLE, i)
|
||||
#define widget_idle(w,i) widget_set_state(w, WST_IDLE, i)
|
||||
#define widget_disable(w,i) widget_set_state(w, WST_DISABLED, i)
|
||||
|
||||
/*** enums ***************************************************************************************/
|
||||
@ -67,15 +67,15 @@ typedef enum
|
||||
WOP_DEFAULT = (0 << 0),
|
||||
WOP_WANT_HOTKEY = (1 << 1),
|
||||
WOP_WANT_CURSOR = (1 << 2),
|
||||
WOP_WANT_IDLE = (1 << 3),
|
||||
WOP_IS_INPUT = (1 << 4)
|
||||
WOP_IS_INPUT = (1 << 3)
|
||||
} widget_options_t;
|
||||
|
||||
/* Widget state */
|
||||
typedef enum
|
||||
{
|
||||
WST_DEFAULT = (0 << 0),
|
||||
WST_DISABLED = (1 << 0) /* Widget cannot be selected */
|
||||
WST_DISABLED = (1 << 0), /* Widget cannot be selected */
|
||||
WST_IDLE = (1 << 1) /* @FIXME@: we want more correct name here */
|
||||
} widget_state_t;
|
||||
|
||||
/* Flags for widget repositioning on dialog resize */
|
||||
|
@ -835,7 +835,7 @@ edit_dialog_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, v
|
||||
* So let's trigger an IDLE signal.
|
||||
*/
|
||||
if (!is_idle ())
|
||||
widget_want_idle (w, TRUE);
|
||||
widget_idle (w, TRUE);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -852,7 +852,7 @@ edit_dialog_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, v
|
||||
return MSG_HANDLED;
|
||||
|
||||
case MSG_IDLE:
|
||||
widget_want_idle (w, FALSE);
|
||||
widget_idle (w, FALSE);
|
||||
return send_message (h->current->data, NULL, MSG_IDLE, 0, NULL);
|
||||
|
||||
default:
|
||||
|
@ -353,7 +353,7 @@ add_to_list (const char *text, void *data)
|
||||
static inline void
|
||||
stop_idle (void *data)
|
||||
{
|
||||
widget_want_idle (WIDGET (data), FALSE);
|
||||
widget_idle (WIDGET (data), FALSE);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
@ -955,7 +955,7 @@ check_find_events (WDialog * h)
|
||||
/* dialog terminated */
|
||||
return FIND_ABORT;
|
||||
}
|
||||
if (!widget_get_options (WIDGET (h), WOP_WANT_IDLE))
|
||||
if (!widget_get_state (WIDGET (h), WST_IDLE))
|
||||
{
|
||||
/* searching suspended */
|
||||
return FIND_SUSPEND;
|
||||
@ -1545,7 +1545,7 @@ start_stop (WButton * button, int action)
|
||||
(void) action;
|
||||
|
||||
running = is_start;
|
||||
widget_want_idle (WIDGET (find_dlg), running);
|
||||
widget_idle (WIDGET (find_dlg), running);
|
||||
is_start = !is_start;
|
||||
|
||||
status_update (is_start ? _("Stopped") : _("Searching"));
|
||||
@ -1681,7 +1681,7 @@ run_process (void)
|
||||
|
||||
resuming = FALSE;
|
||||
|
||||
widget_want_idle (WIDGET (find_dlg), TRUE);
|
||||
widget_idle (WIDGET (find_dlg), TRUE);
|
||||
ret = dlg_run (find_dlg);
|
||||
|
||||
mc_search_free (search_file_handle);
|
||||
@ -1697,7 +1697,7 @@ run_process (void)
|
||||
static void
|
||||
kill_gui (void)
|
||||
{
|
||||
widget_want_idle (WIDGET (find_dlg), FALSE);
|
||||
widget_idle (WIDGET (find_dlg), FALSE);
|
||||
dlg_destroy (find_dlg);
|
||||
}
|
||||
|
||||
|
@ -1421,7 +1421,7 @@ midnight_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void
|
||||
|
||||
case MSG_IDLE:
|
||||
/* We only need the first idle event to show user menu after start */
|
||||
widget_want_idle (w, FALSE);
|
||||
widget_idle (w, FALSE);
|
||||
|
||||
if (boot_current_is_left)
|
||||
dlg_select_widget (get_panel_widget (0));
|
||||
@ -1769,7 +1769,7 @@ do_nc (void)
|
||||
else
|
||||
{
|
||||
/* We only need the first idle event to show user menu after start */
|
||||
widget_want_idle (WIDGET (midnight_dlg), TRUE);
|
||||
widget_idle (WIDGET (midnight_dlg), TRUE);
|
||||
|
||||
setup_mc ();
|
||||
mc_filehighlight = mc_fhl_new (TRUE);
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user