summaryrefslogtreecommitdiffstats
path: root/apps/playlist_viewer.c
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2010-02-20 19:06:39 +0000
committerThomas Martitz <kugel@rockbox.org>2010-02-20 19:06:39 +0000
commitc19e53654b857227e2be224d451037d432529299 (patch)
tree18437a610ce91fe55bcca601cc0dbd21887bd839 /apps/playlist_viewer.c
parentabb3dd4ec2876fa84c1cbf18825ece1c33fc6500 (diff)
downloadrockbox-c19e53654b857227e2be224d451037d432529299.tar.gz
rockbox-c19e53654b857227e2be224d451037d432529299.tar.bz2
rockbox-c19e53654b857227e2be224d451037d432529299.zip
Playlist Viewer Changes to bring consistency:
- combine its two context menus to one and - make the ACTION_STD_MENU go to the main menu as it does in all other screens - call playlist_viewer() via root_menu to reduce call depth and to be consistent with other screens (and for the above changes to be more flexible w.r.t to the following screen) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24791 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/playlist_viewer.c')
-rw-r--r--apps/playlist_viewer.c32
1 files changed, 13 insertions, 19 deletions
diff --git a/apps/playlist_viewer.c b/apps/playlist_viewer.c
index 0a247fa01d..e2be36ce5d 100644
--- a/apps/playlist_viewer.c
+++ b/apps/playlist_viewer.c
@@ -448,7 +448,8 @@ static int onplay_menu(int index)
playlist_buffer_get_track(&viewer.buffer, index);
MENUITEM_STRINGLIST(menu_items, ID2P(LANG_PLAYLIST), NULL,
ID2P(LANG_REMOVE), ID2P(LANG_MOVE),
- ID2P(LANG_CATALOG_ADD_TO), ID2P(LANG_CATALOG_ADD_TO_NEW));
+ ID2P(LANG_CATALOG_ADD_TO), ID2P(LANG_CATALOG_ADD_TO_NEW),
+ ID2P(LANG_PLAYLISTVIEWER_SETTINGS));
bool current = (current_track->index == viewer.current_playing_track);
result = do_menu(&menu_items, NULL, NULL, false);
@@ -503,6 +504,10 @@ static int onplay_menu(int index)
result==3, NULL);
ret = 0;
break;
+ case 4: /* playlist viewer settings */
+ /* true on usb connect */
+ ret = viewer_menu() ? -1 : 0;
+ break;
}
}
return ret;
@@ -531,7 +536,7 @@ static int save_playlist_func(void)
}
/* View current playlist */
-bool playlist_viewer(void)
+enum playlist_viewer_result playlist_viewer(void)
{
return playlist_viewer_ex(NULL);
}
@@ -606,9 +611,9 @@ static enum themable_icons playlist_callback_icons(int selected_item,
/* Main viewer function. Filename identifies playlist to be viewed. If NULL,
view current playlist. */
-bool playlist_viewer_ex(const char* filename)
+enum playlist_viewer_result playlist_viewer_ex(const char* filename)
{
- bool ret = false; /* return value */
+ enum playlist_viewer_result ret = PLAYLIST_VIEWER_OK;
bool exit=false; /* exit viewer */
int button;
struct gui_synclist playlist_lists;
@@ -730,7 +735,7 @@ bool playlist_viewer_ex(const char* filename)
if (ret_val < 0)
{
- ret = true;
+ ret = PLAYLIST_VIEWER_USB;
goto exit;
}
else if (ret_val > 0)
@@ -747,23 +752,12 @@ bool playlist_viewer_ex(const char* filename)
break;
}
case ACTION_STD_MENU:
- if (viewer_menu())
- {
- ret = true;
- goto exit;
- }
- gui_synclist_set_icon_callback(
- &playlist_lists,
- global_settings.playlist_viewer_icons?
- &playlist_callback_icons:NULL
- );
- gui_synclist_draw(&playlist_lists);
- break;
-
+ ret = PLAYLIST_VIEWER_MAINMENU;
+ goto exit;
default:
if(default_event_handler(button) == SYS_USB_CONNECTED)
{
- ret = true;
+ ret = PLAYLIST_VIEWER_USB;
goto exit;
}
break;