Should fix Issue #732. Not reproduced, not tested

This commit is contained in:
Bertrand Songis
2014-02-22 13:15:10 +01:00
parent 5337158911
commit 7cf94ec204
+9 -7
View File
@@ -521,12 +521,14 @@ void MdiChild::writeEeprom() // write to Tx
if (path.isEmpty()) { if (path.isEmpty()) {
QMessageBox::warning(this, tr("Taranis radio not found"), tr("Impossible to identify the radio on your system, please verify the eeprom disk is connected.")); QMessageBox::warning(this, tr("Taranis radio not found"), tr("Impossible to identify the radio on your system, please verify the eeprom disk is connected."));
return; return;
} else { }
else {
QStringList str; QStringList str;
str << path << backupFile; str << path << backupFile;
avrOutputDialog *ad = new avrOutputDialog(this,"", str, tr("Backup EEPROM From Tx")); //, AVR_DIALOG_KEEP_OPEN); avrOutputDialog *ad = new avrOutputDialog(this,"", str, tr("Backup EEPROM From Tx")); //, AVR_DIALOG_KEEP_OPEN);
ad->setWindowIcon(CompanionIcon("read_eeprom.png")); ad->setWindowIcon(CompanionIcon("read_eeprom.png"));
ad->exec(); ad->exec();
delete ad;
sleep(1); sleep(1);
} }
} }
@@ -549,10 +551,9 @@ void MdiChild::writeEeprom() // write to Tx
sleep(1); sleep(1);
QString restoreFile = tempDir + "/compat.bin"; QString restoreFile = tempDir + "/compat.bin";
if (!((MainWindow *)this->parent())->convertEEPROM(tempFile, restoreFile, tempFlash)) { if (!((MainWindow *)this->parent())->convertEEPROM(tempFile, restoreFile, tempFlash)) {
int ret = QMessageBox::question(this, "Error", tr("Cannot check eeprom compatibility! Continue anyway?") , int ret = QMessageBox::question(this, tr("Error"), tr("Cannot check eeprom compatibility! Continue anyway?"), QMessageBox::Yes | QMessageBox::No);
QMessageBox::Yes | QMessageBox::No); if (ret == QMessageBox::No)
if (ret==QMessageBox::No) return;
return;
} }
else { else {
int rev=((MainWindow *)this->parent())->getEpromVersion(restoreFile); int rev=((MainWindow *)this->parent())->getEpromVersion(restoreFile);
@@ -591,6 +592,7 @@ void MdiChild::writeEeprom() // write to Tx
} }
} }
} }
if (IS_TARANIS(eepromInterface->getBoard())) { if (IS_TARANIS(eepromInterface->getBoard())) {
QString path=((MainWindow *)this->parent())->FindTaranisPath(); QString path=((MainWindow *)this->parent())->FindTaranisPath();
if (path.isEmpty()) { if (path.isEmpty()) {
@@ -602,7 +604,7 @@ void MdiChild::writeEeprom() // write to Tx
str << tempFile << path; str << tempFile << path;
avrOutputDialog *ad = new avrOutputDialog(this,"", str, tr("Write EEPROM To Tx"), AVR_DIALOG_SHOW_DONE); //, AVR_DIALOG_KEEP_OPEN); avrOutputDialog *ad = new avrOutputDialog(this,"", str, tr("Write EEPROM To Tx"), AVR_DIALOG_SHOW_DONE); //, AVR_DIALOG_KEEP_OPEN);
ad->setWindowIcon(CompanionIcon("read_eeprom.png")); ad->setWindowIcon(CompanionIcon("read_eeprom.png"));
ad->show(); ad->exec();
delete ad; delete ad;
sleep(1); sleep(1);
} }
@@ -611,7 +613,7 @@ void MdiChild::writeEeprom() // write to Tx
QStringList str = ((MainWindow *)this->parent())->GetSendEEpromCommand(tempFile); QStringList str = ((MainWindow *)this->parent())->GetSendEEpromCommand(tempFile);
avrOutputDialog *ad = new avrOutputDialog(this, ((MainWindow *)this->parent())->GetAvrdudeLocation(), str, "Write EEPROM To Tx", AVR_DIALOG_SHOW_DONE); avrOutputDialog *ad = new avrOutputDialog(this, ((MainWindow *)this->parent())->GetAvrdudeLocation(), str, "Write EEPROM To Tx", AVR_DIALOG_SHOW_DONE);
ad->setWindowIcon(CompanionIcon("write_eeprom.png")); ad->setWindowIcon(CompanionIcon("write_eeprom.png"));
ad->show(); ad->exec();
delete ad; delete ad;
} }
} }