From f215b4035f6cc6d07529b3a15f712cdb381fab98 Mon Sep 17 00:00:00 2001
From: Mikhail S. Pobolovets <styx.mp@gmail.com>
Date: Wed, 21 Jan 2009 16:28:11 +0200
Subject: [PATCH] Signed-off-by: Mikhail S. Pobolovets <styx.mp@gmail.com>
Automatic new directory(Mkdir, F7) name filling.
Can be configured (on|off) in 'Configure options'.
---
src/cmd.c | 11 ++++++++++-
src/option.c | 1 +
src/setup.c | 1 +
3 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/src/cmd.c b/src/cmd.c
index fca2816..67eadd0 100644
a
|
b
|
int output_starts_shell = 0; |
76 | 76 | /* If set, use the builtin editor */ |
77 | 77 | int use_internal_edit = 1; |
78 | 78 | |
| 79 | /* Automatically fills name with current selected item name on mkdir */ |
| 80 | int auto_fill_mkdir_name = 1; |
79 | 81 | |
80 | 82 | int |
81 | 83 | view_file_at_line (const char *filename, int plain_view, int internal, |
… |
… |
void |
347 | 349 | mkdir_cmd (void) |
348 | 350 | { |
349 | 351 | char *dir, *absdir; |
| 352 | char *name = ""; |
| 353 | |
| 354 | /* If 'on' then automatically fills name with current selected item name */ |
| 355 | if (auto_fill_mkdir_name) |
| 356 | name = selection (current_panel)->fname; |
350 | 357 | |
351 | 358 | dir = |
352 | 359 | input_expand_dialog (_("Create a new Directory"), |
353 | | _(" Enter directory name:"), ""); |
| 360 | _(" Enter directory name:"), |
| 361 | name); |
| 362 | |
354 | 363 | if (!dir) |
355 | 364 | return; |
356 | 365 | |
diff --git a/src/option.c b/src/option.c
index 2898266..b02ffda 100644
a
|
b
|
static struct { |
65 | 65 | {N_("shell &Patterns"), &easy_patterns, TOGGLE_VARIABLE, 0 }, |
66 | 66 | {N_("Compute &Totals"), &file_op_compute_totals, TOGGLE_VARIABLE, 0 }, |
67 | 67 | {N_("&Verbose operation"), &verbose, TOGGLE_VARIABLE, 0 }, |
| 68 | {N_("Mkdir autoname"), &auto_fill_mkdir_name, TOGGLE_VARIABLE, 0 }, |
68 | 69 | /* panel options */ |
69 | 70 | {N_("&Fast dir reload"), &fast_reload, toggle_fast_reload, 0 }, |
70 | 71 | {N_("mi&X all files"), &mix_all_files, toggle_mix_all_files, 0 }, |
diff --git a/src/setup.c b/src/setup.c
index f26566a..865fa4c 100644
a
|
b
|
static const struct { |
223 | 223 | { "nice_rotating_dash", &nice_rotating_dash }, |
224 | 224 | { "horizontal_split", &horizontal_split }, |
225 | 225 | { "mcview_remember_file_position", &mcview_remember_file_position }, |
| 226 | { "auto_fill_mkdir_name", &auto_fill_mkdir_name }, |
226 | 227 | { 0, 0 } |
227 | 228 | }; |
228 | 229 | |