summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2004-07-13 13:57:14 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2004-07-13 13:57:14 +0000
commitae9b319ec555fd9b33c5c37b68b5578442e9de9f (patch)
tree7f22f669554cb2913e13e51da0d7e2d9b7d52c0e
parent10fafb3d7c07c4418342858c1d246e65e3c08e2c (diff)
downloadrockbox-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
-rw-r--r--apps/filetypes.c4
-rw-r--r--apps/filetypes.h2
-rw-r--r--apps/onplay.c8
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) */
242void filetype_load_plugin(char* plugin, char* file) 242int 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*);
33void filetype_init(void); 33void filetype_init(void);
34bool filetype_supported(int); 34bool filetype_supported(int);
35int filetype_load_menu(struct menu_item*, int); 35int filetype_load_menu(struct menu_item*, int);
36void filetype_load_plugin(char*,char*); 36int filetype_load_plugin(char*,char*);
37 37
38struct file_type { 38struct 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
48static char* selected_file = NULL; 49static char* selected_file = NULL;
49static int selected_file_attr = 0; 50static 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