summaryrefslogtreecommitdiffstats
path: root/apps/bookmark.c
diff options
context:
space:
mode:
authorMagnus Holmgren <magnushol@gmail.com>2008-02-10 12:16:27 +0000
committerMagnus Holmgren <magnushol@gmail.com>2008-02-10 12:16:27 +0000
commit04dc828c9f7e76785b0478f3b1905c75c2eb5cb7 (patch)
tree83e960cce0c0cb8553787d0f89a63d6bd0fc0ee8 /apps/bookmark.c
parent05e82a45da2bddc0d88a4f77d0cd2b128458d355 (diff)
downloadrockbox-04dc828c9f7e76785b0478f3b1905c75c2eb5cb7.tar.gz
rockbox-04dc828c9f7e76785b0478f3b1905c75c2eb5cb7.tar.bz2
rockbox-04dc828c9f7e76785b0478f3b1905c75c2eb5cb7.zip
Better bookmark resume handling, in particular when resuming a directory. If Load Last Bookmark is set to Yes and the last bookmarked file could not be found, play the selected file instead. When selecting a bookmark for a missing file in the bookmark list, show a message that resume isn't possible (and don't play any selected file if Load Last Bookmark is set to Ask).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16267 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/bookmark.c')
-rw-r--r--apps/bookmark.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/apps/bookmark.c b/apps/bookmark.c
index 3d4705960c..91c823b018 100644
--- a/apps/bookmark.c
+++ b/apps/bookmark.c
@@ -404,7 +404,16 @@ bool bookmark_autoload(const char* file)
if (bookmark != NULL)
{
- return play_bookmark(bookmark);
+ if (!play_bookmark(bookmark))
+ {
+ /* Selected bookmark not found. */
+ gui_syncsplash(HZ*2, ID2P(LANG_NOTHING_TO_RESUME));
+ }
+
+ /* Act as if autoload was done even if it failed, since the
+ * user did make an active selection.
+ */
+ return true;
}
return false;
@@ -418,7 +427,7 @@ bool bookmark_autoload(const char* file)
bool bookmark_load(const char* file, bool autoload)
{
int fd;
- char* bookmark = NULL;;
+ char* bookmark = NULL;
if(autoload)
{
@@ -438,7 +447,12 @@ bool bookmark_load(const char* file, bool autoload)
if (bookmark != NULL)
{
- return play_bookmark(bookmark);
+ if (!play_bookmark(bookmark))
+ {
+ /* Selected bookmark not found. */
+ gui_syncsplash(HZ*2, ID2P(LANG_NOTHING_TO_RESUME));
+ return false;
+ }
}
return true;
@@ -875,9 +889,8 @@ static bool play_bookmark(const char* bookmark)
&global_settings.playlist_shuffle,
global_filename))
{
- bookmark_play(global_temp_buffer, index, offset, seed,
+ return bookmark_play(global_temp_buffer, index, offset, seed,
global_filename);
- return true;
}
return false;