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'.
Этот коммит содержится в:
родитель
881ff40b3d
Коммит
e3a82ba1d8
11
src/cmd.c
11
src/cmd.c
@ -77,6 +77,8 @@ int output_starts_shell = 0;
|
|||||||
/* If set, use the builtin editor */
|
/* If set, use the builtin editor */
|
||||||
int use_internal_edit = 1;
|
int use_internal_edit = 1;
|
||||||
|
|
||||||
|
/* Automatically fills name with current selected item name on mkdir */
|
||||||
|
int auto_fill_mkdir_name = 1;
|
||||||
|
|
||||||
int
|
int
|
||||||
view_file_at_line (const char *filename, int plain_view, int internal,
|
view_file_at_line (const char *filename, int plain_view, int internal,
|
||||||
@ -351,11 +353,18 @@ void
|
|||||||
mkdir_cmd (void)
|
mkdir_cmd (void)
|
||||||
{
|
{
|
||||||
char *dir, *absdir;
|
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 =
|
dir =
|
||||||
input_expand_dialog (_("Create a new Directory"),
|
input_expand_dialog (_("Create a new Directory"),
|
||||||
_(" Enter directory name:"),
|
_(" Enter directory name:"),
|
||||||
MC_HISTORY_FM_MKDIR, "");
|
MC_HISTORY_FM_MKDIR,
|
||||||
|
name);
|
||||||
|
|
||||||
if (!dir)
|
if (!dir)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -71,6 +71,7 @@ extern int output_starts_shell;
|
|||||||
extern int midnight_shutdown;
|
extern int midnight_shutdown;
|
||||||
extern char cmd_buf [512];
|
extern char cmd_buf [512];
|
||||||
extern const char *shell;
|
extern const char *shell;
|
||||||
|
extern int auto_fill_mkdir_name;
|
||||||
|
|
||||||
/* Ugly hack in order to distinguish between left and right panel in menubar */
|
/* Ugly hack in order to distinguish between left and right panel in menubar */
|
||||||
extern int is_right; /* If the selected menu was the right */
|
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_("shell &Patterns"), &easy_patterns, TOGGLE_VARIABLE, 0 },
|
||||||
{N_("Compute &Totals"), &file_op_compute_totals, TOGGLE_VARIABLE, 0 },
|
{N_("Compute &Totals"), &file_op_compute_totals, TOGGLE_VARIABLE, 0 },
|
||||||
{N_("&Verbose operation"), &verbose, TOGGLE_VARIABLE, 0 },
|
{N_("&Verbose operation"), &verbose, TOGGLE_VARIABLE, 0 },
|
||||||
|
{N_("Mkdir autoname"), &auto_fill_mkdir_name, TOGGLE_VARIABLE, 0 },
|
||||||
/* panel options */
|
/* panel options */
|
||||||
{N_("&Fast dir reload"), &fast_reload, toggle_fast_reload, 0 },
|
{N_("&Fast dir reload"), &fast_reload, toggle_fast_reload, 0 },
|
||||||
{N_("mi&X all files"), &mix_all_files, toggle_mix_all_files, 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 */
|
/* Make sure this corresponds to the check_options structure */
|
||||||
#define OTHER_OPTIONS 12
|
#define OTHER_OPTIONS 13
|
||||||
#define PANEL_OPTIONS 6
|
#define PANEL_OPTIONS 6
|
||||||
|
|
||||||
static WRadio *pause_radio;
|
static WRadio *pause_radio;
|
||||||
|
@ -223,6 +223,7 @@ static const struct {
|
|||||||
{ "nice_rotating_dash", &nice_rotating_dash },
|
{ "nice_rotating_dash", &nice_rotating_dash },
|
||||||
{ "horizontal_split", &horizontal_split },
|
{ "horizontal_split", &horizontal_split },
|
||||||
{ "mcview_remember_file_position", &mcview_remember_file_position },
|
{ "mcview_remember_file_position", &mcview_remember_file_position },
|
||||||
|
{ "auto_fill_mkdir_name", &auto_fill_mkdir_name },
|
||||||
{ 0, 0 }
|
{ 0, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Загрузка…
Ссылка в новой задаче
Block a user