mirror of https://github.com/MidnightCommander/mc
Visual improvements of 'Configiration' dialog.
Now 'Configuration' dialog shows enabled/disabled input line for Esc key timeout in depend of 'Single press' checkbox state. Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
c034b04634
commit
ad37b33e0e
36
src/option.c
36
src/option.c
|
@ -37,6 +37,7 @@
|
||||||
#include "lib/tty/key.h" /* old_esc_mode_timeout */
|
#include "lib/tty/key.h" /* old_esc_mode_timeout */
|
||||||
|
|
||||||
#include "dialog.h" /* B_ constants */
|
#include "dialog.h" /* B_ constants */
|
||||||
|
#include "widget.h" /* WCheck */
|
||||||
#include "setup.h" /* panels_options */
|
#include "setup.h" /* panels_options */
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "file.h" /* file_op_compute_totals */
|
#include "file.h" /* file_op_compute_totals */
|
||||||
|
@ -46,6 +47,36 @@
|
||||||
|
|
||||||
#include "option.h"
|
#include "option.h"
|
||||||
|
|
||||||
|
static cb_ret_t
|
||||||
|
configure_callback (Dlg_head * h, Widget * sender, dlg_msg_t msg, int parm, void *data)
|
||||||
|
{
|
||||||
|
switch (msg)
|
||||||
|
{
|
||||||
|
case DLG_ACTION:
|
||||||
|
if (sender->id == 18)
|
||||||
|
{
|
||||||
|
/* message from "Single press" checkbutton */
|
||||||
|
const gboolean not_single = !(((WCheck *) sender)->state & C_BOOL);
|
||||||
|
Widget *w;
|
||||||
|
|
||||||
|
/* label */
|
||||||
|
w = dlg_find_by_id (h, sender->id - 1);
|
||||||
|
widget_disable (*w, not_single);
|
||||||
|
send_message (w, WIDGET_DRAW, 0);
|
||||||
|
/* input */
|
||||||
|
w = dlg_find_by_id (h, sender->id - 2);
|
||||||
|
widget_disable (*w, not_single);
|
||||||
|
send_message (w, WIDGET_DRAW, 0);
|
||||||
|
|
||||||
|
return MSG_HANDLED;
|
||||||
|
}
|
||||||
|
return MSG_NOT_HANDLED;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return default_dlg_callback (h, sender, msg, parm, data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
configure_box (void)
|
configure_box (void)
|
||||||
{
|
{
|
||||||
|
@ -118,7 +149,7 @@ configure_box (void)
|
||||||
QuickDialog Quick_input = {
|
QuickDialog Quick_input = {
|
||||||
dlg_width, dlg_height, -1, -1,
|
dlg_width, dlg_height, -1, -1,
|
||||||
N_("Configure options"), "[Configuration]",
|
N_("Configure options"), "[Configuration]",
|
||||||
quick_widgets, NULL, TRUE
|
quick_widgets, configure_callback, TRUE
|
||||||
};
|
};
|
||||||
|
|
||||||
int qd_result;
|
int qd_result;
|
||||||
|
@ -211,6 +242,9 @@ configure_box (void)
|
||||||
|
|
||||||
g_snprintf (time_out, sizeof (time_out), "%d", old_esc_mode_timeout);
|
g_snprintf (time_out, sizeof (time_out), "%d", old_esc_mode_timeout);
|
||||||
|
|
||||||
|
if (!old_esc_mode)
|
||||||
|
quick_widgets[16].options = quick_widgets[17].options = W_DISABLED;
|
||||||
|
|
||||||
qd_result = quick_dialog (&Quick_input);
|
qd_result = quick_dialog (&Quick_input);
|
||||||
|
|
||||||
if ((qd_result == B_ENTER) || (qd_result == B_EXIT))
|
if ((qd_result == B_ENTER) || (qd_result == B_EXIT))
|
||||||
|
|
Loading…
Reference in New Issue