Commit Graph

13803 Commits

Author SHA1 Message Date
Michael Osipov
b3867a6e15 Ticket #3666: Improper use of IEC and SI prefixes for size in size_trunc().
size_trunc() has been aligned to properly use either IEC or SI prefixes with
the unit B (byte). Additionally always put a space between number and unit
which is required by the norms.

Obsolete gettext message ids have been removed and some cleaned up for
duplicate words or leading spaces.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-10-26 13:33:12 +03:00
Andrew Borodin
c2e1ec81f6 Merge branch '3700_segfault_left_info_panel'
* 3700_segfault_left_info_panel:
  Ticket #3700: fix segfault after switch left panel to info mode.
2016-10-23 08:09:20 +03:00
Andrew Borodin
716479ba4f Ticket #3700: fix segfault after switch left panel to info mode.
(widget_replace): if new widget cannot take focus, move focus to other widget
before widget replacement.

In our case, the focused file panel is replaced by Info one. Info panel
a) isn't selectable (it never takes focus) and b) uses CWD of current
panel. Therefore focus must be moved to other file panel to make it
current and correctly set up it's CWD before first draw of Info panel.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-10-23 08:08:15 +03:00
Yury V. Zaytsev
755447b96e Fix typo in source code comments (s/TEMR/TERM/)
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2016-10-08 16:40:38 +02:00
Yury V. Zaytsev
85a28f11ae Merge branch '3698_etags_codejump' 2016-10-08 16:34:56 +02:00
Roman Mikhayloff
224f53518e Ticket #3698: fix mcedit codejump (etags filenames parsing)
This got broken in the following commit for mc-4.8.16:

    a5ebb7d619

As `g_strlcpy` got replaced with `g_strndup`, the meaning of the last
argument has changed: it is no longer the destination size in bytes, but
the maximum number of bytes to copy, and so it had to be decremented by
one accordingly, hence the bug.

Signed-off-by: Roman Mikhayloff <rimf@inbox.ru>
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2016-10-08 11:15:22 +02:00
Lars Wendler
2c576fad94 mcedit: syntax: update ebuild.syntax to include new EAPI 6 keywords
Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2016-10-08 10:44:37 +02:00
Raymond Jennings
6b656100ac mcedit: syntax: fix mismatched highlighting for <{o,u}l> HTML tags
Signed-off-by: Raymond Jennings <shentino@gmail.com>
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2016-10-07 22:38:07 +02:00
Andrew Borodin
8bf560cb8e Merge branch '3672_bind_tab' 2016-10-06 13:19:08 +03:00
Andrew Borodin
ef5f1fa3eb Ticket #3672: allow rebind TAB key to change panel.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-10-03 15:21:57 +03:00
Yury V. Zaytsev
8a50e158c3 Update doc/NEWS file
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2016-10-02 19:41:40 +02:00
Yury V. Zaytsev
d0eab30d64 Update hints translations from Transifex
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2016-10-02 19:35:36 +02:00
Yury V. Zaytsev
8a83d3f309 Update translations from Transifex
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2016-10-02 19:33:58 +02:00
Yury V. Zaytsev
6822251393 Fix assorted man page typos
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2016-09-20 22:00:52 +02:00
Yury V. Zaytsev
14d7987d25 Ticket #3644: man page uses "the Midnight Commander" instead of "Midnight Commander"
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2016-09-20 21:31:56 +02:00
Andrew Borodin
0cc22928af lib/widget/menu.c: indentation.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-09-11 11:52:07 +03:00
Andrew Borodin
4d6ea43282 Merge branch '2919_widget_focus_refactoring'
* 2919_widget_focus_refactoring:
  Reimplement widget focus/selection.
  (dlg_set_bottom_widget): rename to widget_set_bottom.
  (dlg_select_widget): rename to widget_select.
  Rename WDialog APIs:
  Refactoring of change of current widget.
  WMenuBar: remove WMenuBar::is_active. Use WST_FOCUSED instead.
  WInput: avoid double draw on resize.
  Menu: avoid double draw on resize.
  (widget_set_size): send MSG_DRAW after MSG_RESIZE.
  Refactoring of widget drawing to avoid multiple widget redraw.
  WView: remove WView::active. Use WST_FOCUSED instead.
  WTree: remove WTree:active. Use WST_FOCUSED instead.
  WButton: remove WButton::selected. Use WST_FOCUSED instead.
  WListbox: remove WListbox::focused. Use WST_FOCUSED instead.
  WST_FOCUSED: add new state and handle it.
  (menubar_callback): refactoring of menu draw after get focus and resize.
  (widget_set_state): return cb_ret_t instead of gboolean.
  Don't focus widget that doesn't have the WOP_SELECTABLE option.
  Use WOP_SELECTABLE option in menu.
  Ticket #2919: refactoring of focus/unfocus of widgets.
2016-09-11 11:35:15 +03:00
Andrew Borodin
36cc88b5f2 Reimplement widget focus/selection.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-09-11 11:30:20 +03:00
Andrew Borodin
599361b3fc (dlg_set_bottom_widget): rename to widget_set_bottom.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-09-11 11:30:20 +03:00
Andrew Borodin
d200893347 (dlg_select_widget): rename to widget_select.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-09-11 11:30:20 +03:00
Andrew Borodin
35451978f6 Rename WDialog APIs:
dlg_one_up -> dlg_select_prev_widget
dlg_one_down -> dlg_select_next_widget

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-09-11 11:30:20 +03:00
Andrew Borodin
b19ae2b938 Refactoring of change of current widget.
Add new WDialog APIs:

  * dlg_set_current_widget_next
  * dlg_set_current_widget_prev
  * dlg_get_widget_next_of
  * dlg_get_widget_prev_of

