diff options
| author | Kevin Ferrare <kevin@rockbox.org> | 2005-11-18 02:07:02 +0000 |
|---|---|---|
| committer | Kevin Ferrare <kevin@rockbox.org> | 2005-11-18 02:07:02 +0000 |
| commit | 8719f0913a0f2d8a90e9ecbc7c0e5336369af6be (patch) | |
| tree | b336928b98e48a15d0d1c176105fa21ac557b7c9 /apps/settings_menu.c | |
| parent | ec0a8a749bbc3aa25bf4c136352725bd9d2532b5 (diff) | |
| download | rockbox-8719f0913a0f2d8a90e9ecbc7c0e5336369af6be.zip rockbox-8719f0913a0f2d8a90e9ecbc7c0e5336369af6be.tar.gz rockbox-8719f0913a0f2d8a90e9ecbc7c0e5336369af6be.tar.bz2 rockbox-8719f0913a0f2d8a90e9ecbc7c0e5336369af6be.tar.xz | |
generic multi-screen support for yes/no screens (like the one when reseting settings or when firmware has changed)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7951 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/settings_menu.c')
| -rw-r--r-- | apps/settings_menu.c | 58 |
1 files changed, 17 insertions, 41 deletions
diff --git a/apps/settings_menu.c b/apps/settings_menu.c index 8695177..82c25af 100644 --- a/apps/settings_menu.c +++ b/apps/settings_menu.c @@ -52,6 +52,7 @@ #include "dir.h" #include "dircache.h" #include "splash.h" +#include "yesno.h" #ifdef HAVE_LCD_BITMAP #include "peakmeter.h" @@ -1428,49 +1429,24 @@ static bool bookmark_settings_menu(void) } static bool reset_settings(void) { - bool done=false; - int line; - int button; - - lcd_clear_display(); + char *lines[]={str(LANG_RESET_ASK_RECORDER)}; + char *yes_lines[]={str(LANG_RESET_DONE_SETTING), str(LANG_RESET_DONE_CLEAR)}; + char *no_lines[]={yes_lines[0], str(LANG_RESET_DONE_CANCEL)}; + struct text_message message={lines, 1}; + struct text_message yes_message={yes_lines, 2}; + struct text_message no_message={no_lines, 2}; -#ifdef HAVE_LCD_CHARCELLS - line = 0; -#else - line = 1; - lcd_puts(0,0,str(LANG_RESET_ASK_RECORDER)); -#endif - lcd_puts(0,line,str(LANG_RESET_CONFIRM)); - lcd_puts(0,line+1,str(LANG_RESET_CANCEL)); - - lcd_update(); - - while(!done) { - button = button_get(true); - switch(button) { - case SETTINGS_OK: - settings_reset(); - settings_apply(); - lcd_clear_display(); - lcd_puts(0,1,str(LANG_RESET_DONE_CLEAR)); - done = true; - break; - - case SETTINGS_CANCEL: - lcd_clear_display(); - lcd_puts(0,1,str(LANG_RESET_DONE_CANCEL)); - done = true; - break; - - default: - if(default_event_handler(button) == SYS_USB_CONNECTED) - return true; - } + switch(gui_syncyesno_run(&message, &yes_message, &no_message)) + { + case YESNO_YES: + settings_reset(); + settings_apply(); + break; + case YESNO_NO: + break; + case YESNO_USB: + return true; } - - lcd_puts(0,0,str(LANG_RESET_DONE_SETTING)); - lcd_update(); - sleep(HZ); return false; } |