summaryrefslogtreecommitdiff
path: root/apps/plugins/imageviewer/imageviewer.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/imageviewer/imageviewer.c')
-rw-r--r--apps/plugins/imageviewer/imageviewer.c29
1 files changed, 25 insertions, 4 deletions
diff --git a/apps/plugins/imageviewer/imageviewer.c b/apps/plugins/imageviewer/imageviewer.c
index 01b9f31be1..37610b7bf6 100644
--- a/apps/plugins/imageviewer/imageviewer.c
+++ b/apps/plugins/imageviewer/imageviewer.c
@@ -28,10 +28,10 @@
28#include <lib/helper.h> 28#include <lib/helper.h>
29#include <lib/configfile.h> 29#include <lib/configfile.h>
30#include "imageviewer.h" 30#include "imageviewer.h"
31#include "imageviewer_button.h"
31#include "image_decoder.h" 32#include "image_decoder.h"
32 33
33 34
34
35#ifdef USEGSLIB 35#ifdef USEGSLIB
36GREY_INFO_STRUCT 36GREY_INFO_STRUCT
37#endif 37#endif
@@ -344,6 +344,8 @@ static int show_menu(void) /* return 1 to quit */
344#ifdef USE_PLUG_BUF 344#ifdef USE_PLUG_BUF
345static int ask_and_get_audio_buffer(const char *filename) 345static int ask_and_get_audio_buffer(const char *filename)
346{ 346{
347 int button;
348 int lastbutton = BUTTON_NONE;
347 rb->lcd_setfont(FONT_SYSFIXED); 349 rb->lcd_setfont(FONT_SYSFIXED);
348 rb->lcd_clear_display(); 350 rb->lcd_clear_display();
349 rb->lcd_puts(0, 0, rb->strrchr(filename,'/')+1); 351 rb->lcd_puts(0, 0, rb->strrchr(filename,'/')+1);
@@ -359,10 +361,18 @@ static int ask_and_get_audio_buffer(const char *filename)
359 361
360 while (1) 362 while (1)
361 { 363 {
362 int button = rb->button_get(true); 364 if (iv_api.slideshow_enabled)
365 button = rb->button_get_w_tmo(settings.ss_timeout * HZ);
366 else
367 button = rb->button_get(true);
368
363 switch(button) 369 switch(button)
364 { 370 {
365 case IMGVIEW_ZOOM_IN: 371 case IMGVIEW_ZOOM_IN:
372#ifdef IMGVIEW_ZOOM_PRE
373 if (lastbutton != IMGVIEW_ZOOM_PRE)
374 break;
375#endif
366 iv_api.plug_buf = false; 376 iv_api.plug_buf = false;
367 buf = rb->plugin_get_audio_buffer(&buf_size); 377 buf = rb->plugin_get_audio_buffer(&buf_size);
368 /*try again this file, now using the audio buffer */ 378 /*try again this file, now using the audio buffer */
@@ -391,11 +401,22 @@ static int ask_and_get_audio_buffer(const char *filename)
391 return change_filename(DIR_NEXT); 401 return change_filename(DIR_NEXT);
392 } 402 }
393 break; 403 break;
404 case BUTTON_NONE:
405 if(entries>1)
406 {
407 rb->lcd_clear_display();
408 return change_filename(direction);
409 }
410 break;
411
394 default: 412 default:
395 if(rb->default_event_handler_ex(button, cleanup, NULL) 413 if(rb->default_event_handler_ex(button, cleanup, NULL)
396 == SYS_USB_CONNECTED) 414 == SYS_USB_CONNECTED)
397 return PLUGIN_USB_CONNECTED; 415 return PLUGIN_USB_CONNECTED;
398 } 416 }
417
418 if (button != BUTTON_NONE)
419 lastbutton = button;
399 } 420 }
400} 421}
401#endif /* USE_PLUG_BUF */ 422#endif /* USE_PLUG_BUF */
@@ -771,7 +792,7 @@ static int load_and_show(char* filename, struct image_info *info)
771 return change_filename(direction); 792 return change_filename(direction);
772 } 793 }
773 else if (status == PLUGIN_ABORT) { 794 else if (status == PLUGIN_ABORT) {
774 rb->splash(HZ, "aborted"); 795 rb->splash(HZ, "Aborted");
775 return PLUGIN_OK; 796 return PLUGIN_OK;
776 } 797 }
777 798
@@ -793,7 +814,7 @@ static int load_and_show(char* filename, struct image_info *info)
793 else 814 else
794#endif 815#endif
795 { 816 {
796 rb->splash(HZ, "too large"); 817 rb->splash(HZ, "Too large");
797 file_pt[curfile] = NULL; 818 file_pt[curfile] = NULL;
798 return change_filename(direction); 819 return change_filename(direction);
799 } 820 }