mirror of
https://github.com/Rockbox/rockbox.git
synced 2026-04-12 00:47:49 -04:00
Minor confirm prompt adjustments
* Rename LANG_RESET_ASK to LANG_ARE_YOU_SURE, so that it matches the actual language string (translations remain valid), and can be repurposed for generic confirmation prompts, where the first line says "Are you sure?", and the second line reiterates the selected action * Add "Reset Settings" as second line to the prompt shown before resetting settings, instead of just asking "Are you sure?" * Make Shuffle prompt consistent between WPS and Playlist Viewer, and ask whether user is sure they want to Shuffle instead of warning them that the current playlist will be erased, which was a bit misleading * Explicitly say "Cancelled" when user answers NO to erasing the current playlist or to overwriting a file. Improves consistency with other prompts that are displayed for potentially destructive actions, e.g. before items are deleted, renamed, saved, or reset. * PictureFlow: Prompt before rebuilding/updating cache Change-Id: Id8ae36db7187315eb1a374701307e6ab4dcdbd1d
This commit is contained in:
parent
57f3f290c9
commit
f3d127f372
55 changed files with 169 additions and 114 deletions
|
|
@ -368,14 +368,35 @@ enum yesno_res gui_syncyesno_run(const struct text_message * main_message,
|
|||
main_message, yes_message, no_message);
|
||||
}
|
||||
|
||||
/* Function to manipulate all yesno dialogues.
|
||||
This function needs the prompt text as an argument. */
|
||||
bool yesno_pop(const char* text)
|
||||
static bool yesno_pop_lines(const char *lines[], int line_cnt)
|
||||
{
|
||||
const char *lines[]={text};
|
||||
const struct text_message message={lines, 1};
|
||||
const struct text_message message={lines, line_cnt};
|
||||
bool ret = (gui_syncyesno_run(&message,NULL,NULL)== YESNO_YES);
|
||||
FOR_NB_SCREENS(i)
|
||||
screens[i].clear_viewport();
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* YES/NO dialog, uses text parameter as prompt */
|
||||
bool yesno_pop(const char* text)
|
||||
{
|
||||
const char *lines[]= {text};
|
||||
return yesno_pop_lines(lines, 1);
|
||||
}
|
||||
|
||||
/* YES/NO dialog, asks "Are you sure?", displays
|
||||
text parameter on second line.
|
||||
|
||||
Says "Cancelled" if answered negatively.
|
||||
*/
|
||||
bool yesno_pop_confirm(const char* text)
|
||||
{
|
||||
bool confirmed;
|
||||
const char *lines[] = {ID2P(LANG_ARE_YOU_SURE), text};
|
||||
confirmed = yesno_pop_lines(lines, 2);
|
||||
|
||||
if (!confirmed)
|
||||
splash(HZ, ID2P(LANG_CANCEL));
|
||||
|
||||
return confirmed;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,5 +57,6 @@ extern enum yesno_res gui_syncyesno_run_w_tmo(
|
|||
const struct text_message * no_message);
|
||||
|
||||
bool yesno_pop(const char* text);
|
||||
bool yesno_pop_confirm(const char* text);
|
||||
|
||||
#endif /* _GUI_YESNO_H_ */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue