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
This commit is contained in:
Jonathan Gordon 2010-10-04 10:34:38 +00:00
parent ae75c6eb0a
commit efbcece07b
8 changed files with 65 additions and 7 deletions

View file

@ -344,6 +344,7 @@ MENUITEM_SETTING(rec_prerecord_time, &global_settings.rec_prerecord_time, NULL);
static int clear_rec_directory(void)
{
strcpy(global_settings.rec_directory, REC_BASE_DIR);
settings_save();
splash(HZ, ID2P(LANG_RESET_DONE_CLEAR));
return false;
}

View file

@ -103,6 +103,15 @@ MENUITEM_SETTING(browse_current, &global_settings.browse_current, NULL);
#ifdef HAVE_LCD_BITMAP
MENUITEM_SETTING(show_path_in_browser, &global_settings.show_path_in_browser, NULL);
#endif
static int clear_start_directory(void)
{
strcpy(global_settings.start_directory, "/");
settings_save();
splash(HZ, ID2P(LANG_RESET_DONE_CLEAR));
return false;
}
MENUITEM_FUNCTION(clear_start_directory_item, 0, ID2P(LANG_RESET_START_DIR),
clear_start_directory, NULL, NULL, Icon_file_view_menu);
static int fileview_callback(int action,const struct menu_item_ex *this_item)
{
static int oldval;
@ -124,8 +133,9 @@ MAKE_MENU(file_menu, ID2P(LANG_FILE), 0, Icon_file_view_menu,
&sort_case, &sort_dir, &sort_file, &interpret_numbers,
&dirfilter, &show_filename_ext, &browse_current,
#ifdef HAVE_LCD_BITMAP
&show_path_in_browser
&show_path_in_browser,
#endif
&clear_start_directory_item
);
/* FILE VIEW MENU */
/***********************************/