feat(radio): allow user to choose only one log file per day (#7163)
Co-authored-by: elecpower <elecpower@users.noreply.github.com>
This commit is contained in:
@@ -415,6 +415,8 @@ Node convert<GeneralSettings>::encode(const GeneralSettings& rhs)
|
||||
}
|
||||
}
|
||||
|
||||
node["oneLogPerDay"] = (int)rhs.oneLogPerDay;
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
@@ -772,6 +774,8 @@ bool convert<GeneralSettings>::decode(const Node& node, GeneralSettings& rhs)
|
||||
}
|
||||
}
|
||||
|
||||
node["oneLogPerDay"] >> rhs.oneLogPerDay;
|
||||
|
||||
// override critical settings after import
|
||||
// TODO: for consistency move up call stack to use existing eeprom and profile conversions
|
||||
if (needsConversion)
|
||||
|
||||
@@ -456,6 +456,7 @@ class GeneralSettings {
|
||||
char* keyShortcutTools[MAX_KEYSHORTCUTS];
|
||||
unsigned int qmFavorites[MAX_QMFAVOURITES];
|
||||
char* qmFavoritesTools[MAX_QMFAVOURITES];
|
||||
bool oneLogPerDay;
|
||||
|
||||
void switchConfigClear();
|
||||
|
||||
|
||||
@@ -473,6 +473,7 @@ void GeneralSetupPanel::setValues()
|
||||
ui->registrationId->setText(generalSettings.registrationId);
|
||||
ui->startSoundCB->setChecked(!generalSettings.dontPlayHello);
|
||||
ui->modelQuickSelect_CB->setChecked(generalSettings.modelQuickSelect);
|
||||
ui->chkOneLogPerDay->setChecked(generalSettings.oneLogPerDay);
|
||||
|
||||
if (Boards::getCapability(board, Board::HasColorLcd)) {
|
||||
ui->modelSelectLayout_CB->setCurrentIndex(generalSettings.modelSelectLayout);
|
||||
@@ -942,3 +943,11 @@ void GeneralSetupPanel::on_startSoundCB_stateChanged(int)
|
||||
emit modified();
|
||||
}
|
||||
}
|
||||
|
||||
void GeneralSetupPanel::on_chkOneLogPerDay_stateChanged(int)
|
||||
{
|
||||
if (!lock) {
|
||||
generalSettings.oneLogPerDay = ui->chkOneLogPerDay->isChecked();
|
||||
emit modified();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,6 +102,7 @@ class GeneralSetupPanel : public GeneralPanel
|
||||
void on_favMultiMode_CB_currentIndexChanged(int);
|
||||
|
||||
void on_pwrOffIfInactiveSB_editingFinished();
|
||||
void on_chkOneLogPerDay_stateChanged(int);
|
||||
|
||||
private:
|
||||
Ui::GeneralSetup *ui;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user