summaryrefslogtreecommitdiffstats
path: root/apps/onplay.c
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2011-11-15 13:22:02 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2011-11-15 13:22:02 +0000
commit101693fd3047fb64e766580e80635a424fa25c4d (patch)
tree80f5664710a6e84b73f33e22c1b8632c13c5a727 /apps/onplay.c
parente7e4b131d06f748400b5299d4d1ebfb38f9f08bf (diff)
downloadrockbox-101693fd3047fb64e766580e80635a424fa25c4d.tar.gz
rockbox-101693fd3047fb64e766580e80635a424fa25c4d.tar.bz2
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.c19
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 @@
#include "pitchscreen.h"
#include "viewport.h"
#include "filefuncs.h"
+#include "shortcuts.h"
static int context;
static char* selected_file = NULL;
@@ -382,10 +383,13 @@ static int treeplaylist_callback(int action,
return action;
}
-void onplay_show_playlist_menu(char* track_name)
+void onplay_show_playlist_menu(char* path)
{
- selected_file = track_name;
- selected_file_attr = FILE_ATTR_AUDIO;
+ selected_file = path;
+ if (dir_exists(path))
+ selected_file_attr = ATTR_DIRECTORY;
+ else
+ selected_file_attr = filetype_get_attr(path);
do_menu(&tree_playlist_menu, NULL, NULL, false);
}
@@ -1032,8 +1036,13 @@ MENUITEM_FUNCTION(list_viewers_item, 0, ID2P(LANG_ONPLAY_OPEN_WITH),
MENUITEM_FUNCTION(properties_item, MENU_FUNC_USEPARAM, ID2P(LANG_PROPERTIES),
onplay_load_plugin, (void *)"properties",
clipboard_callback, Icon_NOICON);
-MENUITEM_FUNCTION(add_to_faves_item, MENU_FUNC_USEPARAM, ID2P(LANG_ADD_TO_FAVES),
- onplay_load_plugin, (void *)"shortcuts_append",
+static bool onplay_add_to_shortcuts(void)
+{
+ shortcuts_add(SHORTCUT_BROWSER, selected_file);
+ return false;
+}
+MENUITEM_FUNCTION(add_to_faves_item, 0, ID2P(LANG_ADD_TO_FAVES),
+ onplay_add_to_shortcuts, NULL,
clipboard_callback, Icon_NOICON);
#if LCD_DEPTH > 1