Commit Graph

206 Commits

Author SHA1 Message Date
Andrew Borodin be622a9981 Refactoring of configuration handling.
Some functions were renamed. Code was reorganized.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-05-14 18:44:43 +04:00
Ilia Maslakov 91859e4a21 Fixed fogotten diff_map, diff_keymap
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2010-05-08 12:49:53 +00:00
Ilia Maslakov 823387a793 Removed hardcoded hotkeys in dialog.c Replaced keymap's initialization from main.c into setup.c
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>

Collect keybind-related variables in src/keybind.[ch] files.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-05-07 15:02:11 +04:00
Andrew Borodin 873880edc2 vfs_timeout and use_netrc variables were moved to vfs.h file.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-05-05 16:24:14 +04:00
Andrew Borodin 7ada01bfa1 Ticket #2078: changed return value of init_translation_table() function.
init_translation_table() now returnes newly-allocated string
instead of pointer to the static buffer.

Thanks Vit Rosin for original patch.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-05-05 16:24:14 +04:00
Andrew Borodin 78032688f5 Added capability to run MC as standalone diff viewer.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2010-04-26 11:44:31 +04:00
Ilia Maslakov 329ef3846a Ticket #120 (View diff files)
added src/diffviewer/ydiff.[ch] into project tree
    added entry 'View diff files' into 'Command' menu
    added 'diffviewer' color pairs
    fixed Makefile and configure.am
    added new binding CmdDiffView into '[main]' section
    Big thanx to 'Daniel Borca <dborca@yahoo.com>' for ydiff

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>

    Added diffviewer own library

Signed-off-by: Slava Zanko <slavazanko@gmail.com>

    Fixed CFLAGS for diffviewer.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>

    changed skins, added section
        [diffviewer]
            added=
            changedline=
            changednew=
            changed=
            removed=
            folder=
            error=

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>

Reimplementation of hardcoded shortcuts to keybindings.

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-04-26 11:44:15 +04:00
Ilia Maslakov 0400e92fc5 Ticket #2022 (case sensitive quick search)
added new option quick_search_case_sensitive, with 3 position are: 0, 1, 2.
    if "0", quick search in case insensitive
    if "1", quick search in case sensitive
    if "2", get from panel "case_sensitive"

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-03-19 09:15:29 +03:00
Slava Zanko 5354d59337 Identation of some source files.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-02-26 11:26:00 +02:00
Slava Zanko efb3042f29 avoid often memory alocation&release
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-02-26 10:58:49 +02:00
Slava Zanko 054c5d6f44 x86_64: Cleanup of code for master
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-02-26 10:58:49 +02:00
Andrew Borodin 45073c35e7 Ticket #1992: incorrect sturtup of MC with some special paths.
Problem description:
  1. Run mc as
     mc /#ftp:user@server
  2. If FTP server asks password, MC shows the password dialog window.
  3. If type the first symbol in input line, MC crashes.

Bug cause:
  MC asks ftp password before initialize of input line keybindings.

Solution:
  Reimplemented MC startup sequence.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-02-24 16:22:43 +00:00
Martin Petricek 7c3196b60e Ticket #1767: Custom/locale-based date format
Fixed showing of datetime format in various locales (such as Polish locale)

Added new options in config file:

[Misc]
    ...
    timeformat_recent=%d.%m.%y %H:%M
    timeformat_old=%d.%m.%y %H:%M
    ...

where
    timeformat_recent - for files with mtime between now
                         and "6 moths old" (like "Nov 2 00:56")
    timeformat_old    - for other files (like "Jun 23 2007")

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-02-15 12:31:47 +02:00
Leonid Myravjev 56d955152c Ticket #1838: source_codepage autodetect with enca program.
Added support of autodetect codepages via 'enca' program.

New parameter in user configuration file (~/.mc/ini):

[Misc]
autodetect_codeset=(one of `enca --list languages | cut -d : -f1`)

Signed-off-by: Slava Zanko <slavazanko@gmail.com>

Little code cleanup.

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>

Type accuracy. Added missing includes.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-02-08 15:56:48 +02:00
Andrew Borodin ad60c3fd8d Preparation to history cleanup confirmation.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-02-04 13:42:44 +00:00
Slava Zanko 25155c311a Move all interface includes from subdirs lib/*/*.h into lib/*.h
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-01-26 10:30:25 +02:00
Slava Zanko cd4dbf3a09 Changes for build after moving strutil into lib
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-01-26 10:30:24 +02:00
Slava Zanko dbaff2b6f6 Reorganization of sources. Part 2
* moved src/fileloc.h into lib/fileloc.h
 * moved src/timefmt.h into lib/timefmt.h
 * removed unneedded includes into src/util.c

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-01-26 10:30:23 +02:00
Slava Zanko 93dbc46e9c Reorganization of sources. Part 1.
* moved src/global.h into lib/global.h
 * moved glibcompat.[ch] from ./src/ into ./lib/
 * moved fs.h from ./src/ into ./lib/

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-01-26 10:30:23 +02:00
Slava Zanko 39d5b94cac Reorganized pathes to files in '#include' directives 2010-01-26 10:30:22 +02:00
Slava Zanko ddb9ada2e8 Changes in sources matched with mass movement of $(srcdir)/src/*/ into $(srcdir)/lib/*/
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-01-26 10:30:22 +02:00
Slava Zanko 43805741aa Changes in sources matched with movement of $(srcdir)/vfs into $(srcdir)/lib/vfs/mc-vfs
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-01-26 10:30:21 +02:00
Slava Zanko f90725ad0d Changes in sources matched with movement of $(srcdir)/edit into $(srcdir)/src/editor
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-01-26 10:30:19 +02:00
Ilia Maslakov 1eeffc2803 added new parameter mcview_eof into ini-file
if mcview_eof defined show mcview_eof as EOF

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2010-01-19 19:15:30 +00:00
Andrew Borodin 6123cac32b Ticket #1954: check pointers to GArray before deletion.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-01-12 13:42:02 +00:00
Andrew Borodin 1055b85072 Ticket #1918: viewer in QuickView mode corrupts screen.
Initial step: code refactoring:
  * small code formatting;
  * type accuracy;
  * introduce new type 'panel_view_mode_t' for panel type.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-01-06 18:12:53 +03:00
Andrew Borodin 462315fe09 Save find file options in user configuration file.
The new section [FindFile] was created for find file options.
The find_ignore_dirs key in Misc section is obsolete now.
The ignore_dirs key in FindFile section is used instead.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-01-06 18:04:50 +03:00
Ilia Maslakov 7c2692cf8c add new etitor parameter editor_show_right_margin
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2010-01-06 14:26:02 +03:00
Enrico Weigelt, metux IT service ec1a52fb0a VFS: renamed USE_VFS to ENABLE_VFS 2009-12-30 11:06:11 +02:00
Enrico Weigelt, metux IT service 80b3776c20 VFS: fixed lots of missing includes to vfs/vfs.h 2009-12-30 11:06:09 +02:00
Slava Zanko 4f88a84526 Ticket #1663: Panels state saves and restores despite disabled 'Auto save setup'
Added option 'auto_save_setup_panels' into [Midnight-Commander] section of ini-file.
If no specified, value of this option is equal to value of 'auto_save_setup' option.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-12-25 13:23:05 +02:00
Vit Rosin a7110419a6 missing check in src_mcconfig_get.c-mc_config_get_groups()_-2
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-12-16 11:10:43 +02:00
Slava Zanko 59efad629f Ticket #1613: remove charset confirmation on startup
Since mc-4.7.0-pre1 was added charset confirmation if charset was changed.

This commit was adds automatic recognize of system charset and fix in current
config. Also, now contig file will untouched if 'Auto save setup' option is switched off.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-11-19 10:36:37 +02:00
Andrew Borodin ccabd60ffc Implemented keybindings for Help window.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-11-19 10:07:51 +03:00
Andrew Borodin da33e767e9 Type accuracy and code clean up.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-11-19 10:07:51 +03:00
Andrew Borodin efdb645468 Implemeted keybindings for Tree widget
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-11-19 10:07:51 +03:00
kenny 0c309724a5 Ticket #1776: save flags of select/unselet file group.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-11-18 14:21:08 +03:00
Slava Zanko 90a7ad8528 Ticket #1790: mc crashes on start
If ~/.mc/panels.ini have incorrect value of 'sort_order' key, then mc will crashed.

Fix issue: Now default sort_order for incorrect value is  'name' (sort by name)

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-11-11 11:33:06 +02:00
Martin Petricek 2cfed22012 Ticket #1746: Setting "Use passive mode over proxy" is not remembered
Fix: "Use passive mode over proxy" was not remembered in config

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-11-03 12:20:42 +02:00
Slava Zanko 51f10b3038 Cleanup of code for compile with new warnings options for compilator
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-10-30 20:36:48 +02:00
Andrew Borodin 91a4598b54 Ticket #1755: code cleanup before 4.7.0-pre4 release.
Free some variables allocated at MC startup.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-10-30 14:41:03 +02:00
Slava Zanko c9b4b0159d Ticket #1656: Incorrect processing of cases the lack of rights to save preferences.
In the case where insufficient rights to the contents of the directory ~/.mc/* to
save preferences I get "settings saved in ~ /.mc/ini", but really nothing is saved.

It would be correct to issue a message like "Not enough permissions to save the ~/.mc/ini"

Also, when autosave should be issued a message about the lack of rights.

This branch will check rights of config-files.

testCase:
 *) chmod 0400 ~/.mc
 *) run mc

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-10-28 13:37:39 +02:00
Slava Zanko 27cc9ac15e Ticket #119: Persistent global configuration option for "Preserve attributes" wanted
Currently, there is no way to change the defaults. The file mask
dialog options are not persistent.

Added new config option 'copymove_persistent_attr'. If this option is equal to '0'
then 'Preserve attributes' in copy/move dialog will always switched off.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-10-27 23:20:48 +02:00
Ilia Maslakov 467d833ac3 Ticket #46 (mcedit: check POSIX newline at end of file)
* added warning dialog (showed before save/save as)
    * added option "editor_check_new_line"
    * changed dialog 'Edit Save Mode' (added check box 'Check POSIX new line')

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>

    * Redesing of 'Edit Save Mode' dialog.
    * Added hotkeys in 'Edit Save Mode' dialog.
    * Modified warning message, minor optimization.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-10-27 12:08:45 +00:00
Andrew Borodin 7e33c12685 Show actual shortcuts in editor menu.
Key emulation in editor was removed. Default key emulation
is stored in misc/mc.keymap.default file. Emacs key emulation
is stored in misc/mc.keymap.emacs.
Editor options dialog was redesigned.
Shortcut parser was fixed.
Fixes after rebase to recent master.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-10-26 16:15:32 +03:00
Andrew Borodin 41989bd0c6 Implemented display of actual shortcuts in main menu.
Many shortcuts are not defined in keymap file and therefore
not displayed in menu.

Editor menu is not reimplemented yet.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-10-26 16:15:31 +03:00
Ilia Maslakov 82b7c4fdee Add support for multi-hotkeys in editor (like a ctrl-x,t).
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2009-10-26 16:15:31 +03:00
Andrew Borodin b4b30941f5 Some refactoring.
Renamed name_key_map_t to name_keymap_t.
Renamed global_key_map_t to global_keymap_t.
Use more '#ifdef USE_INTERNAL_EDIT' preprocessor directives
Removed unused variables and structure members.
Aplly const modificator to keybind argument of keybind_cmd_bind().
Aplly const modificator to keyname argument of lookup_action().

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-10-26 16:15:31 +03:00
Ilia Maslakov de56559df5 Reimplemented keybindings parser.
New parser allows get the string representation of menu shortcuts.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2009-10-26 16:15:31 +03:00
Slava Zanko 14be06d050 Reorganize work with files. Fixed permissions of files in mc home dir. All file names now accumulated into src/fileloc.h
* Added common functions for work with backups of main config files.
 * Fixed permissions of ~/.mc/ini;
 * Fixed permissions of ~/.mc/filepos
 * Fixed permissions of ~/.mc/hotlist
 * Fixed permissions of ~/.mc/Tree
 * Fixed ownership for ~/.mc/hotlist file
 * Changed definitions of config files. Now used constants from src/fileloc.h

Also, added ability for change mc user home dir. Just type:
{{{
make CFLAGS='-DMC_USERCONF_DIR=\".mc2\"'
}}}

And you will have different config files (very usefull for testing or development).

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-10-07 12:01:05 +03:00