diff --git a/companion/src/boards.h b/companion/src/boards.h index 247fd6dc3..1bd79c20f 100644 --- a/companion/src/boards.h +++ b/companion/src/boards.h @@ -111,6 +111,7 @@ Board::SwitchInfo getSwitchInfo(Board::Type board, unsigned index); #define IS_9XRPRO(board) (board==Board::BOARD_9XRPRO) #define IS_TARANIS_X7(board) (board==Board::BOARD_TARANIS_X7) #define IS_TARANIS_X9(board) (board==Board::BOARD_TARANIS_X9D || board==Board::BOARD_TARANIS_X9DP || board==Board::BOARD_TARANIS_X9E) +#define IS_TARANIS_X9D(board) (board==Board::BOARD_TARANIS_X9D || board==Board::BOARD_TARANIS_X9DP) #define IS_TARANIS_PLUS(board) (board==Board::BOARD_TARANIS_X9DP || board==Board::BOARD_TARANIS_X9E) #define IS_TARANIS_X9E(board) (board==Board::BOARD_TARANIS_X9E) #define IS_TARANIS(board) (IS_TARANIS_X9(board) || IS_TARANIS_X7(board)) diff --git a/companion/src/mainwindow.cpp b/companion/src/mainwindow.cpp index 6ca7afdf7..83be17e24 100644 --- a/companion/src/mainwindow.cpp +++ b/companion/src/mainwindow.cpp @@ -496,7 +496,7 @@ void MainWindow::checkForFirmwareUpdateFinished(QNetworkReply * reply) void MainWindow::startFirmwareDownload() { QString url = current_firmware_variant->getFirmwareUrl(); - qDebug() "Downloading firmware" << url; + qDebug() << "Downloading firmware" << url; QString ext = url.mid(url.lastIndexOf(".")); QString defaultFilename = g.flashDir() + "/" + current_firmware_variant->getId(); if (g.profile[g.id()].renameFwFiles()) { diff --git a/companion/src/mdichild.cpp b/companion/src/mdichild.cpp index 545a31355..992966298 100644 --- a/companion/src/mdichild.cpp +++ b/companion/src/mdichild.cpp @@ -507,7 +507,7 @@ bool MdiChild::loadFile(const QString & filename, bool resetCurrentFile) setCurrentFile(filename); } - if (storage.getBoard() != getCurrentBoard()) { + if (!storage.isBoardCompatible(getCurrentBoard())) { convertStorage(storage.getBoard(), getCurrentBoard()); } diff --git a/companion/src/storage/storage.h b/companion/src/storage/storage.h index f48ae8b0a..eaaa0d8f0 100644 --- a/companion/src/storage/storage.h +++ b/companion/src/storage/storage.h @@ -62,10 +62,22 @@ class StorageFormat virtual QString name() = 0; - virtual Board::Type getBoard() { + virtual Board::Type getBoard() + { return board; } + virtual bool isBoardCompatible(Board::Type board) + { + if (this->board == board) + return true; + + if (IS_TARANIS_X9D(this->board) && IS_TARANIS_X9D(board)) + return true; + + return false; + } + protected: void setError(const QString & error) {