diff options
author | Teruaki Kawashima <teru@rockbox.org> | 2010-02-25 11:11:41 +0000 |
---|---|---|
committer | Teruaki Kawashima <teru@rockbox.org> | 2010-02-25 11:11:41 +0000 |
commit | 15f6bfc0e5b63287353df9186b62598adfed7ce2 (patch) | |
tree | 5471688af4d89d6f19593ed59df85d738e8d90be /apps/plugins/imageviewer/imageviewer.c | |
parent | d95211a23d974d175a8609fa3efc7ca43d403993 (diff) | |
download | rockbox-15f6bfc0e5b63287353df9186b62598adfed7ce2.tar.gz rockbox-15f6bfc0e5b63287353df9186b62598adfed7ce2.zip |
imageviewer: add button to quit plugin immediately if there is enough key for it.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24904 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/imageviewer/imageviewer.c')
-rw-r--r-- | apps/plugins/imageviewer/imageviewer.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/apps/plugins/imageviewer/imageviewer.c b/apps/plugins/imageviewer/imageviewer.c index 5c6bcc918f..f82ba771a9 100644 --- a/apps/plugins/imageviewer/imageviewer.c +++ b/apps/plugins/imageviewer/imageviewer.c | |||
@@ -352,6 +352,9 @@ static int ask_and_get_audio_buffer(const char *filename) | |||
352 | #ifdef IMGVIEW_RC_MENU | 352 | #ifdef IMGVIEW_RC_MENU |
353 | case IMGVIEW_RC_MENU: | 353 | case IMGVIEW_RC_MENU: |
354 | #endif | 354 | #endif |
355 | #ifdef IMGVIEW_QUIT | ||
356 | case IMGVIEW_QUIT: | ||
357 | #endif | ||
355 | case IMGVIEW_MENU: | 358 | case IMGVIEW_MENU: |
356 | return PLUGIN_OK; | 359 | return PLUGIN_OK; |
357 | 360 | ||
@@ -374,7 +377,6 @@ static int ask_and_get_audio_buffer(const char *filename) | |||
374 | if(rb->default_event_handler_ex(button, cleanup, NULL) | 377 | if(rb->default_event_handler_ex(button, cleanup, NULL) |
375 | == SYS_USB_CONNECTED) | 378 | == SYS_USB_CONNECTED) |
376 | return PLUGIN_USB_CONNECTED; | 379 | return PLUGIN_USB_CONNECTED; |
377 | |||
378 | } | 380 | } |
379 | } | 381 | } |
380 | } | 382 | } |
@@ -594,6 +596,10 @@ static int scroll_bmp(struct image_info *info) | |||
594 | case IMGVIEW_RC_MENU: | 596 | case IMGVIEW_RC_MENU: |
595 | #endif | 597 | #endif |
596 | case IMGVIEW_MENU: | 598 | case IMGVIEW_MENU: |
599 | #ifdef IMGVIEW_MENU_PRE | ||
600 | if (lastbutton != IMGVIEW_MENU_PRE) | ||
601 | break; | ||
602 | #endif | ||
597 | #ifdef USEGSLIB | 603 | #ifdef USEGSLIB |
598 | grey_show(false); /* switch off greyscale overlay */ | 604 | grey_show(false); /* switch off greyscale overlay */ |
599 | #endif | 605 | #endif |
@@ -609,6 +615,12 @@ static int scroll_bmp(struct image_info *info) | |||
609 | #endif | 615 | #endif |
610 | break; | 616 | break; |
611 | 617 | ||
618 | #ifdef IMGVIEW_QUIT | ||
619 | case IMGVIEW_QUIT: | ||
620 | return PLUGIN_OK; | ||
621 | break; | ||
622 | #endif | ||
623 | |||
612 | default: | 624 | default: |
613 | if (rb->default_event_handler_ex(button, cleanup, NULL) | 625 | if (rb->default_event_handler_ex(button, cleanup, NULL) |
614 | == SYS_USB_CONNECTED) | 626 | == SYS_USB_CONNECTED) |
@@ -835,8 +847,7 @@ static int load_and_show(char* filename, struct image_info *info) | |||
835 | #endif | 847 | #endif |
836 | rb->lcd_clear_display(); | 848 | rb->lcd_clear_display(); |
837 | } | 849 | } |
838 | while (status != PLUGIN_OK && status != PLUGIN_USB_CONNECTED | 850 | while (status > PLUGIN_OTHER); |
839 | && status != PLUGIN_OTHER); | ||
840 | #ifdef USEGSLIB | 851 | #ifdef USEGSLIB |
841 | rb->lcd_update(); | 852 | rb->lcd_update(); |
842 | #endif | 853 | #endif |
@@ -902,8 +913,7 @@ enum plugin_status plugin_start(const void* parameter) | |||
902 | do | 913 | do |
903 | { | 914 | { |
904 | condition = load_and_show(np_file, &image_info); | 915 | condition = load_and_show(np_file, &image_info); |
905 | } while (condition != PLUGIN_OK && condition != PLUGIN_USB_CONNECTED | 916 | } while (condition >= PLUGIN_OTHER); |
906 | && condition != PLUGIN_ERROR); | ||
907 | 917 | ||
908 | if (rb->memcmp(&settings, &old_settings, sizeof (settings))) | 918 | if (rb->memcmp(&settings, &old_settings, sizeof (settings))) |
909 | { | 919 | { |