2019-08-14 11:48:13 +02:00
|
|
|
/****************************************************************************
|
|
|
|
|
**
|
2020-07-02 16:04:31 +02:00
|
|
|
** Copyright (C) 2019 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2019-08-14 11:48:13 +02:00
|
|
|
**
|
|
|
|
|
** This file is part of Qt Creator.
|
|
|
|
|
**
|
|
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
|
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
|
|
|
|
**
|
|
|
|
|
** GNU General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
|
|
|
|
**
|
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
2022-02-15 11:18:56 +01:00
|
|
|
#include "mcusupportoptionspage.h"
|
2022-02-22 14:06:18 +01:00
|
|
|
#include "mcukitmanager.h"
|
2022-02-01 14:30:35 +01:00
|
|
|
#include "mcupackage.h"
|
2019-08-14 11:48:13 +02:00
|
|
|
#include "mcusupportconstants.h"
|
2019-10-22 14:33:31 +02:00
|
|
|
#include "mcusupportoptions.h"
|
2020-12-04 16:32:34 +01:00
|
|
|
#include "mcusupportsdk.h"
|
2022-02-22 14:06:18 +01:00
|
|
|
#include "mcutarget.h"
|
2019-08-14 11:48:13 +02:00
|
|
|
|
2019-11-29 00:07:04 +01:00
|
|
|
#include <cmakeprojectmanager/cmakeprojectconstants.h>
|
|
|
|
|
#include <cmakeprojectmanager/cmaketoolmanager.h>
|
2019-08-14 11:48:13 +02:00
|
|
|
#include <coreplugin/icore.h>
|
2019-11-13 18:37:27 +01:00
|
|
|
#include <projectexplorer/kitmanager.h>
|
2019-08-14 11:48:13 +02:00
|
|
|
#include <projectexplorer/projectexplorerconstants.h>
|
|
|
|
|
#include <utils/algorithm.h>
|
2019-12-11 21:17:53 +01:00
|
|
|
#include <utils/infolabel.h>
|
2019-08-14 11:48:13 +02:00
|
|
|
#include <utils/qtcassert.h>
|
|
|
|
|
#include <utils/utilsicons.h>
|
|
|
|
|
|
2020-10-16 15:10:17 +02:00
|
|
|
#include <QCheckBox>
|
2019-08-14 11:48:13 +02:00
|
|
|
#include <QComboBox>
|
|
|
|
|
#include <QDir>
|
|
|
|
|
#include <QFormLayout>
|
|
|
|
|
#include <QGroupBox>
|
2022-02-15 11:18:56 +01:00
|
|
|
#include <QHBoxLayout>
|
2019-08-14 11:48:13 +02:00
|
|
|
#include <QLabel>
|
2020-04-23 23:30:40 +02:00
|
|
|
#include <QPushButton>
|
2019-08-14 11:48:13 +02:00
|
|
|
#include <QVBoxLayout>
|
|
|
|
|
|
|
|
|
|
namespace McuSupport {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
2020-01-07 17:42:57 +01:00
|
|
|
class McuSupportOptionsWidget : public Core::IOptionsPageWidget
|
2019-08-14 11:48:13 +02:00
|
|
|
{
|
2020-01-16 18:18:20 +01:00
|
|
|
Q_DECLARE_TR_FUNCTIONS(McuSupport::Internal::McuSupportOptionsWidget)
|
|
|
|
|
|
2019-08-14 11:48:13 +02:00
|
|
|
public:
|
2020-01-07 17:42:57 +01:00
|
|
|
McuSupportOptionsWidget();
|
2019-08-14 11:48:13 +02:00
|
|
|
|
|
|
|
|
void updateStatus();
|
2019-11-15 08:38:55 +01:00
|
|
|
void showMcuTargetPackages();
|
|
|
|
|
McuTarget *currentMcuTarget() const;
|
2019-08-14 11:48:13 +02:00
|
|
|
|
|
|
|
|
private:
|
2020-01-07 17:42:57 +01:00
|
|
|
void apply() final;
|
|
|
|
|
|
2020-03-18 03:17:35 +01:00
|
|
|
void populateMcuTargetsComboBox();
|
2020-01-07 17:42:57 +01:00
|
|
|
void showEvent(QShowEvent *event) final;
|
|
|
|
|
|
2019-08-14 11:48:13 +02:00
|
|
|
QString m_armGccPath;
|
2020-01-07 17:42:57 +01:00
|
|
|
McuSupportOptions m_options;
|
2022-02-15 11:18:56 +01:00
|
|
|
QMap<McuPackage *, QWidget *> m_packageWidgets;
|
|
|
|
|
QMap<McuTarget *, QWidget *> m_mcuTargetPacketWidgets;
|
2019-08-14 11:48:13 +02:00
|
|
|
QFormLayout *m_packagesLayout = nullptr;
|
2020-03-04 19:59:50 +01:00
|
|
|
QGroupBox *m_qtForMCUsSdkGroupBox = nullptr;
|
|
|
|
|
QGroupBox *m_packagesGroupBox = nullptr;
|
|
|
|
|
QGroupBox *m_mcuTargetsGroupBox = nullptr;
|
|
|
|
|
QComboBox *m_mcuTargetsComboBox = nullptr;
|
|
|
|
|
QGroupBox *m_kitCreationGroupBox = nullptr;
|
2020-10-16 15:10:17 +02:00
|
|
|
QCheckBox *m_kitAutomaticCreationCheckBox = nullptr;
|
2020-03-04 19:59:50 +01:00
|
|
|
Utils::InfoLabel *m_kitCreationInfoLabel = nullptr;
|
2020-03-10 06:58:37 +01:00
|
|
|
Utils::InfoLabel *m_statusInfoLabel = nullptr;
|
2020-12-04 16:32:34 +01:00
|
|
|
Utils::InfoLabel *m_mcuTargetsInfoLabel = nullptr;
|
2020-04-23 23:30:40 +02:00
|
|
|
QPushButton *m_kitCreationPushButton = nullptr;
|
2021-03-31 16:47:22 +02:00
|
|
|
QPushButton *m_kitUpdatePushButton = nullptr;
|
2019-08-14 11:48:13 +02:00
|
|
|
};
|
|
|
|
|
|
2020-01-07 17:42:57 +01:00
|
|
|
McuSupportOptionsWidget::McuSupportOptionsWidget()
|
2019-08-14 11:48:13 +02:00
|
|
|
{
|
|
|
|
|
auto mainLayout = new QVBoxLayout(this);
|
|
|
|
|
|
2020-03-10 06:58:37 +01:00
|
|
|
{
|
|
|
|
|
m_statusInfoLabel = new Utils::InfoLabel;
|
|
|
|
|
m_statusInfoLabel->setElideMode(Qt::ElideNone);
|
|
|
|
|
m_statusInfoLabel->setOpenExternalLinks(false);
|
|
|
|
|
mainLayout->addWidget(m_statusInfoLabel);
|
2020-06-02 09:10:40 +02:00
|
|
|
connect(m_statusInfoLabel, &QLabel::linkActivated, this, [] {
|
|
|
|
|
Core::ICore::showOptionsDialog(CMakeProjectManager::Constants::CMAKE_SETTINGS_PAGE_ID);
|
2020-03-10 06:58:37 +01:00
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
m_qtForMCUsSdkGroupBox = new QGroupBox(m_options.qtForMCUsSdkPackage->label());
|
|
|
|
|
m_qtForMCUsSdkGroupBox->setFlat(true);
|
|
|
|
|
auto layout = new QVBoxLayout(m_qtForMCUsSdkGroupBox);
|
|
|
|
|
layout->addWidget(m_options.qtForMCUsSdkPackage->widget());
|
|
|
|
|
mainLayout->addWidget(m_qtForMCUsSdkGroupBox);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
{
|
2022-02-15 11:18:56 +01:00
|
|
|
m_mcuTargetsGroupBox = new QGroupBox(
|
|
|
|
|
tr("Targets supported by the %1").arg(m_qtForMCUsSdkGroupBox->title()));
|
2020-03-10 06:58:37 +01:00
|
|
|
m_mcuTargetsGroupBox->setFlat(true);
|
|
|
|
|
mainLayout->addWidget(m_mcuTargetsGroupBox);
|
|
|
|
|
m_mcuTargetsComboBox = new QComboBox;
|
|
|
|
|
auto layout = new QVBoxLayout(m_mcuTargetsGroupBox);
|
|
|
|
|
layout->addWidget(m_mcuTargetsComboBox);
|
2022-02-15 11:18:56 +01:00
|
|
|
connect(m_mcuTargetsComboBox,
|
|
|
|
|
&QComboBox::currentTextChanged,
|
|
|
|
|
this,
|
|
|
|
|
&McuSupportOptionsWidget::showMcuTargetPackages);
|
2022-02-15 11:18:56 +01:00
|
|
|
connect(m_options.qtForMCUsSdkPackage,
|
|
|
|
|
&McuAbstractPackage::changed,
|
|
|
|
|
this,
|
|
|
|
|
&McuSupportOptionsWidget::populateMcuTargetsComboBox);
|
2020-03-10 06:58:37 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
m_packagesGroupBox = new QGroupBox(tr("Requirements"));
|
|
|
|
|
m_packagesGroupBox->setFlat(true);
|
|
|
|
|
mainLayout->addWidget(m_packagesGroupBox);
|
|
|
|
|
m_packagesLayout = new QFormLayout;
|
|
|
|
|
m_packagesGroupBox->setLayout(m_packagesLayout);
|
|
|
|
|
}
|
|
|
|
|
|
2020-12-04 16:32:34 +01:00
|
|
|
{
|
|
|
|
|
m_mcuTargetsInfoLabel = new Utils::InfoLabel;
|
|
|
|
|
mainLayout->addWidget(m_mcuTargetsInfoLabel);
|
|
|
|
|
}
|
|
|
|
|
|
2020-10-16 15:10:17 +02:00
|
|
|
{
|
2022-02-15 11:18:56 +01:00
|
|
|
m_kitAutomaticCreationCheckBox = new QCheckBox(
|
|
|
|
|
tr("Automatically create kits for all available targets on start"));
|
|
|
|
|
connect(m_kitAutomaticCreationCheckBox, &QCheckBox::stateChanged, this, [this](int state) {
|
2022-03-09 17:29:07 +01:00
|
|
|
m_options.setAutomaticKitCreationEnabled(state == Qt::CheckState::Checked);
|
2020-10-16 15:10:17 +02:00
|
|
|
});
|
|
|
|
|
mainLayout->addWidget(m_kitAutomaticCreationCheckBox);
|
|
|
|
|
}
|
|
|
|
|
|
2020-03-10 06:58:37 +01:00
|
|
|
{
|
|
|
|
|
m_kitCreationGroupBox = new QGroupBox(tr("Create a Kit"));
|
|
|
|
|
m_kitCreationGroupBox->setFlat(true);
|
|
|
|
|
mainLayout->addWidget(m_kitCreationGroupBox);
|
|
|
|
|
m_kitCreationInfoLabel = new Utils::InfoLabel;
|
2020-04-23 23:30:40 +02:00
|
|
|
auto vLayout = new QHBoxLayout(m_kitCreationGroupBox);
|
|
|
|
|
vLayout->addWidget(m_kitCreationInfoLabel);
|
|
|
|
|
m_kitCreationPushButton = new QPushButton(tr("Create Kit"));
|
|
|
|
|
m_kitCreationPushButton->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred);
|
|
|
|
|
connect(m_kitCreationPushButton, &QPushButton::clicked, this, [this] {
|
2022-02-14 18:01:04 +01:00
|
|
|
McuKitManager::newKit(currentMcuTarget(), m_options.qtForMCUsSdkPackage);
|
2020-04-23 23:30:40 +02:00
|
|
|
McuSupportOptions::registerQchFiles();
|
|
|
|
|
updateStatus();
|
|
|
|
|
});
|
2021-03-31 16:47:22 +02:00
|
|
|
m_kitUpdatePushButton = new QPushButton(tr("Update Kit"));
|
|
|
|
|
m_kitUpdatePushButton->setSizePolicy(m_kitCreationPushButton->sizePolicy());
|
|
|
|
|
connect(m_kitUpdatePushButton, &QPushButton::clicked, this, [this] {
|
2022-02-22 14:06:18 +01:00
|
|
|
for (auto kit :
|
|
|
|
|
McuKitManager::upgradeableKits(currentMcuTarget(), m_options.qtForMCUsSdkPackage))
|
2022-03-09 17:29:07 +01:00
|
|
|
McuKitManager::upgradeKitInPlace(kit,
|
|
|
|
|
currentMcuTarget(),
|
|
|
|
|
m_options.qtForMCUsSdkPackage);
|
2020-04-23 23:30:40 +02:00
|
|
|
updateStatus();
|
|
|
|
|
});
|
|
|
|
|
vLayout->addWidget(m_kitCreationPushButton);
|
2021-03-31 16:47:22 +02:00
|
|
|
vLayout->addWidget(m_kitUpdatePushButton);
|
2020-03-10 06:58:37 +01:00
|
|
|
}
|
2019-12-11 21:17:53 +01:00
|
|
|
|
2020-03-04 19:59:50 +01:00
|
|
|
mainLayout->addStretch();
|
2019-08-14 11:48:13 +02:00
|
|
|
|
2022-02-14 18:01:04 +01:00
|
|
|
connect(&m_options,
|
|
|
|
|
&McuSupportOptions::packagesChanged,
|
|
|
|
|
this,
|
|
|
|
|
&McuSupportOptionsWidget::updateStatus);
|
2019-08-14 11:48:13 +02:00
|
|
|
|
2019-11-15 08:38:55 +01:00
|
|
|
showMcuTargetPackages();
|
2019-08-14 11:48:13 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void McuSupportOptionsWidget::updateStatus()
|
|
|
|
|
{
|
2019-11-15 08:38:55 +01:00
|
|
|
const McuTarget *mcuTarget = currentMcuTarget();
|
2019-11-13 18:37:27 +01:00
|
|
|
|
2020-03-10 06:58:37 +01:00
|
|
|
const bool cMakeAvailable = !CMakeProjectManager::CMakeToolManager::cmakeTools().isEmpty();
|
|
|
|
|
|
|
|
|
|
// Page elements
|
|
|
|
|
{
|
|
|
|
|
m_qtForMCUsSdkGroupBox->setVisible(cMakeAvailable);
|
2022-02-21 15:24:46 +01:00
|
|
|
const bool valid = cMakeAvailable && m_options.qtForMCUsSdkPackage->isValidStatus();
|
2020-12-04 16:32:34 +01:00
|
|
|
const bool ready = valid && mcuTarget;
|
2020-03-10 06:58:37 +01:00
|
|
|
m_mcuTargetsGroupBox->setVisible(ready);
|
|
|
|
|
m_packagesGroupBox->setVisible(ready && !mcuTarget->packages().isEmpty());
|
|
|
|
|
m_kitCreationGroupBox->setVisible(ready);
|
2021-09-29 17:23:11 +02:00
|
|
|
m_mcuTargetsInfoLabel->setVisible(valid && m_options.sdkRepository.mcuTargets.isEmpty());
|
2020-12-04 16:32:34 +01:00
|
|
|
if (m_mcuTargetsInfoLabel->isVisible()) {
|
|
|
|
|
m_mcuTargetsInfoLabel->setType(Utils::InfoLabel::NotOk);
|
2021-09-30 18:30:02 +02:00
|
|
|
const Utils::FilePath sdkPath = m_options.qtForMCUsSdkPackage->basePath();
|
2021-03-01 11:07:44 +01:00
|
|
|
QString deprecationMessage;
|
|
|
|
|
if (Sdk::checkDeprecatedSdkError(sdkPath, deprecationMessage))
|
|
|
|
|
m_mcuTargetsInfoLabel->setText(deprecationMessage);
|
|
|
|
|
else
|
|
|
|
|
m_mcuTargetsInfoLabel->setText(tr("No valid kit descriptions found at %1.")
|
2022-02-15 11:18:56 +01:00
|
|
|
.arg(Sdk::kitsPath(sdkPath).toUserOutput()));
|
2020-12-04 16:32:34 +01:00
|
|
|
}
|
2020-03-10 06:58:37 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Kit creation status
|
2020-03-18 03:17:35 +01:00
|
|
|
if (mcuTarget) {
|
2020-03-10 06:58:37 +01:00
|
|
|
const bool mcuTargetValid = mcuTarget->isValid();
|
2020-04-23 23:30:40 +02:00
|
|
|
m_kitCreationPushButton->setVisible(mcuTargetValid);
|
2021-03-31 16:47:22 +02:00
|
|
|
m_kitUpdatePushButton->setVisible(mcuTargetValid);
|
2020-04-23 23:30:40 +02:00
|
|
|
if (mcuTargetValid) {
|
2022-02-15 11:18:56 +01:00
|
|
|
const bool hasMatchingKits
|
2022-02-22 14:06:18 +01:00
|
|
|
= !McuKitManager::matchingKits(mcuTarget, m_options.qtForMCUsSdkPackage).isEmpty();
|
2022-03-09 17:29:07 +01:00
|
|
|
const bool hasUpgradeableKits
|
|
|
|
|
= !hasMatchingKits
|
|
|
|
|
&& !McuKitManager::upgradeableKits(mcuTarget, m_options.qtForMCUsSdkPackage)
|
|
|
|
|
.isEmpty();
|
2021-03-31 16:47:22 +02:00
|
|
|
|
|
|
|
|
m_kitCreationPushButton->setEnabled(!hasMatchingKits);
|
|
|
|
|
m_kitUpdatePushButton->setEnabled(hasUpgradeableKits);
|
|
|
|
|
|
2022-02-15 11:18:56 +01:00
|
|
|
m_kitCreationInfoLabel->setType(!hasMatchingKits ? Utils::InfoLabel::Information
|
|
|
|
|
: Utils::InfoLabel::Ok);
|
2021-03-31 16:47:22 +02:00
|
|
|
|
|
|
|
|
m_kitCreationInfoLabel->setText(
|
2022-02-15 11:18:56 +01:00
|
|
|
hasMatchingKits
|
|
|
|
|
? tr("A kit for the selected target and SDK version already exists.")
|
|
|
|
|
: hasUpgradeableKits ? tr("Kits for a different SDK version exist.")
|
|
|
|
|
: tr("A kit for the selected target can be created."));
|
2020-04-23 23:30:40 +02:00
|
|
|
} else {
|
|
|
|
|
m_kitCreationInfoLabel->setType(Utils::InfoLabel::NotOk);
|
|
|
|
|
m_kitCreationInfoLabel->setText("Provide the package paths in order to create a kit "
|
|
|
|
|
"for your target.");
|
|
|
|
|
}
|
2020-03-10 06:58:37 +01:00
|
|
|
}
|
|
|
|
|
|
2020-10-16 15:10:17 +02:00
|
|
|
// Automatic Kit creation
|
2022-02-21 13:41:57 +01:00
|
|
|
m_kitAutomaticCreationCheckBox->setChecked(m_options.automaticKitCreationEnabled());
|
2020-10-16 15:10:17 +02:00
|
|
|
|
2020-03-10 06:58:37 +01:00
|
|
|
// Status label in the bottom
|
|
|
|
|
{
|
|
|
|
|
m_statusInfoLabel->setVisible(!cMakeAvailable);
|
|
|
|
|
if (m_statusInfoLabel->isVisible()) {
|
|
|
|
|
m_statusInfoLabel->setType(Utils::InfoLabel::NotOk);
|
|
|
|
|
m_statusInfoLabel->setText("No CMake tool was detected. Add a CMake tool in the "
|
|
|
|
|
"<a href=\"cmake\">CMake options</a> and press Apply.");
|
|
|
|
|
}
|
|
|
|
|
}
|
2019-08-14 11:48:13 +02:00
|
|
|
}
|
|
|
|
|
|
2019-11-15 08:38:55 +01:00
|
|
|
void McuSupportOptionsWidget::showMcuTargetPackages()
|
2019-08-14 11:48:13 +02:00
|
|
|
{
|
2019-11-15 08:38:55 +01:00
|
|
|
const McuTarget *mcuTarget = currentMcuTarget();
|
|
|
|
|
if (!mcuTarget)
|
2019-11-13 18:37:27 +01:00
|
|
|
return;
|
|
|
|
|
|
2019-08-14 11:48:13 +02:00
|
|
|
while (m_packagesLayout->rowCount() > 0) {
|
|
|
|
|
QFormLayout::TakeRowResult row = m_packagesLayout->takeRow(0);
|
|
|
|
|
row.labelItem->widget()->hide();
|
|
|
|
|
row.fieldItem->widget()->hide();
|
|
|
|
|
}
|
|
|
|
|
|
2021-09-29 17:23:11 +02:00
|
|
|
for (auto package : qAsConst(m_options.sdkRepository.packages)) {
|
2019-08-14 11:48:13 +02:00
|
|
|
QWidget *packageWidget = package->widget();
|
2019-11-15 08:38:55 +01:00
|
|
|
if (!mcuTarget->packages().contains(package))
|
2019-08-14 11:48:13 +02:00
|
|
|
continue;
|
|
|
|
|
m_packagesLayout->addRow(package->label(), packageWidget);
|
|
|
|
|
packageWidget->show();
|
|
|
|
|
}
|
2019-11-13 18:37:27 +01:00
|
|
|
|
|
|
|
|
updateStatus();
|
|
|
|
|
}
|
|
|
|
|
|
2019-11-15 08:38:55 +01:00
|
|
|
McuTarget *McuSupportOptionsWidget::currentMcuTarget() const
|
2019-11-13 18:37:27 +01:00
|
|
|
{
|
2020-03-04 19:59:50 +01:00
|
|
|
const int mcuTargetIndex = m_mcuTargetsComboBox->currentIndex();
|
2021-09-29 17:23:11 +02:00
|
|
|
return (mcuTargetIndex == -1 || m_options.sdkRepository.mcuTargets.isEmpty())
|
2022-02-15 11:18:56 +01:00
|
|
|
? nullptr
|
|
|
|
|
: m_options.sdkRepository.mcuTargets.at(mcuTargetIndex);
|
2019-08-14 11:48:13 +02:00
|
|
|
}
|
|
|
|
|
|
2019-11-29 00:07:04 +01:00
|
|
|
void McuSupportOptionsWidget::showEvent(QShowEvent *event)
|
|
|
|
|
{
|
|
|
|
|
Q_UNUSED(event)
|
2020-03-18 03:17:35 +01:00
|
|
|
populateMcuTargetsComboBox();
|
2019-11-29 00:07:04 +01:00
|
|
|
}
|
|
|
|
|
|
2020-01-07 17:42:57 +01:00
|
|
|
void McuSupportOptionsWidget::apply()
|
2019-08-14 11:48:13 +02:00
|
|
|
{
|
2021-04-08 17:14:55 +02:00
|
|
|
bool pathsChanged = false;
|
|
|
|
|
|
2022-02-21 13:41:57 +01:00
|
|
|
m_options.writeGeneralSettings();
|
2021-04-08 17:14:55 +02:00
|
|
|
pathsChanged |= m_options.qtForMCUsSdkPackage->writeToSettings();
|
2021-09-29 17:23:11 +02:00
|
|
|
for (auto package : qAsConst(m_options.sdkRepository.packages))
|
2021-04-08 17:14:55 +02:00
|
|
|
pathsChanged |= package->writeToSettings();
|
2021-03-10 16:38:45 +01:00
|
|
|
|
2021-04-08 17:14:55 +02:00
|
|
|
if (pathsChanged) {
|
|
|
|
|
m_options.checkUpgradeableKits();
|
2022-02-22 13:36:55 +01:00
|
|
|
McuKitManager::updatePathsInExistingKits();
|
2021-04-08 17:14:55 +02:00
|
|
|
}
|
2019-08-14 11:48:13 +02:00
|
|
|
}
|
|
|
|
|
|
2020-03-18 03:17:35 +01:00
|
|
|
void McuSupportOptionsWidget::populateMcuTargetsComboBox()
|
|
|
|
|
{
|
|
|
|
|
m_options.populatePackagesAndTargets();
|
|
|
|
|
m_mcuTargetsComboBox->clear();
|
|
|
|
|
m_mcuTargetsComboBox->addItems(
|
2022-03-09 17:29:07 +01:00
|
|
|
Utils::transform<QStringList>(m_options.sdkRepository.mcuTargets, [](McuTarget *t) {
|
|
|
|
|
return McuKitManager::generateKitNameFromTarget(t);
|
|
|
|
|
}));
|
2020-03-18 03:17:35 +01:00
|
|
|
updateStatus();
|
|
|
|
|
}
|
|
|
|
|
|
2020-01-07 17:42:57 +01:00
|
|
|
McuSupportOptionsPage::McuSupportOptionsPage()
|
2019-08-14 11:48:13 +02:00
|
|
|
{
|
2020-06-26 13:59:38 +02:00
|
|
|
setId(Utils::Id(Constants::SETTINGS_ID));
|
2020-01-16 18:18:20 +01:00
|
|
|
setDisplayName(McuSupportOptionsWidget::tr("MCU"));
|
2020-01-07 17:42:57 +01:00
|
|
|
setCategory(ProjectExplorer::Constants::DEVICE_SETTINGS_CATEGORY);
|
|
|
|
|
setWidgetCreator([] { return new McuSupportOptionsWidget; });
|
2019-08-14 11:48:13 +02:00
|
|
|
}
|
|
|
|
|
|
2022-02-15 11:18:56 +01:00
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace McuSupport
|