Commit Graph

1045 Commits

Author SHA1 Message Date
Slava Zanko 857fe38e87 Fix panel recoding
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2013-07-23 14:15:24 +04:00
Andrew Borodin 9e5d51df95 Ticket #3043: broken NCurses detection.
HAVE_NCURSESW_CURSES_H included the wrong header.

Partially revert 80c8d58003
for lib/tty/tty-ncurses.h.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-07-23 14:15:24 +04:00
Andrew Borodin ab3f53fbbe Add DIR_IS_DOT and DIR_IS_DOTDOT macros
...to detect "." and ".." directories, respectively.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-07-23 14:15:24 +04:00
Andrew Borodin 17aef88637 lib/strutil/strutilutf8.c: cosmetics and minor refactoring.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-07-23 14:01:05 +04:00
Andrew Borodin 7ee58f73ff lib/strutil/strutil8bit.c: cosmetics and minor refactoring.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-07-23 14:01:05 +04:00
Andrew Borodin 9e4d279885 lib/strutil/strutilascii.c: cosmetics and minor refactoring.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-07-23 14:01:05 +04:00
Andrew Borodin 5b91108b3c lib/strutil/strutil.c: cosmetics and minor refactoring.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-07-23 14:01:05 +04:00
Slava Zanko 0013adeeba Ticket #2992: mc fails to link when system lib does not contain strverscmp
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2013-07-09 13:44:51 +03:00
Amadeusz Sławiński 33c47b5734 Ticket #3025: race condition when creating temporary directory.
When there's no mc-tmpdir and a user tries to start two mc sessions
simultaneously, sometimes (in one out of ten attempts on my machine) one
mc session emits the following error message:

Cannot create temporary directory /tmp/mc-lars: File exists (17)
Temporary files will be created in /tmp
Press any key to continue...

Steps to reproduce:

# rm /tmp/mc-$(whoami) -rf
# uxterm -e mc & uxterm -e mc

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-07-05 20:58:41 +04:00
Andrew Borodin ccf82ada12 Add functions to transform string to unsigned integer:
* (xstrtoumax): from gnulib.
 * (parse_integer): from coreutils (dd.c).

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-07-05 09:09:03 +04:00
Andrew Borodin de2a934b37 lib/search/search.c: cosmetics.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-06-28 13:20:08 +04:00
Andrew Borodin 4f16d7e8f0 Ticket #3026: Find File: "All charsets" options don't work.
(mc_search_prepare): use cp_display not cp_source to convert text to all
available charsets.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-06-28 13:20:08 +04:00
Andrew Borodin 48abe8735f Rename functions:
init_widget -> widget_init
create_dlg -> dlg_create
init_dlg -> dlg_init
run_dlg -> dlg_run
destroy_dlg -> dlg_destroy

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-06-28 09:21:17 +04:00
Andrew Borodin 0adf569b54 (dlg_overlap): rename to widget_overlapped()
...and move to lib/widget/widget-common.c.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-06-28 09:21:17 +04:00
Andrew Borodin c7da120588 (dlg_replace_widget): rename to widget_replace()
...and move to lib/widget/widget-common.c.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-06-28 09:21:17 +04:00
Andrew Borodin 1672fa44dd (dlg_widget_active): rename to widget_is_active()
...and move to lib/widget/widget-common.c.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-06-28 09:21:17 +04:00
Andrew Borodin 970cfd881a (dlg_mouse_event): minor refactoring.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-06-28 09:21:17 +04:00
Andrew Borodin 01c5cf66a5 (dlg_default_callback): get rid of extra type cast.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-06-28 09:21:17 +04:00
Slava Zanko d2eac2f5af Code reorganization and fixes around the vfs_path_as_str() function
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2013-06-28 09:21:16 +04:00
Andrew Borodin 32bc72a1d7 (vfs_path_as_string): clarify return value.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-06-28 09:21:16 +04:00
Slava Zanko cb08c1d0bf Fix: sftp: password ask too often if hostname was bring from ~/.ssh/config file
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2013-06-18 12:52:18 +03:00
Veres Lajos 805703523d Misspellings fixes by https://github.com/vlajos/misspell_fixer
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-06-15 11:10:41 +04:00
André Barros 9699d5dd69 Ticket #3011: mc under x11 problems with mouse or hang due gpm
mc may not detect the gpm mouse under X11 on many x terminals when running together with tmux or screen.

On some cases it can even hang.

It's a small patch to the gpm maintainer to improve its checking.
Seems there is a need also to a small change on mc.

Now everything is working perfectly.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2013-06-10 20:08:56 +03:00
Andrew Borodin 5b1982a6bb (strip_ctrl_codes): type accuracy.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-06-08 18:06:55 +04:00
Andrew Borodin d83902e7fc (size_trunc_len): minor optimization.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-06-07 13:06:51 +04:00
Andrew Borodin ceff7c5922 size_trunc_len() generates incorrect result in some cases.
Revert "(size_trunc_len): support automatic maximum unit for specified size."
This reverts commit ef94b84eaf.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-06-07 12:12:34 +04:00
Andrew Borodin e7dc599e42 Use "'" instead of "`" for messages and comments quoting.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-06-03 14:21:03 +03:00
Andrew Borodin d0955f3793 Search callbacks should return mc_search_cbret_t not int.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-06-03 14:21:03 +03:00
Andrew Borodin 3662b84ba1 (vfs_get_encoding): optimization and enhancement:
* get rid of extra memory duplication;
  * support of recursive search of correct encoding;
  * add tests.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-06-03 14:21:02 +03:00
