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.zip
rockbox-ae9b319ec555fd9b33c5c37b68b5578442e9de9f.tar.gz
rockbox-ae9b319ec555fd9b33c5c37b68b5578442e9de9f.tar.bz2
rockbox-ae9b319ec555fd9b33c5c37b68b5578442e9de9f.tar.xz
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 b9f5dd1..b7004f5 100644
--- a/apps/filetypes.c
+++ b/apps/filetypes.c
@@ -239,11 +239,11 @@ int filetype_load_menu(struct menu_item* menu,int max_items)
}
/* start a plugin with an argument (called from onplay.c) */
-void filetype_load_plugin(char* plugin, char* file)
+int filetype_load_plugin(char* plugin, char* file)
{
snprintf(plugin_name,sizeof(plugin_name),"%s/%s.rock",
VIEWERS_DIR,plugin);
- plugin_load(plugin_name,file);
+ return plugin_load(plugin_name,file);
}
/* get index to filetypes[] from the file attribute */
diff --git a/apps/filetypes.h b/apps/filetypes.h
index 30bb71a..22668fd 100644
--- a/apps/filetypes.h
+++ b/apps/filetypes.h
@@ -33,7 +33,7 @@ char* filetype_get_plugin(struct entry*);
void filetype_init(void);
bool filetype_supported(int);
int filetype_load_menu(struct menu_item*, int);
-void filetype_load_plugin(char*,char*);
+int filetype_load_plugin(char*,char*);
struct file_type {
#ifdef HAVE_LCD_BITMAP
diff --git a/apps/onplay.c b/apps/onplay.c
index 1d12997..e2a6c29 100644
--- a/apps/onplay.c
+++ b/apps/onplay.c
@@ -44,6 +44,7 @@
#include "talk.h"
#include "onplay.h"
#include "filetypes.h"
+#include "plugin.h"
static char* selected_file = NULL;
static int selected_file_attr = 0;
@@ -53,6 +54,7 @@ static bool list_viewers(void)
{
struct menu_item menu[8];
int m, i, result;
+ int ret = 0;
i=filetype_load_menu(menu,sizeof(menu)/sizeof(*menu));
if (i)
@@ -61,12 +63,16 @@ static bool list_viewers(void)
result = menu_show(m);
menu_exit(m);
if (result >= 0)
- filetype_load_plugin(menu[result].desc,selected_file);
+ ret = filetype_load_plugin(menu[result].desc,selected_file);
}
else
{
splash(HZ*2, true, "No viewers found");
}
+
+ if(ret == PLUGIN_USB_CONNECTED)
+ onplay_result = ONPLAY_RELOAD_DIR;
+
return false;
}