1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Christian Soffke 2022-11-22 21:03:19 +01:00
parent 3ce3b102dd
commit e8816552f6
13 changed files with 134 additions and 42 deletions

View file

@ -16683,3 +16683,31 @@
*: "Quick (Ignore Directory Cache)" *: "Quick (Ignore Directory Cache)"
</voice> </voice>
</phrase> </phrase>
<phrase>
id: LANG_WPS
desc: in Settings
user: core
<source>
*: "What's Playing Screen"
</source>
<dest>
*: "What's Playing Screen"
</dest>
<voice>
*: "What's Playing Screen"
</voice>
</phrase>
<phrase>
id: LANG_DEFAULT_BROWSER
desc: in Settings
user: core
<source>
*: "Default Browser"
</source>
<dest>
*: "Default Browser"
</dest>
<voice>
*: "Default Browser"
</voice>
</phrase>

View file

@ -191,6 +191,9 @@ MENUITEM_SETTING(dirfilter, &global_settings.dirfilter, NULL);
MENUITEM_SETTING(show_filename_ext, &global_settings.show_filename_ext, NULL); MENUITEM_SETTING(show_filename_ext, &global_settings.show_filename_ext, NULL);
MENUITEM_SETTING(browse_current, &global_settings.browse_current, NULL); MENUITEM_SETTING(browse_current, &global_settings.browse_current, NULL);
MENUITEM_SETTING(show_path_in_browser, &global_settings.show_path_in_browser, NULL); MENUITEM_SETTING(show_path_in_browser, &global_settings.show_path_in_browser, NULL);
#ifdef HAVE_HOTKEY
MENUITEM_SETTING(hotkey_tree_item, &global_settings.hotkey_tree, NULL);
#endif
static int clear_start_directory(void) static int clear_start_directory(void)
{ {
path_append(global_settings.start_directory, PATH_ROOTSTR, path_append(global_settings.start_directory, PATH_ROOTSTR,
@ -229,6 +232,9 @@ MAKE_MENU(file_menu, ID2P(LANG_FILE), filemenu_callback, Icon_file_view_menu,
&dirfilter, &show_filename_ext, &browse_current, &dirfilter, &show_filename_ext, &browse_current,
&show_path_in_browser, &show_path_in_browser,
&clear_start_directory_item &clear_start_directory_item
#ifdef HAVE_HOTKEY
,&hotkey_tree_item
#endif
); );
static int filemenu_callback(int action, static int filemenu_callback(int action,
const struct menu_item_ex *this_item, const struct menu_item_ex *this_item,
@ -776,14 +782,24 @@ MENUITEM_FUNCTION(wps_set_context_plugin, 0,
/***********************************/ /***********************************/
/***********************************/ /***********************************/
/* HOTKEY MENU */ /* WPS Settings MENU */
MENUITEM_SETTING(browser_default,
&global_settings.browser_default, NULL);
#ifdef HAVE_HOTKEY #ifdef HAVE_HOTKEY
MENUITEM_SETTING(hotkey_wps_item, &global_settings.hotkey_wps, NULL); MENUITEM_SETTING(hotkey_wps_item, &global_settings.hotkey_wps, NULL);
MENUITEM_SETTING(hotkey_tree_item, &global_settings.hotkey_tree, NULL); #endif
MAKE_MENU(hotkey_menu, ID2P(LANG_HOTKEY), 0, Icon_NOICON,
&hotkey_wps_item, &hotkey_tree_item); MAKE_MENU(wps_settings, ID2P(LANG_WPS), 0, Icon_Playback_menu
#endif /*have_hotkey */ ,&browser_default
/* HOTKEY MENU */ #ifdef HAVE_HOTKEY
,&hotkey_wps_item
#endif
,&wps_set_context_plugin
);
/* WPS Settings MENU */
/***********************************/ /***********************************/
@ -797,6 +813,7 @@ MENUITEM_FUNCTION_W_PARAM(browse_langs, 0, ID2P(LANG_LANGUAGE),
MAKE_MENU(settings_menu_item, ID2P(LANG_GENERAL_SETTINGS), 0, MAKE_MENU(settings_menu_item, ID2P(LANG_GENERAL_SETTINGS), 0,
Icon_General_settings_menu, Icon_General_settings_menu,
&wps_settings,
&playlist_settings, &file_menu, &playlist_settings, &file_menu,
#ifdef HAVE_TAGCACHE #ifdef HAVE_TAGCACHE
&tagcache_menu, &tagcache_menu,
@ -808,10 +825,6 @@ MAKE_MENU(settings_menu_item, ID2P(LANG_GENERAL_SETTINGS), 0,
&autoresume_menu, &autoresume_menu,
#endif #endif
&browse_langs, &voice_settings_menu, &browse_langs, &voice_settings_menu,
&wps_set_context_plugin,
#ifdef HAVE_HOTKEY
&hotkey_menu,
#endif
); );
/* SETTINGS MENU */ /* SETTINGS MENU */
/***********************************/ /***********************************/

View file

@ -900,9 +900,25 @@ static int root_menu_setup_screens(void)
return new_screen; 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) void root_menu(void)
{ {
int previous_browser = GO_TO_FILEBROWSER; int previous_browser = browser_default();
int selected = 0; int selected = 0;
int shortcut_origin = GO_TO_ROOT; int shortcut_origin = GO_TO_ROOT;
@ -932,12 +948,13 @@ void root_menu(void)
last_screen = GO_TO_ROOT; last_screen = GO_TO_ROOT;
break; break;
#ifdef HAVE_TAGCACHE #ifdef HAVE_TAGCACHE
case GO_TO_FILEBROWSER:
case GO_TO_DBBROWSER: case GO_TO_DBBROWSER:
#endif
case GO_TO_FILEBROWSER:
case GO_TO_PLAYLISTS_SCREEN:
previous_browser = next_screen; previous_browser = next_screen;
goto load_next_screen; goto load_next_screen;
break; break;
#endif /* With !HAVE_TAGCACHE previous_browser is always GO_TO_FILEBROWSER */
#if CONFIG_TUNER #if CONFIG_TUNER
case GO_TO_WPS: case GO_TO_WPS:
case GO_TO_FM: case GO_TO_FM:
@ -1030,7 +1047,8 @@ void root_menu(void)
last_screen = GO_TO_PLUGIN; 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; break;
} }
default: default:

View file

@ -127,6 +127,15 @@ enum
QUEUE_SHOW_IN_SUBMENU QUEUE_SHOW_IN_SUBMENU
}; };
enum
{
BROWSER_DEFAULT_FILES = 0,
#ifdef HAVE_TAGCACHE
BROWSER_DEFAULT_DB,
#endif
BROWSER_DEFAULT_PL_CAT
};
#ifdef HAVE_ALBUMART #ifdef HAVE_ALBUMART
enum enum
{ {
@ -608,6 +617,8 @@ struct user_settings
unsigned char colors_file[MAX_FILENAME+1]; unsigned char colors_file[MAX_FILENAME+1];
#endif #endif
int browser_default; /* Default browser when accessed from WPS */
/* playlist/playback settings */ /* playlist/playback settings */
int repeat_mode; /* 0=off 1=repeat all 2=repeat one 3=shuffle 4=ab */ int repeat_mode; /* 0=off 1=repeat all 2=repeat one 3=shuffle 4=ab */
int next_folder; /* move to next folder */ int next_folder; /* move to next folder */

View file

@ -1852,6 +1852,25 @@ const struct settings_list settings[] = {
ID2P(LANG_SET_BOOL_YES), ID2P(LANG_SET_BOOL_YES),
ID2P(LANG_IN_SUBMENU)), ID2P(LANG_IN_SUBMENU)),
CHOICE_SETTING(0, browser_default, LANG_DEFAULT_BROWSER, 0,
"default browser",
#ifdef HAVE_TAGCACHE
"files,database,playlists",
#else
"files,playlists",
#endif
NULL,
#ifdef HAVE_TAGCACHE
3
#else
2
#endif
,ID2P(LANG_DIR_BROWSER),
#ifdef HAVE_TAGCACHE
ID2P(LANG_TAGCACHE),
#endif
ID2P(LANG_CATALOG)),
#ifdef HAVE_BACKLIGHT #ifdef HAVE_BACKLIGHT
CHOICE_SETTING(0, backlight_on_button_hold, CHOICE_SETTING(0, backlight_on_button_hold,
LANG_BACKLIGHT_ON_BUTTON_HOLD, LANG_BACKLIGHT_ON_BUTTON_HOLD,

View file

@ -251,6 +251,7 @@
dircache & on, off & N/A\\ dircache & on, off & N/A\\
tagcache\_ram & on, off & N/A\\ tagcache\_ram & on, off & N/A\\
database path & path to a directory & N/A\\ database path & path to a directory & N/A\\
default browser & files, database, playlists & N/A\\
\opt{touchpad}{ \opt{touchpad}{
\opt{GIGABEAT_PAD}{ \opt{GIGABEAT_PAD}{

View file

@ -1,5 +1,5 @@
% $Id$ % % $Id$ %
\section{File View} \section{\label{ref:FileView}File View}
The File View menu deals with options relating to how the File Browser The File View menu deals with options relating to how the File Browser
displays files. displays files.
% %
@ -90,4 +90,11 @@ displays files.
\setting{Current Directory Only} or \setting{Full Path}, then the title of \setting{Current Directory Only} or \setting{Full Path}, then the title of
each menu will be displayed on the first line in the \setting{Database Browser}. each menu will be displayed on the first line in the \setting{Database Browser}.
\opt{hotkey}{
\nopt{touchscreen}{\item[File Browser Hotkey.]
Sets the hotkey function for the \setting{File Browser},
\setting{Database} and \setting{Playlist Viewer} (see \reference{ref:Hotkeys}).
The default is \setting{Off}.
}
}
\end{description} \end{description}

View file

@ -1,15 +0,0 @@
% $Id: hotkey_settings.tex 16765 2008-03-23 22:07:09Z nls $ %
\opt{hotkey}{
\section{\label{ref:HotkeySettings}Hotkey}
\begin{description}
\item[WPS Hotkey.] \opt{touchscreen}{This options sets the hotkey function for
the WPS (see \reference{ref:Hotkeys}). The
default is \setting{View Playlist}.}
\nopt{touchscreen}{\item[File Browser Hotkey.]}
\end{description}
\nopt{touchscreen}{These options set the hotkey function for their respective
screens (see \reference{ref:Hotkeys}). The default for the WPS is
\setting{View Playlist}. The File Browser default is \setting{Off}.}
}

View file

@ -9,6 +9,7 @@
\chapter{General Settings} \chapter{General Settings}
\label{ref:configure_rockbox_general} \label{ref:configure_rockbox_general}
\input{configure_rockbox/general_settings.tex} \input{configure_rockbox/general_settings.tex}
\input{configure_rockbox/wps.tex}
\input{configure_rockbox/playlist_options.tex} \input{configure_rockbox/playlist_options.tex}
\input{configure_rockbox/file_view.tex} \input{configure_rockbox/file_view.tex}
\input{configure_rockbox/database.tex} \input{configure_rockbox/database.tex}
@ -21,8 +22,6 @@
} }
\input{configure_rockbox/language.tex} \input{configure_rockbox/language.tex}
\input{configure_rockbox/voice.tex} \input{configure_rockbox/voice.tex}
\input{configure_rockbox/wps_context_plugin.tex}
\input{configure_rockbox/hotkey_settings.tex}
\chapter{Theme Settings} \chapter{Theme Settings}
\label{ref:configure_rockbox_themes} \label{ref:configure_rockbox_themes}

View file

@ -0,0 +1,16 @@
\section{\label{ref:WPSSettings}What's Playing Screen}
\begin{description}
\item[Default Browser.]
Decide if you want the \setting{File Browser}, \setting{Database}, or
\setting{Playlist Catalogue} to launch after pressing \ActionWpsBrowse{}
on the WPS, when no other browser has recently been used.
\opt{hotkey}{
\item[WPS Hotkey.] Sets the hotkey function for
the WPS (see \reference{ref:Hotkeys}). The
default is \setting{View Playlist}.
}
\item[Set WPS Context Plugin.]
This option will allow you to run a Rockbox plugin from the WPS context menu.
\end{description}

View file

@ -1,6 +0,0 @@
\section{\label{ref:SetWPSContextPlugin}Set WPS Context Plugin}
\begin{description}
\item[Set WPS Context Plugin.]
This option will allow you to run a rockbox plugin from the WPS context menu
\end{description}

View file

@ -11,10 +11,11 @@
assignment.} If there is no assignment for a given screen, assignment.} If there is no assignment for a given screen,
the hotkey is ignored. the hotkey is ignored.
The hotkey assignments are changed for the What's Playing Screen (see
\reference{ref:WPSSettings}) and browsers (see \reference{ref:FileView})
separately.
The default assignment for the \nopt{touchscreen}{File Browser hotkey is The default assignment for the \nopt{touchscreen}{File Browser hotkey is
\setting{Off}, while the default for the }WPS hotkey is \setting{Off}, while the default for the }WPS hotkey is
\setting{View Playlist}. \setting{View Playlist}.
The hotkey assignments are changed in the Hotkey menu (see
\reference{ref:HotkeySettings}) under \setting{General Settings}.
} }

View file

@ -61,7 +61,7 @@ your WPS (While Playing Screen).
% %
\ActionWpsBrowse \ActionWpsBrowse
\opt{HAVEREMOTEKEYMAP}{& \ActionRCWpsBrowse} \opt{HAVEREMOTEKEYMAP}{& \ActionRCWpsBrowse}
& Return to the \setting{File Browser} / \setting{Database}.\\ & Return to the \setting{File Browser} / \setting{Database} / \setting{Playlist Catalogue}.\\
% %
\ActionWpsContext \ActionWpsContext
\opt{HAVEREMOTEKEYMAP}{& \ActionRCWpsContext} \opt{HAVEREMOTEKEYMAP}{& \ActionRCWpsContext}