From e8816552f6adc2bb458860759bd15a31b7d9d0d1 Mon Sep 17 00:00:00 2001 From: Christian Soffke Date: Tue, 22 Nov 2022 21:03:19 +0100 Subject: Offer choice of default browsers The database or playlist catalogue can now be set as the browser that is launched when pressing ACTION_WPS_BROWSE on the WPS, unless another browser has more recently been opened. Previously you'd always have to exit the File Browser first, after the player had been restarted, which is annoying for users who prefer the database. The playlist catalogue has become part of the MRU browser list, so pressing ACTION_WPS_BROWSE after selecting a track from a playlist in the playlist catalogue will now take you back there. Settings menus have been slightly restructured. - Eliminated "Set WPS Context Plugin" and "Hotkey" menus from the General menu - Added "What's Playing Screen" menu in Settings-General with option for setting default browser. The "WPS Hotkey" and "WPS Context Plugin" menu options have been moved to this menu. - "File Browser Hotkey" is now part of the File View menu, which means it is accessible from the browser's context menu as well. Overview of resulting menu structure in Settings->General: What's Playing Screen Default Browser WPS Hotkey Set WPS Context Plugin File View (...) File Browser Hotkey Change-Id: Iaa3619a791c20ce3562a1efd2cf90c72933b729a --- apps/root_menu.c | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) (limited to 'apps/root_menu.c') diff --git a/apps/root_menu.c b/apps/root_menu.c index e606d5cd68..7c75b12586 100644 --- a/apps/root_menu.c +++ b/apps/root_menu.c @@ -900,9 +900,25 @@ static int root_menu_setup_screens(void) return new_screen; } +static int browser_default(void) +{ + switch (global_settings.browser_default) + { +#ifdef HAVE_TAGCACHE + case BROWSER_DEFAULT_DB: + return GO_TO_DBBROWSER; +#endif + case BROWSER_DEFAULT_PL_CAT: + return GO_TO_PLAYLISTS_SCREEN; + case BROWSER_DEFAULT_FILES: + default: + return GO_TO_FILEBROWSER; + } +} + void root_menu(void) { - int previous_browser = GO_TO_FILEBROWSER; + int previous_browser = browser_default(); int selected = 0; int shortcut_origin = GO_TO_ROOT; @@ -932,12 +948,13 @@ void root_menu(void) last_screen = GO_TO_ROOT; break; #ifdef HAVE_TAGCACHE - case GO_TO_FILEBROWSER: case GO_TO_DBBROWSER: +#endif + case GO_TO_FILEBROWSER: + case GO_TO_PLAYLISTS_SCREEN: previous_browser = next_screen; goto load_next_screen; break; -#endif /* With !HAVE_TAGCACHE previous_browser is always GO_TO_FILEBROWSER */ #if CONFIG_TUNER case GO_TO_WPS: case GO_TO_FM: @@ -1030,7 +1047,8 @@ void root_menu(void) last_screen = GO_TO_PLUGIN; } } - previous_browser = (next_screen != GO_TO_WPS) ? GO_TO_FILEBROWSER : GO_TO_PLUGIN; + previous_browser = (next_screen != GO_TO_WPS) ? browser_default() : + GO_TO_PLUGIN; break; } default: -- cgit v1.2.3