ncmpc-debian.git
2 years agowreadln: use plain `int` instead of `gint`
Max Kellermann [Wed, 12 Sep 2018 18:32:27 +0000 (20:32 +0200)]
wreadln: use plain `int` instead of `gint`

2 years agoutil/LocaleString: replacement for locale_width() using wcswidth()
Max Kellermann [Wed, 12 Sep 2018 18:18:18 +0000 (20:18 +0200)]
util/LocaleString: replacement for locale_width() using wcswidth()

2 years agowreadln: eliminate next_char_size()
Max Kellermann [Wed, 12 Sep 2018 18:06:25 +0000 (20:06 +0200)]
wreadln: eliminate next_char_size()

2 years agowreadln: optimize cursor_move_left() using std::mbrlen()
Max Kellermann [Wed, 12 Sep 2018 18:05:40 +0000 (20:05 +0200)]
wreadln: optimize cursor_move_left() using std::mbrlen()

2 years agowreadln: use locale_width() in byte_to_screen()
Max Kellermann [Wed, 12 Sep 2018 17:50:25 +0000 (19:50 +0200)]
wreadln: use locale_width() in byte_to_screen()

2 years agowreadln: use CharSizeMB() in next_char_size()
Max Kellermann [Wed, 12 Sep 2018 17:43:47 +0000 (19:43 +0200)]
wreadln: use CharSizeMB() in next_char_size()

2 years agoutil/StringUTF8: add missing `config.h` include
Max Kellermann [Wed, 12 Sep 2018 17:56:46 +0000 (19:56 +0200)]
util/StringUTF8: add missing `config.h` include

All `#ifdefs` didn't work because the macros were not defined.

2 years agowreadln: use locale_width() in right_align_bytes()
Max Kellermann [Wed, 12 Sep 2018 17:38:34 +0000 (19:38 +0200)]
wreadln: use locale_width() in right_align_bytes()

2 years agowreadln: optimize character skipping in right_align_bytes()
Max Kellermann [Wed, 12 Sep 2018 17:24:45 +0000 (19:24 +0200)]
wreadln: optimize character skipping in right_align_bytes()

2 years agoCompiler.h: move to util/
Max Kellermann [Wed, 12 Sep 2018 17:25:01 +0000 (19:25 +0200)]
Compiler.h: move to util/

2 years agowreadln: use `std::string` in various helper functions
Max Kellermann [Wed, 12 Sep 2018 16:16:11 +0000 (18:16 +0200)]
wreadln: use `std::string` in various helper functions

2 years agowreadln: simplify end-of-string check
Max Kellermann [Wed, 12 Sep 2018 16:38:23 +0000 (18:38 +0200)]
wreadln: simplify end-of-string check

2 years agowreadln: add `pure` attributes
Max Kellermann [Wed, 12 Sep 2018 16:15:38 +0000 (18:15 +0200)]
wreadln: add `pure` attributes

2 years agoinclude cleanup
Max Kellermann [Wed, 12 Sep 2018 15:54:22 +0000 (17:54 +0200)]
include cleanup

2 years agoBasicMarquee: use replace_utf8_to_locale() to avoid one string copy
Max Kellermann [Wed, 12 Sep 2018 16:02:08 +0000 (18:02 +0200)]
BasicMarquee: use replace_utf8_to_locale() to avoid one string copy

2 years agocharset: really free the `replace_*()` source pointer
Max Kellermann [Wed, 12 Sep 2018 16:06:18 +0000 (18:06 +0200)]
charset: really free the `replace_*()` source pointer

This memory leak was added 9 years ago in the initial commit that
added these functions (87e8d7f3e8fa5a005c2aae06b6e00c4ba47d0c7e).
D'oh!

Maybe it's really time to migrate away from the C memory leak hell and
use `std::string`?

2 years agofilelist: use CollateUTF8()
Max Kellermann [Wed, 12 Sep 2018 15:56:20 +0000 (17:56 +0200)]
filelist: use CollateUTF8()

2 years agoutil/StringUTF8: use g_utf8_collate()
Max Kellermann [Wed, 12 Sep 2018 15:56:31 +0000 (17:56 +0200)]
util/StringUTF8: use g_utf8_collate()

2 years agoncfix.h: remove obsolete header
Max Kellermann [Wed, 12 Sep 2018 15:50:24 +0000 (17:50 +0200)]
ncfix.h: remove obsolete header

2 years agohscroll: use enum Style
Max Kellermann [Wed, 12 Sep 2018 15:47:28 +0000 (17:47 +0200)]
hscroll: use enum Style

