forked from qt-creator/qt-creator
Qnx: Allow kit creator creation per target architecture
So far there were always kits for "all" (usually three?) archs created, leaving n-1 of them in an typically unused but expensive to validate state. Change-Id: I78c7ed3faea0829104dc62bf358e9e1c62082b01 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -37,6 +37,7 @@
|
|||||||
#include <QComboBox>
|
#include <QComboBox>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QDomDocument>
|
#include <QDomDocument>
|
||||||
|
#include <QGridLayout>
|
||||||
#include <QGroupBox>
|
#include <QGroupBox>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
@@ -483,6 +484,32 @@ static QnxSettingsPagePrivate *dd = nullptr;
|
|||||||
|
|
||||||
// QnxSettingsWidget
|
// QnxSettingsWidget
|
||||||
|
|
||||||
|
|
||||||
|
class ArchitecturesList final : public QWidget
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
void setConfiguration(const FilePath &envFile)
|
||||||
|
{
|
||||||
|
m_envFile = envFile;
|
||||||
|
delete layout();
|
||||||
|
|
||||||
|
QnxConfiguration *config = dd->configurationFromEnvFile(envFile);
|
||||||
|
if (!config)
|
||||||
|
return;
|
||||||
|
|
||||||
|
auto l = new QHBoxLayout(this);
|
||||||
|
for (const QnxTarget &target : config->m_targets) {
|
||||||
|
auto button = new QPushButton(tr("Create Kit for %1").arg(target.cpuDir()));
|
||||||
|
connect(button, &QPushButton::clicked, this, [config, target] {
|
||||||
|
config->createKit(target);
|
||||||
|
});
|
||||||
|
l->addWidget(button);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FilePath m_envFile;
|
||||||
|
};
|
||||||
|
|
||||||
class QnxSettingsWidget final : public Core::IOptionsPageWidget
|
class QnxSettingsWidget final : public Core::IOptionsPageWidget
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -510,7 +537,6 @@ public:
|
|||||||
|
|
||||||
void addConfiguration();
|
void addConfiguration();
|
||||||
void removeConfiguration();
|
void removeConfiguration();
|
||||||
void generateKits(bool checked);
|
|
||||||
void updateInformation();
|
void updateInformation();
|
||||||
void populateConfigsCombo();
|
void populateConfigsCombo();
|
||||||
|
|
||||||
@@ -518,12 +544,14 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
QComboBox *m_configsCombo = new QComboBox;
|
QComboBox *m_configsCombo = new QComboBox;
|
||||||
QCheckBox *m_generateKitsCheckBox = new QCheckBox(Tr::tr("Generate kits"));
|
|
||||||
QLabel *m_configName = new QLabel;
|
QLabel *m_configName = new QLabel;
|
||||||
QLabel *m_configVersion = new QLabel;
|
QLabel *m_configVersion = new QLabel;
|
||||||
QLabel *m_configHost = new QLabel;
|
QLabel *m_configHost = new QLabel;
|
||||||
QLabel *m_configTarget = new QLabel;
|
QLabel *m_configTarget = new QLabel;
|
||||||
QLabel *m_architecturesLabel = new QLabel;
|
QLabel *m_compiler = new QLabel;
|
||||||
|
QLabel *m_architectures = new QLabel;
|
||||||
|
|
||||||
|
ArchitecturesList *m_kitCreation = new ArchitecturesList;
|
||||||
|
|
||||||
QList<ConfigState> m_changedConfigs;
|
QList<ConfigState> m_changedConfigs;
|
||||||
};
|
};
|
||||||
@@ -538,7 +566,6 @@ QnxSettingsWidget::QnxSettingsWidget()
|
|||||||
Row {
|
Row {
|
||||||
Column {
|
Column {
|
||||||
m_configsCombo,
|
m_configsCombo,
|
||||||
Row { m_generateKitsCheckBox, st },
|
|
||||||
Group {
|
Group {
|
||||||
title(Tr::tr("Configuration Information:")),
|
title(Tr::tr("Configuration Information:")),
|
||||||
Form {
|
Form {
|
||||||
@@ -546,9 +573,11 @@ QnxSettingsWidget::QnxSettingsWidget()
|
|||||||
Tr::tr("Version:"), m_configVersion, br,
|
Tr::tr("Version:"), m_configVersion, br,
|
||||||
Tr::tr("Host:"), m_configHost, br,
|
Tr::tr("Host:"), m_configHost, br,
|
||||||
Tr::tr("Target:"), m_configTarget, br,
|
Tr::tr("Target:"), m_configTarget, br,
|
||||||
Tr::tr("Architectures:"), m_architecturesLabel
|
Tr::tr("Compiler:"), m_compiler, br,
|
||||||
|
Tr::tr("Architectures:"), m_architectures
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Row { m_kitCreation, st },
|
||||||
st
|
st
|
||||||
},
|
},
|
||||||
Column {
|
Column {
|
||||||
@@ -566,8 +595,6 @@ QnxSettingsWidget::QnxSettingsWidget()
|
|||||||
this, &QnxSettingsWidget::removeConfiguration);
|
this, &QnxSettingsWidget::removeConfiguration);
|
||||||
connect(m_configsCombo, &QComboBox::currentIndexChanged,
|
connect(m_configsCombo, &QComboBox::currentIndexChanged,
|
||||||
this, &QnxSettingsWidget::updateInformation);
|
this, &QnxSettingsWidget::updateInformation);
|
||||||
connect(m_generateKitsCheckBox, &QAbstractButton::toggled,
|
|
||||||
this, &QnxSettingsWidget::generateKits);
|
|
||||||
connect(QtVersionManager::instance(), &QtVersionManager::qtVersionsChanged,
|
connect(QtVersionManager::instance(), &QtVersionManager::qtVersionsChanged,
|
||||||
this, &QnxSettingsWidget::updateInformation);
|
this, &QnxSettingsWidget::updateInformation);
|
||||||
}
|
}
|
||||||
@@ -630,32 +657,26 @@ void QnxSettingsWidget::removeConfiguration()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void QnxSettingsWidget::generateKits(bool checked)
|
|
||||||
{
|
|
||||||
const FilePath envFile = m_configsCombo->currentData().value<FilePath>();
|
|
||||||
setConfigState(envFile, checked ? Activated : Deactivated);
|
|
||||||
}
|
|
||||||
|
|
||||||
void QnxSettingsWidget::updateInformation()
|
void QnxSettingsWidget::updateInformation()
|
||||||
{
|
{
|
||||||
const FilePath envFile = m_configsCombo->currentData().value<FilePath>();
|
const FilePath envFile = m_configsCombo->currentData().value<FilePath>();
|
||||||
|
|
||||||
if (QnxConfiguration *config = dd->configurationFromEnvFile(envFile)) {
|
if (QnxConfiguration *config = dd->configurationFromEnvFile(envFile)) {
|
||||||
config->ensureContents();
|
config->ensureContents();
|
||||||
m_generateKitsCheckBox->setEnabled(config->isValid());
|
|
||||||
m_generateKitsCheckBox->setChecked(config->isActive());
|
|
||||||
m_configName->setText(config->m_configName);
|
m_configName->setText(config->m_configName);
|
||||||
m_configVersion->setText(config->m_version.toString());
|
m_configVersion->setText(config->m_version.toString());
|
||||||
m_configHost->setText(config->m_qnxHost.toString());
|
m_configHost->setText(config->m_qnxHost.toString());
|
||||||
m_configTarget->setText(config->m_qnxTarget.toString());
|
m_configTarget->setText(config->m_qnxTarget.toString());
|
||||||
m_architecturesLabel->setText(config->architectureNames());
|
m_compiler->setText(config->m_qccCompiler.toUserOutput());
|
||||||
|
m_architectures->setText(config->architectureNames());
|
||||||
|
m_kitCreation->setConfiguration(envFile);
|
||||||
} else {
|
} else {
|
||||||
m_generateKitsCheckBox->setEnabled(false);
|
|
||||||
m_generateKitsCheckBox->setChecked(false);
|
|
||||||
m_configName->setText({});
|
m_configName->setText({});
|
||||||
m_configVersion->setText({});
|
m_configVersion->setText({});
|
||||||
m_configHost->setText({});
|
m_configHost->setText({});
|
||||||
m_architecturesLabel->setText({});
|
m_compiler->setText({});
|
||||||
|
m_architectures->setText({});
|
||||||
|
m_kitCreation->setConfiguration({});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user