From 941de8586c1d64742b5947cb4a49092478755eb5 Mon Sep 17 00:00:00 2001 From: Hardeep Sidhu Date: Sun, 5 Feb 2006 19:35:03 +0000 Subject: Patch #1260463 - Warn on erasing modified dynamic playlist by Craig (ctb311276) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8589 a1c6a512-1295-4272-9138-f99709370657 --- apps/filetree.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'apps/filetree.c') diff --git a/apps/filetree.c b/apps/filetree.c index cb21b71eec..b8f066745f 100644 --- a/apps/filetree.c +++ b/apps/filetree.c @@ -40,6 +40,7 @@ #include "sprintf.h" #include "dircache.h" #include "splash.h" +#include "yesno.h" #ifndef SIMULATOR static int boot_size = 0; @@ -346,6 +347,18 @@ int ft_enter(struct tree_context* c) if (bookmark_autoload(buf)) break; + /* about to create a new current playlist... + allow user to cancel the operation */ + if (global_settings.warnon_erase_dynplaylist && + playlist_modified(NULL)) + { + char *lines[]={str(LANG_WARN_ERASEDYNPLAYLIST_PROMPT)}; + struct text_message message={lines, 1}; + + if(gui_syncyesno_run(&message, NULL, NULL) != YESNO_YES) + break; + } + if (playlist_create(c->currdir, file->name) != -1) { if (global_settings.playlist_shuffle) @@ -360,6 +373,18 @@ int ft_enter(struct tree_context* c) if (bookmark_autoload(c->currdir)) break; + /* about to create a new current playlist... + allow user to cancel the operation */ + if (global_settings.warnon_erase_dynplaylist && + playlist_modified(NULL)) + { + char *lines[]={str(LANG_WARN_ERASEDYNPLAYLIST_PROMPT)}; + struct text_message message={lines, 1}; + + if(gui_syncyesno_run(&message, NULL, NULL) != YESNO_YES) + break; + } + if (playlist_create(c->currdir, NULL) != -1) { start_index = ft_build_playlist(c, c->selected_item); -- cgit v1.2.3