Andrew Borodin 6b90a1468a (button_set_text): update value of WButton::hotpos.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-06-03 14:21:02 +03:00
Andrew Borodin 6d31d85f0d Use tty_draw_box instead of draw_box() to draw frames.
* (draw_box): remove.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-06-03 14:21:02 +03:00
Slava Zanko 2640b21bb9 Remove vfs_path_to_str() function for avoid often memory allocations.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2013-06-03 14:21:01 +03:00
Andrew Borodin 31bacf56c9 Use G_N_ELEMENTS macro to calculate of array size.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-06-03 10:58:14 +03:00
Slava Zanko 80c8d58003 remove the include duplicates from source files
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2013-06-03 10:58:14 +03:00
Denys Vlasenko 664e7d31b6 When we see an unknown sequence, it is not enough
to drop already received part - there can be more of it
coming over e.g. a serial line.

To prevent interpreting it as a random garbage,
eat and discard all chars that follow.
Small, but non-zero timeout is needed to reconnect
escape sequence split up by a serial line.

Before this change, Ctrl-Alt-Shift-Right_Arrow generates "1;8C"
bogus "input" in MC on my machine; after the change,
nothing is generated.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2013-05-23 11:42:02 +03:00
Denys Vlasenko ecd3b62b8e This change prevents misinterpreting an unknown ESC sequence's
tail as a garbage input. To reproduce, run "sleep 3" and
hold down Down_Arrow key until sleep runs.
With debugging log enabled, the following can be seen:

entered get_key_code(no_delay:0)
 c=tty_lowlevel_getch()=27
 push_char(27) !0
 c=xgetch_second()=91
 push_char(91) !0
 2 c=tty_lowlevel_getch()=66
 push_char(66)
 seq_buffer[0]:27   <---- the saved Down Arrow sequence "ESC [ B"
 seq_buffer[1]:91
 seq_buffer[2]:66
 seq_buffer[3]:0
pending_keys!=NULL. m=-1
d=*pending_keys++=27
d=ALT(*pending_keys++)=ALT(91)=8283
^^^^^^^^^^^^^^^^^^^^^^^ we misinterpret "ESC [ B" as "ESC ["
return correct_key_code(8283)
entered get_key_code(no_delay:0)
pending_keys!=NULL. m=-1
d=*pending_keys++=66
^^^^^^^^^^^^ we think user pressed "B"
return correct_key_code(66)

With this patch, no bogus "input" is generated.

Longer unknown sequences need an additional fix, coming next.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2013-05-23 11:42:02 +03:00
Denys Vlasenko 77cfaf03cb Ticket #2988: When an unknown key is pressed, it is interpreted as garbage.
keyboard input: simplify code, no logic changes

This change slightly simplifies and rearranges the code
in get_key_code(), reduces indentation levels there,
adds a few comments. The logic remains the same.

This is a preparatory patch for subsequent changes.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2013-05-23 11:41:25 +03:00
Andrew Borodin f23f0613ec Ticket #2991: fix redraw of WLabel after text change.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-04-08 15:46:39 +04:00
Andrew Borodin 705afe88c0 (mc_config_new_or_override_file): minor optimization.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-03-09 16:04:51 +04:00
Andrew Borodin 30959e0b7d Clarify widget redraw in runtime.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-03-09 16:04:19 +04:00
Andrew Borodin ef94b84eaf (size_trunc_len): support automatic maximum unit for specified size.
Fix typos.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-03-09 16:04:19 +04:00
Andrew Borodin 9b0b017201 (input_update): minor optimization: don't call str_term_width2() twice.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-03-09 16:04:18 +04:00
Slava Zanko c984447f8e Rename vfs_path_cmp() to vfs_path_equals()
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2013-03-09 16:04:18 +04:00
Andrew Borodin 8454f12f8f Ticket #2954: fix typo: occured -> occurred.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-03-09 16:04:18 +04:00
Andrew Borodin e29d98336b Ticket #2971: mouse click below non-droppeddown menubar activates menu box.
How to reproduce:
1. Switch the "Drop down menus" option off.
2. Press F9 to activate menubar. Menu is not dropped.
3. Click somewhere below menubar, on one of the files in the directory
listing.

Buggy behavior: the corresponding "Left" or "File" etc. dropdown is
opened, and the mouse button is released, menu item under the mouse
cursor is activated.

Correct behavior: clicking with the mouse somewhere other than the
active menubar doesn't open dropdown menu, instead removes the focus from
menubar and acts on the actual item under the mouse pointer (such
as a filename in the panel).

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-03-05 16:51:52 +04:00
Slava Zanko 6447c76cca Implementation of getting last editing/viewing position of file.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2013-02-16 17:40:37 +03:00
Slava Zanko 278178093e Add support of reading parameters for external editor/viewer from main config.
for example, the config file may contain strings:

[External editor or viewer parameters]
    vim = %filename +%lineno
    mcedit = %filename:%lineno

And these external editors will open a file at the previously saved position.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2013-02-16 17:40:37 +03:00
Slava Zanko e50c3f8475 mc_config_get_string(): if default parameter is NULL, then no any config entities will be created
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2013-02-16 17:40:37 +03:00
Slava Zanko 5b63c39459 mc_config_get_string_raw(): if default parameter is NULL, then no any config entities will be created
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2013-02-16 17:40:37 +03:00
Slava Zanko 808988b1f1 Add lib/strutil/replace:str_replace_all() function.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2013-02-16 17:40:37 +03:00