2 years agoStyles: derive enum from `unsigned`
Max Kellermann [Wed, 12 Sep 2018 15:46:17 +0000 (17:46 +0200)]
Styles: derive enum from `unsigned`

Allows forward declarations.

2 years agoStyles: rename `colors` to `styles`
Max Kellermann [Wed, 12 Sep 2018 15:42:08 +0000 (17:42 +0200)]
Styles: rename `colors` to `styles`

2 years agoListWindow: include cleanup
Max Kellermann [Wed, 12 Sep 2018 15:45:02 +0000 (17:45 +0200)]
ListWindow: include cleanup

2 years agoCustomColors: fix off-by-one bug
Max Kellermann [Wed, 12 Sep 2018 15:43:53 +0000 (17:43 +0200)]
CustomColors: fix off-by-one bug

2 years agoStyles: convert to strictly-typed enum
Max Kellermann [Wed, 12 Sep 2018 14:51:41 +0000 (16:51 +0200)]
Styles: convert to strictly-typed enum

2 years agomeson.build: repair option "colors"
Max Kellermann [Wed, 12 Sep 2018 14:37:41 +0000 (16:37 +0200)]
meson.build: repair option "colors"

2 years agoStyles: eliminate duplicate cast
Max Kellermann [Wed, 12 Sep 2018 14:41:12 +0000 (16:41 +0200)]
Styles: eliminate duplicate cast

2 years agoStyles: adjust NamedColor constructor
Max Kellermann [Wed, 12 Sep 2018 14:40:32 +0000 (16:40 +0200)]
Styles: adjust NamedColor constructor

Broken since commit 5ce464cc044461489c9f1f512be86c33ed65da19

2 years agocolors: rename to "style"
Max Kellermann [Wed, 12 Sep 2018 12:54:28 +0000 (14:54 +0200)]
colors: rename to "style"

2 years agocolors: split color and attributes
Max Kellermann [Wed, 12 Sep 2018 13:03:35 +0000 (15:03 +0200)]
colors: split color and attributes

Mixing both into one variable works only because the implicit `short`
cast in the `init_pair()` call discards the attribute bits.  But it's
not portable and not reliable.

2 years agocolors: set `COLOR_NONE=-1`
Max Kellermann [Wed, 12 Sep 2018 13:38:08 +0000 (15:38 +0200)]
colors: set `COLOR_NONE=-1`

This is the natural value which is also understood by `init_pair()`,
and we can omit the check.

2 years agocolors: convert NamedColor::mono to attr_t
Max Kellermann [Wed, 12 Sep 2018 12:50:49 +0000 (14:50 +0200)]
colors: convert NamedColor::mono to attr_t

2 years agocolors: make colors_str2color() static
Max Kellermann [Wed, 12 Sep 2018 12:49:11 +0000 (14:49 +0200)]
colors: make colors_str2color() static

2 years agocolors: move custom colors to CustomColors.cxx
Max Kellermann [Wed, 12 Sep 2018 12:33:22 +0000 (14:33 +0200)]
colors: move custom colors to CustomColors.cxx

2 years agocolors: pass color number to `colors_define()`
Max Kellermann [Wed, 12 Sep 2018 12:35:12 +0000 (14:35 +0200)]
colors: pass color number to `colors_define()`

`parse_color_definition()` has already parsed the color name, so why
parse it again?

2 years agoListWindow: add missing include
Max Kellermann [Wed, 12 Sep 2018 12:49:46 +0000 (14:49 +0200)]
ListWindow: add missing include

2 years agoconf: allow only real color numbers for `colordef`
Max Kellermann [Wed, 12 Sep 2018 12:29:52 +0000 (14:29 +0200)]
conf: allow only real color numbers for `colordef`

`colors_str2color()` returns a color number mixed with ncurses
attributes, which is impossible to use with `init_color()`.

2 years agoBasicColors: add ParseColorNameOrNumber()
Max Kellermann [Wed, 12 Sep 2018 12:28:49 +0000 (14:28 +0200)]
BasicColors: add ParseColorNameOrNumber()

2 years agocolors: refactor COLOR_* parser to array in BasicColors.cxx
Max Kellermann [Wed, 12 Sep 2018 11:39:48 +0000 (13:39 +0200)]
colors: refactor COLOR_* parser to array in BasicColors.cxx

2 years agooptions: enable colors by default
Max Kellermann [Tue, 11 Sep 2018 21:12:52 +0000 (23:12 +0200)]
options: enable colors by default

2 years agocolors: use `false` instead of `0` for `bool` variable
Max Kellermann [Tue, 11 Sep 2018 21:11:52 +0000 (23:11 +0200)]
colors: use `false` instead of `0` for `bool` variable

