summaryrefslogtreecommitdiff
path: root/apps/plugins/imageviewer/imageviewer.c
diff options
context:
space:
mode:
authorTeruaki Kawashima <teru@rockbox.org>2010-02-25 11:11:41 +0000
committerTeruaki Kawashima <teru@rockbox.org>2010-02-25 11:11:41 +0000
commit15f6bfc0e5b63287353df9186b62598adfed7ce2 (patch)
tree5471688af4d89d6f19593ed59df85d738e8d90be /apps/plugins/imageviewer/imageviewer.c
parentd95211a23d974d175a8609fa3efc7ca43d403993 (diff)
downloadrockbox-15f6bfc0e5b63287353df9186b62598adfed7ce2.zip
rockbox-15f6bfc0e5b63287353df9186b62598adfed7ce2.tar.gz
rockbox-15f6bfc0e5b63287353df9186b62598adfed7ce2.tar.bz2
rockbox-15f6bfc0e5b63287353df9186b62598adfed7ce2.tar.xz
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.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/apps/plugins/imageviewer/imageviewer.c b/apps/plugins/imageviewer/imageviewer.c
index 5c6bcc9..f82ba77 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)
#ifdef IMGVIEW_RC_MENU
case IMGVIEW_RC_MENU:
#endif
+#ifdef IMGVIEW_QUIT
+ case IMGVIEW_QUIT:
+#endif
case IMGVIEW_MENU:
return PLUGIN_OK;
@@ -374,7 +377,6 @@ static int ask_and_get_audio_buffer(const char *filename)
if(rb->default_event_handler_ex(button, cleanup, NULL)
== SYS_USB_CONNECTED)
return PLUGIN_USB_CONNECTED;
-
}
}
}
@@ -594,6 +596,10 @@ static int scroll_bmp(struct image_info *info)
case IMGVIEW_RC_MENU:
#endif
case IMGVIEW_MENU:
+#ifdef IMGVIEW_MENU_PRE
+ if (lastbutton != IMGVIEW_MENU_PRE)
+ break;
+#endif
#ifdef USEGSLIB
grey_show(false); /* switch off greyscale overlay */
#endif
@@ -609,6 +615,12 @@ static int scroll_bmp(struct image_info *info)
#endif
break;
+#ifdef IMGVIEW_QUIT
+ case IMGVIEW_QUIT:
+ return PLUGIN_OK;
+ break;
+#endif
+
default:
if (rb->default_event_handler_ex(button, cleanup, NULL)
== SYS_USB_CONNECTED)
@@ -835,8 +847,7 @@ static int load_and_show(char* filename, struct image_info *info)
#endif
rb->lcd_clear_display();
}
- while (status != PLUGIN_OK && status != PLUGIN_USB_CONNECTED
- && status != PLUGIN_OTHER);
+ while (status > PLUGIN_OTHER);
#ifdef USEGSLIB
rb->lcd_update();
#endif
@@ -902,8 +913,7 @@ enum plugin_status plugin_start(const void* parameter)
do
{
condition = load_and_show(np_file, &image_info);
- } while (condition != PLUGIN_OK && condition != PLUGIN_USB_CONNECTED
- && condition != PLUGIN_ERROR);
+ } while (condition >= PLUGIN_OTHER);
if (rb->memcmp(&settings, &old_settings, sizeof (settings)))
{