diff options
| author | Nils Wallménius <nils@rockbox.org> | 2008-05-01 10:13:12 +0000 |
|---|---|---|
| committer | Nils Wallménius <nils@rockbox.org> | 2008-05-01 10:13:12 +0000 |
| commit | dabcb81e1380aeab8e50a64efcc1dc4a59145094 (patch) | |
| tree | 6d7f5067169739faf7b4bb874386542f57abe768 /apps/misc.c | |
| parent | e02d031f4ce5da08770b784f17795e5f490d3481 (diff) | |
| download | rockbox-dabcb81e1380aeab8e50a64efcc1dc4a59145094.zip rockbox-dabcb81e1380aeab8e50a64efcc1dc4a59145094.tar.gz rockbox-dabcb81e1380aeab8e50a64efcc1dc4a59145094.tar.bz2 rockbox-dabcb81e1380aeab8e50a64efcc1dc4a59145094.tar.xz | |
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.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/apps/misc.c b/apps/misc.c index c97b9cf..23341a8 100644 --- a/apps/misc.c +++ b/apps/misc.c @@ -50,6 +50,8 @@ #include "tagcache.h" #include "scrobbler.h" #include "sound.h" +#include "playlist.h" +#include "yesno.h" #ifdef HAVE_MMC #include "ata_mmc.h" @@ -244,6 +246,24 @@ char *create_datetime_filename(char *buffer, const char *path, } #endif /* CONFIG_RTC */ +/* Ask the user if they really want to erase the current dynamic playlist + * returns true if the playlist should be replaced */ +bool warn_on_pl_erase(void) +{ + if (global_settings.warnon_erase_dynplaylist && + !global_settings.party_mode && + playlist_modified(NULL)) + { + static const char *lines[] = + {ID2P(LANG_WARN_ERASEDYNPLAYLIST_PROMPT)}; + static const struct text_message message={lines, 1}; + + return (gui_syncyesno_run(&message, NULL, NULL) == YESNO_YES); + } + else + return true; +} + /* Read (up to) a line of text from fd into buffer and return number of bytes * read (which may be larger than the number of bytes stored in buffer). If * an error occurs, -1 is returned (and buffer contains whatever could be |