forked from qt-creator/qt-creator
McuSupport: generate kits automatically on plugin initialization
Fixes: QTCREATORBUG-24354 Change-Id: I26587102bd24d1678707ca1d9160c84149e77c8e Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
committed by
christiaan.janssen
parent
b7c72f8621
commit
9cd5fb927d
@@ -37,6 +37,7 @@
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/utilsicons.h>
|
||||
|
||||
#include <QCheckBox>
|
||||
#include <QComboBox>
|
||||
#include <QDir>
|
||||
#include <QHBoxLayout>
|
||||
@@ -76,6 +77,7 @@ private:
|
||||
QGroupBox *m_mcuTargetsGroupBox = nullptr;
|
||||
QComboBox *m_mcuTargetsComboBox = nullptr;
|
||||
QGroupBox *m_kitCreationGroupBox = nullptr;
|
||||
QCheckBox *m_kitAutomaticCreationCheckBox = nullptr;
|
||||
Utils::InfoLabel *m_kitCreationInfoLabel = nullptr;
|
||||
Utils::InfoLabel *m_statusInfoLabel = nullptr;
|
||||
QPushButton *m_kitCreationPushButton = nullptr;
|
||||
@@ -126,6 +128,14 @@ McuSupportOptionsWidget::McuSupportOptionsWidget()
|
||||
m_packagesGroupBox->setLayout(m_packagesLayout);
|
||||
}
|
||||
|
||||
{
|
||||
m_kitAutomaticCreationCheckBox = new QCheckBox(tr("Automatically create kits for all available targets on start"));
|
||||
connect(m_kitAutomaticCreationCheckBox, &QCheckBox::stateChanged, this, [this] (int state) {
|
||||
m_options.qtForMCUsSdkPackage->setAutomaticKitCreationEnabled(state == Qt::CheckState::Checked);
|
||||
});
|
||||
mainLayout->addWidget(m_kitAutomaticCreationCheckBox);
|
||||
}
|
||||
|
||||
{
|
||||
m_kitCreationGroupBox = new QGroupBox(tr("Create a Kit"));
|
||||
m_kitCreationGroupBox->setFlat(true);
|
||||
@@ -196,6 +206,9 @@ void McuSupportOptionsWidget::updateStatus()
|
||||
}
|
||||
}
|
||||
|
||||
// Automatic Kit creation
|
||||
m_kitAutomaticCreationCheckBox->setChecked(m_options.qtForMCUsSdkPackage->automaticKitCreationEnabled());
|
||||
|
||||
// Status label in the bottom
|
||||
{
|
||||
m_statusInfoLabel->setVisible(!cMakeAvailable);
|
||||
@@ -246,6 +259,7 @@ void McuSupportOptionsWidget::showEvent(QShowEvent *event)
|
||||
|
||||
void McuSupportOptionsWidget::apply()
|
||||
{
|
||||
m_options.qtForMCUsSdkPackage->writeGeneralSettings();
|
||||
m_options.qtForMCUsSdkPackage->writeToSettings();
|
||||
for (auto package : m_options.packages)
|
||||
package->writeToSettings();
|
||||
|
||||
Reference in New Issue
Block a user