1
1

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'.
Этот коммит содержится в:
Mikhail S. Pobolovets 2009-01-22 23:29:10 +02:00 коммит произвёл Sergei Trofimovich
родитель 881ff40b3d
Коммит e3a82ba1d8
4 изменённых файлов: 15 добавлений и 3 удалений

Просмотреть файл

@ -77,6 +77,8 @@ int output_starts_shell = 0;
/* If set, use the builtin editor */
int use_internal_edit = 1;
/* Automatically fills name with current selected item name on mkdir */
int auto_fill_mkdir_name = 1;
int
view_file_at_line (const char *filename, int plain_view, int internal,
@ -351,11 +353,18 @@ void
mkdir_cmd (void)
{
char *dir, *absdir;
char *name = "";
/* If 'on' then automatically fills name with current selected item name */
if (auto_fill_mkdir_name)
name = selection (current_panel)->fname;
dir =
input_expand_dialog (_("Create a new Directory"),
_(" Enter directory name:"),
MC_HISTORY_FM_MKDIR, "");
MC_HISTORY_FM_MKDIR,
name);
if (!dir)
return;

Просмотреть файл

@ -71,6 +71,7 @@ extern int output_starts_shell;
extern int midnight_shutdown;
extern char cmd_buf [512];
extern const char *shell;
extern int auto_fill_mkdir_name;
/* Ugly hack in order to distinguish between left and right panel in menubar */
extern int is_right; /* If the selected menu was the right */

Просмотреть файл

@ -65,6 +65,7 @@ static struct {
{N_("shell &Patterns"), &easy_patterns, TOGGLE_VARIABLE, 0 },
{N_("Compute &Totals"), &file_op_compute_totals, TOGGLE_VARIABLE, 0 },
{N_("&Verbose operation"), &verbose, TOGGLE_VARIABLE, 0 },
{N_("Mkdir autoname"), &auto_fill_mkdir_name, TOGGLE_VARIABLE, 0 },
/* panel options */
{N_("&Fast dir reload"), &fast_reload, toggle_fast_reload, 0 },
{N_("mi&X all files"), &mix_all_files, toggle_mix_all_files, 0 },
@ -76,7 +77,7 @@ static struct {
};
/* Make sure this corresponds to the check_options structure */
#define OTHER_OPTIONS 12
#define OTHER_OPTIONS 13
#define PANEL_OPTIONS 6
static WRadio *pause_radio;

Просмотреть файл

@ -223,6 +223,7 @@ static const struct {
{ "nice_rotating_dash", &nice_rotating_dash },
{ "horizontal_split", &horizontal_split },
{ "mcview_remember_file_position", &mcview_remember_file_position },
{ "auto_fill_mkdir_name", &auto_fill_mkdir_name },
{ 0, 0 }
};