diff options
Diffstat (limited to 'apps/onplay.c')
-rw-r--r-- | apps/onplay.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/apps/onplay.c b/apps/onplay.c index 143745d366..11fffb9312 100644 --- a/apps/onplay.c +++ b/apps/onplay.c | |||
@@ -91,7 +91,8 @@ static int bookmark_menu_callback(int action, | |||
91 | const struct menu_item_ex *this_item); | 91 | const struct menu_item_ex *this_item); |
92 | MENUITEM_FUNCTION(bookmark_create_menu_item, 0, | 92 | MENUITEM_FUNCTION(bookmark_create_menu_item, 0, |
93 | ID2P(LANG_BOOKMARK_MENU_CREATE), | 93 | ID2P(LANG_BOOKMARK_MENU_CREATE), |
94 | bookmark_create_menu, NULL, NULL, Icon_Bookmark); | 94 | bookmark_create_menu, NULL, |
95 | bookmark_menu_callback, Icon_Bookmark); | ||
95 | MENUITEM_FUNCTION(bookmark_load_menu_item, 0, | 96 | MENUITEM_FUNCTION(bookmark_load_menu_item, 0, |
96 | ID2P(LANG_BOOKMARK_MENU_LIST), | 97 | ID2P(LANG_BOOKMARK_MENU_LIST), |
97 | bookmark_load_menu, NULL, | 98 | bookmark_load_menu, NULL, |
@@ -105,13 +106,20 @@ static int bookmark_menu_callback(int action, | |||
105 | switch (action) | 106 | switch (action) |
106 | { | 107 | { |
107 | case ACTION_REQUEST_MENUITEM: | 108 | case ACTION_REQUEST_MENUITEM: |
108 | if (this_item == &bookmark_load_menu_item) | 109 | /* hide create bookmark option if bookmarking isn't currently possible (no track playing, queued tracks...) */ |
110 | if (this_item == &bookmark_create_menu_item) | ||
111 | { | ||
112 | if (!bookmark_is_bookmarkable_state()) | ||
113 | return ACTION_EXIT_MENUITEM; | ||
114 | } | ||
115 | /* hide loading bookmarks menu if no bookmarks exist */ | ||
116 | else if (this_item == &bookmark_load_menu_item) | ||
109 | { | 117 | { |
110 | if (!bookmark_exists()) | 118 | if (!bookmark_exists()) |
111 | return ACTION_EXIT_MENUITEM; | 119 | return ACTION_EXIT_MENUITEM; |
112 | } | 120 | } |
113 | /* hide the bookmark menu if there is no playback */ | 121 | /* hide the bookmark menu if bookmarks can't be loaded or created */ |
114 | else if ((audio_status() & AUDIO_STATUS_PLAY) == 0) | 122 | else if (!bookmark_is_bookmarkable_state() && !bookmark_exists()) |
115 | return ACTION_EXIT_MENUITEM; | 123 | return ACTION_EXIT_MENUITEM; |
116 | break; | 124 | break; |
117 | #ifdef HAVE_LCD_CHARCELLS | 125 | #ifdef HAVE_LCD_CHARCELLS |