2 years agohscroll: don't restore old attributes/colors in Paint()
Max Kellermann [Tue, 11 Sep 2018 20:55:58 +0000 (22:55 +0200)]
hscroll: don't restore old attributes/colors in Paint()

All explicit callers (other than `hscroll::TimerCallback()`) should be
prepared for the wattr_set() call inside Paint().

2 years agocolors: remove unnecessary wattr_get() check
Max Kellermann [Tue, 11 Sep 2018 20:51:13 +0000 (22:51 +0200)]
colors: remove unnecessary wattr_get() check

2 years agoTranslated using Weblate (Norwegian Bokmål)
Allan Nordhøy [Tue, 11 Sep 2018 05:15:28 +0000 (05:15 +0000)]
Translated using Weblate (Norwegian Bokmål)

Currently translated at 94.2% (260 of 276 strings)

Translation: Ncmpc/Translations
Translate-URL: https://hosted.weblate.org/projects/ncmpc/translations/nb/

2 years agoQueuePage: add "pure" attribute
Max Kellermann [Mon, 10 Sep 2018 18:35:00 +0000 (20:35 +0200)]
QueuePage: add "pure" attribute

2 years agoMerge branch 'master' of https://hosted.weblate.org/git/ncmpc/translations
Max Kellermann [Mon, 10 Sep 2018 18:18:21 +0000 (20:18 +0200)]
Merge branch 'master' of https://hosted.weblate.org/git/ncmpc/translations

2 years agoTranslated using Weblate (German)
Max Kellermann [Mon, 10 Sep 2018 18:13:16 +0000 (18:13 +0000)]
Translated using Weblate (German)

Currently translated at 87.6% (242 of 276 strings)

Translation: Ncmpc/Translations
Translate-URL: https://hosted.weblate.org/projects/ncmpc/translations/de/

2 years agoREADME.rst: mention the Meson 0.47 requirement
Max Kellermann [Mon, 10 Sep 2018 18:11:47 +0000 (20:11 +0200)]
README.rst: mention the Meson 0.47 requirement

2 years agoMerge branch 'master' of https://hosted.weblate.org/git/ncmpc/translations
Max Kellermann [Mon, 10 Sep 2018 15:06:10 +0000 (17:06 +0200)]
Merge branch 'master' of https://hosted.weblate.org/git/ncmpc/translations

2 years agoTranslated using Weblate (Norwegian Bokmål)
Allan Nordhøy [Mon, 10 Sep 2018 02:08:30 +0000 (02:08 +0000)]
Translated using Weblate (Norwegian Bokmål)

Currently translated at 95.6% (265 of 277 strings)

Translation: Ncmpc/Translations
Translate-URL: https://hosted.weblate.org/projects/ncmpc/translations/nb/

2 years agoREADME.rst: add Weblate link
Max Kellermann [Mon, 10 Sep 2018 15:01:10 +0000 (17:01 +0200)]
README.rst: add Weblate link

2 years agopo: update ncmpc.pot and *.po
Max Kellermann [Mon, 10 Sep 2018 14:34:00 +0000 (16:34 +0200)]
po: update ncmpc.pot and *.po

2 years agopo: update POTFILES
Max Kellermann [Mon, 10 Sep 2018 14:33:15 +0000 (16:33 +0200)]
po: update POTFILES

Generated with:

 git grep --files-with-matches '_("'|sort --ignore-case

2 years agoscreen_utils: don't translate "%s [%s/%s] "
Max Kellermann [Mon, 10 Sep 2018 14:56:58 +0000 (16:56 +0200)]
screen_utils: don't translate "%s [%s/%s] "

2 years agoscreen_artist: move %s out of translated string
Max Kellermann [Mon, 10 Sep 2018 14:52:03 +0000 (16:52 +0200)]
screen_artist: move %s out of translated string

2 years agoscreen_client: remove trailing ellipsis from message
Max Kellermann [Mon, 10 Sep 2018 14:50:07 +0000 (16:50 +0200)]
screen_client: remove trailing ellipsis from message

2 years agoMain: remove "press K for the key editor" message
Max Kellermann [Mon, 10 Sep 2018 14:43:04 +0000 (16:43 +0200)]
Main: remove "press K for the key editor" message

This hot key is already visible at the top.

2 years agoMain: use screen_status_message() instead of screen_status_printf("%s")
Max Kellermann [Mon, 10 Sep 2018 14:41:18 +0000 (16:41 +0200)]
Main: use screen_status_message() instead of screen_status_printf("%s")

