screen_artist: rename to "library"
authorMax Kellermann <max@musicpd.org>
Wed, 17 Oct 2018 15:21:40 +0000 (17:21 +0200)
committerMax Kellermann <max@musicpd.org>
Wed, 17 Oct 2018 15:21:40 +0000 (17:21 +0200)
This shows a view on the music library, structured by tag values; only
the entry page shows artists.

14 files changed:
NEWS
doc/config.sample
doc/index.rst
meson.build
meson_options.txt
po/POTFILES
src/Command.cxx
src/Command.hxx
src/GlobalBindings.cxx
src/HelpPage.cxx
src/LibraryPage.cxx [moved from src/screen_artist.cxx with 97% similarity]
src/LibraryPage.hxx [moved from src/screen_artist.hxx with 87% similarity]
src/Options.cxx
src/screen_list.cxx

diff --git a/NEWS b/NEWS
index e79f8a2..6819c10 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,5 @@
 ncmpc 0.33 - not yet released
+* artist page: rename to "library"
 * fix color configuration parser bug
 * fix build failure when libpcre is not found
 * remove support for liblircclient (only liblirc)
index a11741f..2f78de2 100644 (file)
@@ -21,7 +21,7 @@
 
 ## A list of screens to cycle through when using
 ## the previous/next screen commands (tab and shift+tab).
-## names: playlist browse help artist search song keydef lyrics outputs chat
+## names: playlist browse help library search song keydef lyrics outputs chat
 #screen-list = playlist browse
 
 ## Default search mode for the search screen. The mode is an
index f2d7c52..23ef231 100644 (file)
@@ -111,7 +111,7 @@ Interface
 
 :command:`screen-list = SCREEN1 SCREEN2...` - A list of screens to
 cycle through when using the previous/next screen commands.  Valid
-choices, if enabled at compile time, are playlist, browse, artist,
+choices, if enabled at compile time, are playlist, browse, library,
 help, search, song, keydef, lyrics, outputs, and chat.
 
 :command:`search-mode = MODE` - Default search mode for the search
index fea42e7..8c274c4 100644 (file)
@@ -222,11 +222,11 @@ if enable_help_screen
   sources += ['src/HelpPage.cxx']
 endif
 
-enable_artist_screen = get_option('artist_screen') and not mini
-conf.set('ENABLE_ARTIST_SCREEN', enable_artist_screen)
-if enable_artist_screen
+enable_library_screen = get_option('library_screen') and not mini
+conf.set('ENABLE_LIBRARY_PAGE', enable_library_screen)
+if enable_library_screen
   sources += [
-    'src/screen_artist.cxx',
+    'src/LibraryPage.cxx',
     'src/TagListPage.cxx',
     'src/TagFilter.cxx',
   ]
index 2f342f2..c364f42 100644 (file)
@@ -38,9 +38,9 @@ option('help_screen', type: 'boolean',
   value: true,
   description: 'Enable the help screen')
 
