chore(cpn): remove binary file format models and settings support (#5653)
This commit is contained in:
@@ -267,7 +267,7 @@ void FlashFirmwareDialog::shrink()
|
||||
|
||||
void FlashFirmwareDialog::startFlash(const QString &filename)
|
||||
{
|
||||
bool backup = g.backupOnFlash();
|
||||
// bool backup = g.backupOnFlash();
|
||||
|
||||
close();
|
||||
|
||||
@@ -297,34 +297,35 @@ void FlashFirmwareDialog::startFlash(const QString &filename)
|
||||
|
||||
if (checkPassed) {
|
||||
// backup if requested
|
||||
bool result = true;
|
||||
QString backupFilename;
|
||||
QString backupPath;
|
||||
if (backup) {
|
||||
backupPath = g.profile[g.id()].pBackupDir();
|
||||
if (backupPath.isEmpty()) {
|
||||
backupPath=g.backupDir();
|
||||
}
|
||||
backupFilename = backupPath + "/backup-" + QDateTime().currentDateTime().toString("yyyy-MM-dd-HHmmss") + ".bin";
|
||||
result = readSettings(backupFilename, progressDialog.progress());
|
||||
sleep(2);
|
||||
}
|
||||
// bool result = true;
|
||||
// QString backupFilename;
|
||||
// QString backupPath;
|
||||
// if (backup) {
|
||||
// backupPath = g.profile[g.id()].pBackupDir();
|
||||
// if (backupPath.isEmpty()) {
|
||||
// backupPath=g.backupDir();
|
||||
// }
|
||||
// backupFilename = backupPath + "/backup-" + QDateTime().currentDateTime().toString("yyyy-MM-dd-HHmmss") + ".bin";
|
||||
// result = readSettings(backupFilename, progressDialog.progress());
|
||||
// sleep(2);
|
||||
// }
|
||||
|
||||
// flash
|
||||
result = (result && writeFirmware(filename, progressDialog.progress()));
|
||||
//result = (result && writeFirmware(filename, progressDialog.progress()));
|
||||
writeFirmware(filename, progressDialog.progress());
|
||||
|
||||
// restore if backup requested
|
||||
if (backup && result) {
|
||||
sleep(2);
|
||||
QString restoreFilename = generateProcessUniqueTempFileName("restore.bin");
|
||||
if (!convertEEprom(backupFilename, restoreFilename, filename)) {
|
||||
QMessageBox::warning(this, tr("Conversion failed"), tr("Cannot convert Models and Settings for use with this firmware, original data will be used"));
|
||||
restoreFilename = backupFilename;
|
||||
}
|
||||
if (!writeSettings(restoreFilename, progressDialog.progress())) {
|
||||
QMessageBox::warning(this, tr("Restore failed"), tr("Could not restore Models and Settings to Radio. The models and settings data file can be found at: %1").arg(backupFilename));
|
||||
}
|
||||
}
|
||||
// if (backup && result) {
|
||||
// sleep(2);
|
||||
// QString restoreFilename = generateProcessUniqueTempFileName("restore.bin");
|
||||
// if (!convertEEprom(backupFilename, restoreFilename, filename)) {
|
||||
// QMessageBox::warning(this, tr("Conversion failed"), tr("Cannot convert Models and Settings for use with this firmware, original data will be used"));
|
||||
// restoreFilename = backupFilename;
|
||||
// }
|
||||
// if (!writeSettings(restoreFilename, progressDialog.progress())) {
|
||||
// QMessageBox::warning(this, tr("Restore failed"), tr("Could not restore Models and Settings to Radio. The models and settings data file can be found at: %1").arg(backupFilename));
|
||||
// }
|
||||
// }
|
||||
|
||||
progressDialog.progress()->setInfo(tr("Flashing done"));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user