diff options
| author | Linus Nielsen Feltzing <linus@haxx.se> | 2004-07-26 16:06:59 +0000 |
|---|---|---|
| committer | Linus Nielsen Feltzing <linus@haxx.se> | 2004-07-26 16:06:59 +0000 |
| commit | ade5d7b848bf9c0d46bb14c85528453f969c9429 (patch) | |
| tree | 197aa919b9a3c2a89f77d12b01cc1c2c23f7e37f /apps/tree.c | |
| parent | 3d91885718a1fb9d6d55f07f67a9a1942a352c5e (diff) | |
| download | rockbox-ade5d7b848bf9c0d46bb14c85528453f969c9429.zip rockbox-ade5d7b848bf9c0d46bb14c85528453f969c9429.tar.gz rockbox-ade5d7b848bf9c0d46bb14c85528453f969c9429.tar.bz2 rockbox-ade5d7b848bf9c0d46bb14c85528453f969c9429.tar.xz | |
First step in revamping the USB event handling, paving the way for the upcoming SYS_POWER_OFF event
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4951 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/tree.c')
| -rw-r--r-- | apps/tree.c | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/apps/tree.c b/apps/tree.c index 72a2261..9ce5a9c 100644 --- a/apps/tree.c +++ b/apps/tree.c @@ -56,6 +56,7 @@ #include "action.h" #include "talk.h" #include "filetypes.h" +#include "misc.h" #ifdef HAVE_LCD_BITMAP #include "widgets.h" @@ -599,7 +600,7 @@ static bool ask_resume(bool ask_once) #endif if (usb_detect()) { - usb_screen(); + default_event_handler(SYS_USB_CONNECTED); return false; } @@ -635,13 +636,8 @@ static bool ask_resume(bool ask_once) case BUTTON_ON | BUTTON_REPEAT: break; #endif - - case SYS_USB_CONNECTED: - usb_screen(); - stop = true; - break; - default: + default_event_handler(button); stop = true; break; } @@ -940,6 +936,7 @@ static bool dirbrowse(char *root, int *dirfilter) #ifndef SIMULATOR if (boot_changed) { bool stop = false; + int button; lcd_clear_display(); lcd_puts(0,0,str(LANG_BOOT_CHANGED)); @@ -950,18 +947,15 @@ static bool dirbrowse(char *root, int *dirfilter) lcd_update(); #endif while (!stop) { - switch (button_get(true)) { + button = button_get(true); + switch (button) { case BUTTON_PLAY: rolo_load("/" BOOTFILE); stop = true; break; - case SYS_USB_CONNECTED: - usb_screen(); - stop = true; - break; - default: + default_event_handler(button); stop = true; break; } @@ -1372,11 +1366,6 @@ static bool dirbrowse(char *root, int *dirfilter) #endif break; - case SYS_USB_CONNECTED: - usb_screen(); - reload_root = true; - break; - case BUTTON_NONE: if (thumbnail_time != -1 && TIME_AFTER(current_tick, thumbnail_time)) @@ -1393,6 +1382,11 @@ static bool dirbrowse(char *root, int *dirfilter) } status_draw(false); break; + + default: + if(default_event_handler(button) == SYS_USB_CONNECTED) + reload_root = true; + break; } if ( button ) |