summaryrefslogtreecommitdiff
path: root/apps/onplay.c
diff options
context:
space:
mode:
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 @@
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
67static int context; 68static int context;
68static char* selected_file = NULL; 69static char* selected_file = NULL;
@@ -382,10 +383,13 @@ static int treeplaylist_callback(int action,
382 return action; 383 return action;
383} 384}
384 385
385void onplay_show_playlist_menu(char* track_name) 386void 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),
1032MENUITEM_FUNCTION(properties_item, MENU_FUNC_USEPARAM, ID2P(LANG_PROPERTIES), 1036MENUITEM_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);
1035MENUITEM_FUNCTION(add_to_faves_item, MENU_FUNC_USEPARAM, ID2P(LANG_ADD_TO_FAVES), 1039static 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}
1044MENUITEM_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