RCS file: /cvsroot/mc/mc/src/cmd.c,v
retrieving revision 1.164
diff -u -p -r1.164 cmd.c
|
|
view_file_cmd (void) |
229 | 228 | |
230 | 229 | filename = |
231 | 230 | input_expand_dialog (_(" View file "), _(" Filename:"), |
232 | | selection (current_panel)->fname); |
| 231 | " View file ", selection (current_panel)->fname); |
233 | 232 | if (!filename) |
234 | 233 | return; |
235 | 234 | |
… |
… |
filtered_view_cmd (void) |
252 | 251 | command = |
253 | 252 | input_dialog (_(" Filtered view "), |
254 | 253 | _(" Filter command and arguments:"), |
| 254 | " Filtered view ", |
255 | 255 | selection (current_panel)->fname); |
256 | 256 | if (!command) |
257 | 257 | return; |
… |
… |
mkdir_cmd (void) |
350 | 350 | |
351 | 351 | dir = |
352 | 352 | input_expand_dialog (_("Create a new Directory"), |
353 | | _(" Enter directory name:"), ""); |
| 353 | _(" Enter directory name:"), |
| 354 | "Create a new Directory", ""); |
354 | 355 | if (!dir) |
355 | 356 | return; |
356 | 357 | |
… |
… |
set_panel_filter (WPanel *p) |
422 | 423 | |
423 | 424 | reg_exp = input_dialog_help (_(" Filter "), |
424 | 425 | _(" Set expression for filtering filenames"), |
425 | | "[Filter...]", x); |
| 426 | "[Filter...]", " Filter ", x); |
426 | 427 | if (!reg_exp) |
427 | 428 | return; |
428 | 429 | set_panel_filter_to (p, reg_exp); |
… |
… |
void reverse_selection_cmd (void) |
468 | 469 | } |
469 | 470 | |
470 | 471 | static void |
471 | | select_unselect_cmd (const char *title, int cmd) |
| 472 | select_unselect_cmd (const char *title, const char *history_name, int cmd) |
472 | 473 | { |
473 | 474 | char *reg_exp, *reg_exp_t; |
474 | 475 | int i; |
475 | 476 | int c; |
476 | 477 | int dirflag = 0; |
477 | 478 | |
478 | | reg_exp = input_dialog (title, "", easy_patterns ? "*" : "."); |
| 479 | reg_exp = input_dialog (title, "", history_name, easy_patterns ? "*" : "."); |
479 | 480 | if (!reg_exp) |
480 | 481 | return; |
481 | 482 | if (!*reg_exp) { |
… |
… |
select_unselect_cmd (const char *title, |
521 | 522 | |
522 | 523 | void select_cmd (void) |
523 | 524 | { |
524 | | select_unselect_cmd (_(" Select "), 1); |
| 525 | select_unselect_cmd (_(" Select "), " Select ", 1); |
525 | 526 | } |
526 | 527 | |
527 | 528 | void unselect_cmd (void) |
528 | 529 | { |
529 | | select_unselect_cmd (_(" Unselect "), 0); |
| 530 | select_unselect_cmd (_(" Unselect "), " Unselect ", 0); |
530 | 531 | } |
531 | 532 | |
532 | 533 | /* Check if the file exists */ |
… |
… |
do_link (int symbolic_link, const char * |
903 | 904 | |
904 | 905 | if (!symbolic_link) { |
905 | 906 | src = g_strdup_printf (_("Link %s to:"), name_trunc (fname, 46)); |
906 | | dest = input_expand_dialog (_(" Link "), src, ""); |
| 907 | dest = input_expand_dialog (_(" Link "), src, " Link ", ""); |
907 | 908 | if (!dest || !*dest) |
908 | 909 | goto cleanup; |
909 | 910 | save_cwds_stat (); |
… |
… |
void edit_symlink_cmd (void) |
972 | 988 | i = readlink (p, buffer, MC_MAXPATHLEN - 1); |
973 | 989 | if (i > 0) { |
974 | 990 | buffer [i] = 0; |
975 | | dest = input_expand_dialog (_(" Edit symlink "), q, buffer); |
| 991 | dest = input_expand_dialog (_(" Edit symlink "), q, " Edit symlink ", buffer); |
976 | 992 | if (dest) { |
977 | 993 | if (*dest && strcmp (buffer, dest)) { |
978 | 994 | save_cwds_stat (); |
… |
… |
get_random_hint (int force) |
1085 | 1101 | |
1086 | 1102 | #if defined(USE_NETCODE) || defined(USE_EXT2FSLIB) |
1087 | 1103 | static void |
1088 | | nice_cd (const char *text, const char *xtext, const char *help, const char *prefix, int to_home) |
| 1104 | nice_cd (const char *text, const char *xtext, const char *help, |
| 1105 | const char *history_name, const char *prefix, int to_home) |
1089 | 1106 | { |
1090 | 1107 | char *machine; |
1091 | 1108 | char *cd_path; |
… |
… |
nice_cd (const char *text, const char *x |
1093 | 1110 | if (!SELECTED_IS_PANEL) |
1094 | 1111 | return; |
1095 | 1112 | |
1096 | | machine = input_dialog_help (text, |
1097 | | xtext, |
1098 | | help, ""); |
| 1113 | machine = input_dialog_help (text, xtext, help, history_name, ""); |
1099 | 1114 | if (!machine) |
1100 | 1115 | return; |
1101 | 1116 | |
… |
… |
static const char *machine_str = N_(" En |
1125 | 1140 | void netlink_cmd (void) |
1126 | 1141 | { |
1127 | 1142 | nice_cd (_(" Link to a remote machine "), _(machine_str), |
1128 | | "[Network File System]", "/#mc:", 1); |
| 1143 | "[Network File System]", " Link to a remote machine ", |
| 1144 | "/#mc:", 1); |
1129 | 1145 | } |
1130 | 1146 | #endif /* WITH_MCFS */ |
1131 | 1147 | |
1132 | 1148 | void ftplink_cmd (void) |
1133 | 1149 | { |
1134 | 1150 | nice_cd (_(" FTP to machine "), _(machine_str), |
1135 | | "[FTP File System]", "/#ftp:", 1); |
| 1151 | "[FTP File System]", " FTP to machine ", "/#ftp:", 1); |
1136 | 1152 | } |
1137 | 1153 | |
1138 | 1154 | void fishlink_cmd (void) |
1139 | 1155 | { |
1140 | 1156 | nice_cd (_(" Shell link to machine "), _(machine_str), |
1141 | | "[FIle transfer over SHell filesystem]", "/#sh:", 1); |
| 1157 | "[FIle transfer over SHell filesystem]", " Shell link to machine ", |
| 1158 | "/#sh:", 1); |
1142 | 1159 | } |
1143 | 1160 | |
1144 | 1161 | #ifdef WITH_SMBFS |
1145 | 1162 | void smblink_cmd (void) |
1146 | 1163 | { |
1147 | 1164 | nice_cd (_(" SMB link to machine "), _(machine_str), |
1148 | | "[SMB File System]", "/#smb:", 0); |
| 1165 | "[SMB File System]", " SMB link to machine ", |
| 1166 | "/#smb:", 0); |
1149 | 1167 | } |
1150 | 1168 | #endif /* WITH_SMBFS */ |
1151 | 1169 | #endif /* USE_NETCODE */ |
… |
… |
void undelete_cmd (void) |
1156 | 1174 | nice_cd (_(" Undelete files on an ext2 file system "), |
1157 | 1175 | _(" Enter device (without /dev/) to undelete\n " |
1158 | 1176 | " files on: (F1 for details)"), |
1159 | | "[Undelete File System]", "/#undel:", 0); |
| 1177 | "[Undelete File System]", " Undelete files on an ext2 file system ", |
| 1178 | "/#undel:", 0); |
1160 | 1179 | } |
1161 | 1180 | #endif /* USE_EXT2FSLIB */ |
1162 | 1181 | |
RCS file: /cvsroot/mc/mc/src/ext.c,v
retrieving revision 1.79
diff -u -p -r1.79 ext.c
|
|
exec_extension (const char *filename, co |
113 | 113 | if (*data == '}') { |
114 | 114 | char *parameter; |
115 | 115 | parameter_found = 0; |
116 | | parameter = input_dialog (_(" Parameter "), prompt, ""); |
| 116 | parameter = input_dialog (_(" Parameter "), prompt, " Parameter ", ""); |
117 | 117 | if (!parameter) { |
118 | 118 | /* User canceled */ |
119 | 119 | fclose (cmd_file); |
RCS file: /cvsroot/mc/mc/src/hotlist.c,v
retrieving revision 1.85
diff -u -p -r1.85 hotlist.c
|
|
void add2hotlist_cmd (void) |
1041 | 1041 | strip_password (label_string, 1); |
1042 | 1042 | |
1043 | 1043 | prompt = g_strdup_printf (cp, path_trunc (current_panel->cwd, COLS-2*UX-(l+8))); |
1044 | | label = input_dialog (_(" Add to hotlist "), prompt, label_string); |
| 1044 | label = input_dialog (_(" Add to hotlist "), prompt, " Add to hotlist ", label_string); |
1045 | 1045 | g_free (prompt); |
1046 | 1046 | |
1047 | 1047 | if (!label || !*label) { |
RCS file: /cvsroot/mc/mc/src/panelize.c,v
retrieving revision 1.51
diff -u -p -r1.51 panelize.c
|
|
add2panelize_cmd (void) |
225 | 225 | if (pname->buffer && (*pname->buffer)) { |
226 | 226 | label = input_dialog (_(" Add to external panelize "), |
227 | 227 | _(" Enter command label: "), |
| 228 | " Add to external panelize ", |
228 | 229 | ""); |
229 | 230 | if (!label) |
230 | 231 | return; |
RCS file: /cvsroot/mc/mc/src/user.c,v
retrieving revision 1.76
diff -u -p -r1.76 user.c
|
|
execute_menu_command (WEdit *edit_widget |
603 | 603 | if (*commands == '}'){ |
604 | 604 | char *tmp; |
605 | 605 | *parameter = 0; |
606 | | parameter = input_dialog (_(" Parameter "), prompt, ""); |
| 606 | parameter = input_dialog (_(" Parameter "), prompt, " Parameter ", ""); |
607 | 607 | if (!parameter || !*parameter){ |
608 | 608 | /* User canceled */ |
609 | 609 | fclose (cmd_file); |
RCS file: /cvsroot/mc/mc/src/view.c,v
retrieving revision 1.356
diff -u -p -r1.356 view.c
|
|
view_moveto_line_cmd (WView *view) |
2730 | 2730 | g_snprintf (prompt, sizeof (prompt), |
2731 | 2731 | _(" The current line number is %d.\n" |
2732 | 2732 | " Enter the new line number:"), (int) (line + 1)); |
2733 | | answer = input_dialog (_(" Goto line "), prompt, ""); |
| 2733 | answer = input_dialog (_(" Goto line "), prompt, " Goto line ", ""); |
2734 | 2734 | if (answer != NULL && answer[0] != '\0') { |
2735 | 2735 | errno = 0; |
2736 | 2736 | line = strtoul (answer, &answer_end, 10); |
… |
… |
view_moveto_addr_cmd (WView *view) |
2751 | 2751 | g_snprintf (prompt, sizeof (prompt), |
2752 | 2752 | _(" The current address is 0x%lx.\n" |
2753 | 2753 | " Enter the new address:"), view->hex_cursor); |
2754 | | line = input_dialog (_(" Goto Address "), prompt, ""); |
| 2754 | line = input_dialog (_(" Goto Address "), prompt, " Goto Address ", ""); |
2755 | 2755 | if (line != NULL) { |
2756 | 2756 | if (*line != '\0') { |
2757 | 2757 | addr = strtoul (line, &error, 0); |
… |
… |
regexp_search (WView *view, int directio |
2781 | 2781 | |
2782 | 2782 | defval = (view->search_exp != NULL) ? view->search_exp : ""; |
2783 | 2783 | |
2784 | | regexp = input_dialog (_("Search"), _(" Enter regexp:"), defval); |
| 2784 | regexp = input_dialog (_("Search"), _(" Enter regexp:"), "Search", defval); |
2785 | 2785 | if (regexp == NULL || regexp[0] == '\0') |
2786 | 2786 | goto cleanup; |
2787 | 2787 | |
RCS file: /cvsroot/mc/mc/src/wtools.c,v
retrieving revision 1.85
diff -u -p -r1.85 wtools.c
|
|
int quick_dialog (QuickDialog *qd) |
433 | 433 | * |
434 | 434 | * If the arguments "header" and "text" should be translated, |
435 | 435 | * that MUST be done by the caller of fg_input_dialog_help(). |
| 436 | * |
| 437 | * The argument "history_name" holds the name of a section |
| 438 | * in the history file. Data entered in the input field of |
| 439 | * the dialog box will be stored there. |
436 | 440 | * |
437 | 441 | */ |
438 | 442 | static char * |
439 | 443 | fg_input_dialog_help (const char *header, const char *text, const char *help, |
440 | | const char *def_text) |
| 444 | const char *history_name, const char *def_text) |
441 | 445 | { |
442 | 446 | QuickDialog Quick_input; |
443 | 447 | QuickWidget quick_widgets[] = { |
… |
… |
fg_input_dialog_help (const char *header |
457 | 461 | char histname[64] = "inp|"; |
458 | 462 | char *p_text; |
459 | 463 | |
460 | | /* we need a unique name for histname because widget.c:history_tool() |
461 | | needs a unique name for each dialog - using the header is ideal */ |
462 | | g_strlcpy (histname + 3, header, 61); |
463 | | quick_widgets[2].histname = histname; |
| 464 | if (history_name != NULL && *history_name != '\0') { |
| 465 | g_strlcpy (histname + 3, history_name, 61); |
| 466 | quick_widgets[2].histname = histname; |
| 467 | } |
464 | 468 | |
465 | 469 | msglen (text, &lines, &cols); |
466 | 470 | len = max ((int) strlen (header), cols) + 4; |
… |
… |
fg_input_dialog_help (const char *header |
524 | 528 | * that MUST be done by the caller of these wrappers. |
525 | 529 | */ |
526 | 530 | char * |
527 | | input_dialog_help (const char *header, const char *text, const char *help, const char *def_text) |
| 531 | input_dialog_help (const char *header, const char *text, const char *help, |
| 532 | const char *history_name, const char *def_text) |
528 | 533 | { |
529 | 534 | #ifdef WITH_BACKGROUND |
530 | 535 | if (we_are_background) |
531 | | return parent_call_string ((void *) fg_input_dialog_help, 4, |
| 536 | return parent_call_string ((void *) fg_input_dialog_help, 5, |
532 | 537 | strlen (header), header, strlen (text), |
533 | 538 | text, strlen (help), help, |
| 539 | strlen (history_name), history_name, |
534 | 540 | strlen (def_text), def_text); |
535 | 541 | else |
536 | 542 | #endif /* WITH_BACKGROUND */ |
537 | | return fg_input_dialog_help (header, text, help, def_text); |
| 543 | return fg_input_dialog_help (header, text, help, history_name, def_text); |
538 | 544 | } |
539 | 545 | |
540 | 546 | /* Show input dialog with default help, background safe */ |
541 | | char *input_dialog (const char *header, const char *text, const char *def_text) |
| 547 | char *input_dialog (const char *header, const char *text, |
| 548 | const char *history_name, const char *def_text) |
542 | 549 | { |
543 | | return input_dialog_help (header, text, "[Input Line Keys]", def_text); |
| 550 | return input_dialog_help (header, text, "[Input Line Keys]", history_name, def_text); |
544 | 551 | } |
545 | 552 | |
546 | 553 | char * |
547 | | input_expand_dialog (const char *header, const char *text, const char *def_text) |
| 554 | input_expand_dialog (const char *header, const char *text, |
| 555 | const char *history_name, const char *def_text) |
548 | 556 | { |
549 | 557 | char *result; |
550 | 558 | char *expanded; |
551 | 559 | |
552 | | result = input_dialog (header, text, def_text); |
| 560 | result = input_dialog (header, text, history_name, def_text); |
553 | 561 | if (result) { |
554 | 562 | expanded = tilde_expand (result); |
555 | 563 | g_free (result); |
RCS file: /cvsroot/mc/mc/src/tree.c,v
retrieving revision 1.69
diff -u -p -r1.69 tree.c
|
|
static void tree_copy (WTree *tree, cons |
597 | 597 | return; |
598 | 598 | g_snprintf (cmd_buf, sizeof(cmd_buf), _("Copy \"%s\" directory to:"), |
599 | 599 | name_trunc (tree->selected_ptr->name, 50)); |
600 | | dest = input_expand_dialog (_(" Copy "), cmd_buf, default_dest); |
| 600 | dest = input_expand_dialog (_(" Copy "), cmd_buf, " Copy ", default_dest); |
601 | 601 | |
602 | 602 | if (!dest) |
603 | 603 | return; |
… |
… |
static void tree_move (WTree *tree, cons |
640 | 640 | return; |
641 | 641 | g_snprintf (cmd_buf, sizeof (cmd_buf), _("Move \"%s\" directory to:"), |
642 | 642 | name_trunc (tree->selected_ptr->name, 50)); |
643 | | dest = input_expand_dialog (_(" Move "), cmd_buf, default_dest); |
| 643 | dest = input_expand_dialog (_(" Move "), cmd_buf, " Move ", default_dest); |
644 | 644 | if (!dest) |
645 | 645 | return; |
646 | 646 | if (!*dest){ |
RCS file: /cvsroot/mc/mc/src/wtools.h,v
retrieving revision 1.28
diff -u -p -r1.28 wtools.h
|
|
int quick_dialog_skip (QuickDialog *qd, |
57 | 57 | /* Pass this as def_text to request a password */ |
58 | 58 | #define INPUT_PASSWORD ((char *) -1) |
59 | 59 | |
60 | | char *input_dialog (const char *header, const char *text, const char *def_text); |
61 | | char *input_dialog_help (const char *header, const char *text, const char *help, const char *def_text); |
62 | | char *input_expand_dialog (const char *header, const char *text, const char *def_text); |
| 60 | char *input_dialog (const char *header, const char *text, |
| 61 | const char *history_name, const char *def_text); |
| 62 | char *input_dialog_help (const char *header, const char *text, const char *help, |
| 63 | const char *history_name, const char *def_text); |
| 64 | char *input_expand_dialog (const char *header, const char *text, |
| 65 | const char *history_name, const char *def_text); |
63 | 66 | |
64 | 67 | void query_set_sel (int new_sel); |
65 | 68 | |
RCS file: /cvsroot/mc/mc/edit/editcmd.c,v
retrieving revision 1.151
diff -u -p -r1.151 editcmd.c
|
|
|
57 | 57 | #include "../src/charsets.h" |
58 | 58 | #include "../src/selcodepage.h" |
59 | 59 | |
60 | | #define edit_get_load_file(f,h) input_expand_dialog (h, _(" Enter file name: "), f) |
61 | | #define edit_get_save_file(f,h) input_expand_dialog (h, _(" Enter file name: "), f) |
62 | | |
63 | 60 | struct selection { |
64 | 61 | unsigned char * text; |
65 | 62 | int len; |
… |
… |
edit_save_as_cmd (WEdit *edit) |
505 | 502 | int save_lock = 0; |
506 | 503 | int different_filename = 0; |
507 | 504 | |
508 | | exp = edit_get_save_file (edit->filename, _(" Save As ")); |
| 505 | exp = input_expand_dialog (_(" Save As "), _(" Enter file name: "), |
| 506 | " Save As ", edit->filename); |
509 | 507 | edit_push_action (edit, KEY_PRESS + edit->start_display); |
510 | 508 | |
511 | 509 | if (exp) { |
… |
… |
edit_load_cmd (WEdit *edit) |
887 | 885 | } |
888 | 886 | } |
889 | 887 | |
890 | | exp = edit_get_load_file (edit->filename, _(" Load ")); |
| 888 | exp = input_expand_dialog (_(" Load "), _(" Enter file name: "), |
| 889 | " Load ", edit->filename); |
891 | 890 | |
892 | 891 | if (exp) { |
893 | 892 | if (*exp) |
… |
… |
edit_goto_cmd (WEdit *edit) |
2316 | 2315 | char s[32]; |
2317 | 2316 | |
2318 | 2317 | g_snprintf (s, sizeof (s), "%ld", line); |
2319 | | f = input_dialog (_(" Goto line "), _(" Enter line: "), line ? s : ""); |
| 2318 | f = input_dialog (_(" Goto line "), _(" Enter line: "), " Goto line ", |
| 2319 | line ? s : ""); |
2320 | 2320 | if (!f) |
2321 | 2321 | return; |
2322 | 2322 | |
… |
… |
edit_save_block_cmd (WEdit *edit) |
2350 | 2350 | if (eval_marks (edit, &start_mark, &end_mark)) |
2351 | 2351 | return 1; |
2352 | 2352 | exp = |
2353 | | edit_get_save_file (catstrs (home_dir, PATH_SEP_STR CLIP_FILE, (char *) NULL), |
2354 | | _(" Save Block ")); |
| 2353 | input_expand_dialog (_(" Save Block "), _(" Enter file name: "), |
| 2354 | " Save Block ", |
| 2355 | catstrs (home_dir, PATH_SEP_STR CLIP_FILE, (char *) NULL)); |
2355 | 2356 | edit_push_action (edit, KEY_PRESS + edit->start_display); |
2356 | 2357 | if (exp) { |
2357 | 2358 | if (!*exp) { |
… |
… |
edit_save_block_cmd (WEdit *edit) |
2379 | 2380 | int |
2380 | 2381 | edit_insert_file_cmd (WEdit *edit) |
2381 | 2382 | { |
2382 | | char *exp = edit_get_load_file (catstrs (home_dir, PATH_SEP_STR CLIP_FILE, (char *) NULL), |
2383 | | _(" Insert File ")); |
| 2383 | char *exp = input_expand_dialog (_(" Insert File "), _(" Enter file name: "), |
| 2384 | " Insert File ", |
| 2385 | catstrs (home_dir, PATH_SEP_STR CLIP_FILE, (char *) NULL)); |
2384 | 2386 | edit_push_action (edit, KEY_PRESS + edit->start_display); |
2385 | 2387 | if (exp) { |
2386 | 2388 | if (!*exp) { |
… |
… |
int edit_sort_cmd (WEdit * edit) |
2419 | 2421 | |
2420 | 2422 | exp = input_dialog (_(" Run Sort "), |
2421 | 2423 | _(" Enter sort options (see manpage) separated by whitespace: "), |
2422 | | (old != NULL) ? old : ""); |
| 2424 | " Run Sort ", (old != NULL) ? old : ""); |
2423 | 2425 | |
2424 | 2426 | if (!exp) |
2425 | 2427 | return 1; |
… |
… |
edit_ext_cmd (WEdit *edit) |
2460 | 2462 | |
2461 | 2463 | exp = |
2462 | 2464 | input_dialog (_("Paste output of external command"), |
2463 | | _("Enter shell command(s):"), NULL); |
| 2465 | _("Enter shell command(s):"), |
| 2466 | "Paste output of external command", NULL); |
2464 | 2467 | |
2465 | 2468 | if (!exp) |
2466 | 2469 | return 1; |
RCS file: /cvsroot/mc/mc/vfs/ftpfs.c,v
retrieving revision 1.192
diff -u -p -r1.192 ftpfs.c
|
|
ftpfs_login_server (struct vfs_class *me |
498 | 498 | p = g_strdup_printf (_ |
499 | 499 | ("FTP: Account required for user %s"), |
500 | 500 | SUP.user); |
501 | | op = input_dialog (p, _("Account:"), ""); |
| 501 | op = input_dialog (p, _("Account:"), (char *) NULL, ""); |
502 | 502 | g_free (p); |
503 | 503 | if (op == NULL) |
504 | 504 | ERRNOR (EPERM, 0); |
RCS file: /cvsroot/mc/mc/vfs/utilvfs.c,v
retrieving revision 1.43
diff -u -p -r1.43 utilvfs.c
|
|
vfs_die (const char *m) |
842 | 842 | char * |
843 | 843 | vfs_get_password (const char *msg) |
844 | 844 | { |
845 | | return input_dialog (msg, _("Password:"), INPUT_PASSWORD); |
| 845 | return input_dialog (msg, _("Password:"), (char *) NULL, INPUT_PASSWORD); |
846 | 846 | } |