Commit Graph

16154 Commits

Author SHA1 Message Date
Andrew Borodin
37a0540423 (learn_button): clarify title and message of dialog window.
Change title to "Warning". Move previous title to the message body.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-12-15 14:06:21 +03:00
Andrew Borodin
009efde431 Join create_message() and do_create_message().
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-12-15 14:06:21 +03:00
Andrew Borodin
71199a290f Make message box with button.
* (bg_message): use query_dialog() instead of fg_message().
  * (message): likewise.
  * (fg_message): isn't used anymore. Remove.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-12-15 14:06:21 +03:00
Andrew Borodin
4f47b16ba8 (mcview_do_search): use message().
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-12-15 14:06:19 +03:00
Andrew Borodin
1eb6c94c9b configure.ac: indentation: replace tabs by spaces.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-12-15 14:03:37 +03:00
Yury V. Zaytsev
013b2fddc8 doc: centralized the list of dependencies, removed outdated docs
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2024-12-15 14:03:35 +03:00
Andrew Borodin
ce15d50cde doc/INSTALL: add uClibc, musl and clang.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-12-15 14:00:41 +03:00
Artem S. Tashkinov
83a5d34a64 filehighlight: update to close MidnightCommander/mc#208
- Add awb: https://en.wikipedia.org/wiki/Adaptive_Multi-Rate_Wideband
- Add y4m: RAW video format, https://wiki.multimedia.cx/index.php/YUV4MPEG2
- Add tga: https://en.wikipedia.org/wiki/Truevision_TGA

Signed-off-by: Artem S. Tashkinov <birdie-github@users.noreply.github.com>
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2024-12-15 14:00:41 +03:00
Yury V. Zaytsev
81a7a5bc92 shell: use backticks for compability with Solaris /bin/sh
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2024-12-15 14:00:41 +03:00
Kirill Rekhov
6f60924c83 Ticket #4602: fix typo in mc.emacs.keymap.
Closes MidnightCommander/mc#207.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2024-12-15 14:00:41 +03:00
Andrew Borodin
c547894788 Ticket #4572: code cleanup before 4.8.33 release.
(compare_files): fix coding style.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2024-12-15 14:00:41 +03:00
Andrew Borodin
511d4d853b Merge branch '4587_mcview_search_bol'
* 4587_mcview_search_bol:
  (mcview_moveto_bottom): fix search start and stop positions.
  mcview: fix regex search.
  mcview: minor refactoring.
  Ticket #4587: mcviewer: fix BOL regex search.
2024-12-15 13:48:22 +03:00
Andrew Borodin
a83a6f4acf (mcview_moveto_bottom): fix search start and stop positions.
After move to the end of file, set the start positions to EOL
to make backward search starting directly from EOL.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-12-15 13:46:57 +03:00
Andrew Borodin
4861ccb19a mcview: fix regex search.
Sync regex search way with mcedit: handle BOL (^) metacharacter.

  * (WView::search_line_type): new member.
  * (mcview_search_init): init WView::search_line_type.
  * (mcview_find): sync with edit_find().

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2024-12-15 13:46:57 +03:00
Andrew Borodin
a3825e1b29 mcview: minor refactoring.
* (mcview_search): move to search.c.
  * (mcview_do_search): make static.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2024-12-15 13:46:57 +03:00
Andrew Borodin
c943b931d7 Ticket #4587: mcviewer: fix BOL regex search.
Refactoring.

* (mc_search_line_t): rename from edit_search_line_t and move to
lib/search.h.
* (mc_search_get_line_type): rename from edit_get_search_line_type()
and move to lib/search/regex.c.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2024-12-15 13:46:52 +03:00
Andrew Borodin
7950ae8b24 Merge branch '4613_check_eta_overflow'
* 4613_check_eta_overflow:
  Ticket #4613: check for ETA overflow.
2024-12-14 09:20:47 +03:00
Jakob Kastelic
27c01b8942 Ticket #4613: check for ETA overflow.
(file_eta_prepare_for_show): check if 'eta_secs' is too large to display
as integer. If yes, display "--".

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-12-13 19:51:52 +03:00
Yury V. Zaytsev
7fc6dfc16b Merge branch '4609_rust_crate'
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2024-12-06 22:20:34 +03:00
Yury V. Zaytsev
63a51cdcd7 Ticket #4609: treat Rust crates as tar.gz archives
534ce68621/src/cargo/ops/cargo_package.rs (L185)

Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2024-12-06 16:13:02 +03:00
Andrew Borodin
c2eb73bb2c Merge branch '4608_mcdiff_segfault'
* 4608_mcdiff_segfault:
  Ticket #4608: mcdiff: segmentation fault on empty files merge.
2024-12-05 20:59:44 +03:00
Andrew Borodin
8548796e75 Ticket #4608: mcdiff: segmentation fault on empty files merge.
(get_current_hunk): immediately return if hunk list is empty.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-12-04 21:02:21 +03:00
Andrew Borodin
f85f7fec29 Merge branch '3205_eta'
* 3205_eta: (29 commits)
  Update po/*.po files.
  doc: update EN and RU man pages.
  Calculate pauses in file operations.
  File copy/move: make ETA accurate.
  (calc_copy_file_progress): clarify calculation of BPSes and ETAs.
  (panel_operate): use intermediate variable for better indentation.
  (copy_file_file): clarify handling of mc_open() errors.
  (copy_file_file): fix handling of mc_open() error.
  (calc_copy_file_progress): rename from copy_file_file_display_progress().
  (file_progress_show_total): add 'tv_current' argument.
  (file_progress_show_total): use 'copied_bytes' to show numeric value.
  (file_progress_show_count): remove 'done' and 'total' arguments.
  (erase_dir_iff_empty): remove 'count' argument.
  (file_op_context_t): rename members.
  (copy_file_file): reduce variable scope, change order of progress update.
  (file_op_context_t): reorder members.
  Move content of src/filemanager/fileopctx.[ch] to src/filemanager/filegui.[ch].
  (file_op_total_context_t): remove. All members were moved to file_op_context_t.
  (file_op_total_context_t): rename members.
  (copy_file_file_display_progress): remove dead code.
  ...
2024-11-13 19:38:42 +03:00
Andrew Borodin
883aec7625 Update po/*.po files.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-11-13 19:38:02 +03:00
Andrew Borodin
c3fa92d89a doc: update EN and RU man pages. 2024-11-13 19:38:01 +03:00
Andrew Borodin
5047d4d114 Calculate pauses in file operations.
Calculate BPS and ETA, taking into account pauses due to query
dialog boxes.

  * (file_op_context_t): new 'pauses' member.
  * (file_error): pass file operation context to calculate pause.
  * (real_warn_same_file): likewise.
  * (real_do_file_error): likewise.
  * (real_query_recursive): calculate pause.
  * (overwrite_query_dialog): likewise.
  * (file_progress_show_total): use ctx->pauses to show time of
    operation.
  * (calc_copy_file_progress): calculate use ctx->pauses to calculate ETA.
  * (warn_same_file):
  * (check_same_file):
  * (check_hardlinks):
  * (make_symlink):
  * (do_file_error):
  * (files_error):
  * (try_remove_file):
  * (move_file_file):
  * (try_erase_dir):
  * (do_move_dir_dir):
  * (copy_file_file):
  * (copy_dir_dir):
  * (panel_operate):
  * (tree_move): related changes.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-11-13 19:38:01 +03:00
Andrew Borodin
1e35ae3adb File copy/move: make ETA accurate.
* (progress_update_one): update total progress bytes counter. Update
    progress info in the progress window only if file was processed
    successfully. Don't check buttons here.
  * (move_file_file): update progress info if file move wasn't aborted.
  * (copy_file_file): update progress info if stat() or open() failed
    (file size is unknown, but file counter shoud be updated). Modify
    caclulation and display of byte counters.
  * (panel_operate): simplify files processing loop. Remove action that
    already done via operate_one_file() call.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-11-13 19:38:01 +03:00
Andrew Borodin
ff1a404bb3 (calc_copy_file_progress): clarify calculation of BPSes and ETAs.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-11-13 19:38:01 +03:00
Andrew Borodin
07ea52d767 (panel_operate): use intermediate variable for better indentation.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-11-13 19:38:00 +03:00
Andrew Borodin
e2ca50418d (copy_file_file): clarify handling of mc_open() errors.
Handle mc_open() errors in the same way as mc_fstat().

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-11-13 19:38:00 +03:00
Andrew Borodin
25fb677b87 (copy_file_file): fix handling of mc_open() error.
In case of FILE_IGNORE, immediately stop processing of file.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-11-13 19:38:00 +03:00
Andrew Borodin
e6e329bc8c (calc_copy_file_progress): rename from copy_file_file_display_progress().
Refactoring, reuse variable.

(file_op_context_t): remove 'bps_time' member. It's unused anymore.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-11-13 19:37:59 +03:00
Andrew Borodin
d844c6212c (file_progress_show_total): add 'tv_current' argument.
Get rid of g_get_monotonic_time() here. If possible, use time value
calculated before.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-11-13 19:37:59 +03:00
Andrew Borodin
6ba3cc68c0 (file_progress_show_total): use 'copied_bytes' to show numeric value.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-11-13 19:37:59 +03:00
Andrew Borodin
2b1a63aef3 (file_progress_show_count): remove 'done' and 'total' arguments.
Use members of 'ctx' instead.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-11-13 19:37:59 +03:00
Andrew Borodin
7c418111fd (erase_dir_iff_empty): remove 'count' argument.
Use 'ctx->progress_count' instead.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-11-13 19:37:59 +03:00
Andrew Borodin
527cb1424d (file_op_context_t): rename members.
copied_bytes -> total_progress_bytes
progress_count -> total_progress_count
prev_progress_count -> prev_total_progress_count

No functional changes.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-11-13 19:37:59 +03:00
Andrew Borodin
debd1ee8ce (copy_file_file): reduce variable scope, change order of progress update.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-11-13 19:37:59 +03:00
Andrew Borodin
64c6de4ab8 (file_op_context_t): reorder members.
No functional changes.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-11-13 19:37:59 +03:00
Andrew Borodin
17fd844315 Move content of src/filemanager/fileopctx.[ch] to src/filemanager/filegui.[ch].
No functional changes.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-11-05 18:19:28 +03:00
Andrew Borodin
b2b10f1f87 (file_op_total_context_t): remove. All members were moved to file_op_context_t.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-11-05 18:19:28 +03:00
Andrew Borodin
dde9002aaf (file_op_total_context_t): rename members.
bps -> total_bps
transfer_start -> total_transfer_start
eta_secs -> total_eta_secs

No functional changes.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-11-05 18:19:28 +03:00
Andrew Borodin
ab5bbba2dd (copy_file_file_display_progress): remove dead code.
(file_op_total_context_t): bps_count member is unused. Remove it.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-11-05 18:19:28 +03:00
Andrew Borodin
23ed903814 (file_op_context_t): rename members.
progress_count -> total_count
progress_bytes -> total_bytes
progress_totals_computed -> totals_computed

No functional changes.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-11-05 18:19:28 +03:00
Andrew Borodin
31771bd332 Store start time of file transfer in the file operation context descriptor.
* (file_op_context_t): new member transfer_start.
  * (copy_file_file_display_progress): remove tv_transfer_start
    argument, use ctx->transfer_start instead.
  * (copy_file_file): sync with modified file_op_context_t and
    copy_file_file_display_progress().

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-11-05 18:19:28 +03:00
Andrew Borodin
f699e184ea (file_op_context_new): simplify.
Don't NULLify members. This is already done by call of g_new0().

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-11-05 18:19:28 +03:00
Andrew Borodin
a1b4eb0bfb Rename file_op_context_ui_t to file_progress_ui_t, reorder members.
No functional changes.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-11-05 18:19:28 +03:00
Andrew Borodin
0a6604a626 Rename functions.
file_op_context_create_ui -> file_progress_ui_create
file_op_context_destroy_ui -> file_progress_ui_destroy
check_progress_buttons -> file_progress_check_buttons

No functional changes.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-11-05 18:19:28 +03:00
Andrew Borodin
63db380705 (copy_file_file_display_progress): change arguments order.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-11-05 18:19:28 +03:00
Andrew Borodin
6d3c41082c (copy_file_file): fix the ETA calculation.
Pass only the size of the remaining part of file to
copy_file_file_display_progress().

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-11-05 18:19:28 +03:00