Implement profile specific settings for backup folder.
Profile backup path if set overrides general one, in any case the backup will be performed if either profile specific setting or general settings ones are enabled. Disabling backup in profile will not disable backups if generic settings are enabled
This commit is contained in:
@@ -22,7 +22,11 @@ radioData(new RadioData())
|
||||
ui->eepromFilename->hide();
|
||||
ui->eepromLoad->hide();
|
||||
}
|
||||
QString backupPath = g.backupDir();
|
||||
QString backupPath = g.profile[g.id()].pBackupDir();
|
||||
if (backupPath.isEmpty()) {
|
||||
backupPath=g.backupDir();
|
||||
ui->backupBeforeWrite->setChecked(g.enableBackup() || g.profile[g.id()].penableBackup());
|
||||
}
|
||||
if (backupPath.isEmpty() || !QDir(backupPath).exists()) {
|
||||
ui->backupBeforeWrite->setEnabled(false);
|
||||
}
|
||||
@@ -292,8 +296,13 @@ void FlashEEpromDialog::on_burnButton_clicked()
|
||||
|
||||
// backup previous EEPROM if requested
|
||||
QString backupFilename;
|
||||
QString backupPath;
|
||||
if (ui->backupBeforeWrite->isChecked()) {
|
||||
backupFilename = g.backupDir() + "/backup-" + QDateTime().currentDateTime().toString("yyyy-MM-dd-HHmmss") + ".bin";
|
||||
backupPath = g.profile[g.id()].pBackupDir();
|
||||
if (backupPath.isEmpty()) {
|
||||
backupPath=g.backupDir();
|
||||
}
|
||||
backupFilename = backupPath + "/backup-" + QDateTime().currentDateTime().toString("yyyy-MM-dd-HHmmss") + ".bin";
|
||||
}
|
||||
else if (ui->checkFirmwareCompatibility->isChecked()) {
|
||||
backupFilename = generateProcessUniqueTempFileName("eeprom.bin");
|
||||
|
||||
@@ -46,7 +46,10 @@ fwName(g.profile[g.id()].fwName())
|
||||
ui->backupEEprom->setCheckState(g.backupOnFlash() ? Qt::Checked : Qt::Unchecked);
|
||||
}
|
||||
|
||||
QString backupPath = g.backupDir();
|
||||
QString backupPath = g.profile[g.id()].pBackupDir();
|
||||
if (backupPath.isEmpty()) {
|
||||
backupPath=g.backupDir();
|
||||
}
|
||||
if (backupPath.isEmpty() || !QDir(backupPath).exists()) {
|
||||
ui->backupEEprom->setEnabled(false);
|
||||
}
|
||||
@@ -278,8 +281,13 @@ void FlashFirmwareDialog::startFlash(const QString &filename)
|
||||
// backup if requested
|
||||
bool result = true;
|
||||
QString backupFilename;
|
||||
QString backupPath;
|
||||
if (backup) {
|
||||
backupFilename = g.backupDir() + "/backup-" + QDateTime().currentDateTime().toString("yyyy-MM-dd-HHmmss") + ".bin";
|
||||
backupPath = g.profile[g.id()].pBackupDir();
|
||||
if (backupPath.isEmpty()) {
|
||||
backupPath=g.backupDir();
|
||||
}
|
||||
backupFilename = backupPath + "/backup-" + QDateTime().currentDateTime().toString("yyyy-MM-dd-HHmmss") + ".bin";
|
||||
result = readEeprom(backupFilename, progressDialog.progress());
|
||||
sleep(2);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user