forked from len0rd/rockbox
used generic yes/no dialog for confirmation of presets clearing
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7996 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
8690a394b1
commit
0afd9716a4
1 changed files with 39 additions and 57 deletions
|
@ -55,6 +55,7 @@
|
|||
#include "statusbar.h"
|
||||
#include "textarea.h"
|
||||
#include "splash.h"
|
||||
#include "yesno.h"
|
||||
|
||||
#ifdef CONFIG_TUNER
|
||||
|
||||
|
@ -1185,23 +1186,13 @@ static bool toggle_mono_mode(void)
|
|||
|
||||
static bool scan_presets(void)
|
||||
{
|
||||
bool exit = false;
|
||||
bool tuned = false;
|
||||
char buf[32];
|
||||
int freq, i;
|
||||
char *lines[]={str(LANG_FM_CLEAR_PRESETS)};
|
||||
struct text_message message={lines, 1};
|
||||
|
||||
FOR_NB_SCREENS(i){
|
||||
gui_textarea_clear(&screens[i]);
|
||||
screens[i].puts_scroll(0,0,str(LANG_FM_CLEAR_PRESETS));
|
||||
screens[i].puts_scroll(0,2,str(LANG_CONFIRM_WITH_PLAY_RECORDER));
|
||||
screens[i].puts_scroll(0,3,str(LANG_CANCEL_WITH_ANY_RECORDER));
|
||||
gui_textarea_update(&screens[i]);
|
||||
}
|
||||
|
||||
while (!exit) {
|
||||
int btn = button_get(true);
|
||||
switch (btn) {
|
||||
case SETTINGS_OK:
|
||||
if(gui_syncyesno_run(&message,NULL,NULL)==YESNO_YES){
|
||||
FOR_NB_SCREENS(i)
|
||||
gui_textarea_clear(&screens[i]);
|
||||
curr_freq = MIN_FREQ;
|
||||
|
@ -1247,15 +1238,6 @@ static bool scan_presets(void)
|
|||
radio_set(RADIO_FREQUENCY, curr_freq);
|
||||
remember_frequency();
|
||||
}
|
||||
exit = true;
|
||||
break;
|
||||
|
||||
default:
|
||||
/* ignore button releases */
|
||||
if (!(btn & BUTTON_REL))
|
||||
exit = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue