1
0
Fork 0
forked from len0rd/rockbox

Browser enhancements: (all) Only go back to the root dir after USB mode if the current dir no longer exists. (all) Use TREE_MENU as a quick alternative to leave a sub-browser. (recorders) Correct indication of available functions in the buttonbar. Indicate the new 'quick leave' method accordingly.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6475 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jens Arnold 2005-05-16 11:50:46 +00:00
parent badb71de35
commit 7067f188bf

View file

@ -408,11 +408,13 @@ static int showdir(void)
start + tc.firstpos + tree_max_on_screen, VERTICAL); start + tc.firstpos + tree_max_on_screen, VERTICAL);
#if CONFIG_KEYPAD == RECORDER_PAD #if CONFIG_KEYPAD == RECORDER_PAD
if(global_settings.buttonbar) { if (global_settings.buttonbar) {
buttonbar_set(*tc.dirfilter < NUM_FILTER_MODES ? if (*tc.dirfilter < NUM_FILTER_MODES)
str(LANG_DIRBROWSE_F1) : (unsigned char *) "", buttonbar_set(str(LANG_DIRBROWSE_F1),
str(LANG_DIRBROWSE_F2), str(LANG_DIRBROWSE_F2),
str(LANG_DIRBROWSE_F3)); str(LANG_DIRBROWSE_F3));
else
buttonbar_set("<<<", "", "");
buttonbar_draw(); buttonbar_draw();
} }
#endif #endif
@ -1001,6 +1003,8 @@ static bool dirbrowse(void)
id3db = check_changed_id3mode(id3db); id3db = check_changed_id3mode(id3db);
} }
else /* use it as a quick exit instead */
exit_func = true;
break; break;
case TREE_WPS: case TREE_WPS:
@ -1134,7 +1138,7 @@ static bool dirbrowse(void)
might be confusing to the user */ might be confusing to the user */
exit_func = true; exit_func = true;
else else
reload_root = true; reload_dir = true;
} }
break; break;
} }
@ -1149,7 +1153,7 @@ static bool dirbrowse(void)
{ {
lcd_stop_scroll(); lcd_stop_scroll();
if (wps_show() == SYS_USB_CONNECTED) if (wps_show() == SYS_USB_CONNECTED)
reload_root = true; reload_dir = true;
#ifdef HAVE_HOTSWAP #ifdef HAVE_HOTSWAP
else else
if (!id3db) /* Try reload to catch 'no longer valid' case. */ if (!id3db) /* Try reload to catch 'no longer valid' case. */
@ -1163,9 +1167,7 @@ static bool dirbrowse(void)
start_wps=false; start_wps=false;
} }
#ifdef HAVE_HOTSWAP
check_rescan: check_rescan:
#endif
/* do we need to rescan dir? */ /* do we need to rescan dir? */
if (reload_dir || reload_root || if (reload_dir || reload_root ||
lastfilter != *tc.dirfilter || lastfilter != *tc.dirfilter ||
@ -1202,7 +1204,7 @@ static bool dirbrowse(void)
#ifdef HAVE_LCD_BITMAP #ifdef HAVE_LCD_BITMAP
tree_max_on_screen = recalc_screen_height(); tree_max_on_screen = recalc_screen_height();
#endif #endif
/* We need to adjust if the number of lines on screen have /* We need to adjust if the number of lines on screen have
changed because of a status bar change */ changed because of a status bar change */
if(CURSOR_Y+LINE_Y+tc.dircursor>tree_max_on_screen) { if(CURSOR_Y+LINE_Y+tc.dircursor>tree_max_on_screen) {
@ -1216,14 +1218,12 @@ static bool dirbrowse(void)
lcd_setfont(FONT_UI); lcd_setfont(FONT_UI);
#endif #endif
numentries = showdir(); numentries = showdir();
#ifdef HAVE_HOTSWAP if (currdir[1] && (numentries < 0))
if (currdir[1] && (numentries < 0))
{ /* not in root and reload failed */ { /* not in root and reload failed */
reload_root = true; /* try root */ reload_root = true; /* try root */
reload_dir = false; reload_dir = false;
goto check_rescan; goto check_rescan;
} }
#endif
update_all = true; update_all = true;
put_cursorxy(CURSOR_X, CURSOR_Y + tc.dircursor, true); put_cursorxy(CURSOR_X, CURSOR_Y + tc.dircursor, true);