From 11e7ad50a07c0ffcb2005e40c3314bb49a9a1d8b Mon Sep 17 00:00:00 2001 From: Hardeep Sidhu Date: Wed, 2 Jul 2003 15:54:44 +0000 Subject: Added "Ask" option to recursive dir insert which, if enabled, will ask users whether they want to recursively insert selected dir. Also, renamed "Insert first" and "Queue first" to "Insert next" and "Queue next" respectively. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3799 a1c6a512-1295-4272-9138-f99709370657 --- apps/onplay.c | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) (limited to 'apps/onplay.c') diff --git a/apps/onplay.c b/apps/onplay.c index 6c538f8d8a..6c6b2eed0b 100644 --- a/apps/onplay.c +++ b/apps/onplay.c @@ -62,7 +62,45 @@ static bool add_to_playlist(int position, bool queue) if (selected_file_attr & TREE_ATTR_MPA) playlist_insert_track(selected_file, position, queue); else if (selected_file_attr & ATTR_DIRECTORY) - playlist_insert_directory(selected_file, position, queue); + { + bool recurse = false; + + if (global_settings.recursive_dir_insert != RECURSE_ASK) + recurse = (bool)global_settings.recursive_dir_insert; + else + { + /* Ask if user wants to recurse directory */ + bool exit = false; + + lcd_clear_display(); + lcd_puts_scroll(0,0,str(LANG_RECURSE_DIRECTORY_QUESTION)); + lcd_puts_scroll(0,1,selected_file); + +#ifdef HAVE_LCD_BITMAP + lcd_puts(0,3,str(LANG_CONFIRM_WITH_PLAY_RECORDER)); + lcd_puts(0,4,str(LANG_CANCEL_WITH_ANY_RECORDER)); +#endif + + lcd_update(); + + while (!exit) { + int btn = button_get(true); + switch (btn) { + case BUTTON_PLAY: + recurse = true; + exit = true; + break; + default: + /* ignore button releases */ + if (!(btn & BUTTON_REL)) + exit = true; + break; + } + } + } + + playlist_insert_directory(selected_file, position, queue, recurse); + } else if (selected_file_attr & TREE_ATTR_M3U) playlist_insert_playlist(selected_file, position, queue); -- cgit v1.2.3