and use them:

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-09-11 11:30:20 +03:00
Andrew Borodin
47f9b77194 WMenuBar: remove WMenuBar::is_active. Use WST_FOCUSED instead.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-09-11 11:30:20 +03:00
Andrew Borodin
0df5ad5686 WInput: avoid double draw on resize.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-09-11 11:30:20 +03:00
Andrew Borodin
fd7c6c1c5d Menu: avoid double draw on resize.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-09-11 11:30:20 +03:00
Andrew Borodin
91c72122a8 (widget_set_size): send MSG_DRAW after MSG_RESIZE.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-09-11 11:30:20 +03:00
Andrew Borodin
240350db95 Refactoring of widget drawing to avoid multiple widget redraw.
Send MSG_DRAW message immediately after MSG_FOCUS/MSG_UNFOCUS.
Thus, the MSG_DRAW message handler is the only place where widget
should be drawn. Widget should not draw itself in other message
handlers.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-09-11 11:30:20 +03:00
Andrew Borodin
aae31dbe43 WView: remove WView::active. Use WST_FOCUSED instead.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-09-11 11:26:00 +03:00
Andrew Borodin
ac35ab0401 WTree: remove WTree:active. Use WST_FOCUSED instead.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-09-11 11:26:00 +03:00
Andrew Borodin
e1a2e8f8ec WButton: remove WButton::selected. Use WST_FOCUSED instead.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-09-11 11:26:00 +03:00
Andrew Borodin
ad166313a4 WListbox: remove WListbox::focused. Use WST_FOCUSED instead.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-09-11 11:26:00 +03:00
Andrew Borodin
c37f9b770a WST_FOCUSED: add new state and handle it.
Notify widget's owner that widget gets or loses focus.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-09-11 11:26:00 +03:00
Andrew Borodin
3debdac657 (menubar_callback): refactoring of menu draw after get focus and resize.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-09-11 11:26:00 +03:00
Andrew Borodin
41144d619c (widget_set_state): return cb_ret_t instead of gboolean.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-09-11 11:26:00 +03:00
Andrew Borodin
c90b806728 Don't focus widget that doesn't have the WOP_SELECTABLE option.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-09-11 11:26:00 +03:00
Andrew Borodin
a64a7ba2fa Use WOP_SELECTABLE option in menu.
If menu is not active, it is not selectable also in order to disallow
select and focus the inactive menu.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-09-11 11:26:00 +03:00
Andrew Borodin
5ac1c5a3e0 Ticket #2919: refactoring of focus/unfocus of widgets.
Initial step: add WOP_SELECTABLE option and set it up explicitly for
widgets that can be selected.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-09-11 11:26:00 +03:00
Sergey Sharybin
9c3fe04114 Ticket #3686: initial support of CUDA syntax highlighting.
Based on existing cxx.syntax file with some extra keywords added.

Colors could be tweaked a bit still, and perhaps list of keywords
and built-in types could be extended further, but it should be a
good starting point already.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-09-11 11:13:51 +03:00
Andrew Borodin
74dda7352e Merge branch '3641_cleanup'
* 3641_cleanup:
  lib/mcconfig/paths.c: reduce scope of 'homedir' var.
  lib/mcconfig/paths.c: cleanup.
  doc/man/mc.1.in: fix substitution markers.
  src/vfs/fish/fish.c: apply coding guidelines.
  More use link_isdir().
  Get rid of #define const_cast().
  Fix typos.
  Define NCURSES_CONST if curses library doesn't define it.
  (ftpfs_open_data_connection): fix enable/disable interrupt key.
  (ftpfs_open_data_connection): fix socket leak in case of unsuccessful ftp connection.
  (dlg_adjust_position): refactoring.
  Ticket #3641: code cleanup before 4.8.18 release.
2016-09-11 11:11:47 +03:00
Mooffie
61f4ef98b9 lib/mcconfig/paths.c: reduce scope of 'homedir' var.
To ensure that nobody uses the 'homedir' variable in the future without
initializing it first, we make it private to the function, thereby effectively
removing it.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-09-11 11:11:01 +03:00
Mooffie
92889819ea lib/mcconfig/paths.c: cleanup.
We can conclude, by reading their GLib source[1], by their documentation,
and by looking at how popular programs use them[2], that the functions
g_get_user_{config,cache,data}_dir() don't return a NULL or empty string.
So the handling of this case can go.

[1] https://git.gnome.org/browse/glib/tree/glib/gutils.c
[2] E.g., google "g_get_user_data_dir".

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-09-11 11:11:01 +03:00
Andrew Borodin
d32f123d9c doc/man/mc.1.in: fix substitution markers.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-09-11 11:11:01 +03:00
Andrew Borodin
0e22eae836 src/vfs/fish/fish.c: apply coding guidelines.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-09-11 11:11:01 +03:00
Andrew Borodin
f408e9a755 More use link_isdir().
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-09-11 11:11:01 +03:00
Andrew Borodin
6127e5aea6 Get rid of #define const_cast(). 2016-09-11 11:11:01 +03:00
Andrew Borodin
b22e376abf Fix typos. 2016-09-11 11:11:01 +03:00
Andrew Borodin
0df9d1ce0b Define NCURSES_CONST if curses library doesn't define it.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-09-11 11:11:01 +03:00
Andrew Borodin
01428beb2a (ftpfs_open_data_connection): fix enable/disable interrupt key.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-09-11 11:11:01 +03:00
Andrew Borodin
ba20fac1b3 (ftpfs_open_data_connection): fix socket leak in case of unsuccessful ftp connection.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-09-11 11:11:01 +03:00
Andrew Borodin
adc6bd83d6 (dlg_adjust_position): refactoring. 2016-09-11 11:11:01 +03:00