Ticket #50: history-section-names.patch

File history-section-names.patch, 18.0 KB (added by slavazanko, 15 years ago)

added by ptsekov

  • src/cmd.c

    RCS file: /cvsroot/mc/mc/src/cmd.c,v
    retrieving revision 1.164
    diff -u -p -r1.164 cmd.c
    view_file_cmd (void) 
    229228 
    230229    filename = 
    231230        input_expand_dialog (_(" View file "), _(" Filename:"), 
    232                              selection (current_panel)->fname); 
     231                             " View file ", selection (current_panel)->fname); 
    233232    if (!filename) 
    234233        return; 
    235234 
    filtered_view_cmd (void) 
    252251    command = 
    253252        input_dialog (_(" Filtered view "), 
    254253                      _(" Filter command and arguments:"), 
     254                      " Filtered view ", 
    255255                      selection (current_panel)->fname); 
    256256    if (!command) 
    257257        return; 
    mkdir_cmd (void) 
    350350 
    351351    dir = 
    352352        input_expand_dialog (_("Create a new Directory"), 
    353                              _(" Enter directory name:"), ""); 
     353                             _(" Enter directory name:"),  
     354                             "Create a new Directory", ""); 
    354355    if (!dir) 
    355356        return; 
    356357 
    set_panel_filter (WPanel *p) 
    422423         
    423424    reg_exp = input_dialog_help (_(" Filter "), 
    424425                                 _(" Set expression for filtering filenames"), 
    425                                  "[Filter...]", x); 
     426                                 "[Filter...]", " Filter ", x); 
    426427    if (!reg_exp) 
    427428        return; 
    428429    set_panel_filter_to (p, reg_exp); 
    void reverse_selection_cmd (void) 
    468469} 
    469470 
    470471static void 
    471 select_unselect_cmd (const char *title, int cmd) 
     472select_unselect_cmd (const char *title, const char *history_name, int cmd) 
    472473{ 
    473474    char *reg_exp, *reg_exp_t; 
    474475    int i; 
    475476    int c; 
    476477    int dirflag = 0; 
    477478 
    478     reg_exp = input_dialog (title, "", easy_patterns ? "*" : "."); 
     479    reg_exp = input_dialog (title, "", history_name, easy_patterns ? "*" : "."); 
    479480    if (!reg_exp) 
    480481        return; 
    481482    if (!*reg_exp) { 
    select_unselect_cmd (const char *title,  
    521522 
    522523void select_cmd (void) 
    523524{ 
    524     select_unselect_cmd (_(" Select "), 1); 
     525    select_unselect_cmd (_(" Select "), " Select ", 1); 
    525526} 
    526527 
    527528void unselect_cmd (void) 
    528529{ 
    529     select_unselect_cmd (_(" Unselect "), 0); 
     530    select_unselect_cmd (_(" Unselect "), " Unselect ", 0); 
    530531} 
    531532 
    532533/* Check if the file exists */ 
    do_link (int symbolic_link, const char * 
    903904 
    904905    if (!symbolic_link) { 
    905906        src = g_strdup_printf (_("Link %s to:"), name_trunc (fname, 46)); 
    906         dest = input_expand_dialog (_(" Link "), src, ""); 
     907        dest = input_expand_dialog (_(" Link "), src, " Link ", ""); 
    907908        if (!dest || !*dest) 
    908909            goto cleanup; 
    909910        save_cwds_stat (); 
    void edit_symlink_cmd (void) 
    972988        i = readlink (p, buffer, MC_MAXPATHLEN - 1); 
    973989        if (i > 0) { 
    974990            buffer [i] = 0; 
    975             dest = input_expand_dialog (_(" Edit symlink "), q, buffer); 
     991            dest = input_expand_dialog (_(" Edit symlink "), q, " Edit symlink ", buffer); 
    976992            if (dest) { 
    977993                if (*dest && strcmp (buffer, dest)) { 
    978994                    save_cwds_stat (); 
    get_random_hint (int force) 
    10851101 
    10861102#if defined(USE_NETCODE) || defined(USE_EXT2FSLIB) 
    10871103static void 
    1088 nice_cd (const char *text, const char *xtext, const char *help, const char *prefix, int to_home) 
     1104nice_cd (const char *text, const char *xtext, const char *help, 
     1105         const char *history_name, const char *prefix, int to_home) 
    10891106{ 
    10901107    char *machine; 
    10911108    char *cd_path; 
    nice_cd (const char *text, const char *x 
    10931110    if (!SELECTED_IS_PANEL) 
    10941111        return; 
    10951112 
    1096     machine = input_dialog_help (text, 
    1097                                  xtext, 
    1098                                  help, ""); 
     1113    machine = input_dialog_help (text, xtext, help, history_name, ""); 
    10991114    if (!machine) 
    11001115        return; 
    11011116 
    static const char *machine_str = N_(" En 
    11251140void netlink_cmd (void) 
    11261141{ 
    11271142    nice_cd (_(" Link to a remote machine "), _(machine_str), 
    1128              "[Network File System]", "/#mc:", 1); 
     1143             "[Network File System]", " Link to a remote machine ", 
     1144             "/#mc:", 1); 
    11291145} 
    11301146#endif /* WITH_MCFS */ 
    11311147 
    11321148void ftplink_cmd (void) 
    11331149{ 
    11341150    nice_cd (_(" FTP to machine "), _(machine_str), 
    1135              "[FTP File System]", "/#ftp:", 1); 
     1151             "[FTP File System]", " FTP to machine ", "/#ftp:", 1); 
    11361152} 
    11371153 
    11381154void fishlink_cmd (void) 
    11391155{ 
    11401156    nice_cd (_(" Shell link to machine "), _(machine_str), 
    1141              "[FIle transfer over SHell filesystem]", "/#sh:", 1); 
     1157             "[FIle transfer over SHell filesystem]", " Shell link to machine ", 
     1158             "/#sh:", 1); 
    11421159} 
    11431160 
    11441161#ifdef WITH_SMBFS 
    11451162void smblink_cmd (void) 
    11461163{ 
    11471164    nice_cd (_(" SMB link to machine "), _(machine_str), 
    1148              "[SMB File System]", "/#smb:", 0); 
     1165             "[SMB File System]", " SMB link to machine ", 
     1166             "/#smb:", 0); 
    11491167} 
    11501168#endif /* WITH_SMBFS */ 
    11511169#endif /* USE_NETCODE */ 
    void undelete_cmd (void) 
    11561174    nice_cd (_(" Undelete files on an ext2 file system "), 
    11571175             _(" Enter device (without /dev/) to undelete\n " 
    11581176               "  files on: (F1 for details)"), 
    1159              "[Undelete File System]", "/#undel:", 0); 
     1177             "[Undelete File System]", " Undelete files on an ext2 file system ", 
     1178             "/#undel:", 0); 
    11601179} 
    11611180#endif /* USE_EXT2FSLIB */ 
    11621181 
  • src/ext.c

    RCS file: /cvsroot/mc/mc/src/ext.c,v
    retrieving revision 1.79
    diff -u -p -r1.79 ext.c
    exec_extension (const char *filename, co 
    113113            if (*data == '}') { 
    114114                char *parameter; 
    115115                parameter_found = 0; 
    116                 parameter = input_dialog (_(" Parameter "), prompt, ""); 
     116                parameter = input_dialog (_(" Parameter "), prompt, " Parameter ", ""); 
    117117                if (!parameter) { 
    118118                    /* User canceled */ 
    119119                    fclose (cmd_file); 
  • src/hotlist.c

    RCS file: /cvsroot/mc/mc/src/hotlist.c,v
    retrieving revision 1.85
    diff -u -p -r1.85 hotlist.c
    void add2hotlist_cmd (void) 
    10411041    strip_password (label_string, 1); 
    10421042 
    10431043    prompt = g_strdup_printf (cp, path_trunc (current_panel->cwd, COLS-2*UX-(l+8))); 
    1044     label = input_dialog (_(" Add to hotlist "), prompt, label_string); 
     1044    label = input_dialog (_(" Add to hotlist "), prompt, " Add to hotlist ", label_string); 
    10451045    g_free (prompt); 
    10461046 
    10471047    if (!label || !*label) { 
  • src/panelize.c

    RCS file: /cvsroot/mc/mc/src/panelize.c,v
    retrieving revision 1.51
    diff -u -p -r1.51 panelize.c
    add2panelize_cmd (void) 
    225225    if (pname->buffer && (*pname->buffer)) { 
    226226        label = input_dialog (_(" Add to external panelize "),  
    227227                _(" Enter command label: "),  
     228                " Add to external panelize ", 
    228229                              ""); 
    229230        if (!label) 
    230231            return; 
  • src/user.c

    RCS file: /cvsroot/mc/mc/src/user.c,v
    retrieving revision 1.76
    diff -u -p -r1.76 user.c
    execute_menu_command (WEdit *edit_widget 
    603603            if (*commands == '}'){ 
    604604                char *tmp; 
    605605                *parameter = 0; 
    606                 parameter = input_dialog (_(" Parameter "), prompt, ""); 
     606                parameter = input_dialog (_(" Parameter "), prompt, " Parameter ", ""); 
    607607                if (!parameter || !*parameter){ 
    608608                    /* User canceled */ 
    609609                    fclose (cmd_file); 
  • src/view.c

    RCS file: /cvsroot/mc/mc/src/view.c,v
    retrieving revision 1.356
    diff -u -p -r1.356 view.c
    view_moveto_line_cmd (WView *view) 
    27302730    g_snprintf (prompt, sizeof (prompt), 
    27312731                _(" The current line number is %d.\n" 
    27322732                  " Enter the new line number:"), (int) (line + 1)); 
    2733     answer = input_dialog (_(" Goto line "), prompt, ""); 
     2733    answer = input_dialog (_(" Goto line "), prompt, " Goto line ", ""); 
    27342734    if (answer != NULL && answer[0] != '\0') { 
    27352735        errno = 0; 
    27362736        line = strtoul (answer, &answer_end, 10); 
    view_moveto_addr_cmd (WView *view) 
    27512751    g_snprintf (prompt, sizeof (prompt), 
    27522752                _(" The current address is 0x%lx.\n" 
    27532753                  " Enter the new address:"), view->hex_cursor); 
    2754     line = input_dialog (_(" Goto Address "), prompt, ""); 
     2754    line = input_dialog (_(" Goto Address "), prompt, " Goto Address ", ""); 
    27552755    if (line != NULL) { 
    27562756        if (*line != '\0') { 
    27572757            addr = strtoul (line, &error, 0); 
    regexp_search (WView *view, int directio 
    27812781 
    27822782    defval = (view->search_exp != NULL) ? view->search_exp : ""; 
    27832783 
    2784     regexp = input_dialog (_("Search"), _(" Enter regexp:"), defval); 
     2784    regexp = input_dialog (_("Search"), _(" Enter regexp:"), "Search", defval); 
    27852785    if (regexp == NULL || regexp[0] == '\0') 
    27862786        goto cleanup; 
    27872787 
  • src/wtools.c

    RCS file: /cvsroot/mc/mc/src/wtools.c,v
    retrieving revision 1.85
    diff -u -p -r1.85 wtools.c
    int quick_dialog (QuickDialog *qd) 
    433433 * 
    434434 * If the arguments "header" and "text" should be translated, 
    435435 * that MUST be done by the caller of fg_input_dialog_help(). 
     436 * 
     437 * The argument "history_name" holds the name of a section 
     438 * in the history file. Data entered in the input field of 
     439 * the dialog box will be stored there. 
    436440 *  
    437441 */ 
    438442static char * 
    439443fg_input_dialog_help (const char *header, const char *text, const char *help, 
    440                         const char *def_text) 
     444                      const char *history_name, const char *def_text) 
    441445{ 
    442446    QuickDialog Quick_input; 
    443447    QuickWidget quick_widgets[] = { 
    fg_input_dialog_help (const char *header 
    457461    char histname[64] = "inp|"; 
    458462    char *p_text; 
    459463 
    460     /* we need a unique name for histname because widget.c:history_tool() 
    461        needs a unique name for each dialog - using the header is ideal */ 
    462     g_strlcpy (histname + 3, header, 61); 
    463     quick_widgets[2].histname = histname; 
     464    if (history_name != NULL && *history_name != '\0') { 
     465        g_strlcpy (histname + 3, history_name, 61); 
     466        quick_widgets[2].histname = histname; 
     467    } 
    464468 
    465469    msglen (text, &lines, &cols); 
    466470    len = max ((int) strlen (header), cols) + 4; 
    fg_input_dialog_help (const char *header 
    524528 * that MUST be done by the caller of these wrappers. 
    525529 */ 
    526530char * 
    527 input_dialog_help (const char *header, const char *text, const char *help, const char *def_text) 
     531input_dialog_help (const char *header, const char *text, const char *help, 
     532                   const char *history_name, const char *def_text) 
    528533{ 
    529534#ifdef WITH_BACKGROUND 
    530535    if (we_are_background) 
    531         return parent_call_string ((void *) fg_input_dialog_help, 4, 
     536        return parent_call_string ((void *) fg_input_dialog_help, 5, 
    532537                                   strlen (header), header, strlen (text), 
    533538                                   text, strlen (help), help, 
     539                                   strlen (history_name), history_name, 
    534540                                   strlen (def_text), def_text); 
    535541    else 
    536542#endif                          /* WITH_BACKGROUND */ 
    537         return fg_input_dialog_help (header, text, help, def_text); 
     543        return fg_input_dialog_help (header, text, help, history_name, def_text); 
    538544} 
    539545 
    540546/* Show input dialog with default help, background safe */ 
    541 char *input_dialog (const char *header, const char *text, const char *def_text) 
     547char *input_dialog (const char *header, const char *text, 
     548                    const char *history_name, const char *def_text) 
    542549{ 
    543     return input_dialog_help (header, text, "[Input Line Keys]", def_text); 
     550    return input_dialog_help (header, text, "[Input Line Keys]", history_name, def_text); 
    544551} 
    545552 
    546553char * 
    547 input_expand_dialog (const char *header, const char *text, const char *def_text) 
     554input_expand_dialog (const char *header, const char *text,  
     555                     const char *history_name, const char *def_text) 
    548556{ 
    549557    char *result; 
    550558    char *expanded; 
    551559 
    552     result = input_dialog (header, text, def_text); 
     560    result = input_dialog (header, text, history_name, def_text); 
    553561    if (result) { 
    554562        expanded = tilde_expand (result); 
    555563        g_free (result); 
  • src/tree.c

    RCS file: /cvsroot/mc/mc/src/tree.c,v
    retrieving revision 1.69
    diff -u -p -r1.69 tree.c
    static void tree_copy (WTree *tree, cons 
    597597        return; 
    598598    g_snprintf (cmd_buf, sizeof(cmd_buf), _("Copy \"%s\" directory to:"), 
    599599             name_trunc (tree->selected_ptr->name, 50)); 
    600     dest = input_expand_dialog (_(" Copy "), cmd_buf, default_dest); 
     600    dest = input_expand_dialog (_(" Copy "), cmd_buf, " Copy ", default_dest); 
    601601 
    602602    if (!dest) 
    603603        return; 
    static void tree_move (WTree *tree, cons 
    640640        return; 
    641641    g_snprintf (cmd_buf, sizeof (cmd_buf), _("Move \"%s\" directory to:"), 
    642642             name_trunc (tree->selected_ptr->name, 50)); 
    643     dest = input_expand_dialog (_(" Move "), cmd_buf, default_dest); 
     643    dest = input_expand_dialog (_(" Move "), cmd_buf, " Move ", default_dest); 
    644644    if (!dest) 
    645645        return; 
    646646    if (!*dest){ 
  • src/wtools.h

    RCS file: /cvsroot/mc/mc/src/wtools.h,v
    retrieving revision 1.28
    diff -u -p -r1.28 wtools.h
    int quick_dialog_skip (QuickDialog *qd,  
    5757/* Pass this as def_text to request a password */ 
    5858#define INPUT_PASSWORD ((char *) -1) 
    5959 
    60 char *input_dialog (const char *header, const char *text, const char *def_text); 
    61 char *input_dialog_help (const char *header, const char *text, const char *help, const char *def_text); 
    62 char *input_expand_dialog (const char *header, const char *text, const char *def_text); 
     60char *input_dialog (const char *header, const char *text, 
     61                    const char *history_name, const char *def_text); 
     62char *input_dialog_help (const char *header, const char *text, const char *help, 
     63                         const char *history_name, const char *def_text); 
     64char *input_expand_dialog (const char *header, const char *text, 
     65                           const char *history_name, const char *def_text); 
    6366 
    6467void query_set_sel (int new_sel); 
    6568 
  • edit/editcmd.c

    RCS file: /cvsroot/mc/mc/edit/editcmd.c,v
    retrieving revision 1.151
    diff -u -p -r1.151 editcmd.c
     
    5757#include "../src/charsets.h" 
    5858#include "../src/selcodepage.h" 
    5959 
    60 #define edit_get_load_file(f,h) input_expand_dialog (h, _(" Enter file name: "), f) 
    61 #define edit_get_save_file(f,h) input_expand_dialog (h, _(" Enter file name: "), f) 
    62  
    6360struct selection { 
    6461   unsigned char * text; 
    6562   int len; 
    edit_save_as_cmd (WEdit *edit) 
    505502    int save_lock = 0; 
    506503    int different_filename = 0; 
    507504 
    508     exp = edit_get_save_file (edit->filename, _(" Save As ")); 
     505    exp = input_expand_dialog (_(" Save As "), _(" Enter file name: "), 
     506                               " Save As ", edit->filename); 
    509507    edit_push_action (edit, KEY_PRESS + edit->start_display); 
    510508 
    511509    if (exp) { 
    edit_load_cmd (WEdit *edit) 
    887885        } 
    888886    } 
    889887 
    890     exp = edit_get_load_file (edit->filename, _(" Load ")); 
     888    exp = input_expand_dialog (_(" Load "), _(" Enter file name: "), 
     889                               " Load ", edit->filename); 
    891890 
    892891    if (exp) { 
    893892        if (*exp) 
    edit_goto_cmd (WEdit *edit) 
    23162315    char s[32]; 
    23172316 
    23182317    g_snprintf (s, sizeof (s), "%ld", line); 
    2319     f = input_dialog (_(" Goto line "), _(" Enter line: "), line ? s : ""); 
     2318    f = input_dialog (_(" Goto line "), _(" Enter line: "), " Goto line ", 
     2319                      line ? s : ""); 
    23202320    if (!f) 
    23212321        return; 
    23222322 
    edit_save_block_cmd (WEdit *edit) 
    23502350    if (eval_marks (edit, &start_mark, &end_mark)) 
    23512351        return 1; 
    23522352    exp = 
    2353         edit_get_save_file (catstrs (home_dir, PATH_SEP_STR CLIP_FILE, (char *) NULL), 
    2354                             _(" Save Block ")); 
     2353        input_expand_dialog (_(" Save Block "), _(" Enter file name: "), 
     2354                             " Save Block ",  
     2355                            catstrs (home_dir, PATH_SEP_STR CLIP_FILE, (char *) NULL)); 
    23552356    edit_push_action (edit, KEY_PRESS + edit->start_display); 
    23562357    if (exp) { 
    23572358        if (!*exp) { 
    edit_save_block_cmd (WEdit *edit) 
    23792380int 
    23802381edit_insert_file_cmd (WEdit *edit) 
    23812382{ 
    2382     char *exp = edit_get_load_file (catstrs (home_dir, PATH_SEP_STR CLIP_FILE, (char *) NULL), 
    2383                                     _(" Insert File ")); 
     2383    char *exp = input_expand_dialog (_(" Insert File "), _(" Enter file name: "), 
     2384                                     " Insert File ", 
     2385                                     catstrs (home_dir, PATH_SEP_STR CLIP_FILE, (char *) NULL)); 
    23842386    edit_push_action (edit, KEY_PRESS + edit->start_display); 
    23852387    if (exp) { 
    23862388        if (!*exp) { 
    int edit_sort_cmd (WEdit * edit) 
    24192421 
    24202422    exp = input_dialog (_(" Run Sort "), 
    24212423        _(" Enter sort options (see manpage) separated by whitespace: "), 
    2422         (old != NULL) ? old : ""); 
     2424        " Run Sort ", (old != NULL) ? old : ""); 
    24232425 
    24242426    if (!exp) 
    24252427        return 1; 
    edit_ext_cmd (WEdit *edit) 
    24602462 
    24612463    exp = 
    24622464        input_dialog (_("Paste output of external command"), 
    2463                       _("Enter shell command(s):"), NULL); 
     2465                      _("Enter shell command(s):"), 
     2466                      "Paste output of external command", NULL); 
    24642467 
    24652468    if (!exp) 
    24662469        return 1; 
  • vfs/ftpfs.c

    RCS file: /cvsroot/mc/mc/vfs/ftpfs.c,v
    retrieving revision 1.192
    diff -u -p -r1.192 ftpfs.c
    ftpfs_login_server (struct vfs_class *me 
    498498                p = g_strdup_printf (_ 
    499499                                     ("FTP: Account required for user %s"), 
    500500                                     SUP.user); 
    501                 op = input_dialog (p, _("Account:"), ""); 
     501                op = input_dialog (p, _("Account:"), (char *) NULL, ""); 
    502502                g_free (p); 
    503503                if (op == NULL) 
    504504                    ERRNOR (EPERM, 0); 
  • vfs/utilvfs.c

    RCS file: /cvsroot/mc/mc/vfs/utilvfs.c,v
    retrieving revision 1.43
    diff -u -p -r1.43 utilvfs.c
    vfs_die (const char *m) 
    842842char * 
    843843vfs_get_password (const char *msg) 
    844844{ 
    845     return input_dialog (msg, _("Password:"), INPUT_PASSWORD); 
     845    return input_dialog (msg, _("Password:"), (char *) NULL, INPUT_PASSWORD); 
    846846}