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
This commit is contained in:
Christian Soffke 2024-05-26 19:13:55 +02:00
parent d1aeb7db9d
commit ef1e7d8896
5 changed files with 13 additions and 20 deletions

View file

@ -177,21 +177,12 @@ static int bookmark_menu_callback(int action,
switch (action)
{
case ACTION_REQUEST_MENUITEM:
/* hide create bookmark option if bookmarking isn't currently possible (no track playing, queued tracks...) */
if (this_item == &bookmark_create_menu_item)
{
if (!bookmark_is_bookmarkable_state())
return ACTION_EXIT_MENUITEM;
}
/* hide loading bookmarks menu if no bookmarks exist */
else if (this_item == &bookmark_load_menu_item)
if (this_item == &bookmark_load_menu_item)
{
if (!bookmark_exists())
return ACTION_EXIT_MENUITEM;
}
/* hide the bookmark menu if bookmarks can't be loaded or created */
else if (!bookmark_is_bookmarkable_state() && !bookmark_exists())
return ACTION_EXIT_MENUITEM;
break;
case ACTION_EXIT_MENUITEM:
settings_save();