summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/lang/english.lang16
-rw-r--r--apps/onplay.c14
-rw-r--r--apps/plugin.c2
-rw-r--r--apps/plugin.h4
-rw-r--r--apps/plugins/SOURCES1
-rw-r--r--apps/plugins/viewers.config1
-rw-r--r--apps/tree.c9
-rw-r--r--apps/tree.h2
8 files changed, 44 insertions, 5 deletions
diff --git a/apps/lang/english.lang b/apps/lang/english.lang
index dcace6db8c..b66b7f8362 100644
--- a/apps/lang/english.lang
+++ b/apps/lang/english.lang
@@ -11067,4 +11067,18 @@
11067 <voice> 11067 <voice>
11068 *: "" 11068 *: ""
11069 </voice> 11069 </voice>
11070</phrase> \ No newline at end of file 11070</phrase>
11071<phrase>
11072 id: LANG_ADD_TO_FAVES
11073 desc:
11074 user:
11075 <source>
11076 *: "Add to shortcuts"
11077 </source>
11078 <dest>
11079 *: "Add to shortcuts"
11080 </dest>
11081 <voice>
11082 *: "Add to shortcuts"
11083 </voice>
11084</phrase>
diff --git a/apps/onplay.c b/apps/onplay.c
index f09913e312..eb03b0781b 100644
--- a/apps/onplay.c
+++ b/apps/onplay.c
@@ -1077,7 +1077,15 @@ static bool set_recdir(void)
1077MENUITEM_FUNCTION(set_recdir_item, 0, ID2P(LANG_SET_AS_REC_DIR), 1077MENUITEM_FUNCTION(set_recdir_item, 0, ID2P(LANG_SET_AS_REC_DIR),
1078 set_recdir, NULL, clipboard_callback, Icon_Recording); 1078 set_recdir, NULL, clipboard_callback, Icon_Recording);
1079#endif 1079#endif
1080 1080static bool add_to_faves(void)
1081{
1082 if(PLUGIN_USB_CONNECTED == filetype_load_plugin("shortcuts",
1083 selected_file))
1084 onplay_result = ONPLAY_RELOAD_DIR;
1085 return false;
1086}
1087MENUITEM_FUNCTION(add_to_faves_item, 0, ID2P(LANG_ADD_TO_FAVES),
1088 add_to_faves, NULL, clipboard_callback, Icon_NOICON);
1081 1089
1082 1090
1083static int clipboard_callback(int action,const struct menu_item_ex *this_item) 1091static int clipboard_callback(int action,const struct menu_item_ex *this_item)
@@ -1096,7 +1104,8 @@ static int clipboard_callback(int action,const struct menu_item_ex *this_item)
1096 (this_item == &properties_item) || 1104 (this_item == &properties_item) ||
1097 (this_item == &rename_file_item) || 1105 (this_item == &rename_file_item) ||
1098 (this_item == &clipboard_cut_item) || 1106 (this_item == &clipboard_cut_item) ||
1099 (this_item == &clipboard_copy_item) 1107 (this_item == &clipboard_copy_item) ||
1108 (this_item == &add_to_faves_item)
1100 ) 1109 )
1101 { 1110 {
1102 /* always visible */ 1111 /* always visible */
@@ -1177,6 +1186,7 @@ MAKE_ONPLAYMENU( tree_onplay_menu, ID2P(LANG_ONPLAY_MENU_TITLE),
1177#ifdef HAVE_RECORDING 1186#ifdef HAVE_RECORDING
1178 &set_recdir_item, 1187 &set_recdir_item,
1179#endif 1188#endif
1189 &add_to_faves_item,
1180 ); 1190 );
1181int onplay(char* file, int attr, int from) 1191int onplay(char* file, int attr, int from)
1182{ 1192{
diff --git a/apps/plugin.c b/apps/plugin.c
index 5028bfdd3c..20ecafb532 100644
--- a/apps/plugin.c
+++ b/apps/plugin.c
@@ -499,6 +499,8 @@ static const struct plugin_api rockbox_api = {
499 screen_clear_area, 499 screen_clear_area,
500#endif 500#endif
501 led, 501 led,
502 set_current_file,
503 set_dirfilter,
502}; 504};
503 505
504int plugin_load(const char* plugin, void* parameter) 506int plugin_load(const char* plugin, void* parameter)
diff --git a/apps/plugin.h b/apps/plugin.h
index 61cfe96e8d..c3febf3243 100644
--- a/apps/plugin.h
+++ b/apps/plugin.h
@@ -112,7 +112,7 @@
112#define PLUGIN_MAGIC 0x526F634B /* RocK */ 112#define PLUGIN_MAGIC 0x526F634B /* RocK */
113 113
114/* increase this every time the api struct changes */ 114/* increase this every time the api struct changes */
115#define PLUGIN_API_VERSION 69 115#define PLUGIN_API_VERSION 70
116 116
117/* update this to latest version if a change to the api struct breaks 117/* update this to latest version if a change to the api struct breaks
118 backwards compatibility (and please take the opportunity to sort in any 118 backwards compatibility (and please take the opportunity to sort in any
@@ -620,6 +620,8 @@ struct plugin_api {
620 int width, int height); 620 int width, int height);
621#endif 621#endif
622 void (*led)(bool on); 622 void (*led)(bool on);
623 void (*set_current_file)(char* path);
624 void (*set_dirfilter)(int l_dirfilter);
623}; 625};
624 626
625/* plugin header */ 627/* plugin header */
diff --git a/apps/plugins/SOURCES b/apps/plugins/SOURCES
index 31d94d5811..23d3e6becc 100644
--- a/apps/plugins/SOURCES
+++ b/apps/plugins/SOURCES
@@ -13,6 +13,7 @@ random_folder_advance_config.c
13rockblox.c 13rockblox.c
14rockbox_flash.c 14rockbox_flash.c
15search.c 15search.c
16shortcuts.c
16snow.c 17snow.c
17sort.c 18sort.c
18stats.c 19stats.c
diff --git a/apps/plugins/viewers.config b/apps/plugins/viewers.config
index 0f70dc737d..80ebe43334 100644
--- a/apps/plugins/viewers.config
+++ b/apps/plugins/viewers.config
@@ -36,3 +36,4 @@ z80,viewers/zxbox,12
36zzz,viewers/properties,- 36zzz,viewers/properties,-
37colours,rocks/text_editor,11 37colours,rocks/text_editor,11
38ssg,rocks/superdom,- 38ssg,rocks/superdom,-
39link,rocks/shortcuts,-
diff --git a/apps/tree.c b/apps/tree.c
index 5a4292d34c..9341f81421 100644
--- a/apps/tree.c
+++ b/apps/tree.c
@@ -454,8 +454,15 @@ void get_current_file(char* buffer, int buffer_len)
454 tc.dirlength ? e->name : ""); 454 tc.dirlength ? e->name : "");
455} 455}
456 456
457/* Allow apps to change our dirfilter directly (required for sub browsers)
458 if they're suddenly going to become a file browser for example */
459void set_dirfilter(int l_dirfilter)
460{
461 *tc.dirfilter = l_dirfilter;
462}
463
457/* Selects a file and update tree context properly */ 464/* Selects a file and update tree context properly */
458static void set_current_file(char *path) 465void set_current_file(char *path)
459{ 466{
460 char *name; 467 char *name;
461 int i; 468 int i;
diff --git a/apps/tree.h b/apps/tree.h
index 96cb712a1a..e49ac722b9 100644
--- a/apps/tree.h
+++ b/apps/tree.h
@@ -70,6 +70,8 @@ struct tree_context {
70void tree_mem_init(void); 70void tree_mem_init(void);
71void tree_gui_init(void); 71void tree_gui_init(void);
72void get_current_file(char* buffer, int buffer_len); 72void get_current_file(char* buffer, int buffer_len);
73void set_dirfilter(int l_dirfilter);
74void set_current_file(char *path);
73int rockbox_browse(const char *root, int dirfilter); 75int rockbox_browse(const char *root, int dirfilter);
74bool create_playlist(void); 76bool create_playlist(void);
75void resume_directory(const char *dir); 77void resume_directory(const char *dir);