summaryrefslogtreecommitdiff
path: root/apps/misc.c
diff options
context:
space:
mode:
authorNils Wallménius <nils@rockbox.org>2008-05-01 10:13:12 +0000
committerNils Wallménius <nils@rockbox.org>2008-05-01 10:13:12 +0000
commitdabcb81e1380aeab8e50a64efcc1dc4a59145094 (patch)
tree6d7f5067169739faf7b4bb874386542f57abe768 /apps/misc.c
parente02d031f4ce5da08770b784f17795e5f490d3481 (diff)
downloadrockbox-dabcb81e1380aeab8e50a64efcc1dc4a59145094.tar.gz
rockbox-dabcb81e1380aeab8e50a64efcc1dc4a59145094.zip
Introduce a small helper function that asks the user if the dynamic playlist should be erased to increase code re-use
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17295 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/misc.c')
-rw-r--r--apps/misc.c20
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 */
251bool 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