ncmpc-debian.git
4 years agoscreen: add GetCurrentPageMeta()
Max Kellermann [Mon, 10 Sep 2018 12:39:08 +0000 (14:39 +0200)]
screen: add GetCurrentPageMeta()

4 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

4 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().

4 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.

4 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

4 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().

4 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().

4 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

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

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

4 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

4 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

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

4 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

4 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

4 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

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

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

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

4 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

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

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

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

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

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

4 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

4 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()

4 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()

4 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()

4 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

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

4 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.

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

4 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

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

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

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

4 years 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`.

4 years agocommand: remove parameter from get_cmds_max_name_width()
Max Kellermann [Fri, 7 Sep 2018 17:00:59 +0000 (19:00 +0200)]
command: remove parameter from get_cmds_max_name_width()

The only caller will never pass an instance with different names.

4 years agocommand: remove unused function command_dump_keys()
Max Kellermann [Fri, 7 Sep 2018 16:34:22 +0000 (18:34 +0200)]
command: remove unused function command_dump_keys()

4 years agoKeyName: don't translate Fx
Max Kellermann [Fri, 7 Sep 2018 15:45:05 +0000 (17:45 +0200)]
KeyName: don't translate Fx

AFAIK this is the same name in all languages, and translators probably
don't know what "F%d" means anyway.

4 years agocommand: move key2str() to KeyName.cxx
Max Kellermann [Fri, 7 Sep 2018 15:38:01 +0000 (17:38 +0200)]
command: move key2str() to KeyName.cxx

4 years agoscreen_keydef: make command_n_commands constexpr
Max Kellermann [Fri, 7 Sep 2018 09:32:04 +0000 (11:32 +0200)]
screen_keydef: make command_n_commands constexpr

4 years agocommand: remove command_definition_t::command_t
Max Kellermann [Fri, 7 Sep 2018 09:21:57 +0000 (11:21 +0200)]
command: remove command_definition_t::command_t

This is redundant, we can simply use the index.

4 years agocommand: add static_assert on the `cmds` table size
Max Kellermann [Fri, 7 Sep 2018 09:18:08 +0000 (11:18 +0200)]
command: add static_assert on the `cmds` table size

Verify that all commands are in the table.

4 years agocommand: disable commands that are unavailable
Max Kellermann [Fri, 7 Sep 2018 09:19:18 +0000 (11:19 +0200)]
command: disable commands that are unavailable

The `command_t` values should be indexes in the `cmds` table, so we
can remove its `command_t` attribute.

4 years agocommand: reorder enum command_t according to the `cmds` table
Max Kellermann [Fri, 7 Sep 2018 09:10:26 +0000 (11:10 +0200)]
command: reorder enum command_t according to the `cmds` table

4 years agobuild/configure.py: use "debugoptimized" instead of "release"
Max Kellermann [Thu, 6 Sep 2018 18:20:11 +0000 (20:20 +0200)]
build/configure.py: use "debugoptimized" instead of "release"

Both are optimized, but "release" has no debug symbols and thus cannot
be debugged.

4 years agobuild/configure.py: use lld
Max Kellermann [Thu, 6 Sep 2018 18:19:20 +0000 (20:19 +0200)]
build/configure.py: use lld

4 years agomeson.build: fix enable_documentation check
Max Kellermann [Tue, 4 Sep 2018 11:20:21 +0000 (13:20 +0200)]
meson.build: fix enable_documentation check

4 years agoTabBar: rename print_hotkey()
Max Kellermann [Tue, 4 Sep 2018 10:10:49 +0000 (12:10 +0200)]
TabBar: rename print_hotkey()

4 years agoTitleBar: move code to TabBar.cxx
Max Kellermann [Tue, 4 Sep 2018 09:55:18 +0000 (11:55 +0200)]
TitleBar: move code to TabBar.cxx

4 years agoQueue: FindByReference() cannot fail
Max Kellermann [Tue, 4 Sep 2018 08:30:44 +0000 (10:30 +0200)]
Queue: FindByReference() cannot fail

4 years agoQueue: add ContainsUri()
Max Kellermann [Tue, 4 Sep 2018 08:27:42 +0000 (10:27 +0200)]
Queue: add ContainsUri()

4 years agoQueue: remove FindUri(mpd_song)
Max Kellermann [Tue, 4 Sep 2018 08:24:47 +0000 (10:24 +0200)]
Queue: remove FindUri(mpd_song)

This overload appears to be convenient, but it is somewhat confusing,
because there is also FindByReference().

4 years agoFileListPage: use Queue::FindIdByUri(), fixing id/position mixup
Max Kellermann [Tue, 4 Sep 2018 08:22:56 +0000 (10:22 +0200)]
FileListPage: use Queue::FindIdByUri(), fixing id/position mixup

Now really closes #27.

4 years agoQueue: add FindIdByUri()
Max Kellermann [Tue, 4 Sep 2018 08:20:04 +0000 (10:20 +0200)]
Queue: add FindIdByUri()

4 years agoQueue: rename and document the Find*() methods
Max Kellermann [Tue, 4 Sep 2018 08:01:30 +0000 (10:01 +0200)]
Queue: rename and document the Find*() methods

Clarify their meaning.  This is obviously necessary because it has led
to bug #27.  To make it even worse, an attempt to fix that bug in
commit 08f864133ccf92c5839257531dab73827dd3d148 has produced another
bug.

4 years agoRevert "Enqueue from search list goes to wrong song"
Max Kellermann [Tue, 4 Sep 2018 07:59:22 +0000 (09:59 +0200)]
Revert "Enqueue from search list goes to wrong song"

This reverts commit 08f864133ccf92c5839257531dab73827dd3d148.  The
commit causes an endless loop when deselecting a song in the database
browser.

4 years agomeson_options.txt: make "-Ddocumentation" a combo
Max Kellermann [Mon, 3 Sep 2018 21:00:08 +0000 (23:00 +0200)]
meson_options.txt: make "-Ddocumentation" a combo

4 years agodoc/meson.build: the "documentation" option affects Sphinx as well
Max Kellermann [Mon, 3 Sep 2018 21:00:28 +0000 (23:00 +0200)]
doc/meson.build: the "documentation" option affects Sphinx as well

4 years agoconf: support $XDG_CONFIG_HOME
Max Kellermann [Mon, 3 Sep 2018 20:48:41 +0000 (22:48 +0200)]
conf: support $XDG_CONFIG_HOME

Closes #24

4 years agodoc: remove stray ":command"
Max Kellermann [Mon, 3 Sep 2018 20:57:30 +0000 (22:57 +0200)]
doc: remove stray ":command"

4 years agoconf: use CamelCase and return std::string
Max Kellermann [Mon, 3 Sep 2018 20:29:51 +0000 (22:29 +0200)]
conf: use CamelCase and return std::string

4 years agoconf: pass const string to read_rc_file()
Max Kellermann [Mon, 3 Sep 2018 20:36:36 +0000 (22:36 +0200)]
conf: pass const string to read_rc_file()

4 years agoconf: make build_user_key_binding_filename() static
Max Kellermann [Mon, 3 Sep 2018 20:30:29 +0000 (22:30 +0200)]
conf: make build_user_key_binding_filename() static

4 years agoio/Path: add generic template declaration
Max Kellermann [Mon, 3 Sep 2018 20:38:51 +0000 (22:38 +0200)]
io/Path: add generic template declaration

Fixes compiler errors with some combinations of arguments.

4 years agoconf: add MakeUserConfigDirectory(), replacing check_user_conf_dir()
Max Kellermann [Mon, 3 Sep 2018 08:25:13 +0000 (10:25 +0200)]
conf: add MakeUserConfigDirectory(), replacing check_user_conf_dir()

Prepare for XDG support.

4 years agoio/Path: new library replacing g_build_filename()
Max Kellermann [Mon, 3 Sep 2018 19:23:50 +0000 (21:23 +0200)]
io/Path: new library replacing g_build_filename()

4 years agoutil/StringStrip: add "nonnull" attributes
Max Kellermann [Mon, 3 Sep 2018 19:16:21 +0000 (21:16 +0200)]
util/StringStrip: add "nonnull" attributes

4 years agoMain: keep current song in xterm title when MPD is paused
Max Kellermann [Mon, 3 Sep 2018 19:07:12 +0000 (21:07 +0200)]
Main: keep current song in xterm title when MPD is paused

4 years agoconf: add macros for configuration file names
Max Kellermann [Mon, 3 Sep 2018 08:48:38 +0000 (10:48 +0200)]
conf: add macros for configuration file names

4 years agocheck _WIN32 instead of WIN32
Max Kellermann [Mon, 3 Sep 2018 08:49:37 +0000 (10:49 +0200)]
check _WIN32 instead of WIN32

_WIN32 is the one defined by the compiler which always works, even
without including Windows headers first.

4 years agoutil/ScopeExit: new utility library
Max Kellermann [Mon, 3 Sep 2018 08:33:25 +0000 (10:33 +0200)]
util/ScopeExit: new utility library

4 years agoscreen_keydef: isolate "Error" as translatable string
Max Kellermann [Mon, 3 Sep 2018 07:56:26 +0000 (09:56 +0200)]
screen_keydef: isolate "Error" as translatable string

Eliminates two translatable strings.

4 years agoMerge branch 'master' of git://github.com/paradox-ptr/ncmpc
Max Kellermann [Mon, 3 Sep 2018 07:31:56 +0000 (09:31 +0200)]
Merge branch 'master' of git://github.com/paradox-ptr/ncmpc

4 years agomeson.build: disable `-Wformat-truncation`
Max Kellermann [Mon, 3 Sep 2018 07:09:40 +0000 (09:09 +0200)]
meson.build: disable `-Wformat-truncation`

4 years agobuild/configure.py: add clang builds
Max Kellermann [Mon, 3 Sep 2018 07:00:11 +0000 (09:00 +0200)]
build/configure.py: add clang builds

4 years agoLyricsPage: replace `switch` with ternary operator
Max Kellermann [Mon, 3 Sep 2018 07:07:07 +0000 (09:07 +0200)]
LyricsPage: replace `switch` with ternary operator

4 years agooptions: add `noreturn` attribute to option_error()
Max Kellermann [Mon, 3 Sep 2018 07:06:14 +0000 (09:06 +0200)]
options: add `noreturn` attribute to option_error()

4 years agoscreen_keydef: remove unused attribute
Max Kellermann [Mon, 3 Sep 2018 07:05:22 +0000 (09:05 +0200)]
screen_keydef: remove unused attribute

4 years agoscreen_utils: remove std::move() to allow copy elision
Max Kellermann [Mon, 3 Sep 2018 07:03:58 +0000 (09:03 +0200)]
screen_utils: remove std::move() to allow copy elision

Thanks to clang's `-Wpessimizing-move`.

4 years agoListWindow: declare as class
Max Kellermann [Mon, 3 Sep 2018 07:02:32 +0000 (09:02 +0200)]
ListWindow: declare as class

4 years agomeson.build: don't use compiler.has_argument() for linker flags
Max Kellermann [Mon, 3 Sep 2018 06:46:21 +0000 (08:46 +0200)]
meson.build: don't use compiler.has_argument() for linker flags

This doesn't work; Meson's "compiler" object doesn't verify linker
flags and the test always passes.

Instead, the caller needs to pass linker flags to the LDFLAGS
environment variable.  For example, this commit move these flags to
build/configure.py.

4 years agoEnqueue from search list goes to wrong song
paradox_ptr [Fri, 3 Aug 2018 13:54:02 +0000 (23:54 +1000)]
Enqueue from search list goes to wrong song

Closes #27

4 years agoProgressBar: fix 'progressbar-background' doc entry
Todd Zullinger [Sat, 18 Aug 2018 22:04:55 +0000 (18:04 -0400)]
ProgressBar: fix 'progressbar-background' doc entry

The 'progressbar-background' option was added in 74c9243 ("ProgressBar:
dark gray background line", 2018-02-25).  The documentation incorrectly
refers to 'progressbar'.

4 years agoSilence unitialized variable gcc warning
paradox_ptr [Wed, 1 Aug 2018 14:36:09 +0000 (00:36 +1000)]
Silence unitialized variable gcc warning

4 years agoSilence unitialized variable gcc warning
paradox_ptr [Tue, 31 Jul 2018 10:55:13 +0000 (20:55 +1000)]
Silence unitialized variable gcc warning

4 years agoMerge branch 'master' of git://github.com/Morgus/ncmpc
Max Kellermann [Tue, 10 Apr 2018 07:26:18 +0000 (09:26 +0200)]
Merge branch 'master' of git://github.com/Morgus/ncmpc

4 years agoincrement version number to 0.31
Max Kellermann [Tue, 10 Apr 2018 07:25:05 +0000 (09:25 +0200)]
increment version number to 0.31

4 years agoFix blank progressbar when colors are not in use
Aleksi Blinnikka [Mon, 9 Apr 2018 23:33:30 +0000 (02:33 +0300)]
Fix blank progressbar when colors are not in use

When moving wbkgd() call in 9c22a95 it was not conditional like it was
for others (commits 7946611 and 6b337bc), which caused progress bar to
not show.

4 years agorelease v0.30
Max Kellermann [Wed, 4 Apr 2018 08:23:50 +0000 (10:23 +0200)]
release v0.30

4 years agoNEWS: mention that ncmpc is now C++
Max Kellermann [Wed, 4 Apr 2018 08:23:44 +0000 (10:23 +0200)]
NEWS: mention that ncmpc is now C++

4 years agoNEWS: mention the chat screen crash bug fix
Max Kellermann [Wed, 4 Apr 2018 08:20:05 +0000 (10:20 +0200)]
NEWS: mention the chat screen crash bug fix

Without knowing the bug, I fixed CVE-2018-9240 in commit
1cd20d1326c716b36286369c690fba5ee546946c while refactoring code.

4 years agoQueue: clear the vector in clear()
Max Kellermann [Mon, 19 Mar 2018 10:38:17 +0000 (11:38 +0100)]
Queue: clear the vector in clear()

Fixes regression from commit bdaf506c12dfcfa39499ba4aba26d8db77aa4e7b

4 years agosong_paint: include cleanup
Max Kellermann [Mon, 19 Mar 2018 09:10:03 +0000 (10:10 +0100)]
song_paint: include cleanup

4 years agoutil/{CharUtil,StringStrip}: more GLib replacements
Max Kellermann [Mon, 19 Mar 2018 09:07:26 +0000 (10:07 +0100)]
util/{CharUtil,StringStrip}: more GLib replacements

4 years agoSongPage: use strftime() instead of g_date_strftime()
Max Kellermann [Mon, 19 Mar 2018 09:02:26 +0000 (10:02 +0100)]
SongPage: use strftime() instead of g_date_strftime()

4 years agoutil/Macros: replacement for G_N_ELEMENTS()
Max Kellermann [Mon, 19 Mar 2018 08:58:41 +0000 (09:58 +0100)]
util/Macros: replacement for G_N_ELEMENTS()

4 years agoscreen_utils: use plain C types, not GLib
Max Kellermann [Mon, 19 Mar 2018 08:53:29 +0000 (09:53 +0100)]
screen_utils: use plain C types, not GLib