diff options
author | Jonathan Gordon <rockbox@jdgordon.info> | 2011-11-15 13:22:02 +0000 |
---|---|---|
committer | Jonathan Gordon <rockbox@jdgordon.info> | 2011-11-15 13:22:02 +0000 |
commit | 101693fd3047fb64e766580e80635a424fa25c4d (patch) | |
tree | 80f5664710a6e84b73f33e22c1b8632c13c5a727 /apps/onplay.c | |
parent | e7e4b131d06f748400b5299d4d1ebfb38f9f08bf (diff) | |
download | rockbox-101693fd3047fb64e766580e80635a424fa25c4d.tar.gz rockbox-101693fd3047fb64e766580e80635a424fa25c4d.zip |
FS#12251 - User shortcuts in the main menu.
Custom shortcuts which give the user fast access to regularly used files/folders/settings/whatever.
Thanks to Alexander Levin for the manual part of the patch
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30990 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/onplay.c')
-rw-r--r-- | apps/onplay.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/apps/onplay.c b/apps/onplay.c index aab023c846..629de93886 100644 --- a/apps/onplay.c +++ b/apps/onplay.c | |||
@@ -63,6 +63,7 @@ | |||
63 | #include "pitchscreen.h" | 63 | #include "pitchscreen.h" |
64 | #include "viewport.h" | 64 | #include "viewport.h" |
65 | #include "filefuncs.h" | 65 | #include "filefuncs.h" |
66 | #include "shortcuts.h" | ||
66 | 67 | ||
67 | static int context; | 68 | static int context; |
68 | static char* selected_file = NULL; | 69 | static char* selected_file = NULL; |
@@ -382,10 +383,13 @@ static int treeplaylist_callback(int action, | |||
382 | return action; | 383 | return action; |
383 | } | 384 | } |
384 | 385 | ||
385 | void onplay_show_playlist_menu(char* track_name) | 386 | void onplay_show_playlist_menu(char* path) |
386 | { | 387 | { |
387 | selected_file = track_name; | 388 | selected_file = path; |
388 | selected_file_attr = FILE_ATTR_AUDIO; | 389 | if (dir_exists(path)) |
390 | selected_file_attr = ATTR_DIRECTORY; | ||
391 | else | ||
392 | selected_file_attr = filetype_get_attr(path); | ||
389 | do_menu(&tree_playlist_menu, NULL, NULL, false); | 393 | do_menu(&tree_playlist_menu, NULL, NULL, false); |
390 | } | 394 | } |
391 | 395 | ||
@@ -1032,8 +1036,13 @@ MENUITEM_FUNCTION(list_viewers_item, 0, ID2P(LANG_ONPLAY_OPEN_WITH), | |||
1032 | MENUITEM_FUNCTION(properties_item, MENU_FUNC_USEPARAM, ID2P(LANG_PROPERTIES), | 1036 | MENUITEM_FUNCTION(properties_item, MENU_FUNC_USEPARAM, ID2P(LANG_PROPERTIES), |
1033 | onplay_load_plugin, (void *)"properties", | 1037 | onplay_load_plugin, (void *)"properties", |
1034 | clipboard_callback, Icon_NOICON); | 1038 | clipboard_callback, Icon_NOICON); |
1035 | MENUITEM_FUNCTION(add_to_faves_item, MENU_FUNC_USEPARAM, ID2P(LANG_ADD_TO_FAVES), | 1039 | static bool onplay_add_to_shortcuts(void) |
1036 | onplay_load_plugin, (void *)"shortcuts_append", | 1040 | { |
1041 | shortcuts_add(SHORTCUT_BROWSER, selected_file); | ||
1042 | return false; | ||
1043 | } | ||
1044 | MENUITEM_FUNCTION(add_to_faves_item, 0, ID2P(LANG_ADD_TO_FAVES), | ||
1045 | onplay_add_to_shortcuts, NULL, | ||
1037 | clipboard_callback, Icon_NOICON); | 1046 | clipboard_callback, Icon_NOICON); |
1038 | 1047 | ||
1039 | #if LCD_DEPTH > 1 | 1048 | #if LCD_DEPTH > 1 |