fix(cpn): preserve current calibration when writing models and settings to radio (#6722)

This commit is contained in:
Neil Horne
2025-10-29 11:23:45 +10:00
committed by GitHub
parent dbab5745b6
commit edaba32e2b
10 changed files with 143 additions and 62 deletions
+4 -5
View File
@@ -1493,10 +1493,11 @@ int MdiChild::askQuestion(const QString & msg, QMessageBox::StandardButtons butt
return QMessageBox::question(this, CPN_STR_APP_NAME, msg, buttons, defaultButton);
}
void MdiChild::writeSettings(StatusDialog * status, bool toRadio) // write to Tx
void MdiChild::writeSettings(StatusDialog * status, bool toRadio)
{
// safeguard as the menu actions should be disabled
int cnt = radioData.invalidModels();
if (cnt) {
QMessageBox::critical(this, tr("Write Models and Settings"), tr("Operation aborted as %1 models have significant errors that may affect model operation.").arg(cnt));
return;
@@ -1522,8 +1523,7 @@ void MdiChild::writeSettings(StatusDialog * status, bool toRadio) // write to T
if (toRadio) {
radioPath = findMassStoragePath("RADIO", true);
qDebug() << "Searching for SD card, found" << radioPath;
}
else {
} else {
radioPath = g.currentProfile().sdPath();
if (!QFile(radioPath % "/RADIO").exists())
radioPath.clear();
@@ -1538,8 +1538,7 @@ void MdiChild::writeSettings(StatusDialog * status, bool toRadio) // write to T
if (saveFile(radioPath, false)) {
status->hide();
QMessageBox::information(this, CPN_STR_TTL_INFO, tr("Models and settings written"));
}
else {
} else {
status->hide();
QMessageBox::critical(this, CPN_STR_TTL_ERROR, tr("Error writing models and settings!"));
}