diff options
author | William Wilgus <wilgus.william@gmail.com> | 2022-06-20 22:37:09 -0400 |
---|---|---|
committer | William Wilgus <me.theuser@yahoo.com> | 2022-06-21 22:43:39 -0400 |
commit | 8283752223a4c0f0d98c1798568526546c4ab7b9 (patch) | |
tree | ab2dddab69f41c9f5f665eae1ed7bca438bd5919 /apps | |
parent | e75e07e1b68b5ce59b0a77f321c90a091682e362 (diff) | |
download | rockbox-8283752223a4c0f0d98c1798568526546c4ab7b9.tar.gz rockbox-8283752223a4c0f0d98c1798568526546c4ab7b9.zip |
Reset settings on button hold
extend this properly to the gigabeast and iriver
updated manual entries
Change-Id: Ibd1bce8d113193cb3b76f4daf0d6ceb01a2f7585
Diffstat (limited to 'apps')
-rw-r--r-- | apps/features.txt | 3 | ||||
-rw-r--r-- | apps/lang/english.lang | 13 | ||||
-rw-r--r-- | apps/main.c | 8 | ||||
-rw-r--r-- | apps/menus/settings_menu.c | 7 | ||||
-rw-r--r-- | apps/settings.h | 7 | ||||
-rw-r--r-- | apps/settings_list.c | 7 |
6 files changed, 29 insertions, 16 deletions
diff --git a/apps/features.txt b/apps/features.txt index da2064ab2f..2262f7502e 100644 --- a/apps/features.txt +++ b/apps/features.txt | |||
@@ -290,7 +290,8 @@ multi_boot | |||
290 | hibylinux | 290 | hibylinux |
291 | #endif | 291 | #endif |
292 | 292 | ||
293 | #if defined(SETTINGS_RESET) || \ | 293 | #if defined(BUTTON_REC) || \ |
294 | (CONFIG_KEYPAD == GIGABEAT_PAD) || \ | ||
294 | (CONFIG_KEYPAD == IPOD_4G_PAD) || \ | 295 | (CONFIG_KEYPAD == IPOD_4G_PAD) || \ |
295 | (CONFIG_KEYPAD == IRIVER_H10_PAD) | 296 | (CONFIG_KEYPAD == IRIVER_H10_PAD) |
296 | clear_settings_on_hold | 297 | clear_settings_on_hold |
diff --git a/apps/lang/english.lang b/apps/lang/english.lang index f4571aa6bc..75849714e6 100644 --- a/apps/lang/english.lang +++ b/apps/lang/english.lang | |||
@@ -16374,14 +16374,21 @@ | |||
16374 | user: core | 16374 | user: core |
16375 | <source> | 16375 | <source> |
16376 | *: none | 16376 | *: none |
16377 | clear_settings_on_hold, ipod4g, iriverh10: "Clear settings when hold switch is on during startup" | 16377 | ipod3g: none |
16378 | ipod*: "Clear settings when hold switch is on during startup" | ||
16379 | clear_settings_on_hold, iriverh10: "Clear settings when reset button is held during startup" | ||
16378 | </source> | 16380 | </source> |
16379 | <dest> | 16381 | <dest> |
16380 | *: none | 16382 | *: none |
16381 | clear_settings_on_hold, ipod4g, iriverh10: "Clear settings when hold switch is on during startup" | 16383 | ipod3g: none |
16384 | ipod*: "Clear settings when hold switch is on during startup" | ||
16385 | clear_settings_on_hold, iriverh10: "Clear settings when reset button is held during startup" | ||
16382 | </dest> | 16386 | </dest> |
16383 | <voice> | 16387 | <voice> |
16384 | *: none | 16388 | *: none |
16385 | clear_settings_on_hold, ipod4g, iriverh10: "Clear settings when hold switch is on during startup" | 16389 | ipod3g: none |
16390 | ipod*: "Clear settings when hold switch is on during startup" | ||
16391 | clear_settings_on_hold, iriverh10: "Clear settings when reset button is held during startup" | ||
16386 | </voice> | 16392 | </voice> |
16387 | </phrase> | 16393 | </phrase> |
16394 | |||
diff --git a/apps/main.c b/apps/main.c index 515a9978f5..59932d6185 100644 --- a/apps/main.c +++ b/apps/main.c | |||
@@ -570,16 +570,18 @@ static void init(void) | |||
570 | settings_load(SETTINGS_ALL); | 570 | settings_load(SETTINGS_ALL); |
571 | CHART("<settings_load(ALL)"); | 571 | CHART("<settings_load(ALL)"); |
572 | 572 | ||
573 | #if defined(SETTINGS_RESET) || \ | 573 | #if defined(BUTTON_REC) || \ |
574 | (CONFIG_KEYPAD == GIGABEAT_PAD) || \ | ||
574 | (CONFIG_KEYPAD == IPOD_4G_PAD) || \ | 575 | (CONFIG_KEYPAD == IPOD_4G_PAD) || \ |
575 | (CONFIG_KEYPAD == IRIVER_H10_PAD) | 576 | (CONFIG_KEYPAD == IRIVER_H10_PAD) |
577 | if (global_settings.clear_settings_on_hold && | ||
576 | #ifdef SETTINGS_RESET | 578 | #ifdef SETTINGS_RESET |
577 | /* Reset settings if holding the reset button. (Rec on Archos, | 579 | /* Reset settings if holding the reset button. (Rec on Archos, |
578 | A on Gigabeat) */ | 580 | A on Gigabeat) */ |
579 | if ((button_status() & SETTINGS_RESET) == SETTINGS_RESET) | 581 | ((button_status() & SETTINGS_RESET) == SETTINGS_RESET)) |
580 | #else | 582 | #else |
581 | /* Reset settings if the hold button is turned on */ | 583 | /* Reset settings if the hold button is turned on */ |
582 | if (global_settings.clear_settings_on_hold && button_hold()) | 584 | (button_hold())) |
583 | #endif | 585 | #endif |
584 | { | 586 | { |
585 | splash(HZ*2, str(LANG_RESET_DONE_CLEAR)); | 587 | splash(HZ*2, str(LANG_RESET_DONE_CLEAR)); |
diff --git a/apps/menus/settings_menu.c b/apps/menus/settings_menu.c index 60f206c86f..460909318a 100644 --- a/apps/menus/settings_menu.c +++ b/apps/menus/settings_menu.c | |||
@@ -584,9 +584,10 @@ MENUITEM_SETTING(keypress_restarts_sleeptimer, | |||
584 | &global_settings.keypress_restarts_sleeptimer, NULL); | 584 | &global_settings.keypress_restarts_sleeptimer, NULL); |
585 | MENUITEM_SETTING(show_shutdown_message, &global_settings.show_shutdown_message, NULL); | 585 | MENUITEM_SETTING(show_shutdown_message, &global_settings.show_shutdown_message, NULL); |
586 | 586 | ||
587 | #if defined(SETTINGS_RESET) || \ | 587 | #if defined(BUTTON_REC) || \ |
588 | (CONFIG_KEYPAD == IPOD_4G_PAD) || \ | 588 | (CONFIG_KEYPAD == GIGABEAT_PAD) || \ |
589 | (CONFIG_KEYPAD == IRIVER_H10_PAD) | 589 | (CONFIG_KEYPAD == IPOD_4G_PAD) || \ |
590 | (CONFIG_KEYPAD == IRIVER_H10_PAD) | ||
590 | #define SETTINGS_CLEAR_ON_HOLD | 591 | #define SETTINGS_CLEAR_ON_HOLD |
591 | MENUITEM_SETTING(clear_settings_on_hold, | 592 | MENUITEM_SETTING(clear_settings_on_hold, |
592 | &global_settings.clear_settings_on_hold, NULL); | 593 | &global_settings.clear_settings_on_hold, NULL); |
diff --git a/apps/settings.h b/apps/settings.h index ae9b6f31ce..092c04a76b 100644 --- a/apps/settings.h +++ b/apps/settings.h | |||
@@ -868,9 +868,10 @@ struct user_settings | |||
868 | #if defined(DX50) || defined(DX90) || (defined(HAVE_USB_POWER) && !defined(USB_NONE) && !defined(SIMULATOR)) | 868 | #if defined(DX50) || defined(DX90) || (defined(HAVE_USB_POWER) && !defined(USB_NONE) && !defined(SIMULATOR)) |
869 | int usb_mode; | 869 | int usb_mode; |
870 | #endif | 870 | #endif |
871 | #if defined(SETTINGS_RESET) || \ | 871 | #if defined(BUTTON_REC) || \ |
872 | (CONFIG_KEYPAD == IPOD_4G_PAD) || \ | 872 | (CONFIG_KEYPAD == GIGABEAT_PAD) || \ |
873 | (CONFIG_KEYPAD == IRIVER_H10_PAD) | 873 | (CONFIG_KEYPAD == IPOD_4G_PAD) || \ |
874 | (CONFIG_KEYPAD == IRIVER_H10_PAD) | ||
874 | bool clear_settings_on_hold; | 875 | bool clear_settings_on_hold; |
875 | #endif | 876 | #endif |
876 | }; | 877 | }; |
diff --git a/apps/settings_list.c b/apps/settings_list.c index d6449d1c6f..fc526987e2 100644 --- a/apps/settings_list.c +++ b/apps/settings_list.c | |||
@@ -2167,9 +2167,10 @@ const struct settings_list settings[] = { | |||
2167 | #endif | 2167 | #endif |
2168 | ), | 2168 | ), |
2169 | #endif | 2169 | #endif |
2170 | #if defined(SETTINGS_RESET) || \ | 2170 | #if defined(BUTTON_REC) || \ |
2171 | (CONFIG_KEYPAD == IPOD_4G_PAD) || \ | 2171 | (CONFIG_KEYPAD == GIGABEAT_PAD) || \ |
2172 | (CONFIG_KEYPAD == IRIVER_H10_PAD) | 2172 | (CONFIG_KEYPAD == IPOD_4G_PAD) || \ |
2173 | (CONFIG_KEYPAD == IRIVER_H10_PAD) | ||
2173 | OFFON_SETTING(0, clear_settings_on_hold, LANG_CLEAR_SETTINGS_ON_HOLD, | 2174 | OFFON_SETTING(0, clear_settings_on_hold, LANG_CLEAR_SETTINGS_ON_HOLD, |
2174 | true, "clear settings on hold", NULL), | 2175 | true, "clear settings on hold", NULL), |
2175 | #endif | 2176 | #endif |