diff options
author | Christian Soffke <christian.soffke@gmail.com> | 2024-05-26 19:13:55 +0200 |
---|---|---|
committer | Christian Soffke <christian.soffke@gmail.com> | 2024-06-01 11:42:47 -0400 |
commit | ef1e7d88963aa411f06448f10b3b63886c157c9c (patch) | |
tree | 46d64aa9ae593cdff436a7790e721824cdea1ceb /apps | |
parent | d1aeb7db9dbc3cdd0db25ab709b9e2d2322ef8d2 (diff) | |
download | rockbox-ef1e7d88963aa411f06448f10b3b63886c157c9c.tar.gz rockbox-ef1e7d88963aa411f06448f10b3b63886c157c9c.zip |
bookmarks: show 'Create Bookmark' for unsaved playlists
Instead of hiding this option when the current playlist
is unsaved, we can offer to save the playlist, if
necessary, before attempting to create a bookmark.
This simplifies the workflow by getting rid of steps 1
and 2 that a user currently needs to perform:
1) Open context menu, check if "Create Bookmark" option
is available
2) If not: Re-open context menu. Select Current Playlist
-> Save Current Playlist
3) Re-open context menu. Select Bookmarks
-> Create Bookmark
Change-Id: Ia9fb5f9db95e2fcbde03470a3c3745824424a339
Diffstat (limited to 'apps')
-rw-r--r-- | apps/bookmark.c | 4 | ||||
-rw-r--r-- | apps/onplay.c | 11 |
2 files changed, 5 insertions, 10 deletions
diff --git a/apps/bookmark.c b/apps/bookmark.c index 3087b7302b..08f63469aa 100644 --- a/apps/bookmark.c +++ b/apps/bookmark.c | |||
@@ -42,6 +42,7 @@ | |||
42 | #include "plugin.h" | 42 | #include "plugin.h" |
43 | #include "file.h" | 43 | #include "file.h" |
44 | #include "pathfuncs.h" | 44 | #include "pathfuncs.h" |
45 | #include "playlist_menu.h" | ||
45 | 46 | ||
46 | /*#define LOGF_ENABLE*/ | 47 | /*#define LOGF_ENABLE*/ |
47 | #include "logf.h" | 48 | #include "logf.h" |
@@ -1096,6 +1097,9 @@ static bool play_bookmark(const char* bookmark) | |||
1096 | /* ----------------------------------------------------------------------- */ | 1097 | /* ----------------------------------------------------------------------- */ |
1097 | bool bookmark_create_menu(void) | 1098 | bool bookmark_create_menu(void) |
1098 | { | 1099 | { |
1100 | if (!bookmark_is_bookmarkable_state()) | ||
1101 | save_playlist_screen(NULL); | ||
1102 | |||
1099 | return write_bookmark(true); | 1103 | return write_bookmark(true); |
1100 | } | 1104 | } |
1101 | /* ----------------------------------------------------------------------- */ | 1105 | /* ----------------------------------------------------------------------- */ |
diff --git a/apps/onplay.c b/apps/onplay.c index 71f902900d..2a2ac16b04 100644 --- a/apps/onplay.c +++ b/apps/onplay.c | |||
@@ -177,21 +177,12 @@ static int bookmark_menu_callback(int action, | |||
177 | switch (action) | 177 | switch (action) |
178 | { | 178 | { |
179 | case ACTION_REQUEST_MENUITEM: | 179 | case ACTION_REQUEST_MENUITEM: |
180 | /* hide create bookmark option if bookmarking isn't currently possible (no track playing, queued tracks...) */ | ||
181 | if (this_item == &bookmark_create_menu_item) | ||
182 | { | ||
183 | if (!bookmark_is_bookmarkable_state()) | ||
184 | return ACTION_EXIT_MENUITEM; | ||
185 | } | ||
186 | /* hide loading bookmarks menu if no bookmarks exist */ | 180 | /* hide loading bookmarks menu if no bookmarks exist */ |
187 | else if (this_item == &bookmark_load_menu_item) | 181 | if (this_item == &bookmark_load_menu_item) |
188 | { | 182 | { |
189 | if (!bookmark_exists()) | 183 | if (!bookmark_exists()) |
190 | return ACTION_EXIT_MENUITEM; | 184 | return ACTION_EXIT_MENUITEM; |
191 | } | 185 | } |
192 | /* hide the bookmark menu if bookmarks can't be loaded or created */ | ||
193 | else if (!bookmark_is_bookmarkable_state() && !bookmark_exists()) | ||
194 | return ACTION_EXIT_MENUITEM; | ||
195 | break; | 186 | break; |
196 | case ACTION_EXIT_MENUITEM: | 187 | case ACTION_EXIT_MENUITEM: |
197 | settings_save(); | 188 | settings_save(); |