diff options
Diffstat (limited to 'apps/plugins/random_folder_advance_config.c')
-rw-r--r-- | apps/plugins/random_folder_advance_config.c | 85 |
1 files changed, 42 insertions, 43 deletions
diff --git a/apps/plugins/random_folder_advance_config.c b/apps/plugins/random_folder_advance_config.c index 3c74b790f9..2d3959ac1f 100644 --- a/apps/plugins/random_folder_advance_config.c +++ b/apps/plugins/random_folder_advance_config.c | |||
@@ -535,10 +535,8 @@ int start_shuffled_play(void) | |||
535 | return 1; | 535 | return 1; |
536 | } | 536 | } |
537 | 537 | ||
538 | int main_menu(void) | 538 | enum plugin_status main_menu(void) |
539 | { | 539 | { |
540 | bool exit = false; | ||
541 | |||
542 | MENUITEM_STRINGLIST(menu, "Main Menu", NULL, | 540 | MENUITEM_STRINGLIST(menu, "Main Menu", NULL, |
543 | "Generate Folder List", | 541 | "Generate Folder List", |
544 | "Edit Folder List", | 542 | "Edit Folder List", |
@@ -547,69 +545,72 @@ int main_menu(void) | |||
547 | "Play Shuffled", | 545 | "Play Shuffled", |
548 | "Quit"); | 546 | "Quit"); |
549 | 547 | ||
550 | switch (rb->do_menu(&menu, NULL, NULL, false)) | 548 | while (true) |
551 | { | 549 | { |
552 | case 0: /* generate */ | 550 | switch (rb->do_menu(&menu, NULL, NULL, false)) |
551 | { | ||
552 | case 0: /* generate */ | ||
553 | #ifdef HAVE_ADJUSTABLE_CPU_FREQ | 553 | #ifdef HAVE_ADJUSTABLE_CPU_FREQ |
554 | rb->cpu_boost(true); | 554 | rb->cpu_boost(true); |
555 | #endif | 555 | #endif |
556 | generate(); | 556 | generate(); |
557 | #ifdef HAVE_ADJUSTABLE_CPU_FREQ | 557 | #ifdef HAVE_ADJUSTABLE_CPU_FREQ |
558 | rb->cpu_boost(false); | 558 | rb->cpu_boost(false); |
559 | #endif | 559 | #endif |
560 | #ifdef HAVE_REMOTE_LCD | 560 | #ifdef HAVE_REMOTE_LCD |
561 | rb->remote_backlight_on(); | 561 | rb->remote_backlight_on(); |
562 | #endif | 562 | #endif |
563 | rb->backlight_on(); | 563 | rb->backlight_on(); |
564 | break; | 564 | break; |
565 | case 1: | 565 | case 1: |
566 | #ifdef HAVE_ADJUSTABLE_CPU_FREQ | 566 | #ifdef HAVE_ADJUSTABLE_CPU_FREQ |
567 | rb->cpu_boost(true); | 567 | rb->cpu_boost(true); |
568 | #endif | 568 | #endif |
569 | if (edit_list() < 0) | 569 | if (edit_list() < 0) |
570 | exit = true; | 570 | return PLUGIN_OK; |
571 | #ifdef HAVE_ADJUSTABLE_CPU_FREQ | 571 | #ifdef HAVE_ADJUSTABLE_CPU_FREQ |
572 | rb->cpu_boost(false); | 572 | rb->cpu_boost(false); |
573 | #endif | 573 | #endif |
574 | #ifdef HAVE_REMOTE_LCD | 574 | #ifdef HAVE_REMOTE_LCD |
575 | rb->remote_backlight_on(); | 575 | rb->remote_backlight_on(); |
576 | #endif | 576 | #endif |
577 | rb->backlight_on(); | 577 | rb->backlight_on(); |
578 | break; | 578 | break; |
579 | case 2: /* export to textfile */ | 579 | case 2: /* export to textfile */ |
580 | #ifdef HAVE_ADJUSTABLE_CPU_FREQ | 580 | #ifdef HAVE_ADJUSTABLE_CPU_FREQ |
581 | rb->cpu_boost(true); | 581 | rb->cpu_boost(true); |
582 | #endif | 582 | #endif |
583 | export_list_to_file_text(); | 583 | export_list_to_file_text(); |
584 | #ifdef HAVE_ADJUSTABLE_CPU_FREQ | 584 | #ifdef HAVE_ADJUSTABLE_CPU_FREQ |
585 | rb->cpu_boost(false); | 585 | rb->cpu_boost(false); |
586 | #endif | 586 | #endif |
587 | #ifdef HAVE_REMOTE_LCD | 587 | #ifdef HAVE_REMOTE_LCD |
588 | rb->remote_backlight_on(); | 588 | rb->remote_backlight_on(); |
589 | #endif | 589 | #endif |
590 | rb->backlight_on(); | 590 | rb->backlight_on(); |
591 | break; | 591 | break; |
592 | case 3: /* import from textfile */ | 592 | case 3: /* import from textfile */ |
593 | #ifdef HAVE_ADJUSTABLE_CPU_FREQ | 593 | #ifdef HAVE_ADJUSTABLE_CPU_FREQ |
594 | rb->cpu_boost(true); | 594 | rb->cpu_boost(true); |
595 | #endif | 595 | #endif |
596 | import_list_from_file_text(); | 596 | import_list_from_file_text(); |
597 | #ifdef HAVE_ADJUSTABLE_CPU_FREQ | 597 | #ifdef HAVE_ADJUSTABLE_CPU_FREQ |
598 | rb->cpu_boost(false); | 598 | rb->cpu_boost(false); |
599 | #endif | 599 | #endif |
600 | #ifdef HAVE_REMOTE_LCD | 600 | #ifdef HAVE_REMOTE_LCD |
601 | rb->remote_backlight_on(); | 601 | rb->remote_backlight_on(); |
602 | #endif | 602 | #endif |
603 | rb->backlight_on(); | 603 | rb->backlight_on(); |
604 | break; | 604 | break; |
605 | case 4: | 605 | case 4: |
606 | start_shuffled_play(); | 606 | if (!start_shuffled_play()) |
607 | exit=true; | 607 | return PLUGIN_ERROR; |
608 | break; | 608 | else |
609 | case 5: | 609 | return PLUGIN_GOTO_WPS; |
610 | return 1; | 610 | case 5: |
611 | return PLUGIN_OK; | ||
612 | } | ||
611 | } | 613 | } |
612 | return exit?1:0; | ||
613 | } | 614 | } |
614 | 615 | ||
615 | enum plugin_status plugin_start(const void* parameter) | 616 | enum plugin_status plugin_start(const void* parameter) |
@@ -618,7 +619,5 @@ enum plugin_status plugin_start(const void* parameter) | |||
618 | 619 | ||
619 | abort = false; | 620 | abort = false; |
620 | 621 | ||
621 | while (!main_menu()) | 622 | return main_menu(); |
622 | ; | ||
623 | return PLUGIN_OK; | ||
624 | } | 623 | } |