mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-09 21:25:19 -05:00
Accept FS #7346 and take it a whole step further. Gives a separate setting to control the displaying of file extensions: off, on, or only how unknown extensions.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14315 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
1e28f59f26
commit
37fd439fc0
5 changed files with 41 additions and 6 deletions
|
|
@ -10997,3 +10997,31 @@
|
|||
*: ""
|
||||
</voice>
|
||||
</phrase>
|
||||
<phrase>
|
||||
id: LANG_SHOW_FILENAME_EXT
|
||||
desc: in settings_menu
|
||||
user:
|
||||
<source>
|
||||
*: "Show filename extensions"
|
||||
</source>
|
||||
<dest>
|
||||
*: "Show filename extensions"
|
||||
</dest>
|
||||
<voice>
|
||||
*: "Show filename extensions"
|
||||
</voice>
|
||||
</phrase>
|
||||
<phrase>
|
||||
id: LANG_UNKNOWN_TYPES
|
||||
desc: in settings_menu
|
||||
user:
|
||||
<source>
|
||||
*: "Only unknown types"
|
||||
</source>
|
||||
<dest>
|
||||
*: "Only unknown types"
|
||||
</dest>
|
||||
<voice>
|
||||
*: "Only unknown types"
|
||||
</voice>
|
||||
</phrase>
|
||||
|
|
|
|||
|
|
@ -92,6 +92,7 @@ MENUITEM_SETTING(sort_case, &global_settings.sort_case, NULL);
|
|||
MENUITEM_SETTING(sort_dir, &global_settings.sort_dir, fileview_callback);
|
||||
MENUITEM_SETTING(sort_file, &global_settings.sort_file, fileview_callback);
|
||||
MENUITEM_SETTING(dirfilter, &global_settings.dirfilter, NULL);
|
||||
MENUITEM_SETTING(show_filename_ext, &global_settings.show_filename_ext, NULL);
|
||||
MENUITEM_SETTING(browse_current, &global_settings.browse_current, NULL);
|
||||
MENUITEM_SETTING(show_path_in_browser, &global_settings.show_path_in_browser, NULL);
|
||||
static int fileview_callback(int action,const struct menu_item_ex *this_item)
|
||||
|
|
@ -113,7 +114,8 @@ static int fileview_callback(int action,const struct menu_item_ex *this_item)
|
|||
|
||||
MAKE_MENU(file_menu, ID2P(LANG_FILE), 0, Icon_file_view_menu,
|
||||
&sort_case, &sort_dir, &sort_file,
|
||||
&dirfilter, &browse_current, &show_path_in_browser);
|
||||
&dirfilter, &show_filename_ext, &browse_current,
|
||||
&show_path_in_browser);
|
||||
/* FILE VIEW MENU */
|
||||
/***********************************/
|
||||
|
||||
|
|
|
|||
|
|
@ -444,6 +444,8 @@ struct user_settings
|
|||
int dirfilter; /* 0=display all, 1=only supported, 2=only music,
|
||||
3=dirs+playlists, 4=ID3 database */
|
||||
bool sort_case; /* dir sort order: 0=case insensitive, 1=sensitive */
|
||||
int show_filename_ext; /* show filename extensions in file browser?
|
||||
0 = no, 1 = yes, 2 = only unknown 0 */
|
||||
int volume_type; /* how volume is displayed: 0=graphic, 1=percent */
|
||||
int battery_display; /* how battery is displayed: 0=graphic, 1=percent */
|
||||
int timeformat; /* time format: 0=24 hour clock, 1=12 hour clock */
|
||||
|
|
|
|||
|
|
@ -653,6 +653,9 @@ const struct settings_list settings[] = {
|
|||
"all,supported,music,playlists", NULL, 4, ID2P(LANG_ALL),
|
||||
ID2P(LANG_FILTER_SUPPORTED), ID2P(LANG_FILTER_MUSIC), ID2P(LANG_PLAYLISTS)),
|
||||
OFFON_SETTING(0,sort_case,LANG_SORT_CASE,false,"sort case",NULL),
|
||||
CHOICE_SETTING(0, show_filename_ext, LANG_SHOW_FILENAME_EXT, 2,
|
||||
"show filename exts", "off,on,unknown", NULL , 3 ,
|
||||
ID2P(LANG_OFF), ID2P(LANG_ON), ID2P(LANG_UNKNOWN_TYPES)),
|
||||
OFFON_SETTING(0,browse_current,LANG_FOLLOW,false,"follow playlist",NULL),
|
||||
OFFON_SETTING(0,playlist_viewer_icons,LANG_SHOW_ICONS,true,
|
||||
"playlist viewer icons",NULL),
|
||||
|
|
|
|||
10
apps/tree.c
10
apps/tree.c
|
|
@ -154,11 +154,11 @@ static char * tree_get_filename(int selected_item, void * data, char *buffer)
|
|||
name = e->name;
|
||||
attr = e->attr;
|
||||
}
|
||||
/* if any file filter is on, and if it's not a directory,
|
||||
* strip the extension */
|
||||
|
||||
if ( (*(local_tc->dirfilter) != SHOW_ID3DB) && !(attr & ATTR_DIRECTORY)
|
||||
&& (*(local_tc->dirfilter) != SHOW_ALL) )
|
||||
/* if it's not a directory, strip the extension if necessary */
|
||||
if((global_settings.show_filename_ext == 0) ||
|
||||
((global_settings.show_filename_ext == 2) &&
|
||||
(filetype_supported(attr)) &&
|
||||
!(attr & ATTR_DIRECTORY)))
|
||||
{
|
||||
return(strip_extension(name, buffer));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue