mirror of
https://github.com/opentx/opentx.git
synced 2025-07-26 17:55:19 +03:00
Now we are able to have Model windows with different transmitter types!
This commit is contained in:
parent
a5085cf7e2
commit
5de6f4dc94
3 changed files with 22 additions and 19 deletions
|
@ -1546,7 +1546,7 @@ void MainWindow::updateMenus()
|
|||
|
||||
MdiChild *MainWindow::createMdiChild()
|
||||
{
|
||||
MdiChild *child = new MdiChild;
|
||||
MdiChild *child = new MdiChild();
|
||||
mdiArea->addSubWindow(child);
|
||||
if(!child->parentWidget()->isMaximized() && !child->parentWidget()->isMinimized())
|
||||
child->parentWidget()->resize(400, 400);
|
||||
|
|
|
@ -66,6 +66,7 @@
|
|||
MdiChild::MdiChild():
|
||||
QWidget(),
|
||||
ui(new Ui::mdiChild),
|
||||
firmware(GetCurrentFirmware()),
|
||||
isUntitled(true),
|
||||
fileChanged(false)
|
||||
{
|
||||
|
@ -103,7 +104,7 @@ void MdiChild::qSleep(int ms)
|
|||
void MdiChild::eepromInterfaceChanged()
|
||||
{
|
||||
ui->modelsList->refreshList();
|
||||
ui->SimulateTxButton->setEnabled(GetCurrentFirmware()->getCapability(Simulation));
|
||||
ui->SimulateTxButton->setEnabled(firmware->getCapability(Simulation));
|
||||
updateTitle();
|
||||
}
|
||||
|
||||
|
@ -181,7 +182,7 @@ void MdiChild::modelEdit()
|
|||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
checkAndInitModel( row );
|
||||
ModelData &model = radioData.models[row - 1];
|
||||
ModelEdit *t = new ModelEdit(this, radioData, (row - 1), GetCurrentFirmware());
|
||||
ModelEdit *t = new ModelEdit(this, radioData, (row - 1), firmware);
|
||||
t->setWindowTitle(tr("Editing model %1: ").arg(row) + model.name);
|
||||
connect(t, SIGNAL(modified()), this, SLOT(setModified()));
|
||||
t->show();
|
||||
|
@ -666,10 +667,10 @@ void MdiChild::print(int model, QString filename)
|
|||
PrintDialog * pd = NULL;
|
||||
|
||||
if (model>=0 && !filename.isEmpty()) {
|
||||
pd = new PrintDialog(this, GetCurrentFirmware(), &radioData.generalSettings, &radioData.models[model], filename);
|
||||
pd = new PrintDialog(this, firmware, &radioData.generalSettings, &radioData.models[model], filename);
|
||||
}
|
||||
else if (ui->modelsList->currentRow() > 0) {
|
||||
pd = new PrintDialog(this, GetCurrentFirmware(), &radioData.generalSettings, &radioData.models[ui->modelsList->currentRow()-1]);
|
||||
pd = new PrintDialog(this, firmware, &radioData.generalSettings, &radioData.models[ui->modelsList->currentRow()-1]);
|
||||
}
|
||||
|
||||
if (pd) {
|
||||
|
|
|
@ -59,7 +59,7 @@ class MdiChild : public QWidget
|
|||
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
public:
|
||||
MdiChild();
|
||||
~MdiChild();
|
||||
|
||||
|
@ -78,18 +78,18 @@ public:
|
|||
void eepromInterfaceChanged();
|
||||
void setEEpromAvail(int eavail);
|
||||
|
||||
signals:
|
||||
signals:
|
||||
void copyAvailable(bool val);
|
||||
|
||||
protected:
|
||||
protected:
|
||||
void closeEvent(QCloseEvent *event);
|
||||
|
||||
private slots:
|
||||
private slots:
|
||||
void documentWasModified();
|
||||
void on_SimulateTxButton_clicked();
|
||||
void qSleep(int ms);
|
||||
|
||||
public slots:
|
||||
public slots:
|
||||
void checkAndInitModel(int row);
|
||||
void generalEdit();
|
||||
void modelEdit();
|
||||
|
@ -105,7 +105,7 @@ public slots:
|
|||
void setModified();
|
||||
void updateTitle();
|
||||
|
||||
private:
|
||||
private:
|
||||
bool maybeSave();
|
||||
void setCurrentFile(const QString &fileName);
|
||||
QString strippedName(const QString &fullFileName);
|
||||
|
@ -115,6 +115,8 @@ private:
|
|||
Ui::mdiChild *ui;
|
||||
|
||||
QString curFile;
|
||||
|
||||
FirmwareInterface * firmware;
|
||||
RadioData radioData;
|
||||
|
||||
bool isUntitled;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue