combo box for pwr off delay (#55)

* combo box for pwr off delay
* put STR into untranslated, change max to 4s
This commit is contained in:
olliw42
2021-05-29 17:34:16 +02:00
committed by GitHub
parent 9582337d96
commit 4c4764d828
4 changed files with 53 additions and 46 deletions
+4 -2
View File
@@ -363,8 +363,10 @@ void RadioSetupPage::build(FormWindow * window)
} }
#if defined(PWR_BUTTON_PRESS) #if defined(PWR_BUTTON_PRESS)
// Pwr Off Delay
{
new StaticText(window, grid.getLabelSlot(), STR_PWR_OFF_DELAY); new StaticText(window, grid.getLabelSlot(), STR_PWR_OFF_DELAY);
edit = new NumberEdit(window, grid.getFieldSlot(), 0, 3, new Choice(window, grid.getFieldSlot(), STR_PWR_OFF_DELAYS, 0, 3,
[=]() -> int32_t { [=]() -> int32_t {
return 2 - g_eeGeneral.pwrOffSpeed; return 2 - g_eeGeneral.pwrOffSpeed;
}, },
@@ -372,8 +374,8 @@ void RadioSetupPage::build(FormWindow * window)
g_eeGeneral.pwrOffSpeed = 2 - newValue; g_eeGeneral.pwrOffSpeed = 2 - newValue;
SET_DIRTY(); SET_DIRTY();
}); });
edit->setSuffix("s");
grid.nextLine(); grid.nextLine();
}
#endif #endif
#if defined(INTERNAL_GPS) #if defined(INTERNAL_GPS)
+1
View File
@@ -112,6 +112,7 @@ ISTR(BLUETOOTH_MODES);
ISTR(TEXT_SIZE); ISTR(TEXT_SIZE);
ISTR(SUBTRIMMODES); ISTR(SUBTRIMMODES);
ISTR(PWR_OFF_DELAYS);
const char STR_POPUPS_ENTER_EXIT[] = TR_POPUPS_ENTER_EXIT; const char STR_POPUPS_ENTER_EXIT[] = TR_POPUPS_ENTER_EXIT;
const char STR_OK[] = TR_OK; const char STR_OK[] = TR_OK;
+1
View File
@@ -330,6 +330,7 @@ extern const char STR_SPLASHSCREEN[];
#if defined(PWR_BUTTON_PRESS) #if defined(PWR_BUTTON_PRESS)
extern const char STR_PWR_ON_DELAY[]; extern const char STR_PWR_ON_DELAY[];
extern const char STR_PWR_OFF_DELAY[]; extern const char STR_PWR_OFF_DELAY[];
extern const char STR_PWR_OFF_DELAYS[];
#endif #endif
extern const char STR_THROTTLE_WARNING[]; extern const char STR_THROTTLE_WARNING[];
extern const char STR_SWITCHWARNING[]; extern const char STR_SWITCHWARNING[];
+3
View File
@@ -178,6 +178,9 @@
#define LEN_SBUS_INVERSION_VALUES "\014" #define LEN_SBUS_INVERSION_VALUES "\014"
#define TR_SBUS_INVERSION_VALUES "normal\0 ""not inverted" #define TR_SBUS_INVERSION_VALUES "normal\0 ""not inverted"
#define LEN_PWR_OFF_DELAYS "\002"
#define TR_PWR_OFF_DELAYS "0s""1s""2s""4s"
#define TR_SENSOR_RSSI "RSSI" #define TR_SENSOR_RSSI "RSSI"
#define TR_SENSOR_R9PW "R9PW" #define TR_SENSOR_R9PW "R9PW"
#define TR_SENSOR_RAS "SWR" #define TR_SENSOR_RAS "SWR"