diff options
author | Christi Scarborough <christi@coraline.org> | 2005-06-26 15:21:29 +0000 |
---|---|---|
committer | Christi Scarborough <christi@coraline.org> | 2005-06-26 15:21:29 +0000 |
commit | 314c2dec1eee9f91076f263aa038d6ef1eca672d (patch) | |
tree | f0501c3d0aca1145e0f5b9b86c8c0d7c2055cbd4 /apps/tree.c | |
parent | f69e6eaeb58afb3246be2c3bc77eb0f2c0b1a1ca (diff) |
Resume behaviour. Resume setting renamed to 'Resume on Startup'. Pressing the resume button from the WPS now resumes without prompting, regardless of the resume on startup setting. Error message displayed if no playlist in memory. (Bug in iriver playlist handling means that playlists don't get unloaded at the end of the playlist, so this feature does not currently work on iRiver.)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6872 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/tree.c')
-rw-r--r-- | apps/tree.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/apps/tree.c b/apps/tree.c index 344088d12a..46413fe31b 100644 --- a/apps/tree.c +++ b/apps/tree.c @@ -431,7 +431,7 @@ static int showdir(void) return tc.filesindir; } -static bool ask_resume(bool ask_once) +static bool ask_resume(bool just_powered_on) { int button; bool stop = false; @@ -449,7 +449,7 @@ static bool ask_resume(bool ask_once) #endif /* always resume? */ - if ( global_settings.resume == RESUME_ON) + if ( global_settings.resume == RESUME_ON || ! just_powered_on) return true; lcd_clear_display(); @@ -475,17 +475,15 @@ static bool ask_resume(bool ask_once) #ifdef TREE_RC_RUN_PRE case TREE_RC_RUN_PRE: /* catch the press, not the release */ #else -#ifdef TREE_RC_RUN case TREE_RC_RUN: #endif -#endif ignore_power = false; /* Don't ignore the power button for subsequent calls */ return true; #ifdef TREE_POWER_BTN /* Initially ignore the button which powers on the box. It - might still be pressed since booting. */ + * might still be pressed since booting. */ case TREE_POWER_BTN: case TREE_POWER_BTN | BUTTON_REPEAT: if(!ignore_power) @@ -497,6 +495,7 @@ static bool ask_resume(bool ask_once) ignore_power = false; break; #endif + /* Handle sys events, ignore button releases */ default: if(default_event_handler(button) == SYS_USB_CONNECTED || @@ -506,7 +505,7 @@ static bool ask_resume(bool ask_once) } } - if ( global_settings.resume == RESUME_ASK_ONCE && ask_once) { + if ( global_settings.resume == RESUME_ASK_ONCE && just_powered_on) { global_settings.resume_index = -1; settings_save(); } @@ -547,15 +546,15 @@ void reload_directory(void) reload_dir = true; } -static void start_resume(bool ask_once) +static void start_resume(bool just_powered_on) { - if ( global_settings.resume && + if ( ( global_settings.resume || ! just_powered_on ) && global_settings.resume_index != -1 ) { DEBUGF("Resume index %X offset %X\n", global_settings.resume_index, global_settings.resume_offset); - if (!ask_resume(ask_once)) + if (!ask_resume(just_powered_on) && just_powered_on ) return; if (playlist_resume() != -1) @@ -565,8 +564,9 @@ static void start_resume(bool ask_once) start_wps = true; } - else - return; + else return; + } else if (! just_powered_on) { + splash(HZ*2, true, str(LANG_NOTHING_TO_RESUME)); } } |