summaryrefslogtreecommitdiff
path: root/apps/tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/tree.c')
-rw-r--r--apps/tree.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/apps/tree.c b/apps/tree.c
index 344088d12a..46413fe31b 100644
--- a/apps/tree.c
+++ b/apps/tree.c
@@ -431,7 +431,7 @@ static int showdir(void)
431 return tc.filesindir; 431 return tc.filesindir;
432} 432}
433 433
434static bool ask_resume(bool ask_once) 434static bool ask_resume(bool just_powered_on)
435{ 435{
436 int button; 436 int button;
437 bool stop = false; 437 bool stop = false;
@@ -449,7 +449,7 @@ static bool ask_resume(bool ask_once)
449#endif 449#endif
450 450
451 /* always resume? */ 451 /* always resume? */
452 if ( global_settings.resume == RESUME_ON) 452 if ( global_settings.resume == RESUME_ON || ! just_powered_on)
453 return true; 453 return true;
454 454
455 lcd_clear_display(); 455 lcd_clear_display();
@@ -475,17 +475,15 @@ static bool ask_resume(bool ask_once)
475#ifdef TREE_RC_RUN_PRE 475#ifdef TREE_RC_RUN_PRE
476 case TREE_RC_RUN_PRE: /* catch the press, not the release */ 476 case TREE_RC_RUN_PRE: /* catch the press, not the release */
477#else 477#else
478#ifdef TREE_RC_RUN
479 case TREE_RC_RUN: 478 case TREE_RC_RUN:
480#endif 479#endif
481#endif
482 ignore_power = false; 480 ignore_power = false;
483 /* Don't ignore the power button for subsequent calls */ 481 /* Don't ignore the power button for subsequent calls */
484 return true; 482 return true;
485 483
486#ifdef TREE_POWER_BTN 484#ifdef TREE_POWER_BTN
487 /* Initially ignore the button which powers on the box. It 485 /* Initially ignore the button which powers on the box. It
488 might still be pressed since booting. */ 486 * might still be pressed since booting. */
489 case TREE_POWER_BTN: 487 case TREE_POWER_BTN:
490 case TREE_POWER_BTN | BUTTON_REPEAT: 488 case TREE_POWER_BTN | BUTTON_REPEAT:
491 if(!ignore_power) 489 if(!ignore_power)
@@ -497,6 +495,7 @@ static bool ask_resume(bool ask_once)
497 ignore_power = false; 495 ignore_power = false;
498 break; 496 break;
499#endif 497#endif
498
500 /* Handle sys events, ignore button releases */ 499 /* Handle sys events, ignore button releases */
501 default: 500 default:
502 if(default_event_handler(button) == SYS_USB_CONNECTED || 501 if(default_event_handler(button) == SYS_USB_CONNECTED ||
@@ -506,7 +505,7 @@ static bool ask_resume(bool ask_once)
506 } 505 }
507 } 506 }
508 507
509 if ( global_settings.resume == RESUME_ASK_ONCE && ask_once) { 508 if ( global_settings.resume == RESUME_ASK_ONCE && just_powered_on) {
510 global_settings.resume_index = -1; 509 global_settings.resume_index = -1;
511 settings_save(); 510 settings_save();
512 } 511 }
@@ -547,15 +546,15 @@ void reload_directory(void)
547 reload_dir = true; 546 reload_dir = true;
548} 547}
549 548
550static void start_resume(bool ask_once) 549static void start_resume(bool just_powered_on)
551{ 550{
552 if ( global_settings.resume && 551 if ( ( global_settings.resume || ! just_powered_on ) &&
553 global_settings.resume_index != -1 ) { 552 global_settings.resume_index != -1 ) {
554 DEBUGF("Resume index %X offset %X\n", 553 DEBUGF("Resume index %X offset %X\n",
555 global_settings.resume_index, 554 global_settings.resume_index,
556 global_settings.resume_offset); 555 global_settings.resume_offset);
557 556
558 if (!ask_resume(ask_once)) 557 if (!ask_resume(just_powered_on) && just_powered_on )
559 return; 558 return;
560 559
561 if (playlist_resume() != -1) 560 if (playlist_resume() != -1)
@@ -565,8 +564,9 @@ static void start_resume(bool ask_once)
565 564
566 start_wps = true; 565 start_wps = true;
567 } 566 }
568 else 567 else return;
569 return; 568 } else if (! just_powered_on) {
569 splash(HZ*2, true, str(LANG_NOTHING_TO_RESUME));
570 } 570 }
571} 571}
572 572