diff options
| author | Thomas Martitz <kugel@rockbox.org> | 2009-07-05 22:15:04 +0000 |
|---|---|---|
| committer | Thomas Martitz <kugel@rockbox.org> | 2009-07-05 22:15:04 +0000 |
| commit | f4c31ae3094665fc5c71e98e185aa712ebdb9598 (patch) | |
| tree | 38ff3320233fbb4e9cc936fedc1d48d63aa4a5e1 /apps/plugins/random_folder_advance_config.c | |
| parent | df6f955a82bce03650f24f562926ae9e7ffa58d4 (diff) | |
| download | rockbox-f4c31ae3094665fc5c71e98e185aa712ebdb9598.zip rockbox-f4c31ae3094665fc5c71e98e185aa712ebdb9598.tar.gz rockbox-f4c31ae3094665fc5c71e98e185aa712ebdb9598.tar.bz2 rockbox-f4c31ae3094665fc5c71e98e185aa712ebdb9598.tar.xz | |
Adapt pictureflow and random_folder_advance_config to make use of the new goto-wps exit feature.
For pictureflow a menu item is added, but the key press that works in the filetree works also (unless it's already remapped),
rfa will go to the wps after selecting "Play Shuffled", as it needs to exit then anyway.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21681 a1c6a512-1295-4272-9138-f99709370657
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 3c74b79..2d3959a 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) return 1; } -int main_menu(void) +enum plugin_status main_menu(void) { - bool exit = false; - MENUITEM_STRINGLIST(menu, "Main Menu", NULL, "Generate Folder List", "Edit Folder List", @@ -547,69 +545,72 @@ int main_menu(void) "Play Shuffled", "Quit"); - switch (rb->do_menu(&menu, NULL, NULL, false)) + while (true) { - case 0: /* generate */ + switch (rb->do_menu(&menu, NULL, NULL, false)) + { + case 0: /* generate */ #ifdef HAVE_ADJUSTABLE_CPU_FREQ - rb->cpu_boost(true); + rb->cpu_boost(true); #endif - generate(); + generate(); #ifdef HAVE_ADJUSTABLE_CPU_FREQ - rb->cpu_boost(false); + rb->cpu_boost(false); #endif #ifdef HAVE_REMOTE_LCD - rb->remote_backlight_on(); + rb->remote_backlight_on(); #endif - rb->backlight_on(); - break; - case 1: + rb->backlight_on(); + break; + case 1: #ifdef HAVE_ADJUSTABLE_CPU_FREQ - rb->cpu_boost(true); + rb->cpu_boost(true); #endif - if (edit_list() < 0) - exit = true; + if (edit_list() < 0) + return PLUGIN_OK; #ifdef HAVE_ADJUSTABLE_CPU_FREQ - rb->cpu_boost(false); + rb->cpu_boost(false); #endif #ifdef HAVE_REMOTE_LCD - rb->remote_backlight_on(); + rb->remote_backlight_on(); #endif - rb->backlight_on(); - break; - case 2: /* export to textfile */ + rb->backlight_on(); + break; + case 2: /* export to textfile */ #ifdef HAVE_ADJUSTABLE_CPU_FREQ - rb->cpu_boost(true); + rb->cpu_boost(true); #endif - export_list_to_file_text(); + export_list_to_file_text(); #ifdef HAVE_ADJUSTABLE_CPU_FREQ - rb->cpu_boost(false); + rb->cpu_boost(false); #endif #ifdef HAVE_REMOTE_LCD - rb->remote_backlight_on(); + rb->remote_backlight_on(); #endif - rb->backlight_on(); - break; - case 3: /* import from textfile */ + rb->backlight_on(); + break; + case 3: /* import from textfile */ #ifdef HAVE_ADJUSTABLE_CPU_FREQ - rb->cpu_boost(true); + rb->cpu_boost(true); #endif - import_list_from_file_text(); + import_list_from_file_text(); #ifdef HAVE_ADJUSTABLE_CPU_FREQ - rb->cpu_boost(false); + rb->cpu_boost(false); #endif #ifdef HAVE_REMOTE_LCD - rb->remote_backlight_on(); + rb->remote_backlight_on(); #endif - rb->backlight_on(); - break; - case 4: - start_shuffled_play(); - exit=true; - break; - case 5: - return 1; + rb->backlight_on(); + break; + case 4: + if (!start_shuffled_play()) + return PLUGIN_ERROR; + else + return PLUGIN_GOTO_WPS; + case 5: + return PLUGIN_OK; + } } - return exit?1:0; } enum plugin_status plugin_start(const void* parameter) @@ -618,7 +619,5 @@ enum plugin_status plugin_start(const void* parameter) abort = false; - while (!main_menu()) - ; - return PLUGIN_OK; + return main_menu(); } |