diff options
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 8695177a00..82c25af433 100644 --- a/apps/settings_menu.c +++ b/apps/settings_menu.c | |||
@@ -52,6 +52,7 @@ | |||
52 | #include "dir.h" | 52 | #include "dir.h" |
53 | #include "dircache.h" | 53 | #include "dircache.h" |
54 | #include "splash.h" | 54 | #include "splash.h" |
55 | #include "yesno.h" | ||
55 | 56 | ||
56 | #ifdef HAVE_LCD_BITMAP | 57 | #ifdef HAVE_LCD_BITMAP |
57 | #include "peakmeter.h" | 58 | #include "peakmeter.h" |
@@ -1428,49 +1429,24 @@ static bool bookmark_settings_menu(void) | |||
1428 | } | 1429 | } |
1429 | static bool reset_settings(void) | 1430 | static bool reset_settings(void) |
1430 | { | 1431 | { |
1431 | bool done=false; | 1432 | char *lines[]={str(LANG_RESET_ASK_RECORDER)}; |
1432 | int line; | 1433 | char *yes_lines[]={str(LANG_RESET_DONE_SETTING), str(LANG_RESET_DONE_CLEAR)}; |
1433 | int button; | 1434 | char *no_lines[]={yes_lines[0], str(LANG_RESET_DONE_CANCEL)}; |
1434 | 1435 | struct text_message message={lines, 1}; | |
1435 | lcd_clear_display(); | 1436 | struct text_message yes_message={yes_lines, 2}; |
1437 | struct text_message no_message={no_lines, 2}; | ||
1436 | 1438 | ||
1437 | #ifdef HAVE_LCD_CHARCELLS | 1439 | switch(gui_syncyesno_run(&message, &yes_message, &no_message)) |
1438 | line = 0; | 1440 | { |
1439 | #else | 1441 | case YESNO_YES: |
1440 | line = 1; | 1442 | settings_reset(); |
1441 | lcd_puts(0,0,str(LANG_RESET_ASK_RECORDER)); | 1443 | settings_apply(); |
1442 | #endif | 1444 | break; |
1443 | lcd_puts(0,line,str(LANG_RESET_CONFIRM)); | 1445 | case YESNO_NO: |
1444 | lcd_puts(0,line+1,str(LANG_RESET_CANCEL)); | 1446 | break; |
1445 | 1447 | case YESNO_USB: | |
1446 | lcd_update(); | 1448 | return true; |
1447 | |||
1448 | while(!done) { | ||
1449 | button = button_get(true); | ||
1450 | switch(button) { | ||
1451 | case SETTINGS_OK: | ||
1452 | settings_reset(); | ||
1453 | settings_apply(); | ||
1454 | lcd_clear_display(); | ||
1455 | lcd_puts(0,1,str(LANG_RESET_DONE_CLEAR)); | ||
1456 | done = true; | ||
1457 | break; | ||
1458 | |||
1459 | case SETTINGS_CANCEL: | ||
1460 | lcd_clear_display(); | ||
1461 | lcd_puts(0,1,str(LANG_RESET_DONE_CANCEL)); | ||
1462 | done = true; | ||
1463 | break; | ||
1464 | |||
1465 | default: | ||
1466 | if(default_event_handler(button) == SYS_USB_CONNECTED) | ||
1467 | return true; | ||
1468 | } | ||
1469 | } | 1449 | } |
1470 | |||
1471 | lcd_puts(0,0,str(LANG_RESET_DONE_SETTING)); | ||
1472 | lcd_update(); | ||
1473 | sleep(HZ); | ||
1474 | return false; | 1450 | return false; |
1475 | } | 1451 | } |
1476 | 1452 | ||