McuSupport: Display errors when configuring Qt for MCUs SDK

Fixes: QTCREATORBUG-25258
Change-Id: I6f445bddb51f3bc1850793966f049c4b7ce7889f
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Erik Verbruggen <erik.verbruggen@me.com>
This commit is contained in:
Christiaan Janssen
2020-12-04 16:32:34 +01:00
committed by christiaan.janssen
parent ef5b4b8db5
commit 5b7a3fba27
5 changed files with 151 additions and 29 deletions

View File

@@ -26,6 +26,7 @@
#include "mcusupportconstants.h"
#include "mcusupportoptionspage.h"
#include "mcusupportoptions.h"
#include "mcusupportsdk.h"
#include <cmakeprojectmanager/cmakeprojectconstants.h>
#include <cmakeprojectmanager/cmaketoolmanager.h>
@@ -80,6 +81,7 @@ private:
QCheckBox *m_kitAutomaticCreationCheckBox = nullptr;
Utils::InfoLabel *m_kitCreationInfoLabel = nullptr;
Utils::InfoLabel *m_statusInfoLabel = nullptr;
Utils::InfoLabel *m_mcuTargetsInfoLabel = nullptr;
QPushButton *m_kitCreationPushButton = nullptr;
QPushButton *m_kitRemovalPushButton = nullptr;
};
@@ -128,6 +130,11 @@ McuSupportOptionsWidget::McuSupportOptionsWidget()
m_packagesGroupBox->setLayout(m_packagesLayout);
}
{
m_mcuTargetsInfoLabel = new Utils::InfoLabel;
mainLayout->addWidget(m_mcuTargetsInfoLabel);
}
{
m_kitAutomaticCreationCheckBox = new QCheckBox(tr("Automatically create kits for all available targets on start"));
connect(m_kitAutomaticCreationCheckBox, &QCheckBox::stateChanged, this, [this] (int state) {
@@ -177,11 +184,18 @@ void McuSupportOptionsWidget::updateStatus()
// Page elements
{
m_qtForMCUsSdkGroupBox->setVisible(cMakeAvailable);
const bool ready = cMakeAvailable && mcuTarget &&
const bool valid = cMakeAvailable &&
m_options.qtForMCUsSdkPackage->status() == McuPackage::ValidPackage;
const bool ready = valid && mcuTarget;
m_mcuTargetsGroupBox->setVisible(ready);
m_packagesGroupBox->setVisible(ready && !mcuTarget->packages().isEmpty());
m_kitCreationGroupBox->setVisible(ready);
m_mcuTargetsInfoLabel->setVisible(valid && m_options.mcuTargets.isEmpty());
if (m_mcuTargetsInfoLabel->isVisible()) {
m_mcuTargetsInfoLabel->setType(Utils::InfoLabel::NotOk);
auto displayKitsPath = Sdk::kitsPath(Utils::FilePath::fromString(m_options.qtForMCUsSdkPackage->basePath())).toUserOutput();
m_mcuTargetsInfoLabel->setText(tr("No valid kit descriptions found at %1.").arg(displayKitsPath));
}
}
// Kit creation status