Commit Graph

4857 Commits

Author SHA1 Message Date
Andrew Borodin
0fb3e0a3c7 Directory size: rename variables for consistency.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-04 09:14:08 +04:00
Andrew Borodin
01d6801f4e (do_compute_dir_count): display directory name only.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-04 09:14:08 +04:00
Andrew Borodin
5d1d542da9 (edit_ok_to_exit): get rid of file name string duplication.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-04 09:14:07 +04:00
Andrew Borodin
1b041ad484 (add2panelize_cmd): minor optimization and type accuracy.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-04 09:14:07 +04:00
Andrew Borodin
5e81b4be89 (do_panelize_cd): minor optimization.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-04 09:14:07 +04:00
Andrew Borodin
9ea1ed08c6 mcedit: file loading speed up.
Apply direct line counting during file reading.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-04 09:11:05 +04:00
Andrew Borodin
13c8f5213b (load_panelize): replace while() by for() and fix potential memory leak.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-04 09:11:05 +04:00
Andrew Borodin
9232bcb093 (edit_load_macro_cmd): minor refactoring: replace while() by for().
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-04 09:11:04 +04:00
Marco Atzeri
87a5f11452 Ticket #3053: src/filemanager/filegui.c: fix preprocessor condition.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-04 09:11:04 +04:00
Andrew Borodin
33896c610b Ticket #1588: rpm extfs enhancements:
* Improve support for EPOCH
  * Add support for PREINPROG/POSTINPROG/PREUNPROG/POSTUNPROG
  * Add support for VERIFYSCRIPTPROG
  * Add support for TRIGGERSCRIPTS/TRIGGERSCRIPTPROG

Thanks Arkadiusz Miśkiewicz <arekm@maven.pl> for the original patch.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-03 12:43:00 +04:00
Slava Zanko
836cff5863 Fix indentation
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2013-10-03 10:57:03 +03:00
Egmont Koblinger
930f683019 Handle newline and tab with shift/ctrl modifiers correctly.
MC already has its own half-ready trick: when pasting with Shift-Insert,
using the X11 extension, the newline ("Enter" as mc calls it) with the
Shift modifier pressed gets converted to a "Return", and in the editor
the Return character inserts a non-indenting newline. This makes pasting
better in terminals not supporting bracketed paste, however, it has some
problems that this commit addresses:

  * Shift+newline gets this special treatment, but Ctrl+newline gets
    dropped. Hence e.g. when pasting in Gnome-terminal with Ctrl+Shift+V
    all the newlines will be missing. This commit adds the same
    non-indenting newline behavior to Ctrl+Newline and Ctrl+Shift+Newline.

  * The code forgets about Tab that also needs special treatment:

    - Most terminals send \e[Z on Shift+Tab, this is not handled by MC
      at all, moreover it causes a hang for about a second. This commit
      teaches this sequence to MC. This is especially useful when no X11
      is available, because there Ctrl+Tab is identical to Tab, so the
      backwards tab feature is not available. With this commit Shift+Tab
      becomes a backwards tab too on all terminals that emit \e[Z.

    - When pasting to the editor, Shift+Tab, Ctrl+Tab and Ctrl+Shift+Tab
      should all insert a tab for the same reason mentioned at the newline.

    - It would look inconsistent in the keymap files to have logical code
      such as "backtab" instead of "shift-tab" and friends, hence get rid
      of KEY_BTAB and use KEY_M_SHIFT | '\t' instead.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-03 11:41:58 +04:00
Egmont Koblinger
5b47861101 Support bracketed paste mode of xterm in mcedit.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-03 11:41:58 +04:00
Egmont Koblinger
8f35c90b94 Ticket #2661: support enable bracketed paste of xterm.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-03 11:41:58 +04:00
Oleksandr Natalenko
c4a546ac01 Ticket #3073: urar helper: fix handling filenames with spaces for unrar v5.
Extfs urar helper doesn't allow to see the whole filename if it
contains spaces and is unpacked by unrar v5. This commit should fix that.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-09-24 11:46:00 +04:00
Andrew Borodin
1988ce2759 Ticket #3070: changes to files in nested .zip archives are lost.
How to reproduce:

Changes to the text file inside nested .zip file are lost.

echo "hello, world" >hello.txt
zip message.zip hello.txt
zip wrapper.zip message.zip
rm -v hello.txt message.zip

Using mc enter to wrapper.zip/message.zip and edit (F4) "hello.txt",
save, then exit mc.

unzip wrapper.zip
unzip message.zip

Result: changes were not saved to "hello.txt".
Expected result: changes are saved.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-09-23 10:43:13 +04:00
Slava Zanko
0b0f7e3975 Refactoring: use define DEFAULT_CHARSET for "ASCII" charset.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2013-09-21 13:35:59 +04:00
Andrew Borodin
941a1eac1d Search: better support of --disable-charset
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-09-21 13:35:56 +04:00
Andrew Borodin
66da276200 Ticket 3069: fix of case-sensitive search
...if file encoding and locale are different.

Example: locale is KOI8-R, file encoding is UTF-8. Note: those encodings
are not same.

File content is following (in Russian):

йцукен
Йцукен

The difference is in first line char only: Й (lowercase letter) and й
(uppercase letter).  The search of Ê gives the result Й independently of
case sensitivity. й isn't found.
If switch "All charsets" on, nothing is found.

The main idea of fix is modification of search API to allow set of search
pattern charset and use if within search engine.
Old API:
mc_search_new (pattern, pattern_len);
New API:
mc_search_new (pattern, pattern_len, pattern_charset);

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-09-21 13:35:31 +04:00
Slava Zanko
8a28d3bac4 Rename type file_entry to the file_entry_t.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2013-09-19 16:22:30 +04:00
Slava Zanko
ba0808aae4 Concretize an usage of file_entry type.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2013-09-19 16:22:30 +04:00
Andrew Borodin
92cdd89887 Rename functions:
set_zero_dir -> dir_list_init
clean_dir -> dir_list_clean
do_sort -> dir_list_sort
do_load_dir -> dir_list_load
do_reload_dir -> dir_list_reload
get_dotdot_dir_stat -> dir_get_dotdot_stat

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-09-19 16:22:30 +04:00
Andrew Borodin
3470695357 Rename macros related to dir_list::size.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-09-19 16:22:30 +04:00
Andrew Borodin
6b31f67f31 (dir_list_append): add new dir_list API and use it.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-09-19 16:22:30 +04:00
Andrew Borodin
6aa9503f2f (clean_dir): try minimize memory usage.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-09-19 16:22:30 +04:00
Andrew Borodin
30cc6c6a29 Add dir_list::len member to keep number of items in list.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-09-19 16:22:30 +04:00
Andrew Borodin
a774019250 (handle_path): don't check list size here.
(handle_dirent): likewise.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-09-19 16:22:30 +04:00
Andrew Borodin
6a3943fcf0 (dir_list_grow): new public API of dir_list.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-09-19 16:22:30 +04:00
Andrew Borodin
e6bb69a0d9 Rename panel_sort_info_t to dir_sort_options_t
...and use it in routines of load and sort directory.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-09-19 16:22:30 +04:00
Andrew Borodin
72ad268a9c Move sort_field member out from panel_sort_info_t structure.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-09-19 16:22:30 +04:00
Andrew Borodin
d8d1f90082 Ticket #3066: refactoring of dir_list class and related code.
Initial commit: use GCompareFunc instead of sortfn.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-09-19 16:22:30 +04:00
Andrew Borodin
54a5139eec Ticket #2075: apply "Compute totals" option to Move operation.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-09-19 15:05:48 +04:00
Denis Silakov
53dce22933 Support tar payload of rpm.
mc always expects to see cpio payload inside rpm packages. However, it
is also possible for rpm packages to contain tar payload (ustar, to be
more precise).

rpm2cpio works correctly for such files (but it produces tar archives,
not cpio ones).

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-09-14 10:24:53 +04:00
Andrew Borodin
20f8f204c8 Ticket #3064: crash in case of incorrect cpio content within rpm.
(cpio_open_archive): handle error of cpio header reading.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-09-14 10:24:29 +04:00
Andrew Borodin
446748619b Ticket #3047: fix mc arguments handling.
Following cases from command line are possible:
  * 'mc' (no arguments):
     active panel uses current directory
     passive panel uses "other_dir" from panels.ini
  * 'mc dir1 dir2' (two arguments):
     active panel uses dir1
     right panel uses dir2
  * 'mc dir1' (single argument):
     active panel uses dir1
     passive panel uses "other_dir" from panels.ini

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-09-13 18:00:50 +04:00
Andrew Borodin
4b8e47da6d Ticket #2271: fix i18n in Confirmation dialog.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-09-12 18:19:02 +04:00
Avi Kelman
3452b707b8 Ticket #3061: fix [en|dis]abling of layout split adjust buttons.
Switching between vertical and horizontal layouts doesn't properly
activate or deactivate the < and > widget buttons in the layout dialog
according to the setting of the mode being switched to.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-09-09 14:19:20 +04:00
Alexander Chumachenko
ff0346d1f9 Ticket #2812: rpm vfs: add dependency version output.
This commit does some rpm extfs facelift and adds dependency version
output; since this shifts the semantics from "name" to "name and maybe
a version", the generated virtual file has been renamed either (REQUIRES
instead of REQUIRENAME, more in a line with PROVIDES).

It is esteemed that nothing worse than a passing surprise for some users
would happen while improving the overall usefulness.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-09-05 14:11:42 +04:00
Avi Kelman
e546698396 Make layout dialog left/right arrows more coherent.
Alt+Shift+Left_arrow and Alt+Shift+Right_arrow directly influence the
divider position, but the < and > layout dialog buttons have the
reverse effect, which is unintuitive behavior. Reverse the direction of
< and > influence so that clicking left moves the divider left, and
clicking right moves the divider right.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-08-31 12:58:44 +04:00
Avi Kelman
a8101d8403 Ticket #3060: live update the panels size when editing layout.
Update the panel split display while adjusting the layout dialog,
because the user should not be expected to know what number of columns
or rows is reasonable without being able to see the effects. Cancel
reverts previous settings.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-08-31 12:58:44 +04:00
Andrew Borodin
8efc98d2fd src/filemanager/find.c: type accuracy.
Use gboolean instead of int for boolean variables.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-08-02 21:58:45 +04:00
Andrew Borodin
b451e8d13d (menubar_new): add 3rd 'visible' argument.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-08-02 21:58:45 +04:00
Andrew Borodin
f029a529d2 rpm extfs: fix rpm file name in status message.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-08-02 21:58:45 +04:00
Andrew Borodin
0fe4734fd6 Ticket #3035: prepare to 4.8.10 release.
(move_dir_dir): fix segfault during file erase after directory move.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-08-02 21:58:44 +04:00
Andrew Borodin
c194851754 Indentation.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-08-02 08:20:11 +04:00
Andrew Borodin
6da546bcf3 Ticket #3047: fix mc arguments handling.
Following cases from command line are possible:
  * 'mc' (no arguments):
     active panel uses current directory
     passive panel uses "other_dir" from ini
  * 'mc dir1 dir2' (two arguments):
     left panel uses dir1
     right panel uses dir2
  * 'mc dir1' (single argument):
     active panel uses current directory
     passive panel uses dir1

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-08-01 22:32:13 +04:00
Andrew Borodin
0eb1f6fcae Ticket #3045: change behavior of the 'Right' key
...in 'Directory hotlist' and 'Active VFS directories' windows.

Previously, the 'Right' key was used for:
1) move to the selected directory in the 'Directory hotlist' window;
2) enter into the selected group in the 'Directory hotlist' window;
3) move to the selected VFS in the 'Active VFS directories' window.

1) and 2) cases look as inconsistent bevavior because only two these
dialogs are closed after 'Right' key pressing.

Now 'Right' key is used only for 2) case and ignored in 1) and 2) cases.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-08-01 22:25:41 +04:00
Andrew Borodin
864c741e65 Ticket #2713: mcedit: respect multibyte characters in paragraph format.
Treate the option_word_wrap_line_length option as the line length in
screen cells not in bytes.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-08-01 22:19:24 +04:00
Andrew Borodin
abfad1e654 src/filemanager/mountlist.c: correct preprocessor conditions.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-07-23 16:56:47 +04:00
Andrew Borodin
ed6055474b Ticket #3041: fix build failure on Cygwin: redefinition of 'statvfs_works'.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-07-23 16:56:47 +04:00