Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 23 additions & 12 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ body:

Please note that this is not the place to make feature requests or ask for
help. For this, please use the [Discord server](https://discord.gg/wF9wUKnZ6H) or [Discussion forum](https://github.com/EdgeTX/edgetx/discussions).
- type: markdown
attributes:
value: |
**STM32F2 radios** (BetaFPV LiteRadio3 Pro; FrSky Q X7 / Q X7S (ACCST), X9D, X9D+ (not 2019),
X9 Lite / Lite S, X-Lite / S / Pro; Jumper T12, T-Lite, T-Pro; RadioMaster T8, TX12 (not MK2))
were last supported in **EdgeTX 2.11**. Firmware bug reports for these radios on later versions
will not be accepted. Companion can still read their models and settings.
See [STM32 platform support](https://edgetx.org/edgetx/latest/hardware/stm32-platforms/).
- type: checkboxes
attributes:
label: Is there an existing issue for this problem?
Expand Down Expand Up @@ -89,10 +97,12 @@ body:
label: Transmitter
description: |
What transmitter are you using? You can pick more than one if this is
affecting more than one transmitter.
affecting more than one transmitter. Radios marked "2.11 max" are
[STM32F2 radios](https://edgetx.org/edgetx/latest/hardware/stm32-platforms/)
last supported in EdgeTX 2.11.
multiple: true
options:
- BetaFPV LiteRadio3 Pro
- BetaFPV LiteRadio3 Pro (2.11 max)
- iFlight Commando 8
- iFlight Commando 14
- Fatfish F16
Expand All @@ -103,23 +113,23 @@ body:
- Flysky PL18/PL18EV
- Flysky PL18U
- Flysky ST16
- FrSky Q X7 / Q X7S (ACCST)
- FrSky Q X7 / Q X7S (ACCST, 2.11 max)
- FrSky Q X7 / Q X7S (ACCESS)
- FrSky X9D
- FrSky X9D+
- FrSky X9D (2.11 max)
- FrSky X9D+ (2.11 max)
- FrSky X9D+2019
- FrSky X9E / X9E Hall
- FrSky X9 Lite / Lite S
- FrSky X9 Lite / Lite S (2.11 max)
- FrSky X10 / X10S (ACCST)
- FrSky X10 Express / X10S Express (ACCESS)
- FrSky X12
- FrSky X-Lite / S / Pro
- FrSky X-Lite / S / Pro (2.11 max)
- HelloRadioSky V12
- HelloRadioSky V14
- HelloRadioSky V14LCD
- HelloRadioSky V16
- Jumper Bumblebee
- Jumper T12
- Jumper T12 (2.11 max)
- Jumper T12 MAX
- Jumper T14
- Jumper T15
Expand All @@ -129,16 +139,17 @@ body:
- Jumper T20/T20S
- Jumper T20 V2
- Jumper T22
- Jumper T-Lite
- Jumper T-Pro
- Jumper T-Lite (2.11 max)
- Jumper T-Pro (2.11 max)
- Jumper T-Pro V2
- RadioMaster Boxer
- RadioMaster GX12
- RadioMaster GX15
- RadioMaster MT12
- RadioMaster Pocket
- RadioMaster T8
- RadioMaster TX12 / TX12MK2
- RadioMaster T8 (2.11 max)
- RadioMaster TX12 (2.11 max)
- RadioMaster TX12MK2
- RadioMaster TX15
- RadioMaster TX16S / TX16S Mark II
- RadioMaster TX16S MK3
Expand Down
30 changes: 0 additions & 30 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,24 +120,12 @@
"inherits": "firmware",
"cacheVariables": { "PCB": "X12S" }
},
{
"name": "x7",
"displayName": "FrSky QX7",
"inherits": "firmware",
"cacheVariables": { "PCB": "X7" }
},
{
"name": "x7access",
"displayName": "FrSky QX7 Access",
"inherits": "firmware",
"cacheVariables": { "PCB": "X7", "PCBREV": "ACCESS", "PXX1": "YES" }
},
{
"name": "x9dp",
"displayName": "FrSky X9D+",
"inherits": "firmware",
"cacheVariables": { "PCB": "X9D+" }
},
{
"name": "x9dp2019",
"displayName": "FrSky X9D+ 2019",
Expand All @@ -150,12 +138,6 @@
"inherits": "firmware",
"cacheVariables": { "PCB": "X9E" }
},
{
"name": "xlite",
"displayName": "FrSky X-Lite",
"inherits": "firmware",
"cacheVariables": { "PCB": "XLITE" }
},

{
"name": "v12",
Expand Down Expand Up @@ -255,12 +237,6 @@
"inherits": "firmware",
"cacheVariables": { "PCB": "T22" }
},
{
"name": "tpro",
"displayName": "Jumper T-Pro",
"inherits": "firmware",
"cacheVariables": { "PCB": "X7", "PCBREV": "TPRO" }
},
{
"name": "tpros",
"displayName": "Jumper T-Pro S",
Expand Down Expand Up @@ -304,12 +280,6 @@
"inherits": "firmware",
"cacheVariables": { "PCB": "X7", "PCBREV": "POCKET" }
},
{
"name": "tx12",
"displayName": "RadioMaster TX12",
"inherits": "firmware",
"cacheVariables": { "PCB": "X7", "PCBREV": "TX12" }
},
{
"name": "tx12mk2",
"displayName": "RadioMaster TX12 MK2",
Expand Down
3 changes: 3 additions & 0 deletions companion/src/firmwares/boardjson.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,9 @@ const int BoardJson::getCapability(const Board::Capability capability) const
case Board::InputSwitches:
return m_inputCnt.switches;

case Board::IsF2:
return m_hardware.cpu_type == "STM32F2";

case Board::IsF4:
return m_hardware.cpu_type == "STM32F4";

Expand Down
1 change: 1 addition & 0 deletions companion/src/firmwares/boards.h
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ namespace Board {
HasVCPSerialMode,
Inputs,
InputSwitches,
IsF2,
IsF4,
IsH5,
IsH7,
Expand Down
13 changes: 8 additions & 5 deletions companion/src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ void MainWindow::saveAll()
{
foreach (QMdiSubWindow * window, mdiArea->subWindowList()) {
MdiChild * child;
if ((child = qobject_cast<MdiChild *>(window->widget())) && child->isWindowModified())
if ((child = qobject_cast<MdiChild *>(window->widget())) && child->isWindowModified() && !child->isReadOnly())
child->save();
}
}
Expand Down Expand Up @@ -665,13 +665,16 @@ void MainWindow::updateMenus()

newAct->setEnabled(true);
openAct->setEnabled(true);
saveAct->setEnabled(activeChild);
saveAsAct->setEnabled(activeChild);
// documents for radios no longer supported (STM32F2) can only be viewed
MdiChild * child = activeMdiChild();
const bool canWrite = child && !child->isReadOnly();
saveAct->setEnabled(canWrite);
saveAsAct->setEnabled(canWrite);
closeAct->setEnabled(activeChild);
compareAct->setEnabled(activeChild);
writeSettingsAct->setEnabled(activeChild);
writeSettingsAct->setEnabled(canWrite);
readSettingsAct->setEnabled(true);
writeSettingsSDPathAct->setEnabled(activeChild && isSDPathValid());
writeSettingsSDPathAct->setEnabled(canWrite && isSDPathValid());
readSettingsSDPathAct->setEnabled(isSDPathValid());
writeBUToRadioAct->setEnabled(false);
readBUToFileAct->setEnabled(false);
Expand Down
82 changes: 81 additions & 1 deletion companion/src/mdichild.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#include "progress/progresswidget.h"

#include <algorithm>
#include <QTimer>
#include <ExportableTableView>


Expand Down Expand Up @@ -188,6 +189,13 @@ QSize MdiChild::sizeHint() const
return QSize(w + 30, qMin(p->height(), 1000));
}

void MdiChild::showEvent(QShowEvent * event)
{
QWidget::showEvent(event);
// let the document window appear before the notice
QTimer::singleShot(0, this, &MdiChild::showReadOnlyNotice);
}

void MdiChild::changeEvent(QEvent * event)
{
QWidget::changeEvent(event);
Expand Down Expand Up @@ -378,7 +386,7 @@ void MdiChild::updateNavigation()
action[ACT_MDL_PST]->setText(tr("Paste") % (numOnClipbrd ? sp % modelsAddTxt : ns));
action[ACT_MDL_INS]->setEnabled(numOnClipbrd && hasModelSlotSelcted);
action[ACT_MDL_INS]->setText(tr("Insert") % QString(action[ACT_MDL_INS]->isEnabled() ? sp % modelsAddTxt : ns));
action[ACT_MDL_EXP]->setEnabled(modelsSelected);
action[ACT_MDL_EXP]->setEnabled(modelsSelected && !isReadOnly());
action[ACT_MDL_EXP]->setText(tr("Export") % (modelsSelected ? sp % modelsRemvTxt : ns));
action[ACT_MDL_IMP]->setEnabled(true);
action[ACT_MDL_IMP]->setText(tr("Import"));
Expand Down Expand Up @@ -760,6 +768,13 @@ void MdiChild::onFirmwareChanged()
}
setModified();
}

if (previous->getBoard() != firmware->getBoard()) {
// read-only state follows the board
updateNavigation();
readOnlyNoticeShown = false;
showReadOnlyNotice();
}
}

/*
Expand Down Expand Up @@ -1397,6 +1412,9 @@ bool MdiChild::loadFile(const QString & filename, bool resetCurrentFile)

bool MdiChild::save()
{
if (!checkWritable())
return false;

QFileInfo fi(curFile);
if (isUntitled || !fi.isWritable() || fi.suffix().toLower() != "etx") {
return saveAs(true);
Expand All @@ -1408,6 +1426,9 @@ bool MdiChild::save()

bool MdiChild::saveAs(bool isNew)
{
if (!checkWritable())
return false;

forceNewFilename();
QFileInfo fi(curFile);
QString filter(ETX_FILES_FILTER);
Expand All @@ -1428,6 +1449,9 @@ bool MdiChild::saveAs(bool isNew)

bool MdiChild::saveFile(const QString & filename, bool setCurrent, bool toRadio)
{
if (!checkWritable())
return false;

radioData.fixModelFilenames();

bool result = false;
Expand Down Expand Up @@ -1495,6 +1519,15 @@ void MdiChild::closeFile(bool force)

bool MdiChild::maybeSave()
{
if (isWindowModified() && isReadOnly()) {
if (forceCloseFlag)
return true;

int ret = askQuestion(tr("%1 has been modified, but changes cannot be saved for this radio.\nDiscard your changes?").arg(userFriendlyCurrentFile()),
(QMessageBox::Discard | QMessageBox::Cancel), QMessageBox::Cancel);
return ret == QMessageBox::Discard;
}

if (isWindowModified()) {
int ret = askQuestion(tr("%1 has been modified.\nDo you want to save your changes?").arg(userFriendlyCurrentFile()),
(QMessageBox::Save | QMessageBox::Discard | (forceCloseFlag ? QMessageBox::NoButton : QMessageBox::Cancel)),
Expand Down Expand Up @@ -1606,8 +1639,52 @@ int MdiChild::askQuestion(const QString & msg, QMessageBox::StandardButtons butt
return QMessageBox::question(this, CPN_STR_APP_NAME, msg, buttons, defaultButton);
}

// EdgeTX 2.11 was the last release for STM32F2 radios. Their models and settings
// can still be viewed, but must not be saved or written in the current format.
bool MdiChild::isReadOnly() const
{
return Boards::getCapability(firmware->getBoard(), Board::IsF2);
}

bool MdiChild::checkWritable()
{
if (!isReadOnly())
return true;

showReadOnlyMessage(QMessageBox::Warning, CPN_STR_TTL_WARNING);
return false;
}

void MdiChild::showReadOnlyNotice()
{
if (!isReadOnly() || readOnlyNoticeShown)
return;

readOnlyNoticeShown = true;
showReadOnlyMessage(QMessageBox::Information, CPN_STR_APP_NAME);
}

void MdiChild::showReadOnlyMessage(QMessageBox::Icon icon, const QString & title)
{
QString msg = tr("The %1 uses an STM32F2 processor, which was last supported in EdgeTX 2.11.<br><br>"
"Its models and settings can be viewed here, but not saved, exported or written to the radio. "
"To do any of those, use Companion 2.11. To move its models to a supported radio, "
"switch to that radio's profile and they will be converted.<br><br>"
"See <a href='%2'>STM32 platform support</a>.")
.arg(Boards::getBoardName(firmware->getBoard()))
.arg("https://edgetx.org/edgetx/latest/hardware/stm32-platforms/");

QMessageBox msgbox(icon, title, msg, QMessageBox::Ok, this);
msgbox.setTextFormat(Qt::RichText);
msgbox.setTextInteractionFlags(Qt::TextBrowserInteraction);
msgbox.exec();
}

void MdiChild::writeModelsSettings(bool toRadio)
{
if (!checkWritable())
return;

// safeguard as the menu actions are enabled
int cnt = radioData.invalidModels();

Expand Down Expand Up @@ -1916,6 +1993,9 @@ void MdiChild::labelsFault(QString msg)

unsigned MdiChild::exportModels(const QVector<int> modelIndices)
{
if (!checkWritable())
return 0;

unsigned saves = 0;

foreach(const int idx, modelIndices) {
Expand Down
6 changes: 6 additions & 0 deletions companion/src/mdichild.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ class MdiChild : public QWidget
QAction * getAction(const Actions type);
int invalidModels();
QStringList modelErrorsList();
bool isReadOnly() const;

public slots:
void newFile(bool useProfileSettings = false);
Expand All @@ -130,6 +131,7 @@ class MdiChild : public QWidget
virtual void changeEvent(QEvent * event);
virtual void closeEvent(QCloseEvent * event);
virtual void resizeEvent(QResizeEvent * event);
virtual void showEvent(QShowEvent * event);
virtual QSize sizeHint() const;

private slots:
Expand Down Expand Up @@ -220,6 +222,9 @@ class MdiChild : public QWidget
bool hasClipboardData(const quint8 type = 0) const;

bool maybeSave();
bool checkWritable();
void showReadOnlyNotice();
void showReadOnlyMessage(QMessageBox::Icon icon, const QString & title);
void setCurrentFile(const QString & fileName);
void forceNewFilename(const QString & suffix = "", const QString & ext = "etx");
bool convertStorage(Board::Type from, Board::Type to, bool newFile = false);
Expand Down Expand Up @@ -255,6 +260,7 @@ class MdiChild : public QWidget
bool isUntitled;
bool showLabelToolbar;
bool forceCloseFlag;
bool readOnlyNoticeShown = false;
const quint16 stateDataVersion;
AbstractStaticItemModel* modelSortOrderItemModel;
QComboBox* cboModelSortOrder;
Expand Down
Loading
Loading