From a144f2e4f6d82e4aeb3aa862ab5356600a70f259 Mon Sep 17 00:00:00 2001 From: Patrick Winnertz Date: Wed, 14 Jan 2009 01:01:18 +0100 Subject: [PATCH 1/4] Apply patch to fix localised history headers to mc-4.6 branch. This is bad as if the localised string changed or you start mc in another language your history will be lost. --- edit/editcmd.c | 27 +++++++++++++++------------ src/cmd.c | 41 +++++++++++++++++++++++------------------ src/ext.c | 2 +- src/hotlist.c | 2 +- src/panelize.c | 1 + src/tree.c | 4 ++-- src/user.c | 2 +- src/view.c | 6 +++--- src/wtools.c | 32 ++++++++++++++++++++------------ src/wtools.h | 9 ++++++--- vfs/ftpfs.c | 2 +- vfs/utilvfs.c | 2 +- 12 files changed, 75 insertions(+), 55 deletions(-) diff --git a/edit/editcmd.c b/edit/editcmd.c index 01262f153..407b743f1 100644 --- a/edit/editcmd.c +++ b/edit/editcmd.c @@ -58,9 +58,6 @@ #include "../src/charsets.h" #include "../src/selcodepage.h" -#define edit_get_load_file(f,h) input_expand_dialog (h, _(" Enter file name: "), f) -#define edit_get_save_file(f,h) input_expand_dialog (h, _(" Enter file name: "), f) - struct selection { unsigned char * text; int len; @@ -525,7 +522,8 @@ edit_save_as_cmd (WEdit *edit) int save_lock = 0; int different_filename = 0; - exp = edit_get_save_file (edit->filename, _(" Save As ")); + exp = input_expand_dialog (_(" Save As "), _(" Enter file name: "), + " Save As ", edit->filename); edit_push_action (edit, KEY_PRESS + edit->start_display); if (exp) { @@ -907,7 +905,8 @@ edit_load_cmd (WEdit *edit) } } - exp = edit_get_load_file (edit->filename, _(" Load ")); + exp = input_expand_dialog (_(" Load "), _(" Enter file name: "), + " Load ", edit->filename); if (exp) { if (*exp) @@ -2337,7 +2336,8 @@ edit_goto_cmd (WEdit *edit) char s[32]; g_snprintf (s, sizeof (s), "%ld", line); - f = input_dialog (_(" Goto line "), _(" Enter line: "), line ? s : ""); + f = input_dialog (_(" Goto line "), _(" Enter line: "), " Goto line ", + line ? s : ""); if (!f) return; @@ -2371,8 +2371,9 @@ edit_save_block_cmd (WEdit *edit) if (eval_marks (edit, &start_mark, &end_mark)) return 1; exp = - edit_get_save_file (catstrs (home_dir, PATH_SEP_STR CLIP_FILE, (char *) NULL), - _(" Save Block ")); + input_expand_dialog (_(" Save Block "), _(" Enter file name: "), + " Save Block ", + catstrs (home_dir, PATH_SEP_STR CLIP_FILE, (char *) NULL)); edit_push_action (edit, KEY_PRESS + edit->start_display); if (exp) { if (!*exp) { @@ -2400,8 +2401,9 @@ edit_save_block_cmd (WEdit *edit) int edit_insert_file_cmd (WEdit *edit) { - char *exp = edit_get_load_file (catstrs (home_dir, PATH_SEP_STR CLIP_FILE, (char *) NULL), - _(" Insert File ")); + char *exp = input_expand_dialog (_(" Insert File "), _(" Enter file name: "), + " Insert File ", + catstrs (home_dir, PATH_SEP_STR CLIP_FILE, (char *) NULL)); edit_push_action (edit, KEY_PRESS + edit->start_display); if (exp) { if (!*exp) { @@ -2440,7 +2442,7 @@ int edit_sort_cmd (WEdit * edit) exp = input_dialog (_(" Run Sort "), _(" Enter sort options (see manpage) separated by whitespace: "), - (old != NULL) ? old : ""); + " Run Sort ", (old != NULL) ? old : ""); if (!exp) return 1; @@ -2481,7 +2483,8 @@ edit_ext_cmd (WEdit *edit) exp = input_dialog (_("Paste output of external command"), - _("Enter shell command(s):"), NULL); + _("Enter shell command(s):"), + "Paste output of external command", NULL); if (!exp) return 1; diff --git a/src/cmd.c b/src/cmd.c index 01d110ffb..6e0bec35d 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -229,7 +229,7 @@ view_file_cmd (void) filename = input_expand_dialog (_(" View file "), _(" Filename:"), - selection (current_panel)->fname); + " View file ", selection (current_panel)->fname); if (!filename) return; @@ -252,6 +252,7 @@ filtered_view_cmd (void) command = input_dialog (_(" Filtered view "), _(" Filter command and arguments:"), + " Filtered view ", selection (current_panel)->fname); if (!command) return; @@ -350,7 +351,8 @@ mkdir_cmd (void) dir = input_expand_dialog (_("Create a new Directory"), - _(" Enter directory name:"), ""); + _(" Enter directory name:"), + "Create a new Directory", ""); if (!dir) return; @@ -422,7 +424,7 @@ set_panel_filter (WPanel *p) reg_exp = input_dialog_help (_(" Filter "), _(" Set expression for filtering filenames"), - "[Filter...]", x); + "[Filter...]", " Filter ", x); if (!reg_exp) return; set_panel_filter_to (p, reg_exp); @@ -468,14 +470,14 @@ void reverse_selection_cmd (void) } static void -select_unselect_cmd (const char *title, int cmd) +select_unselect_cmd (const char *title, const char *history_name, int cmd) { char *reg_exp, *reg_exp_t; int i; int c; int dirflag = 0; - reg_exp = input_dialog (title, "", easy_patterns ? "*" : "."); + reg_exp = input_dialog (title, "", history_name, easy_patterns ? "*" : "."); if (!reg_exp) return; if (!*reg_exp) { @@ -521,12 +523,12 @@ select_unselect_cmd (const char *title, int cmd) void select_cmd (void) { - select_unselect_cmd (_(" Select "), 1); + select_unselect_cmd (_(" Select "), " Select ", 1); } void unselect_cmd (void) { - select_unselect_cmd (_(" Unselect "), 0); + select_unselect_cmd (_(" Unselect "), " Unselect ", 0); } /* Check if the file exists */ @@ -903,7 +905,7 @@ do_link (int symbolic_link, const char *fname) if (!symbolic_link) { src = g_strdup_printf (_("Link %s to:"), name_trunc (fname, 46)); - dest = input_expand_dialog (_(" Link "), src, ""); + dest = input_expand_dialog (_(" Link "), src, " Link ", ""); if (!dest || !*dest) goto cleanup; save_cwds_stat (); @@ -972,7 +974,7 @@ void edit_symlink_cmd (void) i = readlink (p, buffer, MC_MAXPATHLEN - 1); if (i > 0) { buffer [i] = 0; - dest = input_expand_dialog (_(" Edit symlink "), q, buffer); + dest = input_expand_dialog (_(" Edit symlink "), q, " Edit symlink ", buffer); if (dest) { if (*dest && strcmp (buffer, dest)) { save_cwds_stat (); @@ -1085,7 +1087,8 @@ get_random_hint (int force) #if defined(USE_NETCODE) || defined(USE_EXT2FSLIB) static void -nice_cd (const char *text, const char *xtext, const char *help, const char *prefix, int to_home) +nice_cd (const char *text, const char *xtext, const char *help, + const char *history_name, const char *prefix, int to_home) { char *machine; char *cd_path; @@ -1093,9 +1096,7 @@ nice_cd (const char *text, const char *xtext, const char *help, const char *pref if (!SELECTED_IS_PANEL) return; - machine = input_dialog_help (text, - xtext, - help, ""); + machine = input_dialog_help (text, xtext, help, history_name, ""); if (!machine) return; @@ -1125,27 +1126,30 @@ static const char *machine_str = N_(" Enter machine name (F1 for details): "); void netlink_cmd (void) { nice_cd (_(" Link to a remote machine "), _(machine_str), - "[Network File System]", "/#mc:", 1); + "[Network File System]", " Link to a remote machine ", + "/#mc:", 1); } #endif /* WITH_MCFS */ void ftplink_cmd (void) { nice_cd (_(" FTP to machine "), _(machine_str), - "[FTP File System]", "/#ftp:", 1); + "[FTP File System]", " FTP to machine ", "/#ftp:", 1); } void fishlink_cmd (void) { nice_cd (_(" Shell link to machine "), _(machine_str), - "[FIle transfer over SHell filesystem]", "/#sh:", 1); + "[FIle transfer over SHell filesystem]", " Shell link to machine ", + "/#sh:", 1); } #ifdef WITH_SMBFS void smblink_cmd (void) { nice_cd (_(" SMB link to machine "), _(machine_str), - "[SMB File System]", "/#smb:", 0); + "[SMB File System]", " SMB link to machine ", + "/#smb:", 0); } #endif /* WITH_SMBFS */ #endif /* USE_NETCODE */ @@ -1156,7 +1160,8 @@ void undelete_cmd (void) nice_cd (_(" Undelete files on an ext2 file system "), _(" Enter device (without /dev/) to undelete\n " " files on: (F1 for details)"), - "[Undelete File System]", "/#undel:", 0); + "[Undelete File System]", " Undelete files on an ext2 file system ", + "/#undel:", 0); } #endif /* USE_EXT2FSLIB */ diff --git a/src/ext.c b/src/ext.c index 8e64d2ce5..7f84e66f5 100644 --- a/src/ext.c +++ b/src/ext.c @@ -114,7 +114,7 @@ exec_extension (const char *filename, const char *data, int *move_dir, if (*data == '}') { char *parameter; parameter_found = 0; - parameter = input_dialog (_(" Parameter "), prompt, ""); + parameter = input_dialog (_(" Parameter "), prompt, " Parameter ", ""); if (!parameter) { /* User canceled */ fclose (cmd_file); diff --git a/src/hotlist.c b/src/hotlist.c index a1183cbb7..b8d1c714f 100644 --- a/src/hotlist.c +++ b/src/hotlist.c @@ -1042,7 +1042,7 @@ void add2hotlist_cmd (void) strip_password (label_string, 1); prompt = g_strdup_printf (cp, path_trunc (current_panel->cwd, COLS-2*UX-(l+8))); - label = input_dialog (_(" Add to hotlist "), prompt, label_string); + label = input_dialog (_(" Add to hotlist "), prompt, " Add to hotlist ", label_string); g_free (prompt); if (!label || !*label) { diff --git a/src/panelize.c b/src/panelize.c index c2d212189..9d0e3c76c 100644 --- a/src/panelize.c +++ b/src/panelize.c @@ -226,6 +226,7 @@ add2panelize_cmd (void) if (pname->buffer && (*pname->buffer)) { label = input_dialog (_(" Add to external panelize "), _(" Enter command label: "), + " Add to external panelize ", ""); if (!label) return; diff --git a/src/tree.c b/src/tree.c index 132d170cf..435d32041 100644 --- a/src/tree.c +++ b/src/tree.c @@ -598,7 +598,7 @@ static void tree_copy (WTree *tree, const char *default_dest) return; g_snprintf (cmd_buf, sizeof(cmd_buf), _("Copy \"%s\" directory to:"), name_trunc (tree->selected_ptr->name, 50)); - dest = input_expand_dialog (_(" Copy "), cmd_buf, default_dest); + dest = input_expand_dialog (_(" Copy "), cmd_buf, " Copy ", default_dest); if (!dest) return; @@ -641,7 +641,7 @@ static void tree_move (WTree *tree, const char *default_dest) return; g_snprintf (cmd_buf, sizeof (cmd_buf), _("Move \"%s\" directory to:"), name_trunc (tree->selected_ptr->name, 50)); - dest = input_expand_dialog (_(" Move "), cmd_buf, default_dest); + dest = input_expand_dialog (_(" Move "), cmd_buf, " Move ", default_dest); if (!dest) return; if (!*dest){ diff --git a/src/user.c b/src/user.c index 01022aa97..0daf77064 100644 --- a/src/user.c +++ b/src/user.c @@ -604,7 +604,7 @@ execute_menu_command (WEdit *edit_widget, const char *commands) if (*commands == '}'){ char *tmp; *parameter = 0; - parameter = input_dialog (_(" Parameter "), prompt, ""); + parameter = input_dialog (_(" Parameter "), prompt, " Parameter ", ""); if (!parameter || !*parameter){ /* User canceled */ fclose (cmd_file); diff --git a/src/view.c b/src/view.c index ddb093d3a..0e8c33e6e 100644 --- a/src/view.c +++ b/src/view.c @@ -2734,7 +2734,7 @@ view_moveto_line_cmd (WView *view) g_snprintf (prompt, sizeof (prompt), _(" The current line number is %d.\n" " Enter the new line number:"), (int) (line + 1)); - answer = input_dialog (_(" Goto line "), prompt, ""); + answer = input_dialog (_(" Goto line "), prompt, " Goto line ", ""); if (answer != NULL && answer[0] != '\0') { errno = 0; line = strtoul (answer, &answer_end, 10); @@ -2755,7 +2755,7 @@ view_moveto_addr_cmd (WView *view) g_snprintf (prompt, sizeof (prompt), _(" The current address is 0x%lx.\n" " Enter the new address:"), view->hex_cursor); - line = input_dialog (_(" Goto Address "), prompt, ""); + line = input_dialog (_(" Goto Address "), prompt, " Goto Address ", ""); if (line != NULL) { if (*line != '\0') { addr = strtoul (line, &error, 0); @@ -2788,7 +2788,7 @@ regexp_search (WView *view, int direction) defval = (last_regexp != NULL ? last_regexp : ""); - regexp = input_dialog (_("Search"), _(" Enter regexp:"), defval); + regexp = input_dialog (_("Search"), _(" Enter regexp:"), "Search", defval); if (regexp == NULL || regexp[0] == '\0') { g_free (regexp); return; diff --git a/src/wtools.c b/src/wtools.c index ac79993fd..97e142826 100644 --- a/src/wtools.c +++ b/src/wtools.c @@ -434,11 +434,15 @@ int quick_dialog (QuickDialog *qd) * * If the arguments "header" and "text" should be translated, * that MUST be done by the caller of fg_input_dialog_help(). + * + * The argument "history_name" holds the name of a section + * in the history file. Data entered in the input field of + * the dialog box will be stored there. * */ static char * fg_input_dialog_help (const char *header, const char *text, const char *help, - const char *def_text) + const char *history_name, const char *def_text) { QuickDialog Quick_input; QuickWidget quick_widgets[] = { @@ -458,10 +462,10 @@ fg_input_dialog_help (const char *header, const char *text, const char *help, char histname[64] = "inp|"; char *p_text; - /* we need a unique name for histname because widget.c:history_tool() - needs a unique name for each dialog - using the header is ideal */ - g_strlcpy (histname + 3, header, 61); - quick_widgets[2].histname = histname; + if (history_name != NULL && *history_name != '\0') { + g_strlcpy (histname + 3, history_name, 61); + quick_widgets[2].histname = histname; + } msglen (text, &lines, &cols); len = max ((int) strlen (header), cols) + 4; @@ -525,32 +529,36 @@ fg_input_dialog_help (const char *header, const char *text, const char *help, * that MUST be done by the caller of these wrappers. */ char * -input_dialog_help (const char *header, const char *text, const char *help, const char *def_text) +input_dialog_help (const char *header, const char *text, const char *help, + const char *history_name, const char *def_text) { #ifdef WITH_BACKGROUND if (we_are_background) - return parent_call_string ((void *) fg_input_dialog_help, 4, + return parent_call_string ((void *) fg_input_dialog_help, 5, strlen (header), header, strlen (text), text, strlen (help), help, + strlen (history_name), history_name, strlen (def_text), def_text); else #endif /* WITH_BACKGROUND */ - return fg_input_dialog_help (header, text, help, def_text); + return fg_input_dialog_help (header, text, help, history_name, def_text); } /* Show input dialog with default help, background safe */ -char *input_dialog (const char *header, const char *text, const char *def_text) +char *input_dialog (const char *header, const char *text, + const char *history_name, const char *def_text) { - return input_dialog_help (header, text, "[Input Line Keys]", def_text); + return input_dialog_help (header, text, "[Input Line Keys]", history_name, def_text); } char * -input_expand_dialog (const char *header, const char *text, const char *def_text) +input_expand_dialog (const char *header, const char *text, + const char *history_name, const char *def_text) { char *result; char *expanded; - result = input_dialog (header, text, def_text); + result = input_dialog (header, text, history_name, def_text); if (result) { expanded = tilde_expand (result); g_free (result); diff --git a/src/wtools.h b/src/wtools.h index 7691f237e..e6e0e163e 100644 --- a/src/wtools.h +++ b/src/wtools.h @@ -57,9 +57,12 @@ int quick_dialog_skip (QuickDialog *qd, int nskip); /* Pass this as def_text to request a password */ #define INPUT_PASSWORD ((char *) -1) -char *input_dialog (const char *header, const char *text, const char *def_text); -char *input_dialog_help (const char *header, const char *text, const char *help, const char *def_text); -char *input_expand_dialog (const char *header, const char *text, const char *def_text); +char *input_dialog (const char *header, const char *text, + const char *history_name, const char *def_text); +char *input_dialog_help (const char *header, const char *text, const char *help, + const char *history_name, const char *def_text); +char *input_expand_dialog (const char *header, const char *text, + const char *history_name, const char *def_text); void query_set_sel (int new_sel); diff --git a/vfs/ftpfs.c b/vfs/ftpfs.c index 43d363c31..bb20cad90 100644 --- a/vfs/ftpfs.c +++ b/vfs/ftpfs.c @@ -499,7 +499,7 @@ ftpfs_login_server (struct vfs_class *me, struct vfs_s_super *super, p = g_strdup_printf (_ ("FTP: Account required for user %s"), SUP.user); - op = input_dialog (p, _("Account:"), ""); + op = input_dialog (p, _("Account:"), (char *) NULL, ""); g_free (p); if (op == NULL) ERRNOR (EPERM, 0); diff --git a/vfs/utilvfs.c b/vfs/utilvfs.c index 5f3b5a9fb..ecbe9f526 100644 --- a/vfs/utilvfs.c +++ b/vfs/utilvfs.c @@ -839,5 +839,5 @@ vfs_die (const char *m) char * vfs_get_password (const char *msg) { - return input_dialog (msg, _("Password:"), INPUT_PASSWORD); + return input_dialog (msg, _("Password:"), (char *) NULL, INPUT_PASSWORD); } From 22fada9ce0f6493d9f33ce4d4a3f31338564fa55 Mon Sep 17 00:00:00 2001 From: Slava Zanko Date: Tue, 20 Jan 2009 00:57:09 +0200 Subject: [PATCH 2/4] History sections names: Make names of sections with function name as prefix string. for example: [inp:mc_mkdir Enter directory name ] 0=... --- edit/editcmd.c | 14 +++++++------- src/cmd.c | 26 +++++++++++++------------- src/ext.c | 2 +- src/hotlist.c | 2 +- src/panelize.c | 2 +- src/tree.c | 4 ++-- src/user.c | 2 +- src/view.c | 6 +++--- 8 files changed, 29 insertions(+), 29 deletions(-) diff --git a/edit/editcmd.c b/edit/editcmd.c index 407b743f1..79c81a6dc 100644 --- a/edit/editcmd.c +++ b/edit/editcmd.c @@ -523,7 +523,7 @@ edit_save_as_cmd (WEdit *edit) int different_filename = 0; exp = input_expand_dialog (_(" Save As "), _(" Enter file name: "), - " Save As ", edit->filename); + ":edit_save_as_cmd: Save As ", edit->filename); edit_push_action (edit, KEY_PRESS + edit->start_display); if (exp) { @@ -906,7 +906,7 @@ edit_load_cmd (WEdit *edit) } exp = input_expand_dialog (_(" Load "), _(" Enter file name: "), - " Load ", edit->filename); + ":edit_load_cmd: Load ", edit->filename); if (exp) { if (*exp) @@ -2336,7 +2336,7 @@ edit_goto_cmd (WEdit *edit) char s[32]; g_snprintf (s, sizeof (s), "%ld", line); - f = input_dialog (_(" Goto line "), _(" Enter line: "), " Goto line ", + f = input_dialog (_(" Goto line "), _(" Enter line: "), ":edit_goto_cmd: Goto line ", line ? s : ""); if (!f) return; @@ -2372,7 +2372,7 @@ edit_save_block_cmd (WEdit *edit) return 1; exp = input_expand_dialog (_(" Save Block "), _(" Enter file name: "), - " Save Block ", + ":edit_save_block_cmd: Save Block ", catstrs (home_dir, PATH_SEP_STR CLIP_FILE, (char *) NULL)); edit_push_action (edit, KEY_PRESS + edit->start_display); if (exp) { @@ -2402,7 +2402,7 @@ int edit_insert_file_cmd (WEdit *edit) { char *exp = input_expand_dialog (_(" Insert File "), _(" Enter file name: "), - " Insert File ", + ":edit_insert_file_cmd: Insert File ", catstrs (home_dir, PATH_SEP_STR CLIP_FILE, (char *) NULL)); edit_push_action (edit, KEY_PRESS + edit->start_display); if (exp) { @@ -2442,7 +2442,7 @@ int edit_sort_cmd (WEdit * edit) exp = input_dialog (_(" Run Sort "), _(" Enter sort options (see manpage) separated by whitespace: "), - " Run Sort ", (old != NULL) ? old : ""); + ":edit_sort_cmd: Run Sort ", (old != NULL) ? old : ""); if (!exp) return 1; @@ -2484,7 +2484,7 @@ edit_ext_cmd (WEdit *edit) exp = input_dialog (_("Paste output of external command"), _("Enter shell command(s):"), - "Paste output of external command", NULL); + ":edit_ext_cmd: Paste output of ext.cmd ", NULL); if (!exp) return 1; diff --git a/src/cmd.c b/src/cmd.c index 6e0bec35d..eecf27ba8 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -229,7 +229,7 @@ view_file_cmd (void) filename = input_expand_dialog (_(" View file "), _(" Filename:"), - " View file ", selection (current_panel)->fname); + ":view_file_cmd: View file ", selection (current_panel)->fname); if (!filename) return; @@ -252,7 +252,7 @@ filtered_view_cmd (void) command = input_dialog (_(" Filtered view "), _(" Filter command and arguments:"), - " Filtered view ", + ":filtered_view_cmd: Filtered view ", selection (current_panel)->fname); if (!command) return; @@ -352,7 +352,7 @@ mkdir_cmd (void) dir = input_expand_dialog (_("Create a new Directory"), _(" Enter directory name:"), - "Create a new Directory", ""); + ":mkdir_cmd: Create a new Directory", ""); if (!dir) return; @@ -424,7 +424,7 @@ set_panel_filter (WPanel *p) reg_exp = input_dialog_help (_(" Filter "), _(" Set expression for filtering filenames"), - "[Filter...]", " Filter ", x); + "[Filter...]", ":set_panel_filter: Filter ", x); if (!reg_exp) return; set_panel_filter_to (p, reg_exp); @@ -523,12 +523,12 @@ select_unselect_cmd (const char *title, const char *history_name, int cmd) void select_cmd (void) { - select_unselect_cmd (_(" Select "), " Select ", 1); + select_unselect_cmd (_(" Select "), ":select_cmd: Select ", 1); } void unselect_cmd (void) { - select_unselect_cmd (_(" Unselect "), " Unselect ", 0); + select_unselect_cmd (_(" Unselect "), ":unselect_cmd: Unselect ", 0); } /* Check if the file exists */ @@ -905,7 +905,7 @@ do_link (int symbolic_link, const char *fname) if (!symbolic_link) { src = g_strdup_printf (_("Link %s to:"), name_trunc (fname, 46)); - dest = input_expand_dialog (_(" Link "), src, " Link ", ""); + dest = input_expand_dialog (_(" Link "), src, ":do_link: Link ", ""); if (!dest || !*dest) goto cleanup; save_cwds_stat (); @@ -974,7 +974,7 @@ void edit_symlink_cmd (void) i = readlink (p, buffer, MC_MAXPATHLEN - 1); if (i > 0) { buffer [i] = 0; - dest = input_expand_dialog (_(" Edit symlink "), q, " Edit symlink ", buffer); + dest = input_expand_dialog (_(" Edit symlink "), q, ":edit_symlink_cmd: Edit symlink ", buffer); if (dest) { if (*dest && strcmp (buffer, dest)) { save_cwds_stat (); @@ -1126,7 +1126,7 @@ static const char *machine_str = N_(" Enter machine name (F1 for details): "); void netlink_cmd (void) { nice_cd (_(" Link to a remote machine "), _(machine_str), - "[Network File System]", " Link to a remote machine ", + "[Network File System]", ":netlink_cmd: Link to a remote ", "/#mc:", 1); } #endif /* WITH_MCFS */ @@ -1134,13 +1134,13 @@ void netlink_cmd (void) void ftplink_cmd (void) { nice_cd (_(" FTP to machine "), _(machine_str), - "[FTP File System]", " FTP to machine ", "/#ftp:", 1); + "[FTP File System]", ":ftplink_cmd: FTP to machine ", "/#ftp:", 1); } void fishlink_cmd (void) { nice_cd (_(" Shell link to machine "), _(machine_str), - "[FIle transfer over SHell filesystem]", " Shell link to machine ", + "[FIle transfer over SHell filesystem]", ":fishlink_cmd: Shell link to machine ", "/#sh:", 1); } @@ -1148,7 +1148,7 @@ void fishlink_cmd (void) void smblink_cmd (void) { nice_cd (_(" SMB link to machine "), _(machine_str), - "[SMB File System]", " SMB link to machine ", + "[SMB File System]", ":smblink_cmd: SMB link to machine ", "/#smb:", 0); } #endif /* WITH_SMBFS */ @@ -1160,7 +1160,7 @@ void undelete_cmd (void) nice_cd (_(" Undelete files on an ext2 file system "), _(" Enter device (without /dev/) to undelete\n " " files on: (F1 for details)"), - "[Undelete File System]", " Undelete files on an ext2 file system ", + "[Undelete File System]", ":undelete_cmd: Undel on ext2 fs ", "/#undel:", 0); } #endif /* USE_EXT2FSLIB */ diff --git a/src/ext.c b/src/ext.c index 7f84e66f5..735856c77 100644 --- a/src/ext.c +++ b/src/ext.c @@ -114,7 +114,7 @@ exec_extension (const char *filename, const char *data, int *move_dir, if (*data == '}') { char *parameter; parameter_found = 0; - parameter = input_dialog (_(" Parameter "), prompt, " Parameter ", ""); + parameter = input_dialog (_(" Parameter "), prompt, ":exec_extension: Parameter ", ""); if (!parameter) { /* User canceled */ fclose (cmd_file); diff --git a/src/hotlist.c b/src/hotlist.c index b8d1c714f..cf71967ef 100644 --- a/src/hotlist.c +++ b/src/hotlist.c @@ -1042,7 +1042,7 @@ void add2hotlist_cmd (void) strip_password (label_string, 1); prompt = g_strdup_printf (cp, path_trunc (current_panel->cwd, COLS-2*UX-(l+8))); - label = input_dialog (_(" Add to hotlist "), prompt, " Add to hotlist ", label_string); + label = input_dialog (_(" Add to hotlist "), prompt, ":add2hotlist_cmd: Add to hotlist ", label_string); g_free (prompt); if (!label || !*label) { diff --git a/src/panelize.c b/src/panelize.c index 9d0e3c76c..10b0abffd 100644 --- a/src/panelize.c +++ b/src/panelize.c @@ -226,7 +226,7 @@ add2panelize_cmd (void) if (pname->buffer && (*pname->buffer)) { label = input_dialog (_(" Add to external panelize "), _(" Enter command label: "), - " Add to external panelize ", + ":add2panelize_cmd: Add to external panelize ", ""); if (!label) return; diff --git a/src/tree.c b/src/tree.c index 435d32041..51a4ea347 100644 --- a/src/tree.c +++ b/src/tree.c @@ -598,7 +598,7 @@ static void tree_copy (WTree *tree, const char *default_dest) return; g_snprintf (cmd_buf, sizeof(cmd_buf), _("Copy \"%s\" directory to:"), name_trunc (tree->selected_ptr->name, 50)); - dest = input_expand_dialog (_(" Copy "), cmd_buf, " Copy ", default_dest); + dest = input_expand_dialog (_(" Copy "), cmd_buf, ":tree_copy: Copy ", default_dest); if (!dest) return; @@ -641,7 +641,7 @@ static void tree_move (WTree *tree, const char *default_dest) return; g_snprintf (cmd_buf, sizeof (cmd_buf), _("Move \"%s\" directory to:"), name_trunc (tree->selected_ptr->name, 50)); - dest = input_expand_dialog (_(" Move "), cmd_buf, " Move ", default_dest); + dest = input_expand_dialog (_(" Move "), cmd_buf, ":tree_move: Move ", default_dest); if (!dest) return; if (!*dest){ diff --git a/src/user.c b/src/user.c index 0daf77064..cc94bf264 100644 --- a/src/user.c +++ b/src/user.c @@ -604,7 +604,7 @@ execute_menu_command (WEdit *edit_widget, const char *commands) if (*commands == '}'){ char *tmp; *parameter = 0; - parameter = input_dialog (_(" Parameter "), prompt, " Parameter ", ""); + parameter = input_dialog (_(" Parameter "), prompt, ":execute_menu_command: Parameter ", ""); if (!parameter || !*parameter){ /* User canceled */ fclose (cmd_file); diff --git a/src/view.c b/src/view.c index 0e8c33e6e..a3555964f 100644 --- a/src/view.c +++ b/src/view.c @@ -2734,7 +2734,7 @@ view_moveto_line_cmd (WView *view) g_snprintf (prompt, sizeof (prompt), _(" The current line number is %d.\n" " Enter the new line number:"), (int) (line + 1)); - answer = input_dialog (_(" Goto line "), prompt, " Goto line ", ""); + answer = input_dialog (_(" Goto line "), prompt, ":view_moveto_line_cmd: Goto line ", ""); if (answer != NULL && answer[0] != '\0') { errno = 0; line = strtoul (answer, &answer_end, 10); @@ -2755,7 +2755,7 @@ view_moveto_addr_cmd (WView *view) g_snprintf (prompt, sizeof (prompt), _(" The current address is 0x%lx.\n" " Enter the new address:"), view->hex_cursor); - line = input_dialog (_(" Goto Address "), prompt, " Goto Address ", ""); + line = input_dialog (_(" Goto Address "), prompt, ":view_moveto_addr_cmd: Goto Address ", ""); if (line != NULL) { if (*line != '\0') { addr = strtoul (line, &error, 0); @@ -2788,7 +2788,7 @@ regexp_search (WView *view, int direction) defval = (last_regexp != NULL ? last_regexp : ""); - regexp = input_dialog (_("Search"), _(" Enter regexp:"), "Search", defval); + regexp = input_dialog (_("Search"), _(" Enter regexp:"), ":regexp_search: Search", defval); if (regexp == NULL || regexp[0] == '\0') { g_free (regexp); return; From 0dcb0574593540c35eaccf53eac5fbedb6974ba6 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT service" Date: Sat, 24 Jan 2009 21:51:29 +0100 Subject: [PATCH 3/4] separated out history section names to history.h --- edit/editcmd.c | 17 +++++++++-------- src/cmd.c | 12 ++++++------ src/ext.c | 2 +- src/history.h | 36 ++++++++++++++++++++++++++++++++++++ src/hotlist.c | 2 +- src/panelize.c | 2 +- src/tree.c | 4 ++-- src/user.c | 2 +- src/view.c | 6 +++--- vfs/ftpfs.c | 2 +- vfs/utilvfs.c | 2 +- 11 files changed, 62 insertions(+), 25 deletions(-) create mode 100644 src/history.h diff --git a/edit/editcmd.c b/edit/editcmd.c index 92f8b30fc..de8cf79f4 100644 --- a/edit/editcmd.c +++ b/edit/editcmd.c @@ -40,6 +40,7 @@ #include #include "../src/global.h" +#include "../src/history.h" #include "edit.h" #include "editlock.h" @@ -522,8 +523,8 @@ edit_save_as_cmd (WEdit *edit) int save_lock = 0; int different_filename = 0; - exp = input_expand_dialog (_(" Save As "), _(" Enter file name: "), - ":edit_save_as_cmd: Save As ", edit->filename); + exp = input_expand_dialog ( + _(" Save As "), _(" Enter file name: "),MC_HISTORY_EDIT_SAVE_AS, edit->filename); edit_push_action (edit, KEY_PRESS + edit->start_display); if (exp) { @@ -906,7 +907,7 @@ edit_load_cmd (WEdit *edit) } exp = input_expand_dialog (_(" Load "), _(" Enter file name: "), - ":edit_load_cmd: Load ", edit->filename); + MC_HISTORY_EDIT_LOAD, edit->filename); if (exp) { if (*exp) @@ -2337,7 +2338,7 @@ edit_goto_cmd (WEdit *edit) char s[32]; g_snprintf (s, sizeof (s), "%ld", line); - f = input_dialog (_(" Goto line "), _(" Enter line: "), ":edit_goto_cmd: Goto line ", + f = input_dialog (_(" Goto line "), _(" Enter line: "), MC_HISTORY_EDIT_GOTO_LINE, line ? s : ""); if (!f) return; @@ -2373,7 +2374,7 @@ edit_save_block_cmd (WEdit *edit) return 1; exp = input_expand_dialog (_(" Save Block "), _(" Enter file name: "), - ":edit_save_block_cmd: Save Block ", + MC_HISTORY_EDIT_SAVE_BLOCK, catstrs (home_dir, PATH_SEP_STR CLIP_FILE, (char *) NULL)); edit_push_action (edit, KEY_PRESS + edit->start_display); if (exp) { @@ -2403,7 +2404,7 @@ int edit_insert_file_cmd (WEdit *edit) { char *exp = input_expand_dialog (_(" Insert File "), _(" Enter file name: "), - ":edit_insert_file_cmd: Insert File ", + MC_HISTORY_EDIT_INSERT_FILE, catstrs (home_dir, PATH_SEP_STR CLIP_FILE, (char *) NULL)); edit_push_action (edit, KEY_PRESS + edit->start_display); if (exp) { @@ -2443,7 +2444,7 @@ int edit_sort_cmd (WEdit * edit) exp = input_dialog (_(" Run Sort "), _(" Enter sort options (see manpage) separated by whitespace: "), - ":edit_sort_cmd: Run Sort ", (old != NULL) ? old : ""); + MC_HISTORY_EDIT_SORT, (old != NULL) ? old : ""); if (!exp) return 1; @@ -2485,7 +2486,7 @@ edit_ext_cmd (WEdit *edit) exp = input_dialog (_("Paste output of external command"), _("Enter shell command(s):"), - ":edit_ext_cmd: Paste output of ext.cmd ", NULL); + MC_HISTORY_EDIT_PASTE_EXTCMD, NULL); if (!exp) return 1; diff --git a/src/cmd.c b/src/cmd.c index 50069445e..03e333096 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -229,7 +229,7 @@ view_file_cmd (void) filename = input_expand_dialog (_(" View file "), _(" Filename:"), - ":view_file_cmd: View file ", selection (current_panel)->fname); + MC_HISTORY_FM_VIEW_FILE, selection (current_panel)->fname); if (!filename) return; @@ -252,7 +252,7 @@ filtered_view_cmd (void) command = input_dialog (_(" Filtered view "), _(" Filter command and arguments:"), - ":filtered_view_cmd: Filtered view ", + MC_HISTORY_FM_FILTERED_VIEW, selection (current_panel)->fname); if (!command) return; @@ -352,7 +352,7 @@ mkdir_cmd (void) dir = input_expand_dialog (_("Create a new Directory"), _(" Enter directory name:"), - ":mkdir_cmd: Create a new Directory", ""); + MC_HISTORY_FM_MKDIR, ""); if (!dir) return; @@ -424,7 +424,7 @@ set_panel_filter (WPanel *p) reg_exp = input_dialog_help (_(" Filter "), _(" Set expression for filtering filenames"), - "[Filter...]", ":set_panel_filter: Filter ", x); + "[Filter...]", MC_HISTORY_FM_PANEL_FILTER, x); if (!reg_exp) return; set_panel_filter_to (p, reg_exp); @@ -905,7 +905,7 @@ do_link (int symbolic_link, const char *fname) if (!symbolic_link) { src = g_strdup_printf (_("Link %s to:"), name_trunc (fname, 46)); - dest = input_expand_dialog (_(" Link "), src, ":do_link: Link ", ""); + dest = input_expand_dialog (_(" Link "), src, MC_HISTORY_FM_LINK, ""); if (!dest || !*dest) goto cleanup; save_cwds_stat (); @@ -974,7 +974,7 @@ void edit_symlink_cmd (void) i = readlink (p, buffer, MC_MAXPATHLEN - 1); if (i > 0) { buffer [i] = 0; - dest = input_expand_dialog (_(" Edit symlink "), q, ":edit_symlink_cmd: Edit symlink ", buffer); + dest = input_expand_dialog (_(" Edit symlink "), q, MC_HISTORY_FM_EDIT_LINK, buffer); if (dest) { if (*dest && strcmp (buffer, dest)) { save_cwds_stat (); diff --git a/src/ext.c b/src/ext.c index 735856c77..ec992e4dc 100644 --- a/src/ext.c +++ b/src/ext.c @@ -114,7 +114,7 @@ exec_extension (const char *filename, const char *data, int *move_dir, if (*data == '}') { char *parameter; parameter_found = 0; - parameter = input_dialog (_(" Parameter "), prompt, ":exec_extension: Parameter ", ""); + parameter = input_dialog (_(" Parameter "), prompt, MC_HISTORY_EXT_PARAMETER, ""); if (!parameter) { /* User canceled */ fclose (cmd_file); diff --git a/src/history.h b/src/history.h new file mode 100644 index 000000000..efd4e1676 --- /dev/null +++ b/src/history.h @@ -0,0 +1,36 @@ +#ifndef __MC_HISTORY_H +#define __MC_HISTORY_H + +/* history section names */ + +#define MC_HISTORY_EDIT_SAVE_AS "mc.edit.save-as" +#define MC_HISTORY_EDIT_LOAD "mc.edit.load" +#define MC_HISTORY_EDIT_SAVE_BLOCK "mc.edit.save-block" +#define MC_HISTORY_EDIT_INSERT_FILE "mc.edit.insert-file" +#define MC_HISTORY_EDIT_GOTO_LINE "mc.edit.goto-line" +#define MC_HISTORY_EDIT_SORT "mc.edit.sort" +#define MC_HISTORY_EDIT_PASTE_EXTCMD "mc.edit.paste-extcmd" + +#define MC_HISTORY_FM_VIEW_FILE "mc.fm.view-file" +#define MC_HISTORY_FM_MKDIR "mc.fm.mkdir" +#define MC_HISTORY_FM_LINK "mc.fm.link" +#define MC_HISTORY_FM_EDIT_LINK "mc.fm.edit-link" +#define MC_HISTORY_FM_TREE_COPY "mc.fm.tree-copy" +#define MC_HISTORY_FM_TREE_MOVE "mc.fm.tree-move" +#define MC_HISTORY_FM_PANELIZE_ADD "mc.fm.panelize.add" +#define MC_HISTORY_FM_FILTERED_VIEW "mc.fm.filtered-view" +#define MC_HISTORY_FM_PANEL_FILTER "mc.fm.panel-filter" +#define MC_HISTORY_FM_MENU_EXEC_PARAM "mc.fm.menu.exec.parameter" + +#define MC_HISTORY_VIEW_GOTO_LINE "mc.view.goto-line" +#define MC_HISTORY_VIEW_GOTO_ADDR "mc.view.goto-addr" +#define MC_HISTORY_VIEW_SEARCH_REGEX "mc.view.search.regex" + +#define MC_HISTORY_FTPFS_ACCOUNT "mc.vfs.ftp.account" +#define MC_HISTORY_VFS_PASSWORD "mc.vfs.password" + +#define MC_HISTORY_EXT_PARAMETER "mc.ext.parameter" + +#define MC_HISTORY_HOTLIST_ADD "mc.hotlist.add" + +#endif diff --git a/src/hotlist.c b/src/hotlist.c index ff09a4202..1bfa11246 100644 --- a/src/hotlist.c +++ b/src/hotlist.c @@ -1042,7 +1042,7 @@ void add2hotlist_cmd (void) strip_password (label_string, 1); prompt = g_strdup_printf (cp, path_trunc (current_panel->cwd, COLS-2*UX-(l+8))); - label = input_dialog (_(" Add to hotlist "), prompt, ":add2hotlist_cmd: Add to hotlist ", label_string); + label = input_dialog (_(" Add to hotlist "), prompt, MC_HISTORY_HOTLIST_ADD, label_string); g_free (prompt); if (!label || !*label) { diff --git a/src/panelize.c b/src/panelize.c index 10b0abffd..87d279c0c 100644 --- a/src/panelize.c +++ b/src/panelize.c @@ -226,7 +226,7 @@ add2panelize_cmd (void) if (pname->buffer && (*pname->buffer)) { label = input_dialog (_(" Add to external panelize "), _(" Enter command label: "), - ":add2panelize_cmd: Add to external panelize ", + MC_HISTORY_PANELIZE_ADD, ""); if (!label) return; diff --git a/src/tree.c b/src/tree.c index 51a4ea347..cb8459953 100644 --- a/src/tree.c +++ b/src/tree.c @@ -598,7 +598,7 @@ static void tree_copy (WTree *tree, const char *default_dest) return; g_snprintf (cmd_buf, sizeof(cmd_buf), _("Copy \"%s\" directory to:"), name_trunc (tree->selected_ptr->name, 50)); - dest = input_expand_dialog (_(" Copy "), cmd_buf, ":tree_copy: Copy ", default_dest); + dest = input_expand_dialog (_(" Copy "), cmd_buf, MC_HISTORY_FM_TREE_COPY, default_dest); if (!dest) return; @@ -641,7 +641,7 @@ static void tree_move (WTree *tree, const char *default_dest) return; g_snprintf (cmd_buf, sizeof (cmd_buf), _("Move \"%s\" directory to:"), name_trunc (tree->selected_ptr->name, 50)); - dest = input_expand_dialog (_(" Move "), cmd_buf, ":tree_move: Move ", default_dest); + dest = input_expand_dialog (_(" Move "), cmd_buf, MC_HISTORY_FM_TREE_MOVE, default_dest); if (!dest) return; if (!*dest){ diff --git a/src/user.c b/src/user.c index cc94bf264..f80fe3d21 100644 --- a/src/user.c +++ b/src/user.c @@ -604,7 +604,7 @@ execute_menu_command (WEdit *edit_widget, const char *commands) if (*commands == '}'){ char *tmp; *parameter = 0; - parameter = input_dialog (_(" Parameter "), prompt, ":execute_menu_command: Parameter ", ""); + parameter = input_dialog (_(" Parameter "), prompt, MC_HISTORY_FM_EXEC_PARAM, ""); if (!parameter || !*parameter){ /* User canceled */ fclose (cmd_file); diff --git a/src/view.c b/src/view.c index a3555964f..19acc4b36 100644 --- a/src/view.c +++ b/src/view.c @@ -2734,7 +2734,7 @@ view_moveto_line_cmd (WView *view) g_snprintf (prompt, sizeof (prompt), _(" The current line number is %d.\n" " Enter the new line number:"), (int) (line + 1)); - answer = input_dialog (_(" Goto line "), prompt, ":view_moveto_line_cmd: Goto line ", ""); + answer = input_dialog (_(" Goto line "), prompt, MC_HISTORY_VIEW_GOTO_LINE, ""); if (answer != NULL && answer[0] != '\0') { errno = 0; line = strtoul (answer, &answer_end, 10); @@ -2755,7 +2755,7 @@ view_moveto_addr_cmd (WView *view) g_snprintf (prompt, sizeof (prompt), _(" The current address is 0x%lx.\n" " Enter the new address:"), view->hex_cursor); - line = input_dialog (_(" Goto Address "), prompt, ":view_moveto_addr_cmd: Goto Address ", ""); + line = input_dialog (_(" Goto Address "), prompt, MC_HISTORY_VIEW_GOTO_ADDR, ""); if (line != NULL) { if (*line != '\0') { addr = strtoul (line, &error, 0); @@ -2788,7 +2788,7 @@ regexp_search (WView *view, int direction) defval = (last_regexp != NULL ? last_regexp : ""); - regexp = input_dialog (_("Search"), _(" Enter regexp:"), ":regexp_search: Search", defval); + regexp = input_dialog (_("Search"), _(" Enter regexp:"), MC_HISTORY_VIEW_SEARCH_REGEX, defval); if (regexp == NULL || regexp[0] == '\0') { g_free (regexp); return; diff --git a/vfs/ftpfs.c b/vfs/ftpfs.c index bb20cad90..11c79c509 100644 --- a/vfs/ftpfs.c +++ b/vfs/ftpfs.c @@ -499,7 +499,7 @@ ftpfs_login_server (struct vfs_class *me, struct vfs_s_super *super, p = g_strdup_printf (_ ("FTP: Account required for user %s"), SUP.user); - op = input_dialog (p, _("Account:"), (char *) NULL, ""); + op = input_dialog (p, _("Account:"), MC_HISTORY_FTPFS_ACCOUNT(char *) NULL, ""); g_free (p); if (op == NULL) ERRNOR (EPERM, 0); diff --git a/vfs/utilvfs.c b/vfs/utilvfs.c index ecbe9f526..7a4880fea 100644 --- a/vfs/utilvfs.c +++ b/vfs/utilvfs.c @@ -839,5 +839,5 @@ vfs_die (const char *m) char * vfs_get_password (const char *msg) { - return input_dialog (msg, _("Password:"), (char *) NULL, INPUT_PASSWORD); + return input_dialog (msg, _("Password:"), MC_HISTORY_VFS_PASSWORD, INPUT_PASSWORD); } From 9ac56b58ac6a522b75c720c676cedc8cd666b425 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT service" Date: Sat, 24 Jan 2009 21:59:58 +0100 Subject: [PATCH 4/4] fixed missing history.h include --- src/cmd.c | 1 + src/ext.c | 2 +- src/hotlist.c | 1 + src/panelize.c | 3 ++- src/tree.c | 1 + src/user.c | 3 ++- src/view.c | 2 +- vfs/ftpfs.c | 3 ++- vfs/utilvfs.c | 1 + 9 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/cmd.c b/src/cmd.c index 03e333096..743ec46c1 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -61,6 +61,7 @@ #include "setup.h" /* save_setup() */ #include "profile.h" /* PROFILE_NAME */ #include "execute.h" /* toggle_panels() */ +#include "history.h" #ifndef MAP_FILE # define MAP_FILE 0 diff --git a/src/ext.c b/src/ext.c index ec992e4dc..a4468bd8e 100644 --- a/src/ext.c +++ b/src/ext.c @@ -36,7 +36,7 @@ #include "ext.h" #include "view.h" #include "execute.h" - +#include "history.h" #include "cons.saver.h" #include "layout.h" diff --git a/src/hotlist.c b/src/hotlist.c index 1bfa11246..90678fe00 100644 --- a/src/hotlist.c +++ b/src/hotlist.c @@ -51,6 +51,7 @@ #include "key.h" /* KEY_M_CTRL */ #include "command.h" /* cmdline */ #include "glibcompat.h" /* g_strlcpy for glib < 2.0 */ +#include "history.h" #define UX 5 #define UY 2 diff --git a/src/panelize.c b/src/panelize.c index 87d279c0c..3deb0210a 100644 --- a/src/panelize.c +++ b/src/panelize.c @@ -43,6 +43,7 @@ #include "panel.h" /* current_panel */ #include "main.h" /* repaint_screen */ #include "panelize.h" +#include "history.h" #define UX 5 #define UY 2 @@ -226,7 +227,7 @@ add2panelize_cmd (void) if (pname->buffer && (*pname->buffer)) { label = input_dialog (_(" Add to external panelize "), _(" Enter command label: "), - MC_HISTORY_PANELIZE_ADD, + MC_HISTORY_FM_PANELIZE_ADD, ""); if (!label) return; diff --git a/src/tree.c b/src/tree.c index cb8459953..c43feb3c5 100644 --- a/src/tree.c +++ b/src/tree.c @@ -49,6 +49,7 @@ #include "tree.h" #include "treestore.h" #include "cmd.h" +#include "history.h" #define tlines(t) (t->is_panel ? t->widget.lines-2 - (show_mini_info ? 2 : 0) : t->widget.lines) diff --git a/src/user.c b/src/user.c index f80fe3d21..7cb617c3b 100644 --- a/src/user.c +++ b/src/user.c @@ -33,6 +33,7 @@ #include "layout.h" #include "execute.h" #include "setup.h" +#include "history.h" #include "../edit/edit.h" /* BLOCK_FILE */ #include "../edit/edit-widget.h" /* WEdit */ @@ -604,7 +605,7 @@ execute_menu_command (WEdit *edit_widget, const char *commands) if (*commands == '}'){ char *tmp; *parameter = 0; - parameter = input_dialog (_(" Parameter "), prompt, MC_HISTORY_FM_EXEC_PARAM, ""); + parameter = input_dialog (_(" Parameter "), prompt, MC_HISTORY_FM_MENU_EXEC_PARAM, ""); if (!parameter || !*parameter){ /* User canceled */ fclose (cmd_file); diff --git a/src/view.c b/src/view.c index 19acc4b36..846530161 100644 --- a/src/view.c +++ b/src/view.c @@ -62,7 +62,7 @@ #include "execute.h" #include "main.h" /* slow_terminal */ #include "view.h" - +#include "history.h" #include "charsets.h" #include "selcodepage.h" diff --git a/vfs/ftpfs.c b/vfs/ftpfs.c index 11c79c509..5d8ac1f22 100644 --- a/vfs/ftpfs.c +++ b/vfs/ftpfs.c @@ -73,6 +73,7 @@ What to do with this? #include "../src/tty.h" /* enable/disable interrupt key */ #include "../src/wtools.h" /* message() */ #include "../src/main.h" /* print_vfs_message */ +#include "../src/history.h" #include "utilvfs.h" #include "xdirentry.h" #include "vfs.h" @@ -499,7 +500,7 @@ ftpfs_login_server (struct vfs_class *me, struct vfs_s_super *super, p = g_strdup_printf (_ ("FTP: Account required for user %s"), SUP.user); - op = input_dialog (p, _("Account:"), MC_HISTORY_FTPFS_ACCOUNT(char *) NULL, ""); + op = input_dialog (p, _("Account:"), MC_HISTORY_FTPFS_ACCOUNT, ""); g_free (p); if (op == NULL) ERRNOR (EPERM, 0); diff --git a/vfs/utilvfs.c b/vfs/utilvfs.c index 7a4880fea..8284c8a3d 100644 --- a/vfs/utilvfs.c +++ b/vfs/utilvfs.c @@ -28,6 +28,7 @@ #include "utilvfs.h" #include "vfs.h" #include "../src/unixcompat.h" +#include "../src/history.h" /* Extract the hostname and username from the path */ /* path is in the form: [user@]hostname:port/remote-dir, e.g.: