Re #4224: Enable reading and writing Models and Settings from/to Horu… (#4254)

* Re #4224: Enable reading and writing Models and Settings from/to Horus radio (SD card)

* Fix for findMassstoragePath() on Windows (which got there in previous commit)
This commit is contained in:
Damjan Adamic
2017-01-19 21:26:18 +01:00
committed by Bertrand Songis
parent 3c62cbf200
commit e59a51e25f
5 changed files with 46 additions and 15 deletions
+14 -4
View File
@@ -740,13 +740,23 @@ void MainWindow::loadBackup()
void MainWindow::readEeprom()
{
if (getCurrentBoard()== BOARD_HORUS) {
qDebug() << "TODO readEEPROM HORUS";
BoardEnum board = getCurrentBoard();
if (board == BOARD_HORUS) {
QString radioPath = findMassstoragePath("RADIO", true);
qDebug() << "Searching for SD card, found" << radioPath;
if (radioPath.isEmpty()) {
qDebug() << "MainWindow::readEeprom(): Horus radio not found";
QMessageBox::critical(this, tr("Error"), tr("Unable to find Horus radio SD card!"));
return;
}
MdiChild *child = createMdiChild();
if (child->loadFile(radioPath)) {
statusBar()->showMessage(tr("Models and Settings read"), 2000);
child->show();
}
}
else {
QString tempFile;
BoardEnum board = getCurrentBoard();
if (IS_ARM(board))
tempFile = generateProcessUniqueTempFileName("temp.bin");
else