ncmpc-debian.git
21 months 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()

21 months 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()

21 months 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.

21 months 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()

21 months 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()

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

21 months 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

21 months 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

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

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

21 months 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

21 months 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`?

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

21 months 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()

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

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

21 months 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.

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

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

21 months 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

21 months 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

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

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

21 months 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

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

21 months 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.

21 months 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.

21 months 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

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

21 months 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

21 months 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?

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

21 months 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()`.

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

21 months 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

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

21 months 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

21 months 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().

21 months 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

21 months 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/

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

21 months 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

21 months 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/

21 months 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

21 months 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

21 months 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/

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

21 months 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

21 months 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

21 months 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] "

21 months 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

21 months 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

21 months 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.

21 months 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")

21 months 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

21 months 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

21 months 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

21 months 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.

21 months 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...

21 months 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.

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

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

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

21 months 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

21 months 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().

21 months 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.

21 months 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

21 months 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().

21 months 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().

21 months 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

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

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

21 months 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

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

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

21 months 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

21 months 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

21 months 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

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

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

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

22 months 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

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

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

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

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

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

22 months 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

22 months 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()

22 months 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()

22 months 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()

22 months 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

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

22 months 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.

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

22 months 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

22 months agocommand: remove useless sentinel element
Max Kellermann [Fri, 7 Sep 2018 17:06:32 +0000 (19:06 +0200)]
command: remove useless sentinel element

22 months agocommand: use range-based `for`
Max Kellermann [Fri, 7 Sep 2018 17:06:22 +0000 (19:06 +0200)]
command: use range-based `for`

22 months agoGlobalBindings: remove useless sentinel element
Max Kellermann [Fri, 7 Sep 2018 16:38:09 +0000 (18:38 +0200)]
GlobalBindings: remove useless sentinel element

22 months agocommand: split `cmds`, move key bindings table to Bindings.cxx
Max Kellermann [Fri, 7 Sep 2018 09:09:35 +0000 (11:09 +0200)]
command: split `cmds`, move key bindings table to Bindings.cxx

The `cmds` array can now be `constexpr`.