Commit Graph

15452 Commits

Author SHA1 Message Date
Andrew Borodin 36abab7186 Clarify checks of input line content returned from quick dialog.
If quick dialog is finished with value other than B_CANCEL,
string value of input line isn't NULL.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-08-04 11:19:16 +03:00
Andrew Borodin 79645187c6 (input_get_ctext): mew API.
Use it instead of direct access to WInput's buffer.

(handle_cmdline_enter): additional minor refactoring.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-08-04 11:17:29 +03:00
Andrew Borodin 28154dc520 (input_destroy): remove check if WInput object is NULL. This object must exist.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-08-04 11:11:50 +03:00
Andrew Borodin 589155f6bf WInput: make one-line APIs inline.
* (input_get_text): make inline.
  * (input_is_empty): likewise.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-08-04 11:11:33 +03:00
Andrew Borodin 4e245291b4 (input_is_empty): remove checks. WInput object must exist.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-08-04 11:09:49 +03:00
Andrew Borodin 318315399b Ticket #4397: sort in editor without arguments stopped working.
* (input_get_text): never return NULL. If buffer is empty, return an
empty allocated string.
  * (input_push_history): use new input_get_text.
  * (find_parameters): likewise.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-08-04 11:09:42 +03:00
Andrew Borodin 9f15305dc2 Merge branch '4396_contour_terminal'
* 4396_contour_terminal:
  Ticket #4396: (tty_check_term): support Contour terminal.
2022-07-31 19:55:36 +03:00
Whisperity 6cd17f6bbf Ticket #4396: (tty_check_term): support Contour terminal.
Contour terminal: https://github.com/contour-terminal/contour.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-07-31 19:50:27 +03:00
Andrew Borodin 1c31e57c74 Merge branch '4391_edit_delete_macro'
* 4391_edit_delete_macro:
  (edit_delete_macro): do not resort macros after deleting one
  Ticket #4391: fix infinite loop when deleting an mceditor macro.
2022-07-27 19:22:22 +03:00
sxmboer2 cca4c46d05 (edit_delete_macro): do not resort macros after deleting one
...because g_array_remove_index() keeps the array sorted.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-07-27 19:22:05 +03:00
sxmboer2 01c3c56140 Ticket #4391: fix infinite loop when deleting an mceditor macro.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-07-27 19:22:05 +03:00
Andrew Borodin 82da1e88c7 Merge branch '4381_mouse_drag'
* 4381_mouse_drag:
  Ticket #4381: missing selection of some files.
2022-07-27 19:11:09 +03:00
Andrew Borodin 6ea06c9845 Ticket #4381: missing selection of some files.
When files are selected keeping the right mouse button pressed,
some files are not selected.

  * Add new macros for mouse pointer location relative to file list.
  * (mark_if_marking): select/unselect all files between previous
    selected file and new one.
  * (panel_mouse_is_on_item): return clarified value of mouse pointer location.
  * (panel_mouse_callback): modify mouse drag event handling in accordance with
    the mouse pointer location relatively to the file list.

Also fixes ticket #4119: "Cannot scroll panel listing upwards using mouse".

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-07-27 19:10:16 +03:00
Andrew Borodin cd47b158ac Ticket #4373: restore menu accelerator for "Sort order" item.
Menu according for "Sort order" item was changed in
d19b247c6d in order to fix shotrcut
conflict. Restore it back according to user requests.

óhange accelerator for "SFTP link" from S to N.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-07-11 19:44:43 +03:00
Pavel Shumskii 971de9651c Ticket #4059: improve YAML multiline blocks syntax highliting.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-07-09 20:10:31 +03:00
Bogdan Pylypenko 08ab71d49b Ticket #4384: mceditor: add syntax file for Privoxy.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-07-03 15:46:22 +03:00
Andrew Borodin ab63cd2a94 Merge branch '4377_file_b'
* 4377_file_b:
  "file" utility: use -b option if available.
  Ticket #4377: file type check does not work with special character in filename.
2022-07-03 15:38:05 +03:00
Andrew Borodin debabe561a "file" utility: use -b option if available.
* configure.ac: test if "file" utility has -b option.
  * (regex_check_type): don't compare file names if "file -b" is used.
Reduce variable scope. Rename variable.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-06-26 20:03:47 +03:00
Andrew Borodin 0bb9c04720 Ticket #4377: file type check does not work with special character in filename.
Initial commit: clarify usage of "file" utility.

  * (get_popen_information): compile conditionally depending on USE_FILE_CMD
macro.
  * (get_file_type_local): likewise.
  * (get_file_encoding_local): likewise.
  * (regex_check_type): likewise.
  * (regex_command_for): ignore type method if file utiliti isn't used.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-06-26 19:57:37 +03:00
Andrew Borodin 6c45208744 Fix indentation.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-06-05 20:12:46 +03:00
Andrew Borodin 6f2833a422 Merge branch '4357_cleanup'
* 4357_cleanup: (39 commits)
  Update po/*.po files.
  src/filemanager/dir.c: minor sort optimization.
  lib/util.h: fix typo.
  (edit_sort_cmd): clarify hint for Sort command.
  (query_default_callback): clarify widget position.
  (mc_config_get_string): use mc_config_get_string_raw()
  (ftpfs_setup_active): clarify handling of getnameinfo() errors.
  (ftpfs_initconn): clarify errno setup.
  ftpfs.c: variable ftpfs_errno is assigned but never used.
  (ftpfs_dir_load): fix building of remote path.
  (vfs_s_subclass::dir_load): constify argument.
  Minor refactoring of path canonicalization.
  (mc_chdir): clarufy setup of errno.
  (vfs_path_get_by_index): set errno, update description.
  Fix ENOTSUP usage.
  mceditor: minor refactoring of file load.
  (edit_init): change argument for coordinates.
  (edit_add_window): change argument for coordinates.
  (widget_adjust_position): change argument for coordinates.
  (group_init): change argument for coordinates.
  ...
2022-06-05 19:50:03 +03:00
Andrew Borodin a0ac476983 Update po/*.po files.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-06-05 19:49:32 +03:00
Andrew Borodin 1b93bae611 src/filemanager/dir.c: minor sort optimization.
Get rid of sort condition double check.

Condition

    ad == bd || panels_options.mix_all_files

was checked twice: first in sort_xxx(), then in sort_name() called in
sort_xxx().

Now this condition is checked in sort_xxx() only.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-06-05 12:19:47 +03:00
Andrew Borodin f5399c6d4d lib/util.h: fix typo.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-06-05 12:19:47 +03:00
Andrew Borodin c7af7f0bbd (edit_sort_cmd): clarify hint for Sort command.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-06-05 12:19:47 +03:00
Andrew Borodin 101714e39b (query_default_callback): clarify widget position.
If dialog should be placed too high (in the upper half of the screen
closer to the screen top), show it centered.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-06-05 12:19:47 +03:00
Andrew Borodin 4008d3b96c (mc_config_get_string): use mc_config_get_string_raw()
...to get rid of code duplcation.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-06-05 12:19:47 +03:00
Andrew Borodin bae55d637a (ftpfs_setup_active): clarify handling of getnameinfo() errors.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-06-05 12:19:47 +03:00
Andrew Borodin 798f6e87b3 (ftpfs_initconn): clarify errno setup.
Handle errors of bind(), getsockname(), and listen() calls.
Return if one of these functions fails and setup errno to indicate the
cause of the error.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-06-05 12:19:47 +03:00
Andrew Borodin 03cef1bb6f ftpfs.c: variable ftpfs_errno is assigned but never used.
Use me->verrno directly instead.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-06-05 12:19:47 +03:00
Andrew Borodin 556cf2274d (ftpfs_dir_load): fix building of remote path.
Call of mc_build_filename(remote_path, ".") is pointless
because the path canonicalization is performed and trailing
"/." is removed.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-06-05 12:19:47 +03:00
Andrew Borodin ebb328353e (vfs_s_subclass::dir_load): constify argument.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-06-05 12:19:44 +03:00
Andrew Borodin db8bc2fbff Minor refactoring of path canonicalization.
(canon_path_flags_t): rename from CANON_PATH_FLAGS, add
CANON_PATH_NOCHANGE value, clarify comments.
(canonicalize_pathname_custom): rename from custom_canonicalize_pathname,
update description.
(canonicalize_pathname): add description.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-06-05 12:17:59 +03:00
Andrew Borodin 4ceb5c5105 (mc_chdir): clarufy setup of errno. 2022-06-05 12:00:26 +03:00
Andrew Borodin bae8fe0af0 (vfs_path_get_by_index): set errno, update description.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-06-05 12:00:25 +03:00
Andrew Borodin 666586e41a Fix ENOTSUP usage.
Remove E_NOTSUPP define. Use ENOTSUP directly where required.

(vfs_clone_file): use ENOTSUP instead of EOPNOTSUPP.
(mc_open): likewize. Fix sign.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-06-05 11:59:32 +03:00
Andrew Borodin 5f746eea0c mceditor: minor refactoring of file load.
(edit_load_file_from_filename): make public, use it as main function to
load file and create editor window.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-06-05 11:56:32 +03:00
Andrew Borodin 12543835f9 (edit_init): change argument for coordinates.
Use WRect instead of four values.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-06-05 11:56:31 +03:00
Andrew Borodin 533b2076dd (edit_add_window): change argument for coordinates.
Use WRect instead of four values.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-06-05 11:55:06 +03:00
Andrew Borodin caf41457c6 (widget_adjust_position): change argument for coordinates.
Use WRect instead of four values.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-06-05 11:55:06 +03:00
Andrew Borodin 390d614b5e (group_init): change argument for coordinates.
Use WRect instead of four values.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-06-05 11:55:06 +03:00
Andrew Borodin ccdc909105 (widget_init): change argument for coordinates.
Use WRect instead of four values.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-06-05 11:55:03 +03:00
Andrew Borodin 2759d080cf Viewer: use WRect to hold position and size of various areas.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-06-05 11:52:14 +03:00
Andrew Borodin aac258e44e (rect_grow): new API.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-06-05 11:50:19 +03:00
Andrew Borodin 5fae2313f3 Widget: use WRect to hold position and size.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-06-05 11:49:20 +03:00
Andrew Borodin ed65694caa quick_dlg: use WRect to hold dialog position and size.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-06-05 11:37:04 +03:00
Andrew Borodin 3978dee37c (widget_set_size_rect): reimplement
...to pass given WRect object directly to widget callback withowt
constuction/deconstuction of intermediate WRect object.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-06-05 11:32:47 +03:00
Andrew Borodin b265b388aa (input_push_history): join checks.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-06-05 11:29:21 +03:00
Andrew Borodin 6aeeb7ffb1 (push history): refactoring.
Rename to input_push_history().

Use input's buffer.

Don't duplicate an empty string, use current one.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-06-05 11:29:21 +03:00
Andrew Borodin 6639c4f070 (delete_region): use move_buffer_backward().
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-06-05 11:29:21 +03:00