summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorBjörn Stenberg <bjorn@haxx.se>2003-06-29 22:39:35 +0000
committerBjörn Stenberg <bjorn@haxx.se>2003-06-29 22:39:35 +0000
commitba5dfbd71ef9ea1a1c786d02e10311decc9ced64 (patch)
tree0a239fec234d9ec617ff8583e35922bb7f608954 /apps
parent2f836a655cc1d00f9998d33e353662d4e131c16b (diff)
The file browser now detects if ajbrec.ajz/archos.mod has been modified after a usb session, and asks if you want to reboot to the new version.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3783 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/lang/english.lang13
-rw-r--r--apps/tree.c35
2 files changed, 48 insertions, 0 deletions
diff --git a/apps/lang/english.lang b/apps/lang/english.lang
index 1d7b3088a6..9ca18b88ef 100644
--- a/apps/lang/english.lang
+++ b/apps/lang/english.lang
@@ -1599,3 +1599,16 @@ desc: The plugin return an error code
eng: "Plugin returned error"
new:
+##
+## boot change detection
+##
+
+id: LANG_BOOT_CHANGED
+desc: File browser discovered the boot file was changed
+eng: "Boot changed"
+new:
+
+id: LANG_REBOOT_NOW
+desc: Do you want to reboot?
+eng: "Reboot now?"
+new:
diff --git a/apps/tree.c b/apps/tree.c
index e61fdc50cb..f7a83de85f 100644
--- a/apps/tree.c
+++ b/apps/tree.c
@@ -55,6 +55,9 @@
#ifdef HAVE_LCD_BITMAP
#include "widgets.h"
+#define BOOTFILE "ajbrec.ajz"
+#else
+#define BOOTFILE "archos.mod"
#endif
/* Boot value of global_settings.max_files_in_dir */
@@ -80,6 +83,9 @@ static char lastdir[MAX_PATH];
static char lastfile[MAX_PATH];
static char currdir[MAX_PATH];
static bool reload_dir = false;
+static int boot_size = 0;
+static int boot_cluster;
+static bool boot_changed = false;
void browse_root(void)
{
@@ -322,6 +328,17 @@ static int showdir(char *path, int start)
dptr->attr |= TREE_ATTR_ROCK;
}
+ /* memorize/compare details about the boot file */
+ if ((currdir[1] == 0) && !strcmp(entry->d_name, BOOTFILE)) {
+ if (boot_size) {
+ if ((entry->size != boot_size) ||
+ (entry->startcluster != boot_cluster))
+ boot_changed = true;
+ }
+ boot_size = entry->size;
+ boot_cluster = entry->startcluster;
+ }
+
/* filter out all non-playlist files */
if ( global_settings.dirfilter == SHOW_PLAYLIST &&
(!(dptr->attr &
@@ -822,6 +839,24 @@ bool dirbrowse(char *root)
bool restore = false;
button = button_get_w_tmo(HZ/5);
+
+#ifndef SIMULATOR
+ if (boot_changed) {
+ lcd_clear_display();
+ lcd_puts(0,0,str(LANG_BOOT_CHANGED));
+ lcd_puts(0,1,str(LANG_REBOOT_NOW));
+#ifdef HAVE_LCD_BITMAP
+ lcd_puts(0,3,str(LANG_CONFIRM_WITH_PLAY_RECORDER));
+ lcd_puts(0,4,str(LANG_CANCEL_WITH_ANY_RECORDER));
+ lcd_update();
+#endif
+ if (button_get(true) == BUTTON_PLAY)
+ rolo_load("/" BOOTFILE);
+ restore = true;
+ boot_changed = false;
+ }
+#endif
+
switch ( button ) {
case TREE_EXIT:
case BUTTON_RC_STOP: