mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 20:36:50 +03:00
* dlg.c (x_set_dialog_title): Completely eliminate. Adjust all
dependencies.
This commit is contained in:
parent
00baa9f8fe
commit
6c2eb32b70
@ -1,5 +1,8 @@
|
||||
2002-09-03 Pavel Roskin <proski@gnu.org>
|
||||
|
||||
* dlg.c (x_set_dialog_title): Completely eliminate. Adjust all
|
||||
dependencies.
|
||||
|
||||
* help.c (interactive_display): Fallback to node "[main]" if the
|
||||
requested node cannot be found.
|
||||
|
||||
|
24
src/boxes.c
24
src/boxes.c
@ -178,10 +178,9 @@ display_init (int radio_sel, char *init_text, int _check_status,
|
||||
i18n_displays_flag = 1;
|
||||
}
|
||||
dd = create_dlg (0, 0, DISPLAY_Y, DISPLAY_X, dialog_colors,
|
||||
display_callback, "[Listing Mode...]", "display",
|
||||
display_callback, "[Listing Mode...]", display_title,
|
||||
DLG_CENTER);
|
||||
|
||||
x_set_dialog_title (dd, display_title);
|
||||
add_widget (dd,
|
||||
button_new (4, button_start, B_CANCEL, NORMAL_BUTTON,
|
||||
cancel_button, 0, 0, "cancel-button"));
|
||||
@ -326,9 +325,7 @@ sort_box (sortfn *sort_fn, int *reverse, int *case_sensitive)
|
||||
}
|
||||
|
||||
dd = create_dlg (0, 0, SORT_Y, SORT_X, dialog_colors, NULL,
|
||||
"[Sort Order...]", "sort", DLG_CENTER);
|
||||
|
||||
x_set_dialog_title (dd, sort_title);
|
||||
"[Sort Order...]", sort_title, DLG_CENTER);
|
||||
|
||||
add_widget (dd,
|
||||
button_new (10, button_pos, B_CANCEL, NORMAL_BUTTON, cancel_button,
|
||||
@ -570,8 +567,7 @@ init_disp_bits_box (void)
|
||||
do_refresh();
|
||||
|
||||
dbits_dlg = create_dlg( 0, 0, DISPY, DISPX, dialog_colors,
|
||||
NULL, "[Display bits]", "Display bits", DLG_CENTER );
|
||||
x_set_dialog_title( dbits_dlg, _(" Display bits "));
|
||||
NULL, "[Display bits]", _(" Display bits "), DLG_CENTER);
|
||||
|
||||
add_widget( dbits_dlg,
|
||||
label_new( 3, 4, _("Input / display codepage:"), NULL));
|
||||
@ -975,9 +971,9 @@ jobs_cmd (void)
|
||||
#endif /* ENABLE_NLS */
|
||||
|
||||
jobs_dlg = create_dlg (0, 0, JOBS_Y, JOBS_X, dialog_colors, NULL,
|
||||
"[Background jobs]", "jobs", DLG_CENTER);
|
||||
x_set_dialog_title (jobs_dlg, _("Background Jobs"));
|
||||
|
||||
"[Background jobs]", _("Background Jobs"),
|
||||
DLG_CENTER);
|
||||
|
||||
bg_list = listbox_new (2, 3, JOBS_X-7, JOBS_Y-9, listbox_nothing, 0, "listbox");
|
||||
add_widget (jobs_dlg, bg_list);
|
||||
|
||||
@ -1058,11 +1054,11 @@ vfs_smb_get_authinfo (const char *host, const char *share, const char *domain,
|
||||
if (!user)
|
||||
user = "";
|
||||
|
||||
auth_dlg = create_dlg (0, 0, dialog_y, dialog_x, dialog_colors, NULL,
|
||||
"[Smb Authinfo]", "smbauthinfo", DLG_CENTER);
|
||||
|
||||
title = g_strdup_printf (_("Password for \\\\%s\\%s"), host, share);
|
||||
x_set_dialog_title (auth_dlg, title);
|
||||
|
||||
auth_dlg = create_dlg (0, 0, dialog_y, dialog_x, dialog_colors, NULL,
|
||||
"[Smb Authinfo]", title, DLG_CENTER);
|
||||
|
||||
g_free (title);
|
||||
|
||||
in_user = input_new (5, istart, INPUT_COLOR, ilen, user, "auth_name");
|
||||
|
@ -199,9 +199,8 @@ init_chmod (void)
|
||||
|
||||
ch_dlg =
|
||||
create_dlg (0, 0, 22 - single_set, 70, dialog_colors,
|
||||
chmod_callback, "[Chmod]", "chmod", DLG_CENTER);
|
||||
|
||||
x_set_dialog_title (ch_dlg, _("Chmod command"));
|
||||
chmod_callback, "[Chmod]", _("Chmod command"),
|
||||
DLG_CENTER);
|
||||
|
||||
for (i = 0; i < BUTTONS; i++) {
|
||||
if (i == 2 && single_set)
|
||||
|
@ -162,8 +162,7 @@ init_chown (void)
|
||||
|
||||
ch_dlg =
|
||||
create_dlg (0, 0, 18, 74, dialog_colors, chown_callback, "[Chown]",
|
||||
"chown", DLG_CENTER);
|
||||
x_set_dialog_title (ch_dlg, _(" Chown command "));
|
||||
_(" Chown command "), DLG_CENTER);
|
||||
|
||||
for (i = 0; i < BUTTONS - single_set; i++)
|
||||
add_widget (ch_dlg,
|
||||
|
12
src/dlg.c
12
src/dlg.c
@ -962,15 +962,3 @@ int dlg_select_nth_widget (Dlg_head *h, int n)
|
||||
return dlg_select_widget (h, w->widget);
|
||||
}
|
||||
|
||||
/* Set dialog title. This function should be eliminated. */
|
||||
void
|
||||
x_set_dialog_title (Dlg_head * h, const char *title)
|
||||
{
|
||||
char *t;
|
||||
|
||||
g_free (h->title);
|
||||
t = g_strstrip (g_strdup (title));
|
||||
h->title = g_strconcat (" ", t, " ", NULL);
|
||||
g_free (t);
|
||||
}
|
||||
|
||||
|
@ -132,9 +132,6 @@ Dlg_head *create_dlg (int y1, int x1, int lines, int cols,
|
||||
int (*callback) (struct Dlg_head *, int, int),
|
||||
char *help_ctx, const char *title, int flags);
|
||||
|
||||
/* Set title - this function should go away */
|
||||
void x_set_dialog_title (Dlg_head *h, const char *title);
|
||||
|
||||
|
||||
/* The flags: */
|
||||
#define DLG_BACKWARD 32 /* Tab order is reverse to the index order */
|
||||
|
@ -196,9 +196,7 @@ find_par_start:
|
||||
in_contents = g_strdup ("");
|
||||
|
||||
find_dlg = create_dlg (0, 0, FIND_Y, FIND_X, dialog_colors, NULL,
|
||||
"[Find File]", "findfile", DLG_CENTER);
|
||||
|
||||
x_set_dialog_title (find_dlg, _("Find File"));
|
||||
"[Find File]", _("Find File"), DLG_CENTER);
|
||||
|
||||
add_widget (find_dlg, button_new (11, b2, B_CANCEL, NORMAL_BUTTON,
|
||||
buts[2], 0 ,0, "cancel"));
|
||||
@ -779,9 +777,7 @@ setup_gui (void)
|
||||
}
|
||||
|
||||
find_dlg = create_dlg (0, 0, FIND2_Y, FIND2_X, dialog_colors,
|
||||
find_callback, "[Find File]", "mfind", DLG_CENTER);
|
||||
|
||||
x_set_dialog_title (find_dlg, _("Find file"));
|
||||
find_callback, "[Find File]", _("Find file"), DLG_CENTER);
|
||||
|
||||
add_widget (find_dlg,
|
||||
button_new (FIND2_Y-3, fbuts[7].x, B_VIEW, NORMAL_BUTTON,
|
||||
|
@ -440,9 +440,7 @@ static void init_layout (void)
|
||||
|
||||
layout_dlg = create_dlg (0, 0, 15, first_width + second_width + 9,
|
||||
dialog_colors, layout_callback,
|
||||
"[Layout]", "layout", DLG_CENTER);
|
||||
|
||||
x_set_dialog_title (layout_dlg, _("Layout"));
|
||||
"[Layout]", _("Layout"), DLG_CENTER);
|
||||
|
||||
add_widget (layout_dlg,
|
||||
button_new (BY, b3, B_CANCEL, NORMAL_BUTTON, cancel_button, 0, 0, "c"));
|
||||
|
@ -256,9 +256,8 @@ static void init_learn (void)
|
||||
do_refresh ();
|
||||
|
||||
learn_dlg = create_dlg (0, 0, 23, 78, dialog_colors,
|
||||
learn_callback, "[Learn keys]", "Learn keys",
|
||||
DLG_CENTER);
|
||||
x_set_dialog_title (learn_dlg, _("Learn keys"));
|
||||
learn_callback, "[Learn keys]",
|
||||
_("Learn keys"), DLG_CENTER);
|
||||
|
||||
#define XTRACT(i) BY+learn_but[i].y, learn_but[i].x, learn_but[i].ret_cmd, learn_but[i].flags, _(learn_but[i].text), 0, 0, NULL
|
||||
|
||||
|
@ -166,8 +166,7 @@ init_listmode (char *oldlistformat)
|
||||
|
||||
listmode_dlg =
|
||||
create_dlg (0, 0, 22, 74, dialog_colors, listmode_callback,
|
||||
listmode_section, "listmode", DLG_CENTER);
|
||||
x_set_dialog_title (listmode_dlg, "Listing format edit");
|
||||
listmode_section, "Listing format edit", DLG_CENTER);
|
||||
|
||||
#define XTRACT(i) BY+listmode_but[i].y, BX+listmode_but[i].x, listmode_but[i].ret_cmd, listmode_but[i].flags, listmode_but[i].text, 0, 0, NULL
|
||||
|
||||
|
@ -191,9 +191,7 @@ static void init_configure (void)
|
||||
|
||||
conf_dlg = create_dlg (0, 0, 20, first_width + second_width + 9,
|
||||
dialog_colors, configure_callback, "[Configuration]",
|
||||
"option", DLG_CENTER);
|
||||
|
||||
x_set_dialog_title (conf_dlg, _("Configure options"));
|
||||
_("Configure options"), DLG_CENTER);
|
||||
|
||||
add_widget (conf_dlg,
|
||||
button_new (BY, b3, B_CANCEL, NORMAL_BUTTON,
|
||||
|
@ -163,9 +163,8 @@ static void init_panelize (void)
|
||||
do_refresh ();
|
||||
|
||||
panelize_dlg = create_dlg (0, 0, 22, panelize_cols, dialog_colors,
|
||||
panelize_callback, "[External panelize]", "panelize",
|
||||
DLG_CENTER);
|
||||
x_set_dialog_title (panelize_dlg, _("External panelize"));
|
||||
panelize_callback, "[External panelize]",
|
||||
_("External panelize"), DLG_CENTER);
|
||||
|
||||
#define XTRACT(i) BY+panelize_but[i].y, BX+panelize_but[i].x, panelize_but[i].ret_cmd, panelize_but[i].flags, panelize_but[i].text, 0, 0, panelize_but[i].tkname
|
||||
|
||||
|
@ -946,8 +946,7 @@ show_hist (Hist * history, int widget_x, int widget_y)
|
||||
|
||||
query_dlg =
|
||||
create_dlg (y, x, h, w, dialog_colors, NULL, "[History-query]",
|
||||
"history", DLG_COMPACT);
|
||||
x_set_dialog_title (query_dlg, i18n_htitle ());
|
||||
i18n_htitle (), DLG_COMPACT);
|
||||
query_list = listbox_new (1, 1, w - 2, h - 2, listbox_finish, 0, NULL);
|
||||
add_widget (query_dlg, query_list);
|
||||
hi = z;
|
||||
|
12
src/wtools.c
12
src/wtools.c
@ -76,8 +76,7 @@ Listbox *create_listbox_window (int cols, int lines, char *title, char *help)
|
||||
|
||||
/* Create components */
|
||||
listbox->dlg = create_dlg (ypos, xpos, lines+6, cols+4, dialog_colors,
|
||||
NULL, help, "listbox", DLG_CENTER);
|
||||
x_set_dialog_title (listbox->dlg, title);
|
||||
NULL, help, title, DLG_CENTER);
|
||||
|
||||
listbox->list = listbox_new (2, 2, cols, lines, listbox_finish, 0, "li");
|
||||
|
||||
@ -154,8 +153,7 @@ int query_dialog (char *header, char *text, int flags, int count, ...)
|
||||
|
||||
/* prepare dialog */
|
||||
query_dlg = create_dlg (ypos, xpos, lines, cols, query_colors, NULL,
|
||||
"[QueryBox]", "query", DLG_BACKWARD);
|
||||
x_set_dialog_title (query_dlg, header);
|
||||
"[QueryBox]", header, DLG_BACKWARD);
|
||||
|
||||
if (count > 0){
|
||||
|
||||
@ -333,13 +331,11 @@ int quick_dialog_skip (QuickDialog *qd, int nskip)
|
||||
|
||||
if (qd->xpos == -1)
|
||||
dd = create_dlg (0, 0, qd->ylen, qd->xlen, dialog_colors, quick_callback,
|
||||
qd->help, qd->class, DLG_CENTER | DLG_TRYUP);
|
||||
qd->help, qd->title, DLG_CENTER | DLG_TRYUP);
|
||||
else
|
||||
dd = create_dlg (qd->ypos, qd->xpos, qd->ylen, qd->xlen, dialog_colors,
|
||||
quick_callback,
|
||||
qd->help, qd->class, DLG_NONE);
|
||||
|
||||
x_set_dialog_title (dd, qd->title);
|
||||
qd->help, qd->title, DLG_NONE);
|
||||
|
||||
/* We pass this to the callback */
|
||||
dd->cols = qd->xlen;
|
||||
|
Loading…
Reference in New Issue
Block a user