diff --git a/lib/keybind.c b/lib/keybind.c
index eedea6b..dabd5c8 100644
a
|
b
|
static name_keymap_t command_names[] = { |
134 | 134 | {"Bookmark", CK_Bookmark}, |
135 | 135 | {"Quit", CK_Quit}, |
136 | 136 | {"QuitQuiet", CK_QuitQuiet}, |
| 137 | {"PasteSrcFilename", CK_PasteSrcFilename}, |
137 | 138 | {"ExtendedKeyMap", CK_ExtendedKeyMap}, |
138 | 139 | |
139 | 140 | /* main commands */ |
diff --git a/lib/keybind.h b/lib/keybind.h
index 5bfb81b..c6b7f6e 100644
a
|
b
|
enum |
124 | 124 | CK_Bookmark, |
125 | 125 | CK_Quit, |
126 | 126 | CK_QuitQuiet, |
| 127 | CK_PasteSrcFilename, |
127 | 128 | /* C-x or similar */ |
128 | 129 | CK_ExtendedKeyMap, |
129 | 130 | |
diff --git a/misc/mc.default.keymap b/misc/mc.default.keymap
index 9d1bb60..13796dd 100644
a
|
b
|
Select = kpplus |
37 | 37 | Unselect = kpminus |
38 | 38 | SelectInvert = kpasterisk |
39 | 39 | ScreenList = alt-prime |
| 40 | PasteSrcFilename = ctrl-v; ctrl-insert |
40 | 41 | # OptionsLayout = |
41 | 42 | # OptionsPanel = |
42 | 43 | # OptionsConfirm = |
diff --git a/misc/mc.emacs.keymap b/misc/mc.emacs.keymap
index 6d503b4..72de2ab 100644
a
|
b
|
Select = kpplus |
37 | 37 | Unselect = kpminus |
38 | 38 | SelectInvert = kpasterisk |
39 | 39 | ScreenList = alt-prime |
| 40 | PasteSrcFilename = ctrl-v; ctrl-insert |
40 | 41 | # OptionsLayout = |
41 | 42 | # OptionsPanel = |
42 | 43 | # OptionsConfirm = |
diff --git a/src/filemanager/filegui.c b/src/filemanager/filegui.c
index 009b2e7..a5af1ca 100644
a
|
b
|
statfs (char const *filename, struct fs_info *buf) |
180 | 180 | #include "lib/widget.h" |
181 | 181 | |
182 | 182 | #include "src/setup.h" /* verbose */ |
| 183 | #include "src/keybind-defaults.h" |
183 | 184 | |
184 | 185 | #include "midnight.h" |
185 | 186 | #include "fileopctx.h" /* FILE_CONT */ |
… |
… |
struct |
277 | 278 | /* *INDENT-ON* */ |
278 | 279 | }; |
279 | 280 | |
| 281 | static unsigned long file_mask_dst_id; |
| 282 | static const char *file_mask_src_filename; |
| 283 | |
280 | 284 | /* --------------------------------------------------------------------------------------------- */ |
281 | 285 | /*** file scope functions ************************************************************************/ |
282 | 286 | /* --------------------------------------------------------------------------------------------- */ |
… |
… |
progress_button_callback (WButton * button, int action) |
646 | 650 | } |
647 | 651 | |
648 | 652 | /* --------------------------------------------------------------------------------------------- */ |
| 653 | |
| 654 | static cb_ret_t |
| 655 | file_mask_dialog_cb (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *data) |
| 656 | { |
| 657 | switch (msg) |
| 658 | { |
| 659 | case MSG_KEY: |
| 660 | { |
| 661 | cb_ret_t ret = MSG_NOT_HANDLED; |
| 662 | |
| 663 | if (keybind_lookup_keymap_command (main_map, parm) == CK_PasteSrcFilename) |
| 664 | { |
| 665 | WInput *wi; |
| 666 | wi = INPUT(dlg_find_by_id (DIALOG (w), file_mask_dst_id)); |
| 667 | input_insert (wi, file_mask_src_filename, FALSE); |
| 668 | ret = MSG_HANDLED; |
| 669 | } |
| 670 | |
| 671 | return ret; |
| 672 | } |
| 673 | |
| 674 | default: |
| 675 | return dlg_default_callback (w, sender, msg, parm, data); |
| 676 | } |
| 677 | } |
| 678 | |
| 679 | /* --------------------------------------------------------------------------------------------- */ |
649 | 680 | /*** public functions ****************************************************************************/ |
650 | 681 | /* --------------------------------------------------------------------------------------------- */ |
651 | 682 | |
… |
… |
file_mask_dialog (FileOpContext * ctx, FileOperation operation, |
1158 | 1189 | int format_len, text_len; |
1159 | 1190 | int max_len; |
1160 | 1191 | |
| 1192 | file_mask_src_filename = text; |
| 1193 | |
1161 | 1194 | format_len = str_term_width1 (format); |
1162 | 1195 | text_len = str_term_width1 (text); |
1163 | 1196 | max_len = COLS - 2 - 6; |
… |
… |
file_mask_dialog (FileOpContext * ctx, FileOperation operation, |
1198 | 1231 | QUICK_CHECKBOX (N_("&Using shell patterns"), &source_easy_patterns, NULL), |
1199 | 1232 | QUICK_STOP_COLUMNS, |
1200 | 1233 | QUICK_LABELED_INPUT (N_("to:"), input_label_above, |
1201 | | def_text_secure, "input2", &dest_dir, NULL, FALSE, FALSE, INPUT_COMPLETE_FILENAMES), |
| 1234 | def_text_secure, "input2", &dest_dir, &file_mask_dst_id, FALSE, FALSE, INPUT_COMPLETE_FILENAMES), |
1202 | 1235 | QUICK_SEPARATOR (TRUE), |
1203 | 1236 | QUICK_START_COLUMNS, |
1204 | 1237 | QUICK_CHECKBOX (N_("Follow &links"), &ctx->follow_links, NULL), |
… |
… |
file_mask_dialog (FileOpContext * ctx, FileOperation operation, |
1220 | 1253 | quick_dialog_t qdlg = { |
1221 | 1254 | -1, -1, fmd_xlen, |
1222 | 1255 | op_names[operation], "[Mask Copy/Rename]", |
1223 | | quick_widgets, NULL, NULL |
| 1256 | quick_widgets, only_one ? file_mask_dialog_cb : NULL, NULL |
1224 | 1257 | }; |
1225 | 1258 | |
1226 | 1259 | ask_file_mask: |
diff --git a/src/keybind-defaults.c b/src/keybind-defaults.c
index 7ad1f55..748c255 100644
a
|
b
|
static const global_keymap_ini_t default_main_keymap[] = { |
130 | 130 | {"SelectInvert", "kpasterisk"}, |
131 | 131 | /* List of screens */ |
132 | 132 | {"ScreenList", "alt-prime"}, |
| 133 | /* Paste Source filename on Copy/Move dialog */ |
| 134 | {"PasteSrcFilename", "ctrl-v; ctrl-insert"}, |
133 | 135 | {NULL, NULL} |
134 | 136 | }; |
135 | 137 | |