diff options
author | Linus Nielsen Feltzing <linus@haxx.se> | 2004-07-13 13:57:14 +0000 |
---|---|---|
committer | Linus Nielsen Feltzing <linus@haxx.se> | 2004-07-13 13:57:14 +0000 |
commit | ae9b319ec555fd9b33c5c37b68b5578442e9de9f (patch) | |
tree | 7f22f669554cb2913e13e51da0d7e2d9b7d52c0e /apps | |
parent | 10fafb3d7c07c4418342858c1d246e65e3c08e2c (diff) | |
download | rockbox-ae9b319ec555fd9b33c5c37b68b5578442e9de9f.tar.gz rockbox-ae9b319ec555fd9b33c5c37b68b5578442e9de9f.zip |
Open with... now reloads the dir if the viewer returns PLUGIN_USB_CONNECTED
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4871 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r-- | apps/filetypes.c | 4 | ||||
-rw-r--r-- | apps/filetypes.h | 2 | ||||
-rw-r--r-- | apps/onplay.c | 8 |
3 files changed, 10 insertions, 4 deletions
diff --git a/apps/filetypes.c b/apps/filetypes.c index b9f5dd1935..b7004f58db 100644 --- a/apps/filetypes.c +++ b/apps/filetypes.c | |||
@@ -239,11 +239,11 @@ int filetype_load_menu(struct menu_item* menu,int max_items) | |||
239 | } | 239 | } |
240 | 240 | ||
241 | /* start a plugin with an argument (called from onplay.c) */ | 241 | /* start a plugin with an argument (called from onplay.c) */ |
242 | void filetype_load_plugin(char* plugin, char* file) | 242 | int filetype_load_plugin(char* plugin, char* file) |
243 | { | 243 | { |
244 | snprintf(plugin_name,sizeof(plugin_name),"%s/%s.rock", | 244 | snprintf(plugin_name,sizeof(plugin_name),"%s/%s.rock", |
245 | VIEWERS_DIR,plugin); | 245 | VIEWERS_DIR,plugin); |
246 | plugin_load(plugin_name,file); | 246 | return plugin_load(plugin_name,file); |
247 | } | 247 | } |
248 | 248 | ||
249 | /* get index to filetypes[] from the file attribute */ | 249 | /* get index to filetypes[] from the file attribute */ |
diff --git a/apps/filetypes.h b/apps/filetypes.h index 30bb71a38e..22668fd725 100644 --- a/apps/filetypes.h +++ b/apps/filetypes.h | |||
@@ -33,7 +33,7 @@ char* filetype_get_plugin(struct entry*); | |||
33 | void filetype_init(void); | 33 | void filetype_init(void); |
34 | bool filetype_supported(int); | 34 | bool filetype_supported(int); |
35 | int filetype_load_menu(struct menu_item*, int); | 35 | int filetype_load_menu(struct menu_item*, int); |
36 | void filetype_load_plugin(char*,char*); | 36 | int filetype_load_plugin(char*,char*); |
37 | 37 | ||
38 | struct file_type { | 38 | struct file_type { |
39 | #ifdef HAVE_LCD_BITMAP | 39 | #ifdef HAVE_LCD_BITMAP |
diff --git a/apps/onplay.c b/apps/onplay.c index 1d129970e0..e2a6c29374 100644 --- a/apps/onplay.c +++ b/apps/onplay.c | |||
@@ -44,6 +44,7 @@ | |||
44 | #include "talk.h" | 44 | #include "talk.h" |
45 | #include "onplay.h" | 45 | #include "onplay.h" |
46 | #include "filetypes.h" | 46 | #include "filetypes.h" |
47 | #include "plugin.h" | ||
47 | 48 | ||
48 | static char* selected_file = NULL; | 49 | static char* selected_file = NULL; |
49 | static int selected_file_attr = 0; | 50 | static int selected_file_attr = 0; |
@@ -53,6 +54,7 @@ static bool list_viewers(void) | |||
53 | { | 54 | { |
54 | struct menu_item menu[8]; | 55 | struct menu_item menu[8]; |
55 | int m, i, result; | 56 | int m, i, result; |
57 | int ret = 0; | ||
56 | 58 | ||
57 | i=filetype_load_menu(menu,sizeof(menu)/sizeof(*menu)); | 59 | i=filetype_load_menu(menu,sizeof(menu)/sizeof(*menu)); |
58 | if (i) | 60 | if (i) |
@@ -61,12 +63,16 @@ static bool list_viewers(void) | |||
61 | result = menu_show(m); | 63 | result = menu_show(m); |
62 | menu_exit(m); | 64 | menu_exit(m); |
63 | if (result >= 0) | 65 | if (result >= 0) |
64 | filetype_load_plugin(menu[result].desc,selected_file); | 66 | ret = filetype_load_plugin(menu[result].desc,selected_file); |
65 | } | 67 | } |
66 | else | 68 | else |
67 | { | 69 | { |
68 | splash(HZ*2, true, "No viewers found"); | 70 | splash(HZ*2, true, "No viewers found"); |
69 | } | 71 | } |
72 | |||
73 | if(ret == PLUGIN_USB_CONNECTED) | ||
74 | onplay_result = ONPLAY_RELOAD_DIR; | ||
75 | |||
70 | return false; | 76 | return false; |
71 | } | 77 | } |
72 | 78 | ||