summaryrefslogtreecommitdiff
path: root/apps/onplay.c
diff options
context:
space:
mode:
authorChristian Soffke <christian.soffke@gmail.com>2023-06-04 00:43:56 +0200
committerChristian Soffke <christian.soffke@gmail.com>2023-06-21 13:09:05 -0400
commit422ea20cefd4eb9fa95d283f50049f45dbf10e84 (patch)
tree2d2d3646d86a574f4cea56174b83734503f59827 /apps/onplay.c
parent2747e920baf4346bde62dc65dbdbfa3df39fe3cd (diff)
downloadrockbox-422ea20cefd4eb9fa95d283f50049f45dbf10e84.tar.gz
rockbox-422ea20cefd4eb9fa95d283f50049f45dbf10e84.zip
Warn before overwriting another playlist on disk
When saving a playlist to an existing file on disk, warn user, unless the playlist's file name remains unchanged. Change-Id: I10d82667de5fadb5323be4f981bea9263849f07a
Diffstat (limited to 'apps/onplay.c')
-rw-r--r--apps/onplay.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/apps/onplay.c b/apps/onplay.c
index 341da62840..a9cbc64598 100644
--- a/apps/onplay.c
+++ b/apps/onplay.c
@@ -948,13 +948,6 @@ static bool poll_cancel_action(const char *path)
948 return ACTION_STD_CANCEL == get_action(CONTEXT_STD, TIMEOUT_NOBLOCK); 948 return ACTION_STD_CANCEL == get_action(CONTEXT_STD, TIMEOUT_NOBLOCK);
949} 949}
950 950
951static int confirm_overwrite(void)
952{
953 static const char *lines[] = { ID2P(LANG_REALLY_OVERWRITE) };
954 static const struct text_message message = { lines, 1 };
955 return gui_syncyesno_run(&message, NULL, NULL);
956}
957
958static bool check_new_name(const char *basename) 951static bool check_new_name(const char *basename)
959{ 952{
960 /* at least prevent escapes out of the base directory from keyboard- 953 /* at least prevent escapes out of the base directory from keyboard-
@@ -1426,7 +1419,7 @@ static int clipboard_paste(void)
1426 case RELATE_DIFFERENT: 1419 case RELATE_DIFFERENT:
1427 if (file_exists(target.path)) { 1420 if (file_exists(target.path)) {
1428 /* If user chooses not to overwrite, cancel */ 1421 /* If user chooses not to overwrite, cancel */
1429 if (confirm_overwrite() == YESNO_NO) { 1422 if (confirm_overwrite_yesno() == YESNO_NO) {
1430 rc = OPRC_NOOVERWRT; 1423 rc = OPRC_NOOVERWRT;
1431 break; 1424 break;
1432 } 1425 }