diff options
author | Björn Stenberg <bjorn@haxx.se> | 2003-06-29 22:39:35 +0000 |
---|---|---|
committer | Björn Stenberg <bjorn@haxx.se> | 2003-06-29 22:39:35 +0000 |
commit | ba5dfbd71ef9ea1a1c786d02e10311decc9ced64 (patch) | |
tree | 0a239fec234d9ec617ff8583e35922bb7f608954 /apps/tree.c | |
parent | 2f836a655cc1d00f9998d33e353662d4e131c16b (diff) | |
download | rockbox-ba5dfbd71ef9ea1a1c786d02e10311decc9ced64.tar.gz rockbox-ba5dfbd71ef9ea1a1c786d02e10311decc9ced64.zip |
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/tree.c')
-rw-r--r-- | apps/tree.c | 35 |
1 files changed, 35 insertions, 0 deletions
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 @@ | |||
55 | 55 | ||
56 | #ifdef HAVE_LCD_BITMAP | 56 | #ifdef HAVE_LCD_BITMAP |
57 | #include "widgets.h" | 57 | #include "widgets.h" |
58 | #define BOOTFILE "ajbrec.ajz" | ||
59 | #else | ||
60 | #define BOOTFILE "archos.mod" | ||
58 | #endif | 61 | #endif |
59 | 62 | ||
60 | /* Boot value of global_settings.max_files_in_dir */ | 63 | /* Boot value of global_settings.max_files_in_dir */ |
@@ -80,6 +83,9 @@ static char lastdir[MAX_PATH]; | |||
80 | static char lastfile[MAX_PATH]; | 83 | static char lastfile[MAX_PATH]; |
81 | static char currdir[MAX_PATH]; | 84 | static char currdir[MAX_PATH]; |
82 | static bool reload_dir = false; | 85 | static bool reload_dir = false; |
86 | static int boot_size = 0; | ||
87 | static int boot_cluster; | ||
88 | static bool boot_changed = false; | ||
83 | 89 | ||
84 | void browse_root(void) | 90 | void browse_root(void) |
85 | { | 91 | { |
@@ -322,6 +328,17 @@ static int showdir(char *path, int start) | |||
322 | dptr->attr |= TREE_ATTR_ROCK; | 328 | dptr->attr |= TREE_ATTR_ROCK; |
323 | } | 329 | } |
324 | 330 | ||
331 | /* memorize/compare details about the boot file */ | ||
332 | if ((currdir[1] == 0) && !strcmp(entry->d_name, BOOTFILE)) { | ||
333 | if (boot_size) { | ||
334 | if ((entry->size != boot_size) || | ||
335 | (entry->startcluster != boot_cluster)) | ||
336 | boot_changed = true; | ||
337 | } | ||
338 | boot_size = entry->size; | ||
339 | boot_cluster = entry->startcluster; | ||
340 | } | ||
341 | |||
325 | /* filter out all non-playlist files */ | 342 | /* filter out all non-playlist files */ |
326 | if ( global_settings.dirfilter == SHOW_PLAYLIST && | 343 | if ( global_settings.dirfilter == SHOW_PLAYLIST && |
327 | (!(dptr->attr & | 344 | (!(dptr->attr & |
@@ -822,6 +839,24 @@ bool dirbrowse(char *root) | |||
822 | bool restore = false; | 839 | bool restore = false; |
823 | 840 | ||
824 | button = button_get_w_tmo(HZ/5); | 841 | button = button_get_w_tmo(HZ/5); |
842 | |||
843 | #ifndef SIMULATOR | ||
844 | if (boot_changed) { | ||
845 | lcd_clear_display(); | ||
846 | lcd_puts(0,0,str(LANG_BOOT_CHANGED)); | ||
847 | lcd_puts(0,1,str(LANG_REBOOT_NOW)); | ||
848 | #ifdef HAVE_LCD_BITMAP | ||
849 | lcd_puts(0,3,str(LANG_CONFIRM_WITH_PLAY_RECORDER)); | ||
850 | lcd_puts(0,4,str(LANG_CANCEL_WITH_ANY_RECORDER)); | ||
851 | lcd_update(); | ||
852 | #endif | ||
853 | if (button_get(true) == BUTTON_PLAY) | ||
854 | rolo_load("/" BOOTFILE); | ||
855 | restore = true; | ||
856 | boot_changed = false; | ||
857 | } | ||
858 | #endif | ||
859 | |||
825 | switch ( button ) { | 860 | switch ( button ) { |
826 | case TREE_EXIT: | 861 | case TREE_EXIT: |
827 | case BUTTON_RC_STOP: | 862 | case BUTTON_RC_STOP: |