diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/lang/english.lang | 5 | ||||
-rw-r--r-- | apps/tree.c | 42 |
2 files changed, 34 insertions, 13 deletions
diff --git a/apps/lang/english.lang b/apps/lang/english.lang index a3d8a03858..b4013fd90a 100644 --- a/apps/lang/english.lang +++ b/apps/lang/english.lang @@ -1767,3 +1767,8 @@ id: LANG_LINE_IN desc: in settings_menu eng: "Line In" new: + +id: LANG_NO_FILES +desc: in settings_menu +eng: "No files" +new: diff --git a/apps/tree.c b/apps/tree.c index fb62b0ede8..0b41b3af46 100644 --- a/apps/tree.c +++ b/apps/tree.c @@ -840,11 +840,18 @@ static bool dirbrowse(char *root, int *dirfilter) memcpy(currdir,root,sizeof(currdir)); if (*dirfilter < NUM_FILTER_MODES) - start_resume(true); + start_resume(true); numentries = showdir(currdir, dirstart, dirfilter); if (numentries == -1) return false; /* currdir is not a directory */ + + if (*dirfilter > NUM_FILTER_MODES && numentries==0) + { + splash(HZ*2, 0, true, str(LANG_NO_FILES)); + return false; /* No files found for rockbox_browser() */ + } + update_all = true; put_cursorxy(CURSOR_X, CURSOR_Y + dircursor, true); @@ -1171,10 +1178,13 @@ static bool dirbrowse(char *root, int *dirfilter) break; case TREE_MENU: - lcd_stop_scroll(); - if (main_menu()) - reload_root = true; - restore = true; + if (*dirfilter < NUM_FILTER_MODES) + { + lcd_stop_scroll(); + if (main_menu()) + reload_root = true; + restore = true; + } break; case BUTTON_ON: @@ -1206,19 +1216,25 @@ static bool dirbrowse(char *root, int *dirfilter) #ifdef HAVE_RECORDER_KEYPAD case BUTTON_F2: - if (f2_screen()) - reload_root = true; - restore = true; - break; + if (*dirfilter < NUM_FILTER_MODES) + { + if (f2_screen()) + reload_root = true; + restore = true; + break; + } case BUTTON_F3: - if (f3_screen()) - reload_root = true; + if (*dirfilter < NUM_FILTER_MODES) + { + if (f3_screen()) + reload_root = true; #ifdef HAVE_LCD_BITMAP - tree_max_on_screen = (LCD_HEIGHT - MARGIN_Y) / fh; + tree_max_on_screen = (LCD_HEIGHT - MARGIN_Y) / fh; #endif - restore = true; + restore = true; + } break; #endif |