-option('artist_screen', type: 'boolean',
+option('library_screen', type: 'boolean',
   value: true,
-  description: 'Enable the artist screen')
+  description: 'Enable the library screen')
 
 option('search_screen', type: 'boolean',
   value: true,
index 928b636..34b6552 100644 (file)
@@ -8,6 +8,7 @@ src/FileListPage.cxx
 src/HelpPage.cxx
 src/i18n.h
 src/KeyName.cxx
+src/LibraryPage.cxx
 src/ListWindow.cxx
 src/LyricsPage.cxx
 src/Main.cxx
@@ -16,7 +17,6 @@ src/OutputsPage.cxx
 src/player_command.cxx
 src/QueuePage.cxx
 src/save_playlist.cxx
-src/screen_artist.cxx
 src/screen_client.cxx
 src/screen.cxx
 src/screen_find.cxx
index e3747ca..e8269b6 100644 (file)
@@ -175,9 +175,9 @@ static constexpr command_definition_t cmds[] = {
 
 
        /* extra screens */
-#ifdef ENABLE_ARTIST_SCREEN
-       { "screen-artist",
-         N_("Artist screen") },
+#ifdef ENABLE_LIBRARY_PAGE
+       { "library-page",
+         N_("Library page") },
 #endif
 #ifdef ENABLE_SEARCH_SCREEN
        { "screen-search",
@@ -264,5 +264,11 @@ get_key_command_from_name(const char *name)
                if (strcmp(name, cmds[i].name) == 0)
                        return Command(i);
 
+#ifdef ENABLE_LIBRARY_PAGE
+       /* compatibility with 0.32 and older */
+       if (strcmp(name, "screen-artist") == 0)
+               return Command::LIBRARY_PAGE;
+#endif
+
        return Command::NONE;
 }
index 218b235..4886c06 100644 (file)
@@ -104,8 +104,8 @@ enum class Command : unsigned {
        LIST_JUMP,
 
        /* extra screens */
-#ifdef ENABLE_ARTIST_SCREEN
-       SCREEN_ARTIST,
+#ifdef ENABLE_LIBRARY_PAGE
+       LIBRARY_PAGE,
 #endif
 #ifdef ENABLE_SEARCH_SCREEN
        SCREEN_SEARCH,
index 8049ed2..1ac4a9f 100644 (file)
@@ -132,7 +132,7 @@ static KeyBindings global_key_bindings{{{
 
 
        /* extra screens */
-#ifdef ENABLE_ARTIST_SCREEN
+#ifdef ENABLE_LIBRARY_PAGE
        {'4', F4},
 #endif
 #ifdef ENABLE_SEARCH_SCREEN
index b24ff3c..75e97cb 100644 (file)
@@ -81,8 +81,8 @@ static constexpr HelpRow help_text[] = {
        Command::SCREEN_HELP,
        Command::SCREEN_PLAY,
        Command::SCREEN_FILE,
-#ifdef ENABLE_ARTIST_SCREEN
-       Command::SCREEN_ARTIST,
+#ifdef ENABLE_LIBRARY_PAGE
+       Command::LIBRARY_PAGE,
 #endif
 #ifdef ENABLE_SEARCH_SCREEN
        Command::SCREEN_SEARCH,
similarity index 97%
rename from src/screen_artist.cxx
rename to src/LibraryPage.cxx
index 03f05f4..d2c8ffe 100644 (file)
@@ -17,7 +17,7 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-#include "screen_artist.hxx"
+#include "LibraryPage.hxx"
 #include "TagListPage.hxx"
 #include "PageMeta.hxx"
 #include "screen_status.hxx"
@@ -189,7 +189,7 @@ ArtistBrowserPage::OpenSongList(struct mpdclient &c, TagFilter &&filter)
 }
 
 static std::unique_ptr<Page>
-screen_artist_init(ScreenManager &_screen, WINDOW *w, Size size)
+InitLibraryPage(ScreenManager &_screen, WINDOW *w, Size size)
 {
        return std::make_unique<ArtistBrowserPage>(_screen, w, size);
 }
@@ -296,9 +296,9 @@ ArtistBrowserPage::OnCommand(struct mpdclient &c, Command cmd)
        return false;
 }
 
-const PageMeta screen_artist = {
-       "artist",
-       N_("Artist"),
-       Command::SCREEN_ARTIST,
-       screen_artist_init,
+const PageMeta library_page = {
+       "library",
+       N_("Library"),
+       Command::LIBRARY_PAGE,
+       InitLibraryPage,
 };
similarity index 87%
rename from src/screen_artist.hxx
rename to src/LibraryPage.hxx
index b220c8b..12bf082 100644 (file)
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-#ifndef NCMPC_SCREEN_ARTIST_H
-#define NCMPC_SCREEN_ARTIST_H
+#ifndef NCMPC_LIBRARY_PAGE_HXX
+#define NCMPC_LIBRARY_PAGE_HXX
 
 #include "config.h"
 
-#ifdef ENABLE_ARTIST_SCREEN
+#ifdef ENABLE_LIBRARY_PAGE
 struct PageMeta;
-extern const PageMeta screen_artist;
+extern const PageMeta library_page;
 #endif
 
 #endif
index 5cfb2f5..9284319 100644 (file)
@@ -174,7 +174,7 @@ handle_option(int c, const char *arg)
 #ifdef HAVE_GETMOUSE
                     " getmouse"
 #endif
-#ifdef ENABLE_ARTIST_SCREEN
+#ifdef ENABLE_LIBRARY_PAGE
                     " artist-screen"
 #endif
 #ifdef ENABLE_HELP_SCREEN
index 676d163..d71a609 100644 (file)
@@ -23,7 +23,7 @@
 #include "HelpPage.hxx"
 #include "QueuePage.hxx"
 #include "FileBrowserPage.hxx"
-#include "screen_artist.hxx"
+#include "LibraryPage.hxx"
 #include "SearchPage.hxx"
 #include "SongPage.hxx"
 #include "screen_keydef.hxx"
@@ -40,8 +40,8 @@ static const PageMeta *const screens[] = {
 #endif
        &screen_queue,
        &screen_browse,
-#ifdef ENABLE_ARTIST_SCREEN
-       &screen_artist,
+#ifdef ENABLE_LIBRARY_PAGE
+       &library_page,
 #endif
 #ifdef ENABLE_SEARCH_SCREEN
        &screen_search,
@@ -78,6 +78,12 @@ screen_lookup_name(const char *name) noexcept
                if (strcmp(name, i->name) == 0)
                        return i;
 
+#ifdef ENABLE_LIBRARY_PAGE
+       /* compatibility with 0.32 and older */
+       if (strcmp(name, "artist") == 0)
+               return &library_page;
+#endif
+
        return nullptr;
 }