summaryrefslogtreecommitdiffstats
path: root/apps/onplay.c
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2010-10-04 10:34:38 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2010-10-04 10:34:38 +0000
commitefbcece07b3a91f4b475559997f892e24751f0e6 (patch)
treec7ee12626dbd268df4a94bd46b29f6fc7126d2d4 /apps/onplay.c
parentae75c6eb0ae9c75173ab1b06a26cad30fc5344c9 (diff)
downloadrockbox-efbcece07b3a91f4b475559997f892e24751f0e6.tar.gz
rockbox-efbcece07b3a91f4b475559997f892e24751f0e6.tar.bz2
rockbox-efbcece07b3a91f4b475559997f892e24751f0e6.zip
New setting to control the file browser start location.
Set using the menu item in folder context menus, clear in the filebrowser settings. Can be abused to start selecting a *file* (or have a folder selected) instead of a starting inside a folder by removing the trailing / in the .cfg This only affects the file browser when it would open in / before (on boot, or when entereing after backing out of the browser before (*not* when exited with the menu action) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28206 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/onplay.c')
-rw-r--r--apps/onplay.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/apps/onplay.c b/apps/onplay.c
index 92864f5f16..1d59b34aa4 100644
--- a/apps/onplay.c
+++ b/apps/onplay.c
@@ -1045,6 +1045,16 @@ static bool set_recdir(void)
MENUITEM_FUNCTION(set_recdir_item, 0, ID2P(LANG_SET_AS_REC_DIR),
set_recdir, NULL, clipboard_callback, Icon_Recording);
#endif
+static bool set_startdir(void)
+{
+ snprintf(global_settings.start_directory,
+ sizeof(global_settings.start_directory),
+ "%s/", selected_file);
+ settings_save();
+ return false;
+}
+MENUITEM_FUNCTION(set_startdir_item, 0, ID2P(LANG_SET_AS_START_DIR),
+ set_startdir, NULL, clipboard_callback, Icon_file_view_menu);
static int clipboard_callback(int action,const struct menu_item_ex *this_item)
{
@@ -1097,7 +1107,8 @@ static int clipboard_callback(int action,const struct menu_item_ex *this_item)
else if ((selected_file_attr & ATTR_DIRECTORY))
{
/* only for directories */
- if (this_item == &delete_dir_item
+ if (this_item == &delete_dir_item ||
+ this_item == &set_startdir_item
#ifdef HAVE_RECORDING
|| this_item == &set_recdir_item
#endif
@@ -1162,7 +1173,7 @@ MAKE_ONPLAYMENU( tree_onplay_menu, ID2P(LANG_ONPLAY_MENU_TITLE),
#ifdef HAVE_RECORDING
&set_recdir_item,
#endif
- &add_to_faves_item,
+ &set_startdir_item, &add_to_faves_item,
);
static int onplaymenu_callback(int action,const struct menu_item_ex *this_item)
{