2
===================================================================
3
RCS file: /cvsroot/mc/mc/src/cmd.c,v
4
retrieving revision 1.164
5
diff -u -p -r1.164 cmd.c
6
--- src/cmd.c 4 Feb 2006 11:12:28 -0000 1.164
7
+++ src/cmd.c 19 Sep 2006 07:58:25 -0000
8
@@ -229,7 +228,7 @@ view_file_cmd (void)
11
input_expand_dialog (_(" View file "), _(" Filename:"),
12
- selection (current_panel)->fname);
13
+ " View file ", selection (current_panel)->fname);
17
@@ -252,6 +251,7 @@ filtered_view_cmd (void)
19
input_dialog (_(" Filtered view "),
20
_(" Filter command and arguments:"),
22
selection (current_panel)->fname);
25
@@ -350,7 +350,8 @@ mkdir_cmd (void)
28
input_expand_dialog (_("Create a new Directory"),
29
- _(" Enter directory name:"), "");
30
+ _(" Enter directory name:"),
31
+ "Create a new Directory", "");
35
@@ -422,7 +423,7 @@ set_panel_filter (WPanel *p)
37
reg_exp = input_dialog_help (_(" Filter "),
38
_(" Set expression for filtering filenames"),
40
+ "[Filter...]", " Filter ", x);
43
set_panel_filter_to (p, reg_exp);
44
@@ -468,14 +469,14 @@ void reverse_selection_cmd (void)
48
-select_unselect_cmd (const char *title, int cmd)
49
+select_unselect_cmd (const char *title, const char *history_name, int cmd)
51
char *reg_exp, *reg_exp_t;
56
- reg_exp = input_dialog (title, "", easy_patterns ? "*" : ".");
57
+ reg_exp = input_dialog (title, "", history_name, easy_patterns ? "*" : ".");
61
@@ -521,12 +522,12 @@ select_unselect_cmd (const char *title,
63
void select_cmd (void)
65
- select_unselect_cmd (_(" Select "), 1);
66
+ select_unselect_cmd (_(" Select "), " Select ", 1);
69
void unselect_cmd (void)
71
- select_unselect_cmd (_(" Unselect "), 0);
72
+ select_unselect_cmd (_(" Unselect "), " Unselect ", 0);
75
/* Check if the file exists */
76
@@ -903,7 +904,7 @@ do_link (int symbolic_link, const char *
79
src = g_strdup_printf (_("Link %s to:"), name_trunc (fname, 46));
80
- dest = input_expand_dialog (_(" Link "), src, "");
81
+ dest = input_expand_dialog (_(" Link "), src, " Link ", "");
85
@@ -972,7 +988,7 @@ void edit_symlink_cmd (void)
86
i = readlink (p, buffer, MC_MAXPATHLEN - 1);
89
- dest = input_expand_dialog (_(" Edit symlink "), q, buffer);
90
+ dest = input_expand_dialog (_(" Edit symlink "), q, " Edit symlink ", buffer);
92
if (*dest && strcmp (buffer, dest)) {
94
@@ -1085,7 +1101,8 @@ get_random_hint (int force)
96
#if defined(USE_NETCODE) || defined(USE_EXT2FSLIB)
98
-nice_cd (const char *text, const char *xtext, const char *help, const char *prefix, int to_home)
99
+nice_cd (const char *text, const char *xtext, const char *help,
100
+ const char *history_name, const char *prefix, int to_home)
104
@@ -1093,9 +1110,7 @@ nice_cd (const char *text, const char *x
105
if (!SELECTED_IS_PANEL)
108
- machine = input_dialog_help (text,
111
+ machine = input_dialog_help (text, xtext, help, history_name, "");
115
@@ -1125,27 +1140,30 @@ static const char *machine_str = N_(" En
116
void netlink_cmd (void)
118
nice_cd (_(" Link to a remote machine "), _(machine_str),
119
- "[Network File System]", "/#mc:", 1);
120
+ "[Network File System]", " Link to a remote machine ",
123
#endif /* WITH_MCFS */
125
void ftplink_cmd (void)
127
nice_cd (_(" FTP to machine "), _(machine_str),
128
- "[FTP File System]", "/#ftp:", 1);
129
+ "[FTP File System]", " FTP to machine ", "/#ftp:", 1);
132
void fishlink_cmd (void)
134
nice_cd (_(" Shell link to machine "), _(machine_str),
135
- "[FIle transfer over SHell filesystem]", "/#sh:", 1);
136
+ "[FIle transfer over SHell filesystem]", " Shell link to machine ",
141
void smblink_cmd (void)
143
nice_cd (_(" SMB link to machine "), _(machine_str),
144
- "[SMB File System]", "/#smb:", 0);
145
+ "[SMB File System]", " SMB link to machine ",
148
#endif /* WITH_SMBFS */
149
#endif /* USE_NETCODE */
150
@@ -1156,7 +1174,8 @@ void undelete_cmd (void)
151
nice_cd (_(" Undelete files on an ext2 file system "),
152
_(" Enter device (without /dev/) to undelete\n "
153
" files on: (F1 for details)"),
154
- "[Undelete File System]", "/#undel:", 0);
155
+ "[Undelete File System]", " Undelete files on an ext2 file system ",
158
#endif /* USE_EXT2FSLIB */
161
===================================================================
162
RCS file: /cvsroot/mc/mc/src/ext.c,v
163
retrieving revision 1.79
164
diff -u -p -r1.79 ext.c
165
--- src/ext.c 31 Jul 2005 20:29:35 -0000 1.79
166
+++ src/ext.c 19 Sep 2006 07:58:25 -0000
167
@@ -113,7 +113,7 @@ exec_extension (const char *filename, co
171
- parameter = input_dialog (_(" Parameter "), prompt, "");
172
+ parameter = input_dialog (_(" Parameter "), prompt, " Parameter ", "");
177
===================================================================
178
RCS file: /cvsroot/mc/mc/src/hotlist.c,v
179
retrieving revision 1.85
180
diff -u -p -r1.85 hotlist.c
181
--- src/hotlist.c 8 Aug 2006 12:17:14 -0000 1.85
182
+++ src/hotlist.c 19 Sep 2006 07:58:25 -0000
183
@@ -1041,7 +1041,7 @@ void add2hotlist_cmd (void)
184
strip_password (label_string, 1);
186
prompt = g_strdup_printf (cp, path_trunc (current_panel->cwd, COLS-2*UX-(l+8)));
187
- label = input_dialog (_(" Add to hotlist "), prompt, label_string);
188
+ label = input_dialog (_(" Add to hotlist "), prompt, " Add to hotlist ", label_string);
191
if (!label || !*label) {
192
Index: src/panelize.c
193
===================================================================
194
RCS file: /cvsroot/mc/mc/src/panelize.c,v
195
retrieving revision 1.51
196
diff -u -p -r1.51 panelize.c
197
--- src/panelize.c 27 May 2005 03:35:15 -0000 1.51
198
+++ src/panelize.c 19 Sep 2006 07:58:25 -0000
199
@@ -225,6 +225,7 @@ add2panelize_cmd (void)
200
if (pname->buffer && (*pname->buffer)) {
201
label = input_dialog (_(" Add to external panelize "),
202
_(" Enter command label: "),
203
+ " Add to external panelize ",
208
===================================================================
209
RCS file: /cvsroot/mc/mc/src/user.c,v
210
retrieving revision 1.76
211
diff -u -p -r1.76 user.c
212
--- src/user.c 10 May 2006 12:14:28 -0000 1.76
213
+++ src/user.c 19 Sep 2006 07:58:25 -0000
214
@@ -603,7 +603,7 @@ execute_menu_command (WEdit *edit_widget
215
if (*commands == '}'){
218
- parameter = input_dialog (_(" Parameter "), prompt, "");
219
+ parameter = input_dialog (_(" Parameter "), prompt, " Parameter ", "");
220
if (!parameter || !*parameter){
224
===================================================================
225
RCS file: /cvsroot/mc/mc/src/view.c,v
226
retrieving revision 1.356
227
diff -u -p -r1.356 view.c
228
--- src/view.c 3 Aug 2006 05:51:23 -0000 1.356
229
+++ src/view.c 19 Sep 2006 07:58:26 -0000
230
@@ -2730,7 +2730,7 @@ view_moveto_line_cmd (WView *view)
231
g_snprintf (prompt, sizeof (prompt),
232
_(" The current line number is %d.\n"
233
" Enter the new line number:"), (int) (line + 1));
234
- answer = input_dialog (_(" Goto line "), prompt, "");
235
+ answer = input_dialog (_(" Goto line "), prompt, " Goto line ", "");
236
if (answer != NULL && answer[0] != '\0') {
238
line = strtoul (answer, &answer_end, 10);
239
@@ -2751,7 +2751,7 @@ view_moveto_addr_cmd (WView *view)
240
g_snprintf (prompt, sizeof (prompt),
241
_(" The current address is 0x%lx.\n"
242
" Enter the new address:"), view->hex_cursor);
243
- line = input_dialog (_(" Goto Address "), prompt, "");
244
+ line = input_dialog (_(" Goto Address "), prompt, " Goto Address ", "");
247
addr = strtoul (line, &error, 0);
248
@@ -2781,7 +2781,7 @@ regexp_search (WView *view, int directio
250
defval = (view->search_exp != NULL) ? view->search_exp : "";
252
- regexp = input_dialog (_("Search"), _(" Enter regexp:"), defval);
253
+ regexp = input_dialog (_("Search"), _(" Enter regexp:"), "Search", defval);
254
if (regexp == NULL || regexp[0] == '\0')
258
===================================================================
259
RCS file: /cvsroot/mc/mc/src/wtools.c,v
260
retrieving revision 1.85
261
diff -u -p -r1.85 wtools.c
262
--- src/wtools.c 14 Sep 2006 09:12:49 -0000 1.85
263
+++ src/wtools.c 19 Sep 2006 07:58:26 -0000
264
@@ -433,11 +433,15 @@ int quick_dialog (QuickDialog *qd)
266
* If the arguments "header" and "text" should be translated,
267
* that MUST be done by the caller of fg_input_dialog_help().
269
+ * The argument "history_name" holds the name of a section
270
+ * in the history file. Data entered in the input field of
271
+ * the dialog box will be stored there.
275
fg_input_dialog_help (const char *header, const char *text, const char *help,
276
- const char *def_text)
277
+ const char *history_name, const char *def_text)
279
QuickDialog Quick_input;
280
QuickWidget quick_widgets[] = {
281
@@ -457,10 +461,10 @@ fg_input_dialog_help (const char *header
282
char histname[64] = "inp|";
285
- /* we need a unique name for histname because widget.c:history_tool()
286
- needs a unique name for each dialog - using the header is ideal */
287
- g_strlcpy (histname + 3, header, 61);
288
- quick_widgets[2].histname = histname;
289
+ if (history_name != NULL && *history_name != '\0') {
290
+ g_strlcpy (histname + 3, history_name, 61);
291
+ quick_widgets[2].histname = histname;
294
msglen (text, &lines, &cols);
295
len = max ((int) strlen (header), cols) + 4;
296
@@ -524,32 +528,36 @@ fg_input_dialog_help (const char *header
297
* that MUST be done by the caller of these wrappers.
300
-input_dialog_help (const char *header, const char *text, const char *help, const char *def_text)
301
+input_dialog_help (const char *header, const char *text, const char *help,
302
+ const char *history_name, const char *def_text)
304
#ifdef WITH_BACKGROUND
305
if (we_are_background)
306
- return parent_call_string ((void *) fg_input_dialog_help, 4,
307
+ return parent_call_string ((void *) fg_input_dialog_help, 5,
308
strlen (header), header, strlen (text),
309
text, strlen (help), help,
310
+ strlen (history_name), history_name,
311
strlen (def_text), def_text);
313
#endif /* WITH_BACKGROUND */
314
- return fg_input_dialog_help (header, text, help, def_text);
315
+ return fg_input_dialog_help (header, text, help, history_name, def_text);
318
/* Show input dialog with default help, background safe */
319
-char *input_dialog (const char *header, const char *text, const char *def_text)
320
+char *input_dialog (const char *header, const char *text,
321
+ const char *history_name, const char *def_text)
323
- return input_dialog_help (header, text, "[Input Line Keys]", def_text);
324
+ return input_dialog_help (header, text, "[Input Line Keys]", history_name, def_text);
328
-input_expand_dialog (const char *header, const char *text, const char *def_text)
329
+input_expand_dialog (const char *header, const char *text,
330
+ const char *history_name, const char *def_text)
335
- result = input_dialog (header, text, def_text);
336
+ result = input_dialog (header, text, history_name, def_text);
338
expanded = tilde_expand (result);
341
===================================================================
342
RCS file: /cvsroot/mc/mc/src/tree.c,v
343
retrieving revision 1.69
344
diff -u -p -r1.69 tree.c
345
--- src/tree.c 15 Aug 2005 22:36:53 -0000 1.69
346
+++ src/tree.c 19 Sep 2006 07:58:26 -0000
347
@@ -597,7 +597,7 @@ static void tree_copy (WTree *tree, cons
349
g_snprintf (cmd_buf, sizeof(cmd_buf), _("Copy \"%s\" directory to:"),
350
name_trunc (tree->selected_ptr->name, 50));
351
- dest = input_expand_dialog (_(" Copy "), cmd_buf, default_dest);
352
+ dest = input_expand_dialog (_(" Copy "), cmd_buf, " Copy ", default_dest);
356
@@ -640,7 +640,7 @@ static void tree_move (WTree *tree, cons
358
g_snprintf (cmd_buf, sizeof (cmd_buf), _("Move \"%s\" directory to:"),
359
name_trunc (tree->selected_ptr->name, 50));
360
- dest = input_expand_dialog (_(" Move "), cmd_buf, default_dest);
361
+ dest = input_expand_dialog (_(" Move "), cmd_buf, " Move ", default_dest);
366
===================================================================
367
RCS file: /cvsroot/mc/mc/src/wtools.h,v
368
retrieving revision 1.28
369
diff -u -p -r1.28 wtools.h
370
--- src/wtools.h 3 Feb 2006 14:42:36 -0000 1.28
371
+++ src/wtools.h 19 Sep 2006 07:58:26 -0000
372
@@ -57,9 +57,12 @@ int quick_dialog_skip (QuickDialog *qd,
373
/* Pass this as def_text to request a password */
374
#define INPUT_PASSWORD ((char *) -1)
376
-char *input_dialog (const char *header, const char *text, const char *def_text);
377
-char *input_dialog_help (const char *header, const char *text, const char *help, const char *def_text);
378
-char *input_expand_dialog (const char *header, const char *text, const char *def_text);
379
+char *input_dialog (const char *header, const char *text,
380
+ const char *history_name, const char *def_text);
381
+char *input_dialog_help (const char *header, const char *text, const char *help,
382
+ const char *history_name, const char *def_text);
383
+char *input_expand_dialog (const char *header, const char *text,
384
+ const char *history_name, const char *def_text);
386
void query_set_sel (int new_sel);
388
Index: edit/editcmd.c
389
===================================================================
390
RCS file: /cvsroot/mc/mc/edit/editcmd.c,v
391
retrieving revision 1.151
392
diff -u -p -r1.151 editcmd.c
393
--- edit/editcmd.c 17 Mar 2006 15:41:21 -0000 1.151
394
+++ edit/editcmd.c 19 Sep 2006 07:58:26 -0000
396
#include "../src/charsets.h"
397
#include "../src/selcodepage.h"
399
-#define edit_get_load_file(f,h) input_expand_dialog (h, _(" Enter file name: "), f)
400
-#define edit_get_save_file(f,h) input_expand_dialog (h, _(" Enter file name: "), f)
403
unsigned char * text;
405
@@ -505,7 +502,8 @@ edit_save_as_cmd (WEdit *edit)
407
int different_filename = 0;
409
- exp = edit_get_save_file (edit->filename, _(" Save As "));
410
+ exp = input_expand_dialog (_(" Save As "), _(" Enter file name: "),
411
+ " Save As ", edit->filename);
412
edit_push_action (edit, KEY_PRESS + edit->start_display);
415
@@ -887,7 +885,8 @@ edit_load_cmd (WEdit *edit)
419
- exp = edit_get_load_file (edit->filename, _(" Load "));
420
+ exp = input_expand_dialog (_(" Load "), _(" Enter file name: "),
421
+ " Load ", edit->filename);
425
@@ -2316,7 +2315,8 @@ edit_goto_cmd (WEdit *edit)
428
g_snprintf (s, sizeof (s), "%ld", line);
429
- f = input_dialog (_(" Goto line "), _(" Enter line: "), line ? s : "");
430
+ f = input_dialog (_(" Goto line "), _(" Enter line: "), " Goto line ",
435
@@ -2350,8 +2350,9 @@ edit_save_block_cmd (WEdit *edit)
436
if (eval_marks (edit, &start_mark, &end_mark))
439
- edit_get_save_file (catstrs (home_dir, PATH_SEP_STR CLIP_FILE, (char *) NULL),
440
- _(" Save Block "));
441
+ input_expand_dialog (_(" Save Block "), _(" Enter file name: "),
443
+ catstrs (home_dir, PATH_SEP_STR CLIP_FILE, (char *) NULL));
444
edit_push_action (edit, KEY_PRESS + edit->start_display);
447
@@ -2379,8 +2380,9 @@ edit_save_block_cmd (WEdit *edit)
449
edit_insert_file_cmd (WEdit *edit)
451
- char *exp = edit_get_load_file (catstrs (home_dir, PATH_SEP_STR CLIP_FILE, (char *) NULL),
452
- _(" Insert File "));
453
+ char *exp = input_expand_dialog (_(" Insert File "), _(" Enter file name: "),
455
+ catstrs (home_dir, PATH_SEP_STR CLIP_FILE, (char *) NULL));
456
edit_push_action (edit, KEY_PRESS + edit->start_display);
459
@@ -2419,7 +2421,7 @@ int edit_sort_cmd (WEdit * edit)
461
exp = input_dialog (_(" Run Sort "),
462
_(" Enter sort options (see manpage) separated by whitespace: "),
463
- (old != NULL) ? old : "");
464
+ " Run Sort ", (old != NULL) ? old : "");
468
@@ -2460,7 +2462,8 @@ edit_ext_cmd (WEdit *edit)
471
input_dialog (_("Paste output of external command"),
472
- _("Enter shell command(s):"), NULL);
473
+ _("Enter shell command(s):"),
474
+ "Paste output of external command", NULL);
479
===================================================================
480
RCS file: /cvsroot/mc/mc/vfs/ftpfs.c,v
481
retrieving revision 1.192
482
diff -u -p -r1.192 ftpfs.c
483
--- vfs/ftpfs.c 8 Mar 2006 14:54:11 -0000 1.192
484
+++ vfs/ftpfs.c 19 Sep 2006 07:58:27 -0000
485
@@ -498,7 +498,7 @@ ftpfs_login_server (struct vfs_class *me
486
p = g_strdup_printf (_
487
("FTP: Account required for user %s"),
489
- op = input_dialog (p, _("Account:"), "");
490
+ op = input_dialog (p, _("Account:"), (char *) NULL, "");
495
===================================================================
496
RCS file: /cvsroot/mc/mc/vfs/utilvfs.c,v
497
retrieving revision 1.43
498
diff -u -p -r1.43 utilvfs.c
499
--- vfs/utilvfs.c 27 Jan 2006 22:20:24 -0000 1.43
500
+++ vfs/utilvfs.c 19 Sep 2006 07:58:27 -0000
501
@@ -842,5 +842,5 @@ vfs_die (const char *m)
503
vfs_get_password (const char *msg)
505
- return input_dialog (msg, _("Password:"), INPUT_PASSWORD);
506
+ return input_dialog (msg, _("Password:"), (char *) NULL, INPUT_PASSWORD);