2 years agoMain: remove "Press q to abort" from "Connecting..." string
Max Kellermann [Mon, 10 Sep 2018 14:40:29 +0000 (16:40 +0200)]
Main: remove "Press q to abort" from "Connecting..." string

2 years agoLyricsPage: move trailing "(%d)" out of translated string
Max Kellermann [Mon, 10 Sep 2018 14:39:15 +0000 (16:39 +0200)]
LyricsPage: move trailing "(%d)" out of translated string

2 years agoFileListPage: remove trailing ellipsis from message
Max Kellermann [Mon, 10 Sep 2018 14:37:23 +0000 (16:37 +0200)]
FileListPage: remove trailing ellipsis from message

2 years agorequire MPD 0.19
Max Kellermann [Mon, 10 Sep 2018 14:34:36 +0000 (16:34 +0200)]
require MPD 0.19

MPD 0.19 was released in 2014, and it appears reasonable to cut
support for older versions.  This allows removing a few conditionals.

2 years agoTitleBar: re-add option `welcome-screen-list`
Max Kellermann [Mon, 10 Sep 2018 13:18:11 +0000 (15:18 +0200)]
TitleBar: re-add option `welcome-screen-list`

For some users, the tabbed list may not be useful (e.g. blind users),
so I revert part of the previous commit and just make the option
permanent.  The option's name doesn't fit so well anymore now...

2 years agoalways show the screen list at the top
Max Kellermann [Mon, 10 Sep 2018 13:02:21 +0000 (15:02 +0200)]
always show the screen list at the top

Obsoletes configuration option `welcome-screen-list` and closes #34.

2 years agoTabBar: center-align tab label
Max Kellermann [Mon, 10 Sep 2018 13:01:45 +0000 (15:01 +0200)]
TabBar: center-align tab label

2 years agoTabBar: highlight the current page
Max Kellermann [Mon, 10 Sep 2018 12:39:51 +0000 (14:39 +0200)]
TabBar: highlight the current page

2 years agoscreen: add GetCurrentPageMeta()
Max Kellermann [Mon, 10 Sep 2018 12:39:08 +0000 (14:39 +0200)]
screen: add GetCurrentPageMeta()

2 years agoTabBar: use use `screens` array instead of hard-coding pages
Max Kellermann [Mon, 10 Sep 2018 12:35:02 +0000 (14:35 +0200)]
TabBar: use use `screens` array instead of hard-coding pages

2 years agoPageMeta: add `title` attribute
Max Kellermann [Mon, 10 Sep 2018 12:24:03 +0000 (14:24 +0200)]
PageMeta: add `title` attribute

Will be used by PaintTabBar().

2 years agoi18n: add gettext() fake macro
Max Kellermann [Mon, 10 Sep 2018 12:26:00 +0000 (14:26 +0200)]
i18n: add gettext() fake macro

Use `_()` only for literals.

2 years agoSongPage: use locale_width() for translated strings
Max Kellermann [Mon, 10 Sep 2018 12:28:10 +0000 (14:28 +0200)]
SongPage: use locale_width() for translated strings

2 years agoPageMeta: add Command attribute
Max Kellermann [Mon, 10 Sep 2018 12:05:43 +0000 (14:05 +0200)]
PageMeta: add Command attribute

Look up the command in the page table which saves some code in
ScreenManager::OnCommand().

2 years agoscreen_list: reorder list, same as in TabBar.cxx
Max Kellermann [Mon, 10 Sep 2018 12:03:36 +0000 (14:03 +0200)]
screen_list: reorder list, same as in TabBar.cxx

Prepare to use this list as source for PaintTabBar().

2 years agoscreen_interface: rename struct screen_functions to PageMeta
Max Kellermann [Mon, 10 Sep 2018 11:21:52 +0000 (13:21 +0200)]
screen_interface: rename struct screen_functions to PageMeta

2 years agoscreen_list: include cleanup
Max Kellermann [Mon, 10 Sep 2018 11:53:44 +0000 (13:53 +0200)]
screen_list: include cleanup

2 years agoscreen_list: add "pure" attribute
Max Kellermann [Mon, 10 Sep 2018 11:54:04 +0000 (13:54 +0200)]
screen_list: add "pure" attribute

2 years ago{Artist,Album}ListPage: move CompareUTF8() to util/StringUTF8.cxx
Max Kellermann [Mon, 10 Sep 2018 11:49:42 +0000 (13:49 +0200)]
{Artist,Album}ListPage: move CompareUTF8() to util/StringUTF8.cxx

2 years ago{Artist,Album}ListPage: include cleanup
Max Kellermann [Mon, 10 Sep 2018 11:24:30 +0000 (13:24 +0200)]
{Artist,Album}ListPage: include cleanup

2 years agoutil/StringUTF8: add "const" attribute
Max Kellermann [Mon, 10 Sep 2018 11:46:57 +0000 (13:46 +0200)]
util/StringUTF8: add "const" attribute

2 years agocharset: move utf8_width() to util/StringUTF8.cxx
Max Kellermann [Mon, 10 Sep 2018 11:39:08 +0000 (13:39 +0200)]
charset: move utf8_width() to util/StringUTF8.cxx

2 years agoscreen_keydef: add KeyBinding pointer to class CommandKeysPage
Max Kellermann [Mon, 10 Sep 2018 09:46:49 +0000 (11:46 +0200)]
screen_keydef: add KeyBinding pointer to class CommandKeysPage

2 years agoscreen_keydef: remove redundant "cmd_index" parameters
Max Kellermann [Mon, 10 Sep 2018 10:00:49 +0000 (12:00 +0200)]
screen_keydef: remove redundant "cmd_index" parameters

2 years agoBindings: add method GetKeyCount()
Max Kellermann [Mon, 10 Sep 2018 09:33:34 +0000 (11:33 +0200)]
Bindings: add method GetKeyCount()

2 years agoCommand: include cleanup
Max Kellermann [Fri, 7 Sep 2018 22:12:47 +0000 (00:12 +0200)]
Command: include cleanup

2 years agoCommand: remove unused macro
Max Kellermann [Fri, 7 Sep 2018 22:11:33 +0000 (00:11 +0200)]
Command: remove unused macro

2 years agoCommand: convert to strictly-typed enum
Max Kellermann [Fri, 7 Sep 2018 21:55:49 +0000 (23:55 +0200)]
Command: convert to strictly-typed enum

2 years agocommand: rename to Command.?xx
Max Kellermann [Fri, 7 Sep 2018 21:54:28 +0000 (23:54 +0200)]
command: rename to Command.?xx

2 years agocommand: remove unnecessary #ifdef
Max Kellermann [Fri, 7 Sep 2018 21:53:02 +0000 (23:53 +0200)]
command: remove unnecessary #ifdef

2 years agocommand: include cleanup
Max Kellermann [Fri, 7 Sep 2018 21:51:42 +0000 (23:51 +0200)]
command: include cleanup

2 years agoGlobalBindings: include cleanup
Max Kellermann [Fri, 7 Sep 2018 21:51:14 +0000 (23:51 +0200)]
GlobalBindings: include cleanup

2 years agoBindings: include cleanup
Max Kellermann [Fri, 7 Sep 2018 21:49:34 +0000 (23:49 +0200)]
Bindings: include cleanup

2 years agoBindings: use IsAlphaNumericASCII() instead of ctype.h
Max Kellermann [Fri, 7 Sep 2018 21:49:08 +0000 (23:49 +0200)]
Bindings: use IsAlphaNumericASCII() instead of ctype.h

2 years agoBindings: move code to KeyBinding::HasKey()
Max Kellermann [Fri, 7 Sep 2018 21:44:00 +0000 (23:44 +0200)]
Bindings: move code to KeyBinding::HasKey()

2 years agoBindings: move code to KeyBinding::SetKey()
Max Kellermann [Fri, 7 Sep 2018 21:42:45 +0000 (23:42 +0200)]
Bindings: move code to KeyBinding::SetKey()

2 years agoBindings: move code to KeyBinding::WriteToFile()
Max Kellermann [Fri, 7 Sep 2018 21:32:09 +0000 (23:32 +0200)]
Bindings: move code to KeyBinding::WriteToFile()

2 years agoBindings: add struct KeyBindings, array of struct KeyBinding
Max Kellermann [Fri, 7 Sep 2018 17:10:27 +0000 (19:10 +0200)]
Bindings: add struct KeyBindings, array of struct KeyBinding

2 years agoBindings: use range-based `for`
Max Kellermann [Fri, 7 Sep 2018 17:19:20 +0000 (19:19 +0200)]
Bindings: use range-based `for`

2 years agoBindings: remove the unused `conflict` attribute
Max Kellermann [Fri, 7 Sep 2018 17:22:34 +0000 (19:22 +0200)]
Bindings: remove the unused `conflict` attribute

Nobody needs a write-only attribute.

2 years agoBindings: use std::array
Max Kellermann [Fri, 7 Sep 2018 17:16:21 +0000 (19:16 +0200)]
Bindings: use std::array

2 years agoBindings: remove the assign_keys() return value
Max Kellermann [Fri, 7 Sep 2018 17:15:18 +0000 (19:15 +0200)]
Bindings: remove the assign_keys() return value