diff options
author | Jonas Häggqvist <rasher@rasher.dk> | 2009-06-22 17:37:36 +0000 |
---|---|---|
committer | Jonas Häggqvist <rasher@rasher.dk> | 2009-06-22 17:37:36 +0000 |
commit | 4b831753e799f969b473b0b0fb48317722d7b98e (patch) | |
tree | e974b3dfd5fcd08fd82340c5d3a1e3a22a189c99 /apps | |
parent | c99ab564b0f3a2656521139df6d9524d6b197fe8 (diff) |
Center the list on the currently loaded file in the following screens (FS#10093):
- Font selection
- FM preset selection
- WPS/RWPS selection
- Language selection
Modify the menu wording to make them seem more like a setting and update the manual accordingly.
The code could possibly be more compact - any help on that would be appreciated.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21464 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r-- | apps/lang/english.lang | 24 | ||||
-rw-r--r-- | apps/tree.c | 53 |
2 files changed, 65 insertions, 12 deletions
diff --git a/apps/lang/english.lang b/apps/lang/english.lang index 4c6e38d912..78322662d6 100644 --- a/apps/lang/english.lang +++ b/apps/lang/english.lang @@ -2649,15 +2649,15 @@ user: core <source> *: none - lcd_bitmap: "Browse Fonts" + lcd_bitmap: "Font" </source> <dest> *: none - lcd_bitmap: "Browse Fonts" + lcd_bitmap: "Font" </dest> <voice> *: none - lcd_bitmap: "Browse Fonts" + lcd_bitmap: "Font" </voice> </phrase> <phrase> @@ -2665,13 +2665,13 @@ desc: in settings_menu() user: core <source> - *: "Browse .wps files" + *: "While Playing Screen" </source> <dest> - *: "Browse .wps files" + *: "While Playing Screen" </dest> <voice> - *: "Browse while-playing-screen files" + *: "While playing screen" </voice> </phrase> <phrase> @@ -2680,15 +2680,15 @@ user: core <source> *: none - remote: "Browse .rwps files" + remote: "Remote While Playing Screen" </source> <dest> *: none - remote: "Browse .rwps files" + remote: "Remote While Playing Screen" </dest> <voice> *: none - remote: "Browse remote while-playing-screen files" + remote: "Remote While Playing Screen" </voice> </phrase> <phrase> @@ -5187,13 +5187,13 @@ desc: in the main menu user: core <source> - *: "Browse Themes" + *: "Browse Theme Files" </source> <dest> - *: "Browse Themes" + *: "Browse Theme Files" </dest> <voice> - *: "Browse Themes" + *: "Browse Theme Files" </voice> </phrase> <phrase> diff --git a/apps/tree.c b/apps/tree.c index 84224efa85..d1d0ec3b27 100644 --- a/apps/tree.c +++ b/apps/tree.c @@ -904,6 +904,7 @@ int rockbox_browse(const char *root, int dirfilter) if (dirfilter >= NUM_FILTER_MODES) { static struct tree_context backup; + char current[MAX_PATH]; int last_context; backup = tc; @@ -913,6 +914,58 @@ int rockbox_browse(const char *root, int dirfilter) start_wps = false; last_context = curr_context; + /* Center on the currently loaded language when browsing languages. */ + if (dirfilter == SHOW_LNG) + { + if (global_settings.lang_file[0]) + { + snprintf(current, sizeof(current), LANG_DIR "/%s.lng", + global_settings.lang_file); + } + else + { + strncpy(current, LANG_DIR "/english.lng", sizeof(current)); + } + } + /* Center on currently loaded WPS */ + else if (dirfilter == SHOW_WPS) + { + snprintf(current, sizeof(current), WPS_DIR "/%s.wps", + global_settings.wps_file); + } +#ifdef HAVE_REMOTE_LCD + /* Center on currently loaded RWPS */ + else if (dirfilter == SHOW_RWPS) + { + snprintf(current, sizeof(current), WPS_DIR "/%s.rwps", + global_settings.rwps_file); + } +#endif +#ifdef HAVE_LCD_BITMAP + /* Center on the currently loaded font when browsing fonts */ + else if (dirfilter == SHOW_FONT) + { + snprintf(current, sizeof(current), FONT_DIR "/%s.fnt", + global_settings.font_file); + } +#endif +#if CONFIG_TUNER + /* Center on the currently loaded FM preset when browsing those */ + else if (dirfilter == SHOW_FMR) + { + snprintf(current, sizeof(current), FMPRESET_PATH "/%s.fmr", + global_settings.fmr_file); + } +#endif + + /* If we've found a file to center on, do it */ + if (current[0] == '/') + { + set_current_file(current); + /* set_current_file changes dirlevel, change it back */ + tc.dirlevel = 0; + } + ret_val = dirbrowse(); tc = backup; curr_context = last_context; |