feat: add ability to disable trainer warning on shutdown (#4831)
Co-authored-by: philmoz <phil.a.mitchell@gmail.com> Co-authored-by: Peter Feerick <peter.feerick@gmail.com>
This commit is contained in:
co-authored by
philmoz
Peter Feerick
parent
acd34e7fc9
commit
09d4066a23
@@ -206,6 +206,7 @@ Node convert<GeneralSettings>::encode(const GeneralSettings& rhs)
|
||||
node["alarmsFlash"] = (int)rhs.alarmsFlash;
|
||||
node["disableAlarmWarning"] = (int)rhs.disableAlarmWarning;
|
||||
node["disableRssiPoweroffAlarm"] = (int)rhs.disableRssiPoweroffAlarm;
|
||||
node["disableTrainerPoweroffAlarm"] = (int)rhs.disableTrainerPoweroffAlarm;
|
||||
node["USBMode"] = rhs.usbMode;
|
||||
node["hatsMode"] = hatsModeLut << rhs.hatsMode;
|
||||
node["stickDeadZone"] = rhs.stickDeadZone;
|
||||
@@ -450,6 +451,7 @@ bool convert<GeneralSettings>::decode(const Node& node, GeneralSettings& rhs)
|
||||
node["alarmsFlash"] >> rhs.alarmsFlash;
|
||||
node["disableAlarmWarning"] >> rhs.disableAlarmWarning;
|
||||
node["disableRssiPoweroffAlarm"] >> rhs.disableRssiPoweroffAlarm;
|
||||
node["disableTrainerPoweroffAlarm"] >> rhs.disableTrainerPoweroffAlarm;
|
||||
node["USBMode"] >> rhs.usbMode;
|
||||
node["hatsMode"] >> hatsModeLut >> rhs.hatsMode;
|
||||
node["stickDeadZone"] >> rhs.stickDeadZone;
|
||||
|
||||
@@ -221,6 +221,7 @@ class GeneralSettings {
|
||||
BeeperMode beeperMode;
|
||||
bool disableAlarmWarning;
|
||||
bool disableRssiPoweroffAlarm;
|
||||
bool disableTrainerPoweroffAlarm;
|
||||
unsigned int usbMode;
|
||||
unsigned int hatsMode;
|
||||
unsigned int stickDeadZone;
|
||||
|
||||
@@ -271,6 +271,7 @@ ui(new Ui::GeneralSetup)
|
||||
ui->alarmwarnChkB->setChecked(!generalSettings.disableAlarmWarning); // Default is zero=checked
|
||||
|
||||
ui->rssiPowerOffWarnChkB->setChecked(!generalSettings.disableRssiPoweroffAlarm); // Default is zero=checked
|
||||
ui->trainerPowerOffWarnChkB->setChecked(!generalSettings.disableTrainerPoweroffAlarm); // Default is zero=checked
|
||||
|
||||
ui->splashScreenDuration->setCurrentIndex(3-generalSettings.splashMode);
|
||||
if (IS_FAMILY_HORUS_OR_T16(firmware->getBoard())) {
|
||||
@@ -820,6 +821,12 @@ void GeneralSetupPanel::on_rssiPowerOffWarnChkB_stateChanged(int)
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void GeneralSetupPanel::on_trainerPowerOffWarnChkB_stateChanged(int)
|
||||
{
|
||||
generalSettings.disableTrainerPoweroffAlarm = ui->trainerPowerOffWarnChkB->isChecked() ? 0 : 1;
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void GeneralSetupPanel::on_beeperCB_currentIndexChanged(int index)
|
||||
{
|
||||
generalSettings.beeperMode = (GeneralSettings::BeeperMode)(index-2);
|
||||
|
||||
@@ -40,6 +40,7 @@ class GeneralSetupPanel : public GeneralPanel
|
||||
void on_splashScreenDuration_currentIndexChanged(int index);
|
||||
void on_alarmwarnChkB_stateChanged(int);
|
||||
void on_rssiPowerOffWarnChkB_stateChanged(int);
|
||||
void on_trainerPowerOffWarnChkB_stateChanged(int);
|
||||
void on_gpsFormatCB_currentIndexChanged(int index);
|
||||
void on_displayTypeCB_currentIndexChanged(int index);
|
||||
void on_BLBright_SB_editingFinished();
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user