diff --git a/companion/src/CMakeLists.txt b/companion/src/CMakeLists.txt index 90f4aaeb8..2a80ea43d 100644 --- a/companion/src/CMakeLists.txt +++ b/companion/src/CMakeLists.txt @@ -160,6 +160,7 @@ set(companion_SRCS mainwindow.cpp companion.cpp modelconfigdialog.cpp + taranisnotfound.cpp qcustomplot.cpp ) @@ -183,6 +184,7 @@ set(companion_MOC_HDRS mdichild.h mainwindow.h modelconfigdialog.h + taranisnotfound.h qcustomplot.h helpers.h ) @@ -204,6 +206,7 @@ set(companion_UIS splashlibrary.ui burndialog.ui modelconfigdialog.ui + taranisnotfound.ui ) set(companion_RCS diff --git a/companion/src/companion.qrc b/companion/src/companion.qrc index dcb97f0b3..733b12a67 100644 --- a/companion/src/companion.qrc +++ b/companion/src/companion.qrc @@ -57,6 +57,7 @@ images/x9r3.png images/x9s0.png images/x9t0.png + images/taranison.png images/mcw/aicon.png images/mcw/dicon.png images/mcw/gicon.png diff --git a/companion/src/images/taranison.png b/companion/src/images/taranison.png new file mode 100644 index 000000000..42a3aa3f2 Binary files /dev/null and b/companion/src/images/taranison.png differ diff --git a/companion/src/mainwindow.cpp b/companion/src/mainwindow.cpp index bd13d50c3..9d8f62c2c 100644 --- a/companion/src/mainwindow.cpp +++ b/companion/src/mainwindow.cpp @@ -63,6 +63,7 @@ #include "warnings.h" #include "helpers.h" #include "appdata.h" +#include "taranisnotfound.h" #include "firmwares/opentx/opentxinterface.h" // TODO get rid of this include #define DONATE_STR "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QUZ48K4SEXDP2" @@ -1024,7 +1025,8 @@ void MainWindow::readEeprom() if (IS_TARANIS(eepromInterface->getBoard())) { QString path=FindTaranisPath(); 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.")); + taranisNotFoundDialog *tnfd = new taranisNotFoundDialog(this); + tnfd->exec(); res=false; } else { QStringList str; @@ -1080,7 +1082,8 @@ void MainWindow::writeFileToEeprom() if (IS_TARANIS(eepromInterface->getBoard())) { QString path=FindTaranisPath(); 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.")); + taranisNotFoundDialog *tnfd = new taranisNotFoundDialog(this); + tnfd->exec(); return; } else { QStringList str; @@ -1131,7 +1134,8 @@ void MainWindow::writeFileToEeprom() if (IS_TARANIS(eepromInterface->getBoard())) { QString path=FindTaranisPath(); 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.")); + taranisNotFoundDialog *tnfd = new taranisNotFoundDialog(this); + tnfd->exec(); return; } else { QStringList str; @@ -1156,7 +1160,8 @@ void MainWindow::writeFileToEeprom() if (IS_TARANIS(eepromInterface->getBoard())) { QString path=FindTaranisPath(); 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.")); + taranisNotFoundDialog *tnfd = new taranisNotFoundDialog(this); + tnfd->exec(); return; } else { @@ -1402,7 +1407,8 @@ void MainWindow::readEepromToFile() if (IS_TARANIS(eepromInterface->getBoard())) { QString path=FindTaranisPath(); if (path.isEmpty()) { - QMessageBox::warning(this, tr("Taranis radio not found"), tr("Impossible to identify the radio on your system, please verify that the eeprom disk is connected.")); + taranisNotFoundDialog *tnfd = new taranisNotFoundDialog(this); + tnfd->exec(); return; } else { diff --git a/companion/src/mdichild.cpp b/companion/src/mdichild.cpp index 79a1e25ca..2da871fd7 100644 --- a/companion/src/mdichild.cpp +++ b/companion/src/mdichild.cpp @@ -52,6 +52,7 @@ #include "burndialog.h" #include "helpers.h" #include "appdata.h" +#include "taranisnotfound.h" #include #if defined WIN32 || !defined __GNUC__ @@ -525,7 +526,8 @@ void MdiChild::writeEeprom() // write to Tx if (IS_TARANIS(eepromInterface->getBoard())) { QString path=((MainWindow *)this->parent())->FindTaranisPath(); 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.")); + taranisNotFoundDialog *tnfd = new taranisNotFoundDialog(this); + tnfd->exec(); return; } else { @@ -581,7 +583,8 @@ void MdiChild::writeEeprom() // write to Tx if (IS_TARANIS(eepromInterface->getBoard())) { QString path=((MainWindow *)this->parent())->FindTaranisPath(); 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.")); + taranisNotFoundDialog *tnfd = new taranisNotFoundDialog(this); + tnfd->exec(); return; } else { @@ -602,7 +605,8 @@ void MdiChild::writeEeprom() // write to Tx if (IS_TARANIS(eepromInterface->getBoard())) { QString path=((MainWindow *)this->parent())->FindTaranisPath(); 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.")); + taranisNotFoundDialog *tnfd = new taranisNotFoundDialog(this); + tnfd->exec(); return; } else { diff --git a/companion/src/taranisnotfound.cpp b/companion/src/taranisnotfound.cpp new file mode 100644 index 000000000..96b9e6c43 --- /dev/null +++ b/companion/src/taranisnotfound.cpp @@ -0,0 +1,19 @@ +#include "taranisnotfound.h" +#include "ui_taranisnotfound.h" + +taranisNotFoundDialog::taranisNotFoundDialog(QWidget *parent) : + QDialog(parent), + ui(new Ui::taranisNotFoundDialog) +{ + ui->setupUi(this); +} + +taranisNotFoundDialog::~taranisNotFoundDialog() +{ + delete ui; +} + +void taranisNotFoundDialog::on_OK_clicked() +{ + accept(); +} \ No newline at end of file diff --git a/companion/src/taranisnotfound.h b/companion/src/taranisnotfound.h new file mode 100644 index 000000000..8b4d964b9 --- /dev/null +++ b/companion/src/taranisnotfound.h @@ -0,0 +1,22 @@ +#ifndef TARANISNOTFOUNDDIALOG_H +#define TARANISNOTFOUNDDIALOG_H + +#include + +namespace Ui { + class taranisNotFoundDialog; +} + +class taranisNotFoundDialog : public QDialog +{ + Q_OBJECT +public: + explicit taranisNotFoundDialog(QWidget *parent = 0); + ~taranisNotFoundDialog(); +private: + Ui::taranisNotFoundDialog *ui; +private slots: + void on_OK_clicked(); +}; + +#endif // TARANISNOTFOUNDDIALOG_H diff --git a/companion/src/taranisnotfound.ui b/companion/src/taranisnotfound.ui new file mode 100644 index 000000000..062ce4667 --- /dev/null +++ b/companion/src/taranisnotfound.ui @@ -0,0 +1,83 @@ + + + taranisNotFoundDialog + + + + 0 + 0 + 365 + 295 + + + + No Taranis Radio Found + + + + + + + + <html><head/><body><p>No Taranis Radio was found!</p><p>Make sure that you hold the lower trim buttons towards the center while you turn it on.</p><p>Then connect the USB wire to the computer.</p></body></html> + + + Qt::RichText + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + true + + + + + + + + 0 + 0 + + + + + + + :/images/taranison.png + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + OK + + + + + + + + + + + +