Commit Graph

15242 Commits

Author SHA1 Message Date
Andrew Borodin
231c84caeb Widget: implement destroy callback.
(dlg_destroy): remove. Use widget_destroy() to destroy any dialog.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 15:14:56 +03:00
Andrew Borodin
e7fab254f9 Rename variable: midnight_dlg -> filemanager.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 15:14:56 +03:00
Andrew Borodin
4ed3e4b0f6 Sync with gnulib 80a344e3237b878734295cbe696b7f1e4a8541f0.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 15:14:56 +03:00
Andrew Borodin
1e1cbb31d0 src/filemanager/chattr.c: minor refactoring.
(chattrboxes_new): create WChattrBoxes widget entirely.
(chattr_dlg_create): move creation of checkboxes to chattrboxes_new().

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 15:14:56 +03:00
Andrew Borodin
2cd33ad0d5 Convert widget coordinates from global to local and vice versa.
Add two widget callbacks:
  * (make_global): convert widget coordinates from local (relative to
    owner) to global (screen).
  * (make_local): convert widget coordinates from global (screen) to
    local (relative to owner).

Such conversions are required when nested widgets and groups are added to
or removed from another groups.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 15:14:56 +03:00
Andrew Borodin
ba890d9a92 (make_symlink): take paths as vfs_path_t objects
...to get rid of extra type conversions.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 15:14:56 +03:00
Andrew Borodin
6596185573 (sftpfs_fix_filename): return pointer to GString instead of pointer to char.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 15:14:55 +03:00
Andreas Mohr
b71f66dbbd Fix const/unconst casts.
Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 15:14:55 +03:00
Andrew Borodin
e61db70c58 doc: clarify Russian man page.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 15:14:55 +03:00
Andrew Borodin
0718ef89f7 man2hlp: limited support of \(lq, \(rq and \(dq commands.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 15:14:55 +03:00
Andrew Borodin
5fc84f2cfe m4.include/mc-subshell.m4: minor refactoring.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 15:14:55 +03:00
Andrew Borodin
0a26014ca4 m4.include/mc-with-screen-slang.m4: check S-Lang using pkg-config only.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 15:14:55 +03:00
Andrew Borodin
c2a17d3a99 (repaint_file): remove mv argument.
mv is always the inversion of isstatus.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 15:14:55 +03:00
Andreas Mohr
8d84972533 (extfs_get_archive_name): fix -Wcast-qual warning.
extfs.c:799:24: warning: cast from 'const struct extfs_super_t *' to 'struct vfs_s_super *' drops const qualifier [-Wcast-qual]
        archive_name = VFS_SUPER (archive)->name;
                       ^
../../../lib/vfs/xdirentry.h:39:46: note: expanded from macro 'VFS_SUPER'
#define VFS_SUPER(a) ((struct vfs_s_super *) (a))
                                             ^

Found by Clang-11

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 15:14:55 +03:00
Andreas Mohr
108c465176 (overwrite_query_dialog): fix -Wcast-qual warnings.
filegui.c:531:19: warning: cast from 'const char *' to 'char *' drops const qualifier [-Wcast-qual]
    s1 = (char *) file_date (ui->src_stat->st_mtime);
                  ^
filegui.c:546:19: warning: cast from 'const char *' to 'char *' drops const qualifier [-Wcast-qual]
    s1 = (char *) file_date (ui->dst_stat->st_mtime);
                  ^

Found by Clang-11.

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 15:14:55 +03:00
Andreas Mohr
34616d6444 src/filemanager/chattr.c: fix -Wcast-qual warnings.
chattr.c:398:34: warning: cast from 'const struct WChattrBoxes *' to 'struct WGroup *' drops const qualifier [-Wcast-qual]
    w = WIDGET (g_list_nth_data (GROUP (cb)->widgets, Id - cb->top));
                                 ^
../../lib/widget/group.h:16:29: note: expanded from macro 'GROUP'
#define GROUP(x) ((WGroup *)(x))
                            ^
chattr.c:515:27: warning: cast from 'const struct WChattrBoxes *' to 'struct WGroup *' drops const qualifier [-Wcast-qual]
    for (i = cb->top, l = GROUP (cb)->widgets; l != NULL; i++, l = g_list_next (l))
                          ^
../../lib/widget/group.h:16:29: note: expanded from macro 'GROUP'
#define GROUP(x) ((WGroup *)(x))
                            ^

Found by Clang-11

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 15:14:55 +03:00
Andreas Mohr
e68c2f8c1b Ticket #4179: code cleanup before 4.8.27 release.
lib/widget/group.c: fix -Wcast-qual warnings:

group.c:199:21: warning: cast from 'const struct Widget *' to 'struct WGroup *' drops const qualifier [-Wcast-qual]
        for (iter = GROUP (w)->widgets; iter != NULL; iter = g_list_next (iter))
                    ^
../../lib/widget/group.h:16:29: note: expanded from macro 'GROUP'
                            ^
group.c:231:21: warning: cast from 'const struct Widget *' to 'struct WGroup *' drops const qualifier [-Wcast-qual]
        for (iter = GROUP (w)->widgets; iter != NULL; iter = g_list_next (iter))
                    ^
../../lib/widget/group.h:16:29: note: expanded from macro 'GROUP'
                            ^
group.c:263:21: warning: cast from 'const struct Widget *' to 'struct WGroup *' drops const qualifier [-Wcast-qual]
        for (iter = GROUP (w)->widgets; iter != NULL; iter = g_list_next (iter))
                    ^
../../lib/widget/group.h:16:29: note: expanded from macro 'GROUP'
                            ^

Found by Clang-11.

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 15:14:55 +03:00
Andrew Borodin
77545fbb66 Merge branch '4213_freebsd_crash_workaround'
* 4213_freebsd_crash_workaround:
  Ticket #4213: workaround to avoid crash on FreeBSD.
2021-06-20 15:06:50 +03:00
Andrew Borodin
443a8106f1 Ticket #4213: workaround to avoid crash on FreeBSD.
In the read_subshell_prompt() (src/subshell/common.c:1546) the first
call of select() returns 0. Therefore subshell_prompt is NULL.
NULL dereference is the cause of crash.

This commit isn't a real fix but just a workaround.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 14:59:59 +03:00
Marco Ciampa
b870f16b0d Updated Italian translation 2021-06-09 13:19:36 +02:00
Andrew Borodin
cde941ba32 Merge branch '4246_openrc_syntax'
* 4246_openrc_syntax:
  Ticket #4252: change pattern for OpenRC scripts syntax highlighting.
2021-05-31 09:08:44 +03:00
Andrew Borodin
443a9c897b Ticket #4252: change pattern for OpenRC scripts syntax highlighting.
Use an empty patter (^$) that doesn't match any file name. In this
case, only the shebang is used to detect syntax highlighting rules for
OpenRC scripts.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-05-31 09:07:05 +03:00
Andrew Borodin
c16e9f2d42 Merge branch '4251_foot'
* 4251_foot:
  Ticket #4251: add foot to the known terminals
2021-05-30 13:17:22 +03:00
Grzegorz Szymaszek
3a6725bdb7 Ticket #4251: add foot to the known terminals
foot is a "fast, lightweight and minimalistic Wayland terminal emulator"
(see https://codeberg.org/dnkl/foot). Add its default TERM value to the
recognized ones. This enables mc to change the terminal window title and
handle mouse events.

(tty_check_term): add support of foot terminal emulator as xterm-compatible.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-05-30 13:17:07 +03:00
TerraTech
3d5fadd2bb Ticket #4246: add syntax highlighting for for openrc-run scripts.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-05-29 14:21:10 +03:00
Andrew Borodin
db36f1e9df Merge branch '4250_json_syntax'
* 4250_json_syntax:
  filehighlight.ini: highlight .json files as documents.
  Ticket #4250: mcedit: add syntax highlighting for .json files.
2021-05-29 14:11:37 +03:00
Sergii Pylypenko
3409033c28 filehighlight.ini: highlight .json files as documents.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-05-29 14:08:29 +03:00
Sergii Pylypenko
4be98a52ba Ticket #4250: mcedit: add syntax highlighting for .json files.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-05-29 14:05:48 +03:00
Andrew Borodin
167f437b14 Merge branch '4248_alacritty'
* 4248_alacritty:
  (tty_check_term): clarify description.
  Ticket #4248: add alacritty to known terminals.
2021-05-29 13:54:37 +03:00
Andrew Borodin
9132211575 (tty_check_term): clarify description.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-05-29 13:50:30 +03:00
Grzegorz Szymaszek
2f3d59db36 Ticket #4248: add alacritty to known terminals.
Alacritty is a "fast, cross-platform, OpenGL terminal emulator" (see
https://github.com/alacritty/alacritty). Add its default TERM value to
the recognized ones. This enables mc to change window title and handle
mouse events.

(tty_check_term): add support of alacritty terminal as xterm-compatible.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-05-29 13:43:52 +03:00
Andrew Borodin
e4195219fd Merge branch '4249-version.sh'
* 4249-version.sh:
  Ticket #4249: Autoreconf is failing with tarball prepared by make dist.
2021-05-27 20:52:18 +03:00
Andrew Borodin
791acb4611 Ticket #4249: Autoreconf is failing with tarball prepared by make dist.
version.sh: move from maint/utils to the root of the source tree
and make it a part of distributable tarball.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-05-26 21:56:27 +03:00
Andrew Borodin
1a1c6cc278 Merge branch '3375_hardlink_highlight'
* 3375_hardlink_highlight:
  Ticket #3375: make hardlink highlighted by file type or extension.
2021-05-23 10:57:13 +03:00
Andrew Borodin
ce9eb8f7d1 Ticket #3375: make hardlink highlighted by file type or extension.
filehighlight.ini: move [hardlink] section to the bottom of the file.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-05-23 10:54:59 +03:00
Andrew Borodin
83d4966807 Merge branch '4242_usermenu_view_indirect'
* 4242_usermenu_view_indirect:
  (execute_menu_command): get rid of code duplication.
  Ticket #4242: %view fails to execute on no-exec tmp filesystem.
2021-05-23 10:50:20 +03:00
Andrew Borodin
0cb6e97230 (execute_menu_command): get rid of code duplication.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-05-23 10:49:10 +03:00
Lukasz Krotowski
72d2fb981a Ticket #4242: %view fails to execute on no-exec tmp filesystem.
(execute_menu_command): use indirect execution of %view.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-05-23 10:49:10 +03:00
Andrew Borodin
3a457a2cb5 Merge branch '4244_dialog_segfault'
* 4244_dialog_segfault:
  Ticket #4244: fix segfault on dialog before panels get visible.
2021-05-23 10:42:38 +03:00
Andrew Borodin
0375997c78 Ticket #4244: fix segfault on dialog before panels get visible.
If some small dialog (error message or password request) is displayed
before main mc window gets visible, the segfault occures.

The cause of segfault is update of prompt that is not created yet.

(setup_mc, create_file_manager): move creation of event channel from
setup_mc() to create_file_manager(), make that after creation of all
file manager widgets.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-05-18 10:23:08 +03:00
Andrew Borodin
333b20557e Merge branch '4239_7zz'
* 4239_7zz:
  Ticket #4239: extfs/u7z: support official 7z binary (7zz).
2021-05-08 16:31:15 +03:00
MooSE
779f30c39f Ticket #4239: extfs/u7z: support official 7z binary (7zz).
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-05-08 16:29:33 +03:00
Andrew Borodin
8c92bec6eb Modify editor refcounter
...to fix segault introduced in daf21d8315.

Both actions MSG_INIT and MSG_DESTROY should be send to widget. In editor,
if file cannot be open, MSG_INIT isn't sent to, but MSG_DESTROY is. As a
result, a double free is occured in edit_dlg_deinit().

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-04-30 08:54:52 +03:00
Andrew Borodin
0aaf74777d Merge branch '2919_visible'
* 2919_visible:
  WMenubar: remove unneeded action.
  (setup_panels): reduce the number of redraws.
  (setup_panels, setup_cmdline): use WST_VISIBLE to set up prompt and command line.
  (setup_panels): use WST_VISIBLE to set up hint bar.
  Buttonbar: use WST_VISIBLE state
  Menubar: use WST_VISIBLE state
  Add WST_VISIBLE widget state.
  Ticket #2919: implement WST_VISIBLE widget state.
2021-04-11 17:11:00 +03:00
Andrew Borodin
53d073758f WMenubar: remove unneeded action.
(menubar_activate): do not focus explicitly. Focus is made in
widget_select().

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-04-11 17:10:14 +03:00
Andrew Borodin
789aa0bb22 (setup_panels): reduce the number of redraws.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-04-11 17:10:14 +03:00
Andrew Borodin
57fd21c7a0 (setup_panels, setup_cmdline): use WST_VISIBLE to set up prompt and command line.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-04-11 17:10:13 +03:00
Andrew Borodin
9ac272a287 (setup_panels): use WST_VISIBLE to set up hint bar.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-04-11 17:10:13 +03:00
Andrew Borodin
913403b10c Buttonbar: use WST_VISIBLE state
...instead of WButtonBar::visible member.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-04-11 17:10:08 +03:00
Andrew Borodin
0e75e85598 Menubar: use WST_VISIBLE state
...instead of WMenuBar::is_visible member.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-04-11 17:09:53 +03:00