diff options
Diffstat (limited to 'apps/misc.c')
-rw-r--r-- | apps/misc.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/apps/misc.c b/apps/misc.c index c97b9cf0f3..23341a82e8 100644 --- a/apps/misc.c +++ b/apps/misc.c | |||
@@ -50,6 +50,8 @@ | |||
50 | #include "tagcache.h" | 50 | #include "tagcache.h" |
51 | #include "scrobbler.h" | 51 | #include "scrobbler.h" |
52 | #include "sound.h" | 52 | #include "sound.h" |
53 | #include "playlist.h" | ||
54 | #include "yesno.h" | ||
53 | 55 | ||
54 | #ifdef HAVE_MMC | 56 | #ifdef HAVE_MMC |
55 | #include "ata_mmc.h" | 57 | #include "ata_mmc.h" |
@@ -244,6 +246,24 @@ char *create_datetime_filename(char *buffer, const char *path, | |||
244 | } | 246 | } |
245 | #endif /* CONFIG_RTC */ | 247 | #endif /* CONFIG_RTC */ |
246 | 248 | ||
249 | /* Ask the user if they really want to erase the current dynamic playlist | ||
250 | * returns true if the playlist should be replaced */ | ||
251 | bool warn_on_pl_erase(void) | ||
252 | { | ||
253 | if (global_settings.warnon_erase_dynplaylist && | ||
254 | !global_settings.party_mode && | ||
255 | playlist_modified(NULL)) | ||
256 | { | ||
257 | static const char *lines[] = | ||
258 | {ID2P(LANG_WARN_ERASEDYNPLAYLIST_PROMPT)}; | ||
259 | static const struct text_message message={lines, 1}; | ||
260 | |||
261 | return (gui_syncyesno_run(&message, NULL, NULL) == YESNO_YES); | ||
262 | } | ||
263 | else | ||
264 | return true; | ||
265 | } | ||
266 | |||
247 | /* Read (up to) a line of text from fd into buffer and return number of bytes | 267 | /* Read (up to) a line of text from fd into buffer and return number of bytes |
248 | * read (which may be larger than the number of bytes stored in buffer). If | 268 | * read (which may be larger than the number of bytes stored in buffer). If |
249 | * an error occurs, -1 is returned (and buffer contains whatever could be | 269 | * an error occurs, -1 is returned (and buffer contains whatever could be |