* dlg.c (x_set_dialog_title): Completely eliminate. Adjust all

dependencies.
This commit is contained in:
Pavel Roskin 2002-09-03 07:42:36 +00:00
parent 00baa9f8fe
commit 6c2eb32b70
14 changed files with 30 additions and 64 deletions

View File

@ -1,5 +1,8 @@
2002-09-03 Pavel Roskin <proski@gnu.org> 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 * help.c (interactive_display): Fallback to node "[main]" if the
requested node cannot be found. requested node cannot be found.

View File

@ -178,10 +178,9 @@ display_init (int radio_sel, char *init_text, int _check_status,
i18n_displays_flag = 1; i18n_displays_flag = 1;
} }
dd = create_dlg (0, 0, DISPLAY_Y, DISPLAY_X, dialog_colors, dd = create_dlg (0, 0, DISPLAY_Y, DISPLAY_X, dialog_colors,
display_callback, "[Listing Mode...]", "display", display_callback, "[Listing Mode...]", display_title,
DLG_CENTER); DLG_CENTER);
x_set_dialog_title (dd, display_title);
add_widget (dd, add_widget (dd,
button_new (4, button_start, B_CANCEL, NORMAL_BUTTON, button_new (4, button_start, B_CANCEL, NORMAL_BUTTON,
cancel_button, 0, 0, "cancel-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, dd = create_dlg (0, 0, SORT_Y, SORT_X, dialog_colors, NULL,
"[Sort Order...]", "sort", DLG_CENTER); "[Sort Order...]", sort_title, DLG_CENTER);
x_set_dialog_title (dd, sort_title);
add_widget (dd, add_widget (dd,
button_new (10, button_pos, B_CANCEL, NORMAL_BUTTON, cancel_button, button_new (10, button_pos, B_CANCEL, NORMAL_BUTTON, cancel_button,
@ -570,8 +567,7 @@ init_disp_bits_box (void)
do_refresh(); do_refresh();
dbits_dlg = create_dlg( 0, 0, DISPY, DISPX, dialog_colors, dbits_dlg = create_dlg( 0, 0, DISPY, DISPX, dialog_colors,
NULL, "[Display bits]", "Display bits", DLG_CENTER ); NULL, "[Display bits]", _(" Display bits "), DLG_CENTER);
x_set_dialog_title( dbits_dlg, _(" Display bits "));
add_widget( dbits_dlg, add_widget( dbits_dlg,
label_new( 3, 4, _("Input / display codepage:"), NULL)); label_new( 3, 4, _("Input / display codepage:"), NULL));
@ -975,8 +971,8 @@ jobs_cmd (void)
#endif /* ENABLE_NLS */ #endif /* ENABLE_NLS */
jobs_dlg = create_dlg (0, 0, JOBS_Y, JOBS_X, dialog_colors, NULL, jobs_dlg = create_dlg (0, 0, JOBS_Y, JOBS_X, dialog_colors, NULL,
"[Background jobs]", "jobs", DLG_CENTER); "[Background jobs]", _("Background Jobs"),
x_set_dialog_title (jobs_dlg, _("Background Jobs")); DLG_CENTER);
bg_list = listbox_new (2, 3, JOBS_X-7, JOBS_Y-9, listbox_nothing, 0, "listbox"); bg_list = listbox_new (2, 3, JOBS_X-7, JOBS_Y-9, listbox_nothing, 0, "listbox");
add_widget (jobs_dlg, bg_list); 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) if (!user)
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); 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); g_free (title);
in_user = input_new (5, istart, INPUT_COLOR, ilen, user, "auth_name"); in_user = input_new (5, istart, INPUT_COLOR, ilen, user, "auth_name");

View File

@ -199,9 +199,8 @@ init_chmod (void)
ch_dlg = ch_dlg =
create_dlg (0, 0, 22 - single_set, 70, dialog_colors, create_dlg (0, 0, 22 - single_set, 70, dialog_colors,
chmod_callback, "[Chmod]", "chmod", DLG_CENTER); chmod_callback, "[Chmod]", _("Chmod command"),
DLG_CENTER);
x_set_dialog_title (ch_dlg, _("Chmod command"));
for (i = 0; i < BUTTONS; i++) { for (i = 0; i < BUTTONS; i++) {
if (i == 2 && single_set) if (i == 2 && single_set)

View File

@ -162,8 +162,7 @@ init_chown (void)
ch_dlg = ch_dlg =
create_dlg (0, 0, 18, 74, dialog_colors, chown_callback, "[Chown]", create_dlg (0, 0, 18, 74, dialog_colors, chown_callback, "[Chown]",
"chown", DLG_CENTER); _(" Chown command "), DLG_CENTER);
x_set_dialog_title (ch_dlg, _(" Chown command "));
for (i = 0; i < BUTTONS - single_set; i++) for (i = 0; i < BUTTONS - single_set; i++)
add_widget (ch_dlg, add_widget (ch_dlg,

View File

@ -962,15 +962,3 @@ int dlg_select_nth_widget (Dlg_head *h, int n)
return dlg_select_widget (h, w->widget); 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);
}

View File

@ -132,9 +132,6 @@ Dlg_head *create_dlg (int y1, int x1, int lines, int cols,
int (*callback) (struct Dlg_head *, int, int), int (*callback) (struct Dlg_head *, int, int),
char *help_ctx, const char *title, int flags); 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: */ /* The flags: */
#define DLG_BACKWARD 32 /* Tab order is reverse to the index order */ #define DLG_BACKWARD 32 /* Tab order is reverse to the index order */

View File

@ -196,9 +196,7 @@ find_par_start:
in_contents = g_strdup (""); in_contents = g_strdup ("");
find_dlg = create_dlg (0, 0, FIND_Y, FIND_X, dialog_colors, NULL, find_dlg = create_dlg (0, 0, FIND_Y, FIND_X, dialog_colors, NULL,
"[Find File]", "findfile", DLG_CENTER); "[Find File]", _("Find File"), DLG_CENTER);
x_set_dialog_title (find_dlg, _("Find File"));
add_widget (find_dlg, button_new (11, b2, B_CANCEL, NORMAL_BUTTON, add_widget (find_dlg, button_new (11, b2, B_CANCEL, NORMAL_BUTTON,
buts[2], 0 ,0, "cancel")); 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_dlg = create_dlg (0, 0, FIND2_Y, FIND2_X, dialog_colors,
find_callback, "[Find File]", "mfind", DLG_CENTER); find_callback, "[Find File]", _("Find file"), DLG_CENTER);
x_set_dialog_title (find_dlg, _("Find file"));
add_widget (find_dlg, add_widget (find_dlg,
button_new (FIND2_Y-3, fbuts[7].x, B_VIEW, NORMAL_BUTTON, button_new (FIND2_Y-3, fbuts[7].x, B_VIEW, NORMAL_BUTTON,

View File

@ -440,9 +440,7 @@ static void init_layout (void)
layout_dlg = create_dlg (0, 0, 15, first_width + second_width + 9, layout_dlg = create_dlg (0, 0, 15, first_width + second_width + 9,
dialog_colors, layout_callback, dialog_colors, layout_callback,
"[Layout]", "layout", DLG_CENTER); "[Layout]", _("Layout"), DLG_CENTER);
x_set_dialog_title (layout_dlg, _("Layout"));
add_widget (layout_dlg, add_widget (layout_dlg,
button_new (BY, b3, B_CANCEL, NORMAL_BUTTON, cancel_button, 0, 0, "c")); button_new (BY, b3, B_CANCEL, NORMAL_BUTTON, cancel_button, 0, 0, "c"));

View File

@ -256,9 +256,8 @@ static void init_learn (void)
do_refresh (); do_refresh ();
learn_dlg = create_dlg (0, 0, 23, 78, dialog_colors, learn_dlg = create_dlg (0, 0, 23, 78, dialog_colors,
learn_callback, "[Learn keys]", "Learn keys", learn_callback, "[Learn keys]",
DLG_CENTER); _("Learn keys"), DLG_CENTER);
x_set_dialog_title (learn_dlg, _("Learn keys"));
#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 #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

View File

@ -166,8 +166,7 @@ init_listmode (char *oldlistformat)
listmode_dlg = listmode_dlg =
create_dlg (0, 0, 22, 74, dialog_colors, listmode_callback, create_dlg (0, 0, 22, 74, dialog_colors, listmode_callback,
listmode_section, "listmode", DLG_CENTER); listmode_section, "Listing format edit", DLG_CENTER);
x_set_dialog_title (listmode_dlg, "Listing format edit");
#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 #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

View File

@ -191,9 +191,7 @@ static void init_configure (void)
conf_dlg = create_dlg (0, 0, 20, first_width + second_width + 9, conf_dlg = create_dlg (0, 0, 20, first_width + second_width + 9,
dialog_colors, configure_callback, "[Configuration]", dialog_colors, configure_callback, "[Configuration]",
"option", DLG_CENTER); _("Configure options"), DLG_CENTER);
x_set_dialog_title (conf_dlg, _("Configure options"));
add_widget (conf_dlg, add_widget (conf_dlg,
button_new (BY, b3, B_CANCEL, NORMAL_BUTTON, button_new (BY, b3, B_CANCEL, NORMAL_BUTTON,

View File

@ -163,9 +163,8 @@ static void init_panelize (void)
do_refresh (); do_refresh ();
panelize_dlg = create_dlg (0, 0, 22, panelize_cols, dialog_colors, panelize_dlg = create_dlg (0, 0, 22, panelize_cols, dialog_colors,
panelize_callback, "[External panelize]", "panelize", panelize_callback, "[External panelize]",
DLG_CENTER); _("External panelize"), DLG_CENTER);
x_set_dialog_title (panelize_dlg, _("External panelize"));
#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 #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

View File

@ -946,8 +946,7 @@ show_hist (Hist * history, int widget_x, int widget_y)
query_dlg = query_dlg =
create_dlg (y, x, h, w, dialog_colors, NULL, "[History-query]", create_dlg (y, x, h, w, dialog_colors, NULL, "[History-query]",
"history", DLG_COMPACT); i18n_htitle (), DLG_COMPACT);
x_set_dialog_title (query_dlg, i18n_htitle ());
query_list = listbox_new (1, 1, w - 2, h - 2, listbox_finish, 0, NULL); query_list = listbox_new (1, 1, w - 2, h - 2, listbox_finish, 0, NULL);
add_widget (query_dlg, query_list); add_widget (query_dlg, query_list);
hi = z; hi = z;

View File

@ -76,8 +76,7 @@ Listbox *create_listbox_window (int cols, int lines, char *title, char *help)
/* Create components */ /* Create components */
listbox->dlg = create_dlg (ypos, xpos, lines+6, cols+4, dialog_colors, listbox->dlg = create_dlg (ypos, xpos, lines+6, cols+4, dialog_colors,
NULL, help, "listbox", DLG_CENTER); NULL, help, title, DLG_CENTER);
x_set_dialog_title (listbox->dlg, title);
listbox->list = listbox_new (2, 2, cols, lines, listbox_finish, 0, "li"); 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 */ /* prepare dialog */
query_dlg = create_dlg (ypos, xpos, lines, cols, query_colors, NULL, query_dlg = create_dlg (ypos, xpos, lines, cols, query_colors, NULL,
"[QueryBox]", "query", DLG_BACKWARD); "[QueryBox]", header, DLG_BACKWARD);
x_set_dialog_title (query_dlg, header);
if (count > 0){ if (count > 0){
@ -333,13 +331,11 @@ int quick_dialog_skip (QuickDialog *qd, int nskip)
if (qd->xpos == -1) if (qd->xpos == -1)
dd = create_dlg (0, 0, qd->ylen, qd->xlen, dialog_colors, quick_callback, 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 else
dd = create_dlg (qd->ypos, qd->xpos, qd->ylen, qd->xlen, dialog_colors, dd = create_dlg (qd->ypos, qd->xpos, qd->ylen, qd->xlen, dialog_colors,
quick_callback, quick_callback,
qd->help, qd->class, DLG_NONE); qd->help, qd->title, DLG_NONE);
x_set_dialog_title (dd, qd->title);
/* We pass this to the callback */ /* We pass this to the callback */
dd->cols = qd->xlen; dd->cols = qd->xlen;