2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2022 The Qt Company Ltd.
|
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
2019-10-22 14:33:31 +02:00
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2022-02-16 16:48:28 +01:00
|
|
|
#include "mcukitmanager.h"
|
2022-03-09 17:29:07 +01:00
|
|
|
#include "mcusupport_global.h"
|
2022-04-22 11:41:33 +02:00
|
|
|
#include "settingshandler.h"
|
2022-03-09 17:29:07 +01:00
|
|
|
|
|
|
|
|
#include <utils/environmentfwd.h>
|
2022-02-14 18:01:04 +01:00
|
|
|
|
2019-10-22 14:33:31 +02:00
|
|
|
#include <QObject>
|
2020-03-25 15:09:02 +01:00
|
|
|
#include <QVersionNumber>
|
2019-10-22 14:33:31 +02:00
|
|
|
|
|
|
|
|
QT_FORWARD_DECLARE_CLASS(QWidget)
|
|
|
|
|
|
|
|
|
|
namespace Utils {
|
2020-03-18 03:17:35 +01:00
|
|
|
class FilePath;
|
2019-10-22 14:33:31 +02:00
|
|
|
class PathChooser;
|
2019-12-11 21:17:53 +01:00
|
|
|
class InfoLabel;
|
2022-02-15 11:18:56 +01:00
|
|
|
} // namespace Utils
|
2019-10-22 14:33:31 +02:00
|
|
|
|
|
|
|
|
namespace ProjectExplorer {
|
|
|
|
|
class Kit;
|
2020-02-26 16:41:52 +01:00
|
|
|
class ToolChain;
|
2022-02-11 13:51:42 +01:00
|
|
|
} // namespace ProjectExplorer
|
2019-10-22 14:33:31 +02:00
|
|
|
|
|
|
|
|
namespace McuSupport {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
2022-02-11 13:51:42 +01:00
|
|
|
class McuAbstractPackage;
|
2019-10-22 14:33:31 +02:00
|
|
|
|
2022-03-28 16:42:51 +02:00
|
|
|
class McuSdkRepository final
|
2021-09-29 17:23:11 +02:00
|
|
|
{
|
2022-03-03 17:43:41 +01:00
|
|
|
public:
|
2022-03-09 17:29:07 +01:00
|
|
|
Targets mcuTargets;
|
2022-03-28 16:42:51 +02:00
|
|
|
Packages packages;
|
2021-09-29 17:23:11 +02:00
|
|
|
};
|
|
|
|
|
|
2022-03-28 16:42:51 +02:00
|
|
|
class McuSupportOptions final : public QObject
|
2019-10-22 14:33:31 +02:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
2022-04-22 11:41:33 +02:00
|
|
|
explicit McuSupportOptions(const SettingsHandler::Ptr &, QObject *parent = nullptr);
|
2019-10-22 14:33:31 +02:00
|
|
|
|
2022-03-28 16:42:51 +02:00
|
|
|
McuPackagePtr qtForMCUsSdkPackage{nullptr};
|
2021-09-29 17:23:11 +02:00
|
|
|
McuSdkRepository sdkRepository;
|
2019-10-22 14:33:31 +02:00
|
|
|
|
2020-03-18 03:17:35 +01:00
|
|
|
void setQulDir(const Utils::FilePath &dir);
|
2022-09-22 19:29:02 +02:00
|
|
|
[[nodiscard]] Utils::FilePath qulDirFromSettings() const;
|
|
|
|
|
[[nodiscard]] Utils::FilePath qulDocsDir() const;
|
2022-02-16 16:48:28 +01:00
|
|
|
static McuKitManager::UpgradeOption askForKitUpgrades();
|
2020-03-18 03:17:35 +01:00
|
|
|
|
2022-09-22 19:29:02 +02:00
|
|
|
void registerQchFiles() const;
|
|
|
|
|
void registerExamples() const;
|
2022-02-14 18:01:04 +01:00
|
|
|
|
|
|
|
|
static const QVersionNumber &minimalQulVersion();
|
2022-04-01 13:28:09 +02:00
|
|
|
static bool isLegacyVersion(const QVersionNumber &version);
|
2022-02-14 18:01:04 +01:00
|
|
|
|
|
|
|
|
void checkUpgradeableKits();
|
|
|
|
|
void populatePackagesAndTargets();
|
2022-02-16 16:48:28 +01:00
|
|
|
|
|
|
|
|
static bool kitsNeedQtVersion();
|
2022-02-21 13:41:57 +01:00
|
|
|
|
2022-09-22 19:29:02 +02:00
|
|
|
[[nodiscard]] bool automaticKitCreationEnabled() const;
|
2022-02-21 13:41:57 +01:00
|
|
|
void setAutomaticKitCreationEnabled(const bool enabled);
|
2022-03-09 17:29:07 +01:00
|
|
|
|
2022-02-14 18:01:04 +01:00
|
|
|
private:
|
2022-04-22 11:41:33 +02:00
|
|
|
SettingsHandler::Ptr settingsHandler;
|
|
|
|
|
|
2022-02-21 13:41:57 +01:00
|
|
|
bool m_automaticKitCreation = true;
|
2022-02-14 18:01:04 +01:00
|
|
|
signals:
|
|
|
|
|
void packagesChanged();
|
|
|
|
|
};
|
|
|
|
|
|
2019-10-22 14:33:31 +02:00
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace McuSupport
|