Commit Graph

3474 Commits

Author SHA1 Message Date
Andrew Borodin
c57bdc79ba Fixed typo.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-12-16 11:10:40 +02:00
Oswald Buddenhagen
4bc224dd3c Ticket #1845: Code cleanup before 4.7.0 release.
Little optimization for src/filehighlight/get-color.c:c_fhl_is_stale_link() function.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-12-16 11:10:15 +02:00
Enrico Weigelt, metux IT service
d579bb7877 Ticket #1789: Removed obsolete checks for setuid(), getuid(), etc
Removed obsolete checks for setuid(), getuid(), etc

Signed-off-by: Enrico Weigelt <weigelt@metux.de>
2009-12-15 18:13:40 +03:00
Andrew Borodin
bc82403d07 Ticket #1536: fix of case insensitive file sorting in UTF-8 locales.
In UTF-8 locales, with case sensitive sort files are sorted properly:

00050.jpg
001-gepard.jpg
0175ep.jpg
027.jpg
060912.jpg
win.jpg
z1.jpg

but if in case insensitive sort, they get mixed up
and files with number in their name are sorted badly:

001-gepard.jpg
027.jpg
00050.jpg
0175ep.jpg
060912.jpg
win.jpg
z1.jpg

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-12-09 20:12:17 +03:00
Slava Zanko
2887d5c710 Ticket #1858: Segmentation fault when search in different encodings
Test case:
1. Make two files with same content but with different encodings (for example, in UTF-8 and KOI8-R);
2. Open UTF-8 file for editing. Press Alt+e and set 'UTF-8' encoding;
3. Search someting
4. exit from editor and open file with 'KOI8-R' encoding;
5. You must see a dots. Now press shift+F7 (continue search);
6. Segfault here

Fix issue:
Now function mc_search__recode_str() returns newly allocated string in any case

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-12-07 13:45:25 +02:00
Slava Zanko
9808eed46a Minor fix for mc_log_mark() macro.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-12-02 16:05:26 +02:00
Slava Zanko
c9978ff155 Ticket #1798: Not enough magic read before checking for lzma files
In the function get_compression_type() in src/util.c, only 5 bytes of the
file are read into the magic array, but the test for lzma files checks the
first 6 bytes in the magic array.

Fix issue:
now reads 6 bytes for correct recognize LZMA-files.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-12-02 16:03:07 +02:00
Andrew Borodin
92291381e3 Ticket #1781: array index is out of bounds.
Fixed array index in sort_key_name_conv_tab() function.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-12-02 10:01:01 +03:00
Stan. S. Krupoderov
c1426b90ff Ticket #407: C-w does not delete whole command line
Fix set mark on delete_region

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-12-01 16:24:43 +02:00
Andrew Borodin
e6851b18b3 Ticket #1781: little speedup of startup.
Keys sort functions have been maken inline.
Decrease of memory usage: reimplemented
key_name_conv_tab_sorted array as array of pointers
instead of entire copy of key_name_conv_tab array.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-11-23 21:30:43 +03:00
Andrew Borodin
35de934437 Ticket #1814: allow save empty value in history.
Problem: 'Find File' dialog doesn't save an empty "content" filed on exit.
Proposed solution: allow each history (not in content in 'Find File' dialog
only) save an empty value.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-11-20 19:44:14 +03:00
Leonid Myravyev
c3279bd980 Ticket #1835: Coding style fixups in src/charset.c
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-11-20 14:13:12 +02:00
Andrew Borodin
0d4ebe6ece Ticket #1836: fixed wrong shortcuts in menu items.
Also minor optimization of key names sort.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-11-20 14:48:48 +03:00
Andrew Borodin
a193e2e56f Ticket #1831: fixed compilation warings of --disable-nls and --disable-charset options.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-11-20 14:39:51 +03: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
ed2e33574a Fixed generation of shortcut string for menu items.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-11-19 10:07:52 +03:00
Andrew Borodin
5e68b69020 Many shortcuts were fixed.
Ticket #1764:
  * fxed shortcuts for select/unselect/reverse selection
of file group;
  * removed 'C-x C-c' default shortcut for Quit command.

Also fixed some emacs-like keybindings for editor and viewer.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-11-19 10:07:51 +03:00
Vit Rosin
d8130a82a3 Ticket #1824: fixed some keybinding names
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-11-19 10:07:51 +03:00
Andrew Borodin
1ed7892f8e Modified ButtonBar engine to allow bind keys to unused buttons.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-11-19 10:07:51 +03:00
Andrew Borodin
eb2e4b0e17 Unified some commands that differ in its behaviour when called via menu or shortcuts.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-11-19 10:07:51 +03:00
Andrew Borodin
e252488ac2 Added Esc key to the key name table.
Also some fixes of DLG_ACTION message handling in panels and viewer.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-11-19 10:07:51 +03:00
Andrew Borodin
c2693b7212 Implemented keybindings engine for ButtonBar (F1-F10 keys).
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-11-19 10:07:51 +03:00
Andrew Borodin
b7f367542a Modified menu command handling using DLG_ACTION message.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-11-19 10:07:51 +03:00
Andrew Borodin
11d21f1437 Modified dialog callback function.
Added two parameters:
  * Widget *sender -- to recognize the wiget that have sent message;
  * void *data -- to pass any user-defined data to the dialog.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-11-19 10:07:51 +03: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
5592a472f6 Optimization of command handling. 2009-11-19 10:07:51 +03:00
Andrew Borodin
e85f6b23e3 Added Viewer commands and shortcuts.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-11-19 10:07:51 +03:00
Andrew Borodin
8224a26cf4 ButtonBar optimizations.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-11-19 10:07:51 +03:00
Andrew Borodin
6b71dc9f12 Added missed shortcuts for ButtonBar commands.
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
9760092c17 Enlarged sizes of Directory Tree dialog window.
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
Andrew Borodin
9b82c05fca Changed widget order in editor and viewer dialogs.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-11-19 10:07:51 +03:00
Andrew Borodin
e3f85ff6d0 Refactoring of ButtonBar drawing in viewer.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-11-19 10:07:51 +03:00
Andrew Borodin
ce4334e51e Made mcview_execute_cmd() function matched with dlg_exec_fn type.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-11-19 10:07:51 +03:00
Andrew Borodin
71c9e4c668 Ticket #212: implemented keybindings for ButtonBar.
First step: renamed type of dialog command execution function.
Made execution function more flexible: added parameters for
sender and receiver widgets and user data.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-11-19 10:07:51 +03:00
Enrico Weigelt, metux IT service
d06eb6452e Ticket #1826: fixing build w/o internal edit 2009-11-18 22:44:20 +02:00
Slava Zanko
e071af460f Ticket #1794: Segfault in treeview
Testase:
 * rm -f ~/.mc/Tree
 * run mc
 * F9 -> Command -> Directory tree
 * Press F2
 * Go to '/lib' item
 * Press F2
 * exit from mc
 * run mc again
 * F9 -> Command -> Directory tree
 * press HOME key

Fix issue:
changed forgotten variable name.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-11-18 22:36:56 +02:00
Andrew Borodin
15a21a71cd Ticket #1781: some improvements of startup time.
After implementation of keybinding engine and reimplenetation
of menu engine, MC starts very slow due to multiple trivial
(totally non optimized) search of many values in many arrays.

This patch performes the some speedup of MC startup process.

Statistics:
- startup time without the patch: 0m0.413s
- startup time with the patch: 0m0.073s

Great thanks to 0xe2.0x9a.0x9b for the original patch.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-11-18 14:23:48 +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
Vit Rosin
aa3f4b66d4 Ticket #1803: added missed esc sequencies for qansi terminals.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-11-18 13:27:20 +03:00
Egmont Koblinger
ecee0cd4b9 Ticket #256 (segfault in backward_word)
fixed segfault in backward_word (widget.c)
    ...
    The for loop, whose purpose is to remove exactly 1 character
    (hence I don't get why it's a loop, but nevermind) was not UTF8-ready.
    So if the character preceding the cursor was an accented one,
    it jumped to the middle of the UTF-8 sequence, causing the rest of
    the stuff go unpredictable.

    Although it *should* never happen (which, as we all know,
    does not equal to "never happens"), in this case "p" simply jumped
    over "in->buffer". The function has a "p != in->buffer" check three times,
    it might it more robust if you replaced that with "p >= in->buffer".
    This should prevent the segfault, and just stay with a slightly buggy but
    otherwise harmless alt-backspace behavior, should there be any UTF-8 or
    similar bugs left. This change is not included in my patch.

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2009-11-18 11:41:12 +03:00
Slava Zanko
7bdff35062 Makefile.am: Fixed incorrect variable name if maintainer mode is active.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-11-11 11:33:06 +02: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
Enrico Weigelt, metux IT service
9070aa11f7 Fixed several missing includes 2009-11-09 13:49:57 +01:00
Enrico Weigelt, metux IT service
ae417890fe src/screen.c: const char* cleanup, fixing break on -Werror 2009-11-09 13:49:56 +01:00
Enrico Weigelt, metux IT service
91a5df442f Dropping non-strftime() support and fixing -Werror problem
Problem:

a) when running ./configure, strftime() and other functions cannot be
   properly detected, since autoconf generates crappy test code, which
   at least fails when warnings are treated as errors (gcc: -Werror).

b) strtime() is standard since C89, so we can simply expect it to exists
   (if there's *really* some acient box out there breaking mc build,
   it's libc/toolchain should be fixed ;-p)

Solution:

Remove the checks for strftime() and all workarounds
2009-11-09 13:49:56 +01:00
Andrew Borodin
dc2989d766 Display ATime, MTime and CTime for ".." in file panel.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-11-09 13:08:38 +03:00
Andrew Borodin
b39b23a627 Fixed display info about ".." directory in Info panel.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-11-09 13:08:38 +03:00
Andrew Borodin
7ce24c2f57 Set correct stat info for ".." directory.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-11-09 13:08:38 +03:00
Andrew Borodin
4092bf54ac Ticket #1757: set actual stat info for ".." directory in panel.
1st step: minor refacoring.
Removed call of intermediate function and changed the retun value type.
Type accuracy.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-11-09 13:08:38 +03:00
Sergey Fionov
2244f5c2c5 Avoid Sun Studio compiler bug
Modify designators to avoid bug #6888373
(http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6888373)

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-11-04 17:30:31 +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
Slava Zanko
a5fa537f2e Added macros for simplest debug process (yes, gdb is a better way)
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-10-30 20:36:48 +02:00
Slava Zanko
5441d89264 Reorganization of src/Makefile.am
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-10-30 20:36:41 +02:00
Slava Zanko
2a4075d246 Now possible to compile mc in different cases: as mc maintainer or as end-user.
Some debug-related code will compile just in mainteiner mode.
Also, added new parameter for configure script: --enable-werror

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-10-30 20:36:15 +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
12ed4d0b45 Ticket #1753: panel: bad mounpoint is no longer 'red' highlighted
Restored behavior with stale mountpoint (now handled as stale link).

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-10-29 16:48:51 +02:00
Ilia Maslakov
478328812f Ticket #244
add shared clipboard support

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

    Fixed memory leaks. Type accuracy. Optimization.

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

    * fixed ctrl-g handler
    * change action names from InputKillSave to InputXStore and InputPaste to InputXPaste
    * update mc.keymap.default mc.keymap.emacs

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2009-10-29 12:18:18 +00:00
Ilia Maslakov
359c9406d1 Ticket #1489 (indent block)
added bindings for shift block 'EditShiftBlockLeft', 'EditShiftBlockRight'
    EditShiftBlockLeft, EditShiftBlockRight - force move block without option_persistent_selections checking

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2009-10-29 07:58:30 +00:00
Ilia Maslakov
a16b37c8e7 Ticket #1736: editor: X copy/paste eats newlines
1. Open empty file (<Shift-F4>)
2. Fill with data:

1234
5678
9abc

3. Mark contents (or any multiline text in, for example, firefox) with mouse (<Shift+MouseDown???>)
4. Insert somewhere below third line (<Shift+Insert>)
5. Newlines are eaten (xterm)

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-10-29 09:46:20 +02:00
Ilia Maslakov
91c7dbb71c Ticket #1724 (forgotten hotkeys)
* fixed binding in mc.keymap.default and mc.keymap.emacs
    for CmdCopyCurrentTagged, CmdCopyOtherTagged,
    CmdCopyCurrentPathname, CmdCopyOtherPathname
    * fixed typo

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2009-10-29 06:23:51 +00:00
Slava Zanko
b62aece7eb Fixed width calculation of Buttonbar widget.
Also Labels on buttonbar aligned to left side.

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-10-29 00:00:26 +02:00
Slava Zanko
742eae18d2 Ticket #1703: SKIN: Make own colorpairs for buttonbar widget
Now buttonbar have own colorpairs:

[buttonbar]
    hotkey=red;black
    button=yellow;cyan

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-10-28 17:50:46 +02:00
Ilia Maslakov
d98e14de49 Ticket #1600 (incorrect drawing hint)
drop "LANGUAGE" from checking locale.

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2009-10-28 12:17:02 +00:00
Slava Zanko
9c284e99c2 Fix segfault in charset confirmation dialog at start of mc.
When config files is unaccesible, doalig was crashed after 'Esc' pressing.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-10-28 13:37:40 +02:00
Slava Zanko
e7c6d59e63 Code cleanup for compile with new CFLAGS value.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-10-28 13:37:40 +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
Andrew Borodin
00e267c2e0 Sync argument name of mcview_viewer() function in header and in source files.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-10-28 14:31:38 +03:00
Andrew Borodin
3d1114652f Ticket #1750: fix of view next/prev file in viewer.
To view the next (C-f) of previous (C-f) file in viewer,
the quit from viewer is required now.
This commit restores the previous behavior.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-10-28 14:31:38 +03:00
Slava Zanko
575f996e0d Ticket #1748: lzma archives with .tlz extention are not recognized as archives
Attempting to open a .tlz lzma archive fails - error 'xxx.tlz doesn't look like a tar archive'.
If the file is renamed to .tar.lzma, it is opened without problems.

Fix issue: add recognize of '.tlz' extention.

Refactoring: avoid calls of strlen() function

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-10-28 13:00:37 +02:00
Alexander Moiseenko
936727622d Fixed problems:
* When try to replace existing file in background operation
  assertion raised (created operations for initialization ctx->ui for background):
  ** (mc:25716): CRITICAL **: file_progress_real_query_replace: assertion `ctx->ui != NULL' failed

 * Process has been already done, but still draw in list (C-x j)

 * Process is stopped or worked, remove operation don't hide process from list, but kill it

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-10-28 12:05:07 +02:00
Alexander Moiseenko
81f5b5e0b8 Ticket #1500: Segmentation fault while background copying
Test case:
 * create file with name "test" in "tmp" directory (for example)
 * create directory with same name ("test") in other "tmp2" directory (for example)
 * try to copy or move file "test" into "tmp2" in background mode
 * wait for some time

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-10-28 12:05:06 +02:00
sfionov
1551db2f9f Ticket #1642: filegui.c contains Linux-specific things
mc 4.7.0-pre1 introduced dynamic "Save attributes" checkbox value in Copy/Move dialog.
But code is Linux-specific, and not even isolated by macros.

I suggest to add code specific for BSD and SVR4 systems.

In BSD systems (MacOS X, NetBSD, FreeBSD) there is statfs.f_fstypename which contains name of filesystem.
Valid FS names are: msdos, msdosfs (FreeBSD), ntfs, smbfs, procfs, fusefs (BSD), fusefs_subfstype (Mac)

In SVR4 systems (Solaris and other SVR4 Unixes) there are statvfs.f_basetype and statvfs
syscall instead of statfs and also autotools define STAT_STATVFS.
Valid FS names are: pcfs, proc, ntfs, fuse, smbfs

(Note that NetBSD 3.0+ also use statvfs but with BSD syntax.)

For all other OSes we simply return 1.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-10-28 10:38:20 +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
pavlinux
ad8e1563d4 Ticket #1718: OpenSuse: Showing 'B' artefact in command line of user 'root'
This patch was grabbed from Russian fork (ru-fork). Original commit message:

[COMMAND LINE]:  Fix SUSE gabage, letter B in command prompt under root!  Yessssssss! :)

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-10-27 14:42:42 +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
Slava Zanko
bf5b6f368b Ticket #1627: glib macros fix.
This is incomplete copy of same glib-function.
For older glib (less than 2.13) functional is enought.
For full version of glib welcome to glib update.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-10-27 11:42:19 +02:00
Ilia Maslakov
d449c5f383 Ticket #1724 (fix for mc.keymap)
* fixed keybind for 'ViewMoveToBol', 'ViewMoveToEol'
    'EditScrollUpHighlight', 'EditScrollDownHighlight'
    * fixed hardcoded bindings into keybind.c
2009-10-26 21:29:39 +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
729d4f08a9 Implemented default actual shortcuts for main menu.
Some functions and commands are renamed.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-10-26 16:15:31 +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
e5feeea8d9 Added default keybinding strings.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-10-26 16:15:31 +03:00
Andrew Borodin
89336afb6b Added missed '#include "fileloc.h"' in main.c.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
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
Andrew Borodin
095fc65580 Use commands instead of callbacks to execute menu items.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-10-26 16:15:31 +03:00
Andrew Borodin
b3b332083c Use commands instead of callbacks to execute menu items.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-10-26 16:15:31 +03:00
Andrew Borodin
e73664d966 Menu fixes and optimization.
Fixed hotkey handling.
Optimized call of menu item callback.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-10-26 16:15:31 +03:00
Andrew Borodin
c47d2d20d7 New menu engine: use GList instead of GPtrArray.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-10-26 16:15:31 +03:00
Andrew Borodin
83b855027e Menu: handle HOME and END keys.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-10-26 16:15:31 +03:00
Andrew Borodin
7f7bc452e3 Ticket #1563: Modified menu engine to create and modify menu dynamically.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-10-26 16:15:31 +03:00
Slava Zanko
11a54c7edf Ticket #1715: Sort types: duplicate of i18n strings
Avoid translations duplicates of sort type names.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-10-26 12:08:12 +02:00
Slava Zanko
e3702891ae Ticket #1617: Fixed saving filepos file
Restored old behaviour with some new improvements.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-10-26 11:40:00 +02:00
Ilia Maslakov
acd0ed038d fixed drawing zerowidth characters
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2009-10-24 15:21:34 +00:00
Slava Zanko
e29e6126a6 * Added g_unichar_iszerowidth() and g_file_set_contents() functions for
compability with glib-2.6

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-10-24 15:21:34 +00:00
Ilia Maslakov
dfb0040c5b Ticket #1627
fix: display double width (CJK) characters.

Signed-off-by: Ilia Maslakov <il.smind@google.com>
2009-10-24 15:21:34 +00:00
Slava Zanko
41c5b369de Fix colors showing for compile with S-Lang library
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-10-24 16:42:04 +03:00
Ilia Maslakov
cb5836c2e0 Ticket #1667: Hardcoded colours
Problem:
BOOK_MARK_COLOR and BOOK_MARK_FOUND_COLOR are hardcoded
in edit/edit-widget.h and so cannot be changed via skin.

Solution:
Now these colors will configure via skin-file. Like:

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2009-10-24 16:42:04 +03:00
Andrew Borodin
c7636e36bb Don't modify file name in file operation.
The problem: if I copy or move file with invalid UTF-8 symbols
in name to another directory (e.g. simply F5 Enter F6 Enter
to copy/move to the other panel), the filename gets mangled,
invalid UTF-8 characters are replaced by literal question marks.

Now the copy/move operation leaves the filename unchanged,
even if it is invalid in the locale mc's using for display.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-10-24 17:18:48 +04:00
Andrew Borodin
0cd390fd50 Ticket #1609: Do not modify file name in file operations.
Initial step: minor refactoring.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-10-24 17:18:48 +04:00
Andrew Borodin
551ca67e8f Fixed header of file operation dialogs.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-10-24 15:38:31 +04:00
Andrew Borodin
562ad3e84b More usage of gettext context.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-10-23 18:50:13 +04:00
Andrew Borodin
055bff485e Minor otimization of panel_operate_generate_prompt().
Create temporary buffer in stack instead of heap.

Fixed pointer type mismatch in conditional expression
in panel_operate().

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-10-23 18:50:13 +04:00
Andrew Borodin
9fc2ffecce Ticket #1711: i18n: context and cleanup in file prompt strings
Use gettext context to handle file operation names in
Copy/Move/Delete dialogs.
Thanks to David Martin for the original patch.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-10-23 18:50:13 +04:00
Slava Zanko
1017d4f548 branch-outside patch: Fix return value of function mc_config_normalize_before_save()
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-10-21 20:13:00 +00:00
Slava Zanko
4db3447eed Ticket #213 [mc-ru-fork] patch for fix bug 'The shell is already running a command'
Test case:

- run mc
- press CTRL+o (hide panels)
- press 'space' key
- press 'backspace' key
- press CTRL+o (show panels)
- type 'ls' and press 'enter' key

Fix issue: Now 'busy shell' status toggle on if user will press 'Enter' key.
Old behavior: User was press any key into subshell and 'busy shell' status toggle on.

Also, patch will enter new behavior:
 * run mc
 * press ctrl+o (hide panels)
 * type 'cat ' and don't press 'Enter' key
 * press ctrl+o (show panels)
 * type 'ls' and press enter

You'll see:
cat: ls: File not found.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-10-16 14:47:27 +03:00
Andrew Borodin
d3735c6c10 Adjust width of Copy/Move dialog depending on initial screen width.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-10-16 13:07:30 +04:00
Andrew Borodin
6cd26f8385 Fixed calculation of Copy/Move dialog width.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-10-16 13:07:30 +04:00
Andrew Borodin
42ba60cebe Use local buffers instead of global cmd_buf one.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-10-16 13:07:30 +04:00
Andrew Borodin
998001a22e Ticket #1705: fix show of Copy/Move dialog.
Inital step: minor refactoring of src/file.c file.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-10-16 13:07:30 +04:00
Andrew Borodin
10e8d008d7 Ticket #1704: fixed quick search show.
If "show Mini status" option is off, the quick search box
is shown incorrect. In this case the quick seach box
must be invisible, because this is common MC behavior.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-10-15 20:45:24 +04:00
Slava Zanko
87979e779b Ticket #1532: Key configuration doesn't save properly
Problem: need to escape ';' char (as '\;'), but mc_config_set_string function
escape this to '\\;'

Solution: Added mc_config_direct_set_string() function. Also, into src/learn.c
characters '\' and ';' is escaped manually.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-10-15 14:58:47 +03:00
Slava Zanko
8fe4dc26c2 Cosmetic changes of panel interfase (relative to history list):
* Panel widget: History list button  changed  from v to [^]
 * Change drawing of history control elements for panel. Now if panel is active, show in reverse color just panel path.
 * Add reaction on mouse click on [] chars at top of panel
 * Added call of repaint_screen() function for correctly show panels content after click by mouse on 'hidden files' indicator.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-10-15 14:51:30 +03:00
Slava Zanko
bd29603b41 Relative to Ticket #1643: restore patch 'Mouse support in first line when menu is hidden'
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-10-15 14:51:24 +03:00
Slava Zanko
ff5dd64c6b Fix showing widget elements with 'mc -a' option.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-10-15 14:51:24 +03:00
Slava Zanko
d11de35343 Ticket #1716: Adding fully featured skin
As David Martin proposed, this skin support all newest features
May be used as modern skin, but with some restrictions (must be UTF-8 system codepage)

Also, changed src/screen.c for demonstrate skin features :)

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-10-15 14:51:16 +03:00
Andrew Borodin
2328baf7a3 Place choose panel codepage dialog at the centre of the screen. 2009-10-15 11:40:30 +04:00
Andrew Borodin
47c4744347 Ticket #1451: fixed placement of choose encoding dialog window.
The "Choose codepage" dialog (for file panel) is centered
over the according panel.

Renamed create_listbox_window_delta() function to
create_listbox_window_centered(). Now this function takes in
coordinates of dialog center.
Changed argumets order to unified dialogs API.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-10-15 11:40:30 +04:00
Slava Zanko
94f30d0905 Merge branch '1714_context_for_indicator'
* 1714_context_for_indicator:
  Ticket #1714: Sort types: use context for indicator translations.
2009-10-13 15:19:57 +03:00
David Martin
415c10e880 Ticket #1714: Sort types: use context for indicator translations.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-10-13 15:04:36 +03:00
Ilia Maslakov
1e8c3f6789 Ticket #1706
fixed tty_print_anychar, trouble with drawing utf-8 chars in 8-bit locales (ncurses)

Signed-off-by: Ilia Maslakov <il.smind@google.com>
2009-10-13 11:34:05 +00:00
Andrew Borodin
1e608044af Ticket #1700: fixed skin color parser.
Strip leading and trailing spaces in color names read from skin ini
file.

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

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-10-13 12:02:14 +03:00
Ilia Maslakov
db419a27c1 Ticket #1706
fixed tty_print_anychar, replaced addch to addstr when MC build with ncurses library.

Signed-off-by: Ilia Maslakov <il.smind@google.com>
2009-10-13 07:08:00 +00:00
Slava Zanko
1b91f29cbb Ticket #1617: Current editing position of files don't save.
Fixed bug.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-10-12 09:34:08 +03:00
Slava Zanko
55fe1bb86e Ticket #397: Fix initialization of structure.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-10-12 09:09:41 +03:00
Ilia Maslakov
4cd93228d4 Ticket #1683
add command EditToggleSyntax for toggle syntax highlight

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2009-10-10 15:50:58 +00:00
Slava Zanko
0fdb3488e5 Ticket #397: i18n for sort indicator
Fixed translations of sort indicator. Now it separate string for better translate.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-10-09 09:48:38 +03:00
Slava Zanko
19493b9518 Some fixies for optimization.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-10-07 11:57:19 +00:00
Egmont Koblinger
51771e0092 Ticket #256
fix: Alt+Backspace (kill word) behaviour in command line

Signed-off-by: Ilia Maslakov <il.smind@google.com>
2009-10-07 11:57:18 +00:00
Jindrich Novy
7370136f2a Ticket #1680: Allow 'exit' command on non-local filesystems.
On non-local filesystems, mc won't allow execution of commandline arguments.
This makes sense, except for the `exit' command, which might be allowed even on
non-local filesystems.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-10-07 12:24:40 +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
Slava Zanko
a931ff73cc Ticket #1617: ownership of files ~/.mc
Test case:

$ sudo bash
files in the directory ~/.mc overwritten and hence change of ownership at the root.
Later, when starting from a user, MC can not save history (the file ~/.mc/history),
because this file is not overwritten.

Fix issue: Now files will overwrite if exists (rather than remove and create new file).
 * Added backup of saved files.  If someone wrong in 'write config' stage, backup file still present.
 * Identation of code.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-10-07 12:01:05 +03:00
Slava Zanko
71642b9bdb Ticket #1620: File hightlighting based on extension is case sensitive.
Added parameter extensions_case.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-10-07 10:42:25 +03:00
Ilia Maslakov
93f8b96b32 Ticket #1664 (Viewer: incorrect tabs alignment)
fix tabs alignment. Variable option_tab_spacing instead hardcoded '8' are used.

Signed-off-by: Ilia Maslakov <il.smind@google.com>
2009-10-07 07:25:26 +00:00
Ilia Maslakov
1c4f8b1a0e Ticket #1675 (hex editor regression)
Viewer: fixed command handling.

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

    add: binding for "esc", "escape"

Signed-off-by: Ilia Maslakov <il.smind@google.com>
2009-10-07 07:15:04 +00:00
Andrew Borodin
2d1eb7bea0 Ticket #1662: keep empty 'Content:' field in 'Find File' dialog.
Partially revert of 5fd7d65dca.
If 'Content:' field is empty, keep it and don't populate it
from history.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-10-06 21:20:26 +04:00
Slava Zanko
ba9ac667d2 Cleanup of code. Remove unused panel_field_t::use_in_gui variable
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-10-06 10:18:55 +03:00
Slava Zanko
08e6e1caf4 Added indicators for current sort type and sort direction.
Added parameters into skin-files for showing sort indicator.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-10-06 10:18:55 +03:00
Slava Zanko
9766359a1b Fixed segfault in 'Brief file list' listing mode
Segfault was been raised after clink on header of right column.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-10-06 10:18:55 +03:00
Slava Zanko
13220bfc6c Added reversing sort order ability if one keybind raised multiple times.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-10-06 10:18:55 +03:00
Slava Zanko
9fa3347fc1 Added keymaps for some sort types.
* PanelSortOrderByName
 * PanelSortOrderByExt
 * PanelSortOrderBySize
 * PanelSortOrderByMTime

Also added 'PanelReverseSort' keymap.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-10-06 10:18:54 +03:00
Slava Zanko
3def4aeb0e Remove code for reverse search direction when toggle search types.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-10-06 10:18:54 +03:00
Slava Zanko
fe73db4227 Fixed behavior of CK_PanelSelectSortOrder event.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-10-06 10:18:54 +03:00
Slava Zanko
c8857b3084 Remove unneded code
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-10-06 10:18:54 +03:00
Slava Zanko
7896ea84f6 Added handlers for panel sort keybind actions.
* PanelSelectSortOrder - show 'Sort order' dialog
 * PanelToggleSortOrderPrev - toggle next sort type (or reverse sort order)
 * PanelToggleSortOrderNext - toggle previous sort type (or cancel reverse)

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-10-06 10:18:54 +03:00
Slava Zanko
b4f7ea071f Remove array of hardcoded format names from listmode.c
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-10-06 10:18:54 +03:00
Slava Zanko
82a384d8f4 Some changes for better toggle sort types of panel.
Now we have just one array for formats of panel and for sort types.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-10-06 10:18:53 +03:00