Fix for #1176 improved
This commit is contained in:
@@ -168,7 +168,7 @@ set(companion_SRCS
|
|||||||
splashlibrary.cpp
|
splashlibrary.cpp
|
||||||
mainwindow.cpp
|
mainwindow.cpp
|
||||||
companion.cpp
|
companion.cpp
|
||||||
taranisnotfound.cpp
|
radionotfound.cpp
|
||||||
qcustomplot.cpp
|
qcustomplot.cpp
|
||||||
wizarddata.cpp
|
wizarddata.cpp
|
||||||
wizarddialog.cpp
|
wizarddialog.cpp
|
||||||
@@ -193,7 +193,7 @@ set(companion_MOC_HDRS
|
|||||||
modelslist.h
|
modelslist.h
|
||||||
mdichild.h
|
mdichild.h
|
||||||
mainwindow.h
|
mainwindow.h
|
||||||
taranisnotfound.h
|
radionotfound.h
|
||||||
qcustomplot.h
|
qcustomplot.h
|
||||||
qautocombobox.h
|
qautocombobox.h
|
||||||
helpers.h
|
helpers.h
|
||||||
@@ -216,7 +216,7 @@ set(companion_UIS
|
|||||||
customizesplashdialog.ui
|
customizesplashdialog.ui
|
||||||
splashlibrary.ui
|
splashlibrary.ui
|
||||||
burndialog.ui
|
burndialog.ui
|
||||||
taranisnotfound.ui
|
radionotfound.ui
|
||||||
)
|
)
|
||||||
|
|
||||||
set(companion_RCS
|
set(companion_RCS
|
||||||
|
|||||||
@@ -63,7 +63,7 @@
|
|||||||
#include "warnings.h"
|
#include "warnings.h"
|
||||||
#include "helpers.h"
|
#include "helpers.h"
|
||||||
#include "appdata.h"
|
#include "appdata.h"
|
||||||
#include "taranisnotfound.h"
|
#include "radionotfound.h"
|
||||||
#include "googleanalytics.h"
|
#include "googleanalytics.h"
|
||||||
#include "firmwares/opentx/opentxinterface.h" // TODO get rid of this include
|
#include "firmwares/opentx/opentxinterface.h" // TODO get rid of this include
|
||||||
|
|
||||||
@@ -1056,11 +1056,7 @@ bool MainWindow::readEepromFromRadio(const QString filename, const QString messa
|
|||||||
// Mike's bootloader calls the EEPROM file "ERSKY9X.BIN" :(
|
// Mike's bootloader calls the EEPROM file "ERSKY9X.BIN" :(
|
||||||
path = FindMassstoragePath("ERSKY9X.BIN");
|
path = FindMassstoragePath("ERSKY9X.BIN");
|
||||||
}
|
}
|
||||||
if (path.isEmpty()) {
|
if (!path.isEmpty()) {
|
||||||
taranisNotFoundDialog *tnfd = new taranisNotFoundDialog(this);
|
|
||||||
tnfd->exec();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
QStringList str;
|
QStringList str;
|
||||||
str << path << filename;
|
str << path << filename;
|
||||||
avrOutputDialog *ad = new avrOutputDialog(this, "", str, message);
|
avrOutputDialog *ad = new avrOutputDialog(this, "", str, message);
|
||||||
@@ -1071,7 +1067,8 @@ bool MainWindow::readEepromFromRadio(const QString filename, const QString messa
|
|||||||
result = true;
|
result = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
|
if (result == false && !IS_TARANIS(GetCurrentFirmware()->getBoard())) {
|
||||||
QStringList str = GetReceiveEEpromCommand(filename);
|
QStringList str = GetReceiveEEpromCommand(filename);
|
||||||
avrOutputDialog *ad = new avrOutputDialog(this, GetAvrdudeLocation(), str, message);
|
avrOutputDialog *ad = new avrOutputDialog(this, GetAvrdudeLocation(), str, message);
|
||||||
ad->setWindowIcon(CompanionIcon("read_eeprom.png"));
|
ad->setWindowIcon(CompanionIcon("read_eeprom.png"));
|
||||||
@@ -1081,22 +1078,30 @@ bool MainWindow::readEepromFromRadio(const QString filename, const QString messa
|
|||||||
result = true;
|
result = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!QFileInfo(filename).exists())
|
if (result == false && IS_ARM(GetCurrentFirmware()->getBoard())) {
|
||||||
|
RadioNotFoundDialog *dialog = new RadioNotFoundDialog(this);
|
||||||
|
dialog->exec();
|
||||||
|
delete dialog;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!QFileInfo(filename).exists()) {
|
||||||
result = false;
|
result = false;
|
||||||
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MainWindow::writeEepromToRadio(const QString filename, const QString message)
|
bool MainWindow::writeEepromToRadio(const QString filename, const QString message)
|
||||||
{
|
{
|
||||||
|
bool result = false;
|
||||||
|
|
||||||
if (IS_ARM(GetCurrentFirmware()->getBoard())) {
|
if (IS_ARM(GetCurrentFirmware()->getBoard())) {
|
||||||
QString path = FindMassstoragePath("EEPROM.BIN");
|
QString path = FindMassstoragePath("EEPROM.BIN");
|
||||||
if (path.isEmpty()) {
|
if (path.isEmpty()) {
|
||||||
taranisNotFoundDialog *tnfd = new taranisNotFoundDialog(this);
|
// Mike's bootloader calls the EEPROM file "ERSKY9X.BIN" :(
|
||||||
tnfd->exec();
|
path = FindMassstoragePath("ERSKY9X.BIN");
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
else {
|
if (!path.isEmpty()) {
|
||||||
QStringList str;
|
QStringList str;
|
||||||
str << filename << path;
|
str << filename << path;
|
||||||
avrOutputDialog *ad = new avrOutputDialog(this, "", str, message);
|
avrOutputDialog *ad = new avrOutputDialog(this, "", str, message);
|
||||||
@@ -1104,17 +1109,27 @@ bool MainWindow::writeEepromToRadio(const QString filename, const QString messag
|
|||||||
ad->exec();
|
ad->exec();
|
||||||
delete ad;
|
delete ad;
|
||||||
sleep(1);
|
sleep(1);
|
||||||
return true;
|
result = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
|
if (result == false && !IS_TARANIS(GetCurrentFirmware()->getBoard())) {
|
||||||
QStringList str = GetSendEEpromCommand(filename);
|
QStringList str = GetSendEEpromCommand(filename);
|
||||||
avrOutputDialog *ad = new avrOutputDialog(this, GetAvrdudeLocation(), str, "Write Backup To Radio", AVR_DIALOG_SHOW_DONE);
|
avrOutputDialog *ad = new avrOutputDialog(this, GetAvrdudeLocation(), str, "Write Backup To Radio", AVR_DIALOG_SHOW_DONE);
|
||||||
ad->setWindowIcon(CompanionIcon("write_eeprom.png"));
|
ad->setWindowIcon(CompanionIcon("write_eeprom.png"));
|
||||||
ad->exec();
|
ad->exec();
|
||||||
delete ad;
|
delete ad;
|
||||||
return true;
|
sleep(1);
|
||||||
|
result = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (result == false && IS_ARM(GetCurrentFirmware()->getBoard())) {
|
||||||
|
RadioNotFoundDialog *dialog = new RadioNotFoundDialog(this);
|
||||||
|
dialog->exec();
|
||||||
|
delete dialog;
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::writeBackup()
|
void MainWindow::writeBackup()
|
||||||
|
|||||||
@@ -53,7 +53,6 @@
|
|||||||
#include "helpers.h"
|
#include "helpers.h"
|
||||||
#include "appdata.h"
|
#include "appdata.h"
|
||||||
#include "wizarddialog.h"
|
#include "wizarddialog.h"
|
||||||
#include "taranisnotfound.h"
|
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include "googleanalytics.h"
|
#include "googleanalytics.h"
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
#include "radionotfound.h"
|
||||||
|
#include "ui_radionotfound.h"
|
||||||
|
|
||||||
|
RadioNotFoundDialog::RadioNotFoundDialog(QWidget *parent) :
|
||||||
|
QDialog(parent),
|
||||||
|
ui(new Ui::RadioNotFoundDialog)
|
||||||
|
{
|
||||||
|
ui->setupUi(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
RadioNotFoundDialog::~RadioNotFoundDialog()
|
||||||
|
{
|
||||||
|
delete ui;
|
||||||
|
}
|
||||||
|
|
||||||
|
void RadioNotFoundDialog::on_OK_clicked()
|
||||||
|
{
|
||||||
|
accept();
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
#ifndef _RADIONOTFOUNDDIALOG_H
|
||||||
|
#define _RADIONOTFOUNDDIALOG_H
|
||||||
|
|
||||||
|
#include <QDialog>
|
||||||
|
|
||||||
|
namespace Ui {
|
||||||
|
class RadioNotFoundDialog;
|
||||||
|
}
|
||||||
|
|
||||||
|
class RadioNotFoundDialog : public QDialog
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
explicit RadioNotFoundDialog(QWidget *parent = 0);
|
||||||
|
~RadioNotFoundDialog();
|
||||||
|
private:
|
||||||
|
Ui::RadioNotFoundDialog *ui;
|
||||||
|
private slots:
|
||||||
|
void on_OK_clicked();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // _RADIONOTFOUNDDIALOG_H
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<class>taranisNotFoundDialog</class>
|
<class>RadioNotFoundDialog</class>
|
||||||
<widget class="QDialog" name="taranisNotFoundDialog">
|
<widget class="QDialog" name="RadioNotFoundDialog">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
@@ -29,7 +29,7 @@
|
|||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>No Taranis Radio Found</string>
|
<string>No Radio Found</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
@@ -37,7 +37,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label">
|
<widget class="QLabel" name="label">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string><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.</p></body></html></string>
|
<string><html><head/><body><p>No 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.</p></body></html></string>
|
||||||
</property>
|
</property>
|
||||||
<property name="textFormat">
|
<property name="textFormat">
|
||||||
<enum>Qt::RichText</enum>
|
<enum>Qt::RichText</enum>
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
#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();
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
#ifndef TARANISNOTFOUNDDIALOG_H
|
|
||||||
#define TARANISNOTFOUNDDIALOG_H
|
|
||||||
|
|
||||||
#include <QDialog>
|
|
||||||
|
|
||||||
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
|
|
||||||
Reference in New Issue
Block a user