Ticket #204: 204_mkdir_autofills_name.001.patch

File 204_mkdir_autofills_name.001.patch, 3.0 KB (added by styx, 14 years ago)

include some important fixes

  • src/cmd.c

    From 07d1cfef611562b77b41b50c0fb533e412b3814d Mon Sep 17 00:00:00 2001
    From: Mikhail S. Pobolovets <styx.mp@gmail.com>
    Date: Thu, 22 Jan 2009 23:29:10 +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/main.h   |    1 +
     src/option.c |    3 ++-
     src/setup.c  |    1 +
     4 files changed, 14 insertions(+), 2 deletions(-)
    
    diff --git a/src/cmd.c b/src/cmd.c
    index fca2816..67eadd0 100644
    a b int output_starts_shell = 0; 
    7676/* If set, use the builtin editor */ 
    7777int use_internal_edit = 1; 
    7878 
     79/* Automatically fills name with current selected item name on mkdir */ 
     80int auto_fill_mkdir_name = 1; 
    7981 
    8082int 
    8183view_file_at_line (const char *filename, int plain_view, int internal, 
    void 
    347349mkdir_cmd (void) 
    348350{ 
    349351    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; 
    350357 
    351358    dir = 
    352359        input_expand_dialog (_("Create a new Directory"), 
    353                              _(" Enter directory name:"), ""); 
     360                             _(" Enter directory name:"), 
     361                             name); 
     362 
    354363    if (!dir) 
    355364        return; 
    356365 
  • src/main.h

    diff --git a/src/main.h b/src/main.h
    index fb38e7a..1500548 100644
    a b extern int output_starts_shell; 
    7171extern int midnight_shutdown; 
    7272extern char cmd_buf [512]; 
    7373extern const char *shell; 
     74extern int auto_fill_mkdir_name; 
    7475 
    7576/* Ugly hack in order to distinguish between left and right panel in menubar */ 
    7677extern int is_right;            /* If the selected menu was the right */ 
  • src/option.c

    diff --git a/src/option.c b/src/option.c
    index 2898266..1649b05 100644
    a b static struct { 
    6565   {N_("shell &Patterns"),    &easy_patterns,     TOGGLE_VARIABLE,       0 }, 
    6666   {N_("Compute &Totals"),    &file_op_compute_totals, TOGGLE_VARIABLE,  0 }, 
    6767   {N_("&Verbose operation"), &verbose,           TOGGLE_VARIABLE,       0 }, 
     68   {N_("Mkdir autoname"),     &auto_fill_mkdir_name, TOGGLE_VARIABLE,    0 }, 
    6869   /* panel options */ 
    6970   {N_("&Fast dir reload"),   &fast_reload,       toggle_fast_reload,    0 }, 
    7071   {N_("mi&X all files"),     &mix_all_files,     toggle_mix_all_files,  0 }, 
    static struct { 
    7677}; 
    7778 
    7879/* Make sure this corresponds to the check_options structure */ 
    79 #define OTHER_OPTIONS 12 
     80#define OTHER_OPTIONS 13 
    8081#define PANEL_OPTIONS 6 
    8182 
    8283static WRadio *pause_radio; 
  • src/setup.c

    diff --git a/src/setup.c b/src/setup.c
    index f26566a..865fa4c 100644
    a b static const struct { 
    223223    { "nice_rotating_dash", &nice_rotating_dash }, 
    224224    { "horizontal_split",   &horizontal_split }, 
    225225    { "mcview_remember_file_position", &mcview_remember_file_position }, 
     226    { "auto_fill_mkdir_name", &auto_fill_mkdir_name }, 
    226227    { 0, 0 } 
    227228}; 
    228229