summaryrefslogtreecommitdiff
path: root/apps/bookmark.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/bookmark.c')
-rw-r--r--apps/bookmark.c50
1 files changed, 23 insertions, 27 deletions
diff --git a/apps/bookmark.c b/apps/bookmark.c
index 166ed2b7d1..23ccaefd86 100644
--- a/apps/bookmark.c
+++ b/apps/bookmark.c
@@ -256,27 +256,25 @@ bool bookmark_autobookmark(void)
256 { 256 {
257 /* Wait for a key to be pushed */ 257 /* Wait for a key to be pushed */
258 key = button_get(true); 258 key = button_get(true);
259 if (key & BUTTON_REL) 259 switch (key)
260 { 260 {
261#ifdef BUTTON_PLAY 261 case SETTINGS_OK:
262 if (key & BUTTON_PLAY)
263#else
264 if (key & BUTTON_RIGHT)
265#endif
266 {
267 if (global_settings.autocreatebookmark == 262 if (global_settings.autocreatebookmark ==
268 BOOKMARK_RECENT_ONLY_ASK) 263 BOOKMARK_RECENT_ONLY_ASK)
269 write_bookmark(false); 264 return write_bookmark(false);
270 else 265 else
271 write_bookmark(true); 266 return write_bookmark(true);
272 } 267 break;
273 done = true;
274 }
275 268
276 if (default_event_handler(key) == SYS_USB_CONNECTED) 269 default:
277 return false; 270 /* Handle sys events, ignore button releases & repeats */
271 if(default_event_handler(key) ||
272 !(key & (BUTTON_REL|BUTTON_REPEAT)))
273 done = true;
274 break;
275 }
278 } 276 }
279 return true; 277 return false;
280} 278}
281 279
282/* ----------------------------------------------------------------------- */ 280/* ----------------------------------------------------------------------- */
@@ -482,7 +480,7 @@ bool bookmark_autoload(const char* file)
482 } 480 }
483 else 481 else
484 { 482 {
485 while (button_get(false)); /* clear button queue */ 483 button_clear_queue(); /* clear button queue */
486 /* Prompting user to confirm bookmark load */ 484 /* Prompting user to confirm bookmark load */
487 lcd_clear_display(); 485 lcd_clear_display();
488#ifdef HAVE_LCD_BITMAP 486#ifdef HAVE_LCD_BITMAP
@@ -512,11 +510,7 @@ bool bookmark_autoload(const char* file)
512 case BUTTON_DOWN: 510 case BUTTON_DOWN:
513 return bookmark_load(global_bookmark_file_name, false); 511 return bookmark_load(global_bookmark_file_name, false);
514#endif 512#endif
515#ifdef BUTTON_PLAY 513 case SETTINGS_OK:
516 case BUTTON_PLAY:
517#else
518 case BUTTON_RIGHT:
519#endif
520 return bookmark_load(global_bookmark_file_name, true); 514 return bookmark_load(global_bookmark_file_name, true);
521 515
522 default: 516 default:
@@ -621,7 +615,7 @@ static char* select_bookmark(const char* bookmark_file_name)
621 lcd_setmargins(0, 0); 615 lcd_setmargins(0, 0);
622#endif 616#endif
623 617
624 while (button_get(false)); /* clear button queue */ 618 button_clear_queue(); /* clear button queue */
625 bookmark_count = get_bookmark_count(bookmark_file_name); 619 bookmark_count = get_bookmark_count(bookmark_file_name);
626 620
627 while(true) 621 while(true)
@@ -644,7 +638,7 @@ static char* select_bookmark(const char* bookmark_file_name)
644 { 638 {
645 splash(HZ, true, str(LANG_BOOKMARK_LOAD_EMPTY)); 639 splash(HZ, true, str(LANG_BOOKMARK_LOAD_EMPTY));
646 remove(bookmark_file_name); 640 remove(bookmark_file_name);
647 while (button_get(false)); /* clear button queue */ 641 button_clear_queue(); /* clear button queue */
648 return NULL; 642 return NULL;
649 } 643 }
650 else 644 else
@@ -674,10 +668,10 @@ static char* select_bookmark(const char* bookmark_file_name)
674#endif 668#endif
675 return bookmark; 669 return bookmark;
676 670
677#if defined(BUTTON_ON) && defined(BUTTON_PLAY) 671#if CONFIG_KEYPAD == ONDIO_PAD
678 case BUTTON_ON | BUTTON_PLAY:
679#elif defined(BUTTON_MENU) && defined(BUTTON_RIGHT)
680 case BUTTON_MENU | BUTTON_RIGHT: 672 case BUTTON_MENU | BUTTON_RIGHT:
673#else
674 case BUTTON_ON | BUTTON_PLAY:
681#endif 675#endif
682 /* User wants to delete this bookmark */ 676 /* User wants to delete this bookmark */
683 delete_bookmark(bookmark_file_name, bookmark_id); 677 delete_bookmark(bookmark_file_name, bookmark_id);
@@ -685,7 +679,7 @@ static char* select_bookmark(const char* bookmark_file_name)
685 bookmark_count--; 679 bookmark_count--;
686 if(bookmark_id >= bookmark_count) 680 if(bookmark_id >= bookmark_count)
687 bookmark_id = bookmark_count -1; 681 bookmark_id = bookmark_count -1;
688 while (button_get(false)); /* clear button queue */ 682 button_clear_queue(); /* clear button queue */
689 break; 683 break;
690 684
691 case SETTINGS_INC: 685 case SETTINGS_INC:
@@ -696,7 +690,9 @@ static char* select_bookmark(const char* bookmark_file_name)
696 bookmark_id++; 690 bookmark_id++;
697 break; 691 break;
698 692
693#if CONFIG_KEYPAD != ONDIO_PAD
699 case SETTINGS_CANCEL: 694 case SETTINGS_CANCEL:
695#endif
700#ifdef SETTINGS_CANCEL2 696#ifdef SETTINGS_CANCEL2
701 case SETTINGS_CANCEL2: 697 case SETTINGS_CANCEL2:
702#endif 698#endif