Fix T16 companion inport warning (#6965)

* Add JumperTX wartning also when reading from radio

* Reuse

* Reword

* Cosmetics

* Cosmetics
This commit is contained in:
3djc
2019-10-18 16:15:21 +02:00
committed by Andre Bernet
parent 5a298a2362
commit 8b49daa455
4 changed files with 25 additions and 12 deletions
+17
View File
@@ -435,6 +435,23 @@ static bool caseInsensitiveLessThan(const QString &s1, const QString &s2)
return s1.toLower() < s2.toLower();
}
bool displayT16ImportWarning()
{
QMessageBox msgBox;
msgBox.setWindowTitle(QObject::tr("WARNING"));
msgBox.setText(QObject::tr("<p>Importing JumperTX data into OpenTX 2.3 is <b>not supported and dangerous.</b></p> \
<p>It is unfortunately not possible for us to differentiate JumperTX data from legitimate FrSky X10 data, but <b>You should only continue here if the file you opened comes from a real FrSky X10.</b></p> \
<p>Do you really want to continue?</p>"));
msgBox.setIcon(QMessageBox::Warning);
msgBox.addButton(QMessageBox::No);
msgBox.addButton(QMessageBox::Yes);
msgBox.setDefaultButton(QMessageBox::No);
if (msgBox.exec() == QMessageBox::No)
return false;
return true;
}
void Helpers::populateFileComboBox(QComboBox * b, const QSet<QString> & set, const QString & current)
{
b->clear();
+2
View File
@@ -52,6 +52,8 @@ extern const QColor colors[CPN_MAX_CURVES];
#define TRIM_MODE_NONE 0x1F // 0b11111
bool displayT16ImportWarning();
class CompanionIcon: public QIcon {
public:
CompanionIcon(const QString &baseimage);
+1 -12
View File
@@ -1459,18 +1459,7 @@ bool MdiChild::convertStorage(Board::Type from, Board::Type to, bool newFile)
QMessageBox::StandardButton dfltBtn;
if (from == Board::BOARD_X10 && to == Board::BOARD_JUMPER_T16) {
QMessageBox msgBox;
msgBox.setWindowTitle(tr("WARNING"));
msgBox.setText(tr("<p>Due to the way Jumper have handled their JumperTX fork and firmware releases data integrity for settings from JumperTX cannot be trusted when migrating to OpenTX.</p> \
<p>Importing JumperTX data into OpenTX 2.3 is <b>not supported and dangerous.</b></p> \
<p>It is unfortunately not possible for us to differentiate JumperTX data from legitimate FrSky X10 data, but <b>You should only continue here if the file you opened comes from a real FrSky X10.</b></p> \
<p>Do you really want to continue?</p>"));
msgBox.setIcon(QMessageBox::Warning);
msgBox.addButton(QMessageBox::No);
msgBox.addButton(QMessageBox::Yes);
msgBox.setDefaultButton(QMessageBox::No);
if (msgBox.exec() == QMessageBox::No)
if (displayT16ImportWarning() == false)
return false;
}
+5
View File
@@ -333,6 +333,11 @@ bool readEeprom(const QString & filename, ProgressWidget * progress)
QMessageBox::critical(progress, CPN_STR_TTL_ERROR, outputStorage.error());
return false;
}
if (getCurrentBoard() == Board::BOARD_JUMPER_T16 && inputStorage.getBoard() == Board::BOARD_X10) {
if (displayT16ImportWarning() == false)
return false;
}
}
else {
if (IS_ARM(board)) {