Modified "Configure options" dialog for better look'n'feel.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Этот коммит содержится в:
родитель
1dffc24f9b
Коммит
bd2ddb54cb
@ -1798,6 +1798,10 @@ When you press F7 to create a new directory, the input line in popup dialog
|
||||
will be filled by name of current file or directory in active panel.
|
||||
Disabled by default.
|
||||
.PP
|
||||
.I Preallocate space
|
||||
Preallocate space for whole target file, if possible, before copy operation.
|
||||
Disabled by default.
|
||||
.PP
|
||||
.B Esc key mode.
|
||||
.PP
|
||||
By default the Midnight Commander treats the ESC key as a key prefix.
|
||||
|
@ -1907,6 +1907,9 @@ mc на экране.
|
||||
При создании нового каталога по F7 в поле ввода имени нового каталога
|
||||
будет автоматически подставляться имя файла или каталога, находящегося
|
||||
под курсором. По умолчанию выключено.
|
||||
.I Выделять место
|
||||
Если возможно, предварительно выделять место под весь копируемый файл.
|
||||
По умолчанию выключено.
|
||||
.PP
|
||||
.B Клавиша Esc
|
||||
.PP
|
||||
|
@ -76,7 +76,7 @@ configure_callback (Dlg_head * h, Widget * sender, dlg_msg_t msg, int parm, void
|
||||
{
|
||||
case DLG_ACTION:
|
||||
/* message from "Single press" checkbutton */
|
||||
if (sender != NULL && sender->id == 18)
|
||||
if (sender != NULL && sender->id == 17)
|
||||
{
|
||||
const gboolean not_single = !(((WCheck *) sender)->state & C_BOOL);
|
||||
Widget *w;
|
||||
@ -107,7 +107,7 @@ void
|
||||
configure_box (void)
|
||||
{
|
||||
int dlg_width = 60;
|
||||
int dlg_height = 20;
|
||||
int dlg_height = 21;
|
||||
|
||||
char time_out[BUF_TINY] = "";
|
||||
char *time_out_new;
|
||||
@ -125,11 +125,8 @@ configure_box (void)
|
||||
QUICK_BUTTON (38, dlg_width, dlg_height - 3, dlg_height, N_("&Cancel"), B_CANCEL, NULL),
|
||||
QUICK_BUTTON (14, dlg_width, dlg_height - 3, dlg_height, N_("&OK"), B_ENTER, NULL),
|
||||
/* other options */
|
||||
QUICK_CHECKBOX (dlg_width / 2 + 2, dlg_width, 13, dlg_height, N_("A&uto save setup"),
|
||||
QUICK_CHECKBOX (dlg_width / 2 + 2, dlg_width, 12, dlg_height, N_("A&uto save setup"),
|
||||
&auto_save_setup),
|
||||
QUICK_CHECKBOX (dlg_width / 2 + 2, dlg_width, 12, dlg_height,
|
||||
N_("Preallocate &space before file copying"),
|
||||
&mc_global.vfs.preallocate_space),
|
||||
QUICK_CHECKBOX (dlg_width / 2 + 2, dlg_width, 11, dlg_height, N_("Sa&fe delete"),
|
||||
&safe_delete),
|
||||
QUICK_CHECKBOX (dlg_width / 2 + 2, dlg_width, 10, dlg_height, N_("Cd follows lin&ks"),
|
||||
@ -147,28 +144,30 @@ configure_box (void)
|
||||
&use_internal_view),
|
||||
QUICK_CHECKBOX (dlg_width / 2 + 2, dlg_width, 3, dlg_height, N_("Use internal edi&t"),
|
||||
&use_internal_edit),
|
||||
QUICK_GROUPBOX (dlg_width / 2, dlg_width, 2, dlg_height, dlg_width / 2 - 4, 15,
|
||||
QUICK_GROUPBOX (dlg_width / 2, dlg_width, 2, dlg_height, dlg_width / 2 - 4, 16,
|
||||
N_("Other options")),
|
||||
/* pause options */
|
||||
QUICK_RADIO (5, dlg_width, 13, dlg_height, pause_options_num, pause_options,
|
||||
QUICK_RADIO (5, dlg_width, 14, dlg_height, pause_options_num, pause_options,
|
||||
&pause_after_run),
|
||||
QUICK_GROUPBOX (3, dlg_width, 12, dlg_height, dlg_width / 2 - 4, 5, N_("Pause after run")),
|
||||
QUICK_GROUPBOX (3, dlg_width, 13, dlg_height, dlg_width / 2 - 4, 5, N_("Pause after run")),
|
||||
|
||||
/* Esc key mode */
|
||||
QUICK_INPUT (10, dlg_width, 10, dlg_height, (const char *) time_out, 8, 0,
|
||||
QUICK_INPUT (10, dlg_width, 11, dlg_height, (const char *) time_out, 8, 0,
|
||||
MC_HISTORY_ESC_TIMEOUT, &time_out_new),
|
||||
QUICK_LABEL (5, dlg_width, 10, dlg_height, N_("Timeout:")),
|
||||
QUICK_CHECKBOX (5, dlg_width, 9, dlg_height, N_("S&ingle press"), &old_esc_mode),
|
||||
QUICK_GROUPBOX (3, dlg_width, 8, dlg_height, dlg_width / 2 - 4, 4, N_("Esc key mode")),
|
||||
QUICK_LABEL (5, dlg_width, 11, dlg_height, N_("Timeout:")),
|
||||
QUICK_CHECKBOX (5, dlg_width, 10, dlg_height, N_("S&ingle press"), &old_esc_mode),
|
||||
QUICK_GROUPBOX (3, dlg_width, 9, dlg_height, dlg_width / 2 - 4, 4, N_("Esc key mode")),
|
||||
|
||||
/* file operation options */
|
||||
QUICK_CHECKBOX (5, dlg_width, 7, dlg_height, N_("Preallocate &space"),
|
||||
&mc_global.vfs.preallocate_space),
|
||||
QUICK_CHECKBOX (5, dlg_width, 6, dlg_height, N_("Mkdi&r autoname"), &auto_fill_mkdir_name),
|
||||
QUICK_CHECKBOX (5, dlg_width, 5, dlg_height, N_("Classic pro&gressbar"),
|
||||
&classic_progressbar),
|
||||
QUICK_CHECKBOX (5, dlg_width, 4, dlg_height, N_("Compute tota&ls"),
|
||||
&file_op_compute_totals),
|
||||
QUICK_CHECKBOX (5, dlg_width, 3, dlg_height, N_("&Verbose operation"), &verbose),
|
||||
QUICK_GROUPBOX (3, dlg_width, 2, dlg_height, dlg_width / 2 - 4, 6,
|
||||
QUICK_GROUPBOX (3, dlg_width, 2, dlg_height, dlg_width / 2 - 4, 7,
|
||||
N_("File operation options")),
|
||||
QUICK_END
|
||||
};
|
||||
@ -194,14 +193,14 @@ configure_box (void)
|
||||
/* buttons */
|
||||
quick_widgets[i].u.button.text = _(quick_widgets[i].u.button.text);
|
||||
break;
|
||||
case 13:
|
||||
case 15:
|
||||
case 19:
|
||||
case 12:
|
||||
case 14:
|
||||
case 18:
|
||||
case 24:
|
||||
/* groupboxes */
|
||||
quick_widgets[i].u.groupbox.title = _(quick_widgets[i].u.groupbox.title);
|
||||
break;
|
||||
case 14:
|
||||
case 13:
|
||||
{
|
||||
/* radio button */
|
||||
size_t j;
|
||||
@ -209,10 +208,10 @@ configure_box (void)
|
||||
pause_options[j] = _(pause_options[j]);
|
||||
}
|
||||
break;
|
||||
case 16:
|
||||
case 15:
|
||||
/* input line */
|
||||
break;
|
||||
case 17:
|
||||
case 16:
|
||||
/* label */
|
||||
quick_widgets[i].u.label.text = _(quick_widgets[i].u.label.text);
|
||||
break;
|
||||
@ -236,19 +235,19 @@ configure_box (void)
|
||||
/* checkboxes within groupboxes */
|
||||
c_len = 0;
|
||||
for (i = 2; i < 24; i++)
|
||||
if ((i < 13) || (i == 18) || (i > 19))
|
||||
if ((i < 12) || (i == 17) || (i > 18))
|
||||
c_len = max (c_len, str_term_width1 (quick_widgets[i].u.checkbox.text) + 3);
|
||||
/* radiobuttons */
|
||||
for (i = 0; i < (size_t) pause_options_num; i++)
|
||||
c_len = max (c_len, str_term_width1 (pause_options[i]) + 3);
|
||||
/* label + input */
|
||||
l_len = str_term_width1 (quick_widgets[17].u.label.text);
|
||||
l_len = str_term_width1 (quick_widgets[16].u.label.text);
|
||||
c_len = max (c_len, l_len + 1 + 8);
|
||||
/* groupboxes */
|
||||
g_len = max (c_len + 2, str_term_width1 (quick_widgets[24].u.groupbox.title) + 4);
|
||||
g_len = max (g_len, str_term_width1 (quick_widgets[19].u.groupbox.title) + 4);
|
||||
g_len = max (g_len, str_term_width1 (quick_widgets[15].u.groupbox.title) + 4);
|
||||
g_len = max (g_len, str_term_width1 (quick_widgets[13].u.groupbox.title) + 4);
|
||||
g_len = max (g_len, str_term_width1 (quick_widgets[18].u.groupbox.title) + 4);
|
||||
g_len = max (g_len, str_term_width1 (quick_widgets[14].u.groupbox.title) + 4);
|
||||
g_len = max (g_len, str_term_width1 (quick_widgets[12].u.groupbox.title) + 4);
|
||||
/* dialog width */
|
||||
Quick_input.xlen = max (dlg_width, g_len * 2 + 9);
|
||||
Quick_input.xlen = max (Quick_input.xlen, b_len + 2);
|
||||
@ -260,19 +259,19 @@ configure_box (void)
|
||||
quick_widgets[i].x_divisions = Quick_input.xlen;
|
||||
|
||||
/* groupboxes */
|
||||
quick_widgets[15].u.groupbox.width =
|
||||
quick_widgets[19].u.groupbox.width =
|
||||
quick_widgets[14].u.groupbox.width =
|
||||
quick_widgets[18].u.groupbox.width =
|
||||
quick_widgets[24].u.groupbox.width = Quick_input.xlen / 2 - 4;
|
||||
quick_widgets[13].u.groupbox.width = Quick_input.xlen / 2 - 3;
|
||||
quick_widgets[12].u.groupbox.width = Quick_input.xlen / 2 - 3;
|
||||
|
||||
/* input */
|
||||
quick_widgets[16].relative_x = quick_widgets[17].relative_x + l_len + 1;
|
||||
quick_widgets[16].u.input.len = quick_widgets[19].u.groupbox.width - l_len - 4;
|
||||
quick_widgets[15].relative_x = quick_widgets[16].relative_x + l_len + 1;
|
||||
quick_widgets[15].u.input.len = quick_widgets[18].u.groupbox.width - l_len - 4;
|
||||
|
||||
/* right column */
|
||||
quick_widgets[13].relative_x = Quick_input.xlen / 2;
|
||||
for (i = 2; i < 13; i++)
|
||||
quick_widgets[i].relative_x = quick_widgets[13].relative_x + 2;
|
||||
quick_widgets[12].relative_x = Quick_input.xlen / 2;
|
||||
for (i = 2; i < 12; i++)
|
||||
quick_widgets[i].relative_x = quick_widgets[12].relative_x + 2;
|
||||
|
||||
/* buttons */
|
||||
quick_widgets[1].relative_x = (Quick_input.xlen - b_len) / 3;
|
||||
@ -281,7 +280,12 @@ configure_box (void)
|
||||
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;
|
||||
quick_widgets[15].options = quick_widgets[16].options = W_DISABLED;
|
||||
|
||||
#ifndef HAVE_POSIX_FALLOCATE
|
||||
mc_global.vfs.preallocate_space = FALSE;
|
||||
quick_widgets[19].options = W_DISABLED;
|
||||
#endif
|
||||
|
||||
if (quick_dialog (&Quick_input) == B_ENTER)
|
||||
old_esc_mode_timeout = atoi (time_out_new);
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user