feat: Splash screen delay opt for colorlcd, startup sound disable opt (#3451)
* Enable startup splash screen duration for color LCD radios. Add option to disable startup sound. Add Companion support for changes. * Add translation string for Hebrew language file. * Fix rebase. * chore: Add T20 * Update translations. * Update translations. * Update translations. * Update translations. * Right justify radio setup controls. * Use longer translations for all radios. * Enable splash screen timeout for NV14/EL18. * Suspend watchdog timer to prevent EM if long splash display time selected. * Simplify SPLASH_TIMEOUT code. * Use WDG_RESET instead of watchdogSuspend. --------- Co-authored-by: Phil Mitchell <phil.a.mitchell@gmail.com> Co-authored-by: Peter Feerick <peter.feerick@gmail.com>
This commit is contained in:
co-authored by
Phil Mitchell
Peter Feerick
parent
ca025e849f
commit
9e7a331fa6
@@ -193,9 +193,7 @@ Node convert<GeneralSettings>::encode(const GeneralSettings& rhs)
|
||||
node["internalModuleBaudrate"] = internalModuleBaudrate.value;
|
||||
|
||||
node["internalModule"] = LookupValue(internalModuleLut, rhs.internalModule);
|
||||
if (!IS_FAMILY_HORUS_OR_T16(fw->getBoard())) {
|
||||
node["splashMode"] = rhs.splashMode;
|
||||
}
|
||||
node["splashMode"] = rhs.splashMode;
|
||||
node["lightAutoOff"] = rhs.backlightDelay;
|
||||
node["templateSetup"] = rhs.templateSetup;
|
||||
node["hapticLength"] = rhs.hapticLength + 2;
|
||||
@@ -226,6 +224,7 @@ Node convert<GeneralSettings>::encode(const GeneralSettings& rhs)
|
||||
node["varioRange"] = rhs.varioRange * 15;
|
||||
node["varioRepeat"] = rhs.varioRepeat;
|
||||
node["backgroundVolume"] = rhs.backgroundVolume + 2;
|
||||
node["dontPlayHello"] = (int)rhs.dontPlayHello;
|
||||
if (Boards::getCapability(fw->getBoard(), Board::HasColorLcd)) {
|
||||
node["modelQuickSelect"] = (int)rhs.modelQuickSelect;
|
||||
}
|
||||
@@ -435,9 +434,7 @@ bool convert<GeneralSettings>::decode(const Node& node, GeneralSettings& rhs)
|
||||
rhs.internalModule = Boards::getDefaultInternalModules(fw->getBoard());
|
||||
}
|
||||
|
||||
if (!IS_FAMILY_HORUS_OR_T16(fw->getBoard())) {
|
||||
node["splashMode"] >> rhs.splashMode;
|
||||
}
|
||||
node["splashMode"] >> rhs.splashMode;
|
||||
node["lightAutoOff"] >> rhs.backlightDelay;
|
||||
node["templateSetup"] >> rhs.templateSetup;
|
||||
node["hapticLength"] >> ioffset_int(rhs.hapticLength, 2);
|
||||
@@ -471,6 +468,7 @@ bool convert<GeneralSettings>::decode(const Node& node, GeneralSettings& rhs)
|
||||
node["varioRepeat"] >> rhs.varioRepeat;
|
||||
node["backgroundVolume"] >> ioffset_int(rhs.backgroundVolume, 2);
|
||||
node["modelQuickSelect"] >> rhs.modelQuickSelect;
|
||||
node["dontPlayHello"] >> rhs.dontPlayHello;
|
||||
|
||||
// depreciated v2.7 replaced by serialPort
|
||||
if (node["auxSerialMode"]) {
|
||||
|
||||
@@ -221,6 +221,7 @@ class GeneralSettings {
|
||||
bool preBeep;
|
||||
bool flashBeep;
|
||||
int splashMode;
|
||||
bool dontPlayHello;
|
||||
unsigned int backlightDelay;
|
||||
unsigned int templateSetup; //RETA order according to chout_ar array
|
||||
int PPM_Multiplier;
|
||||
|
||||
@@ -251,12 +251,9 @@ ui(new Ui::GeneralSetup)
|
||||
|
||||
ui->rssiPowerOffWarnChkB->setChecked(!generalSettings.disableRssiPoweroffAlarm); // Default is zero=checked
|
||||
|
||||
ui->splashScreenDuration->setCurrentIndex(3-generalSettings.splashMode);
|
||||
if (IS_FAMILY_HORUS_OR_T16(firmware->getBoard())) {
|
||||
ui->splashScreenDuration->hide();
|
||||
ui->splashScreenLabel->hide();
|
||||
}
|
||||
else {
|
||||
ui->splashScreenDuration->setCurrentIndex(3-generalSettings.splashMode);
|
||||
ui->splashScreenDuration->setItemText(0, QCoreApplication::translate("GeneralSetup", "1s", nullptr));
|
||||
}
|
||||
|
||||
if (!firmware->getCapability(PwrButtonPress)) {
|
||||
@@ -477,6 +474,8 @@ void GeneralSetupPanel::setValues()
|
||||
|
||||
ui->registrationId->setText(generalSettings.registrationId);
|
||||
|
||||
ui->startSoundCB->setChecked(!generalSettings.dontPlayHello);
|
||||
|
||||
if (Boards::getCapability(firmware->getBoard(), Board::HasColorLcd)) {
|
||||
ui->modelQuickSelect_CB->setChecked(generalSettings.modelQuickSelect);
|
||||
} else {
|
||||
@@ -804,3 +803,9 @@ void GeneralSetupPanel::on_modelQuickSelect_CB_stateChanged(int)
|
||||
generalSettings.modelQuickSelect = ui->modelQuickSelect_CB->isChecked();
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void GeneralSetupPanel::on_startSoundCB_stateChanged(int)
|
||||
{
|
||||
generalSettings.dontPlayHello = !ui->startSoundCB->isChecked();
|
||||
emit modified();
|
||||
}
|
||||
|
||||
@@ -93,6 +93,7 @@ class GeneralSetupPanel : public GeneralPanel
|
||||
void on_pwrOffDelay_valueChanged(int);
|
||||
|
||||
void on_modelQuickSelect_CB_stateChanged(int);
|
||||
void on_startSoundCB_stateChanged(int);
|
||||
|
||||
private:
|
||||
Ui::GeneralSetup *ui;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user