diff --git a/share/qtcreator/translations/qtcreator_de.ts b/share/qtcreator/translations/qtcreator_de.ts
index e5c05691e2e..35537500ec4 100644
--- a/share/qtcreator/translations/qtcreator_de.ts
+++ b/share/qtcreator/translations/qtcreator_de.ts
@@ -44895,7 +44895,7 @@ Do you want to display them anyway?
- McuSupport::Internal::McuSupportDevice
+ ::McuSupport
MCU Device
MCU-Gerät
@@ -53030,7 +53030,7 @@ Hinweis: Dies macht Sie anfällig für Man-in-the-middle-Angriffe.
- McuSupport::Internal::McuDependenciesKitAspect
+ ::McuSupport
MCU Dependencies
@@ -53051,9 +53051,6 @@ Hinweis: Dies macht Sie anfällig für Man-in-the-middle-Angriffe.
CMake variable %1: path %2 does not exist.
-
-
- ::McuSupport
Warning for target %1: invalid toolchain path (%2). Update the toolchain in Edit > Preferences > Kits.
@@ -53083,9 +53080,6 @@ Hinweis: Dies macht Sie anfällig für Man-in-the-middle-Angriffe.
%1
-
-
- McuSupport::Internal::McuTarget
Warning for target %1: missing CMake toolchain file expected at %2.
@@ -53126,9 +53120,6 @@ Hinweis: Dies macht Sie anfällig für Man-in-the-middle-Angriffe.
Warning creating kit for target %1, package %2: %3
-
-
- McuSupport::Internal::McuPackage
Path %1 exists, but does not contain %2.
@@ -53233,9 +53224,6 @@ Hinweis: Dies macht Sie anfällig für Man-in-the-middle-Angriffe.
Toolchain description for "%1" is invalid because %2 in file "%3".
-
-
- McuSupport::Internal::McuSupportOptions
Qt for MCUs Demos
@@ -53260,9 +53248,6 @@ Hinweis: Dies macht Sie anfällig für Man-in-the-middle-Angriffe.
New version of Qt for MCUs detected. Upgrade existing kits?
-
-
- McuSupport::Internal::McuSupportOptionsWidget
Qt for MCUs SDK
@@ -53291,10 +53276,6 @@ Hinweis: Dies macht Sie anfällig für Man-in-the-middle-Angriffe.
Update Kit
-
- No valid kit descriptions found at %1.
-
-
A kit for the selected target and SDK version already exists.
@@ -53311,16 +53292,10 @@ Hinweis: Dies macht Sie anfällig für Man-in-the-middle-Angriffe.
MCU
-
-
- QtForMCUs
Qt for MCUs: %1
-
-
- McuSupport::Internal::McuSupportPlugin
Create Kits for Qt for MCUs? To do it later, select Edit > Preferences > Devices > MCU.
@@ -53345,16 +53320,10 @@ Hinweis: Dies macht Sie anfällig für Man-in-the-middle-Angriffe.
Proceed
Weiter
-
-
- McuSupport::Internal::FlashAndRunConfiguration
Flash and run CMake parameters:
-
-
- Tr
Parsing error: the type entry in JSON kit files must be a string, defaulting to "path"
diff --git a/share/qtcreator/translations/qtcreator_ja.ts b/share/qtcreator/translations/qtcreator_ja.ts
index 8fb205c3a9f..a23ba9a2318 100644
--- a/share/qtcreator/translations/qtcreator_ja.ts
+++ b/share/qtcreator/translations/qtcreator_ja.ts
@@ -46029,14 +46029,7 @@ Stepping into the module or setting breakpoints by file and line is expected to
- McuSupport::Internal::McuPackage
-
- Path %1 exists, but does not contain %2.
- パス %1 は存在しますが、%2 を含んでいません。
-
-
-
- McuSupport::Internal::McuSupportOptions
+ ::McuSupport
Qt for MCUs Demos
Qt for MCUs のデモ
@@ -46061,9 +46054,6 @@ Stepping into the module or setting breakpoints by file and line is expected to
No CMake tool was detected. Add a CMake tool in Tools > Options > Kits > CMake.
CMake ツールが検出されませんでした。「ツール」→「オプション」→「キット」→「 CMake 」で CMake ツールを追加してください。
-
-
- McuSupport::Internal::McuTarget
Warning for target %1: missing CMake Toolchain File expected at %2.
ターゲット %1 に対する警告: CMake Toolchain ファイルが %2 で見つかりませんでした。
@@ -46076,24 +46066,14 @@ Stepping into the module or setting breakpoints by file and line is expected to
Skipped %1 - Unsupported version "%2" (should be >= %3)
%1をスキップしました - サポート対象外のバージョン "%2" (%3 以上である必要があります)
-
- No valid kit descriptions found at %1.
- %1で有効なキットの説明が見つかりませんでした。
-
Skipped creating fallback desktop kit: Could not find any of %1.
予備のデスクトップ・キットの作成をスキップしました。%1 のいずれも見つかりませんでした。
-
-
- QtForMCUs
Qt for MCUs: %1
Qt for MCUs: %1
-
-
- McuSupport::Internal::McuSupportOptionsWidget
Remove Kit
キットを削除する
diff --git a/share/qtcreator/translations/qtcreator_ru.ts b/share/qtcreator/translations/qtcreator_ru.ts
index 7a65b12bcd7..e00503e577e 100644
--- a/share/qtcreator/translations/qtcreator_ru.ts
+++ b/share/qtcreator/translations/qtcreator_ru.ts
@@ -24664,7 +24664,7 @@ Error: %5
- McuSupport::Internal::FlashAndRunConfiguration
+ ::McuSupport
Flash and run CMake parameters:
Параметры CMake для прошивки и запуска:
@@ -24673,9 +24673,6 @@ Error: %5
Flash and run
Прошивка и запуск
-
-
- McuSupport::Internal::McuPackage
Download from "%1"
Загрузить «%1»
@@ -24708,16 +24705,10 @@ Error: %5
STM32CubeProgrammer
STM32CubeProgrammer
-
-
- McuSupport::Internal::McuSupportDevice
MCU Device
Микроконтроллер
-
-
- McuSupport::Internal::McuSupportOptionsWidget
Targets supported by the %1
Поддерживаемые %1 цели
@@ -24750,9 +24741,6 @@ Error: %5
MCU
Микроконтроллер
-
-
- McuSupport::Internal::McuSupportPlugin
Create Kits for Qt for MCUs? To do it later, select Options > Devices > MCU.
Создать комплекты для Qt для микроконтроллеров? Можно сделать позже через Параметры > Устройства > Микроконтроллер.
diff --git a/share/qtcreator/translations/qtcreator_zh_CN.ts b/share/qtcreator/translations/qtcreator_zh_CN.ts
index 5e70d26c30e..f7eb1bba4ec 100644
--- a/share/qtcreator/translations/qtcreator_zh_CN.ts
+++ b/share/qtcreator/translations/qtcreator_zh_CN.ts
@@ -24249,14 +24249,11 @@ Error: %5
- McuSupport::Internal::FlashAndRunConfiguration
+ ::McuSupport
Flash and run CMake parameters:
-
-
- McuSupport::Internal::McuDependenciesKitAspect
MCU Dependencies
@@ -24277,9 +24274,6 @@ Error: %5
CMake variable %1: path %2 does not exist.
-
-
- McuSupport::Internal::McuPackage
Path %1 exists, but does not contain %2.
@@ -24356,16 +24350,10 @@ Error: %5
STM32CubeProgrammer
-
-
- McuSupport::Internal::McuSupportDevice
MCU Device
-
-
- McuSupport::Internal::McuSupportOptions
Qt for MCUs Demos
@@ -24390,9 +24378,6 @@ Error: %5
New version of Qt for MCUs detected. Upgrade existing kits?
-
-
- McuSupport::Internal::McuSupportOptionsWidget
Qt for MCUs SDK
@@ -24441,9 +24426,6 @@ Error: %5
MCU
-
-
- McuSupport::Internal::McuSupportPlugin
Create Kits for Qt for MCUs? To do it later, select Edit > Preferences > Devices > MCU.
@@ -24468,9 +24450,6 @@ Error: %5
Proceed
继续
-
-
- McuSupport::Internal::McuTarget
Warning for target %1: missing CMake toolchain file expected at %2.
@@ -24499,10 +24478,6 @@ Error: %5
Skipped %1. %2 Qt for MCUs version >= %3 required.
-
- No valid kit descriptions found at %1.
-
-
Kit for %1 created.
@@ -38294,7 +38269,7 @@ For more details, see /etc/sysctl.d/10-ptrace.conf
- QtForMCUs
+ ::McuSupport
Qt for MCUs: %1
diff --git a/src/plugins/mcusupport/mcukitinformation.cpp b/src/plugins/mcusupport/mcukitinformation.cpp
index 2543db589c8..801b7cdeccb 100644
--- a/src/plugins/mcusupport/mcukitinformation.cpp
+++ b/src/plugins/mcusupport/mcukitinformation.cpp
@@ -2,6 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include "mcukitinformation.h"
+#include "mcusupporttr.h"
#include
#include
@@ -33,8 +34,8 @@ McuDependenciesKitAspect::McuDependenciesKitAspect()
{
setObjectName(QLatin1String("McuDependenciesKitAspect"));
setId(McuDependenciesKitAspect::id());
- setDisplayName(tr("MCU Dependencies"));
- setDescription(tr("Paths to 3rd party dependencies"));
+ setDisplayName(Tr::tr("MCU Dependencies"));
+ setDescription(Tr::tr("Paths to 3rd party dependencies"));
setPriority(28500);
}
@@ -48,7 +49,7 @@ Tasks McuDependenciesKitAspect::validate(const Kit *kit) const
if (!checkFormat.isValid() || checkFormat.isNull())
return result;
if (!checkFormat.canConvert(QVariant::List))
- return {BuildSystemTask(Task::Error, tr("The MCU dependencies setting value is invalid."))};
+ return {BuildSystemTask(Task::Error, Tr::tr("The MCU dependencies setting value is invalid."))};
// check paths defined in cmake variables for given dependencies exist
const auto cMakeEntries = Utils::NameValueDictionary(configuration(kit));
@@ -56,12 +57,12 @@ Tasks McuDependenciesKitAspect::validate(const Kit *kit) const
auto givenPath = Utils::FilePath::fromUserInput(cMakeEntries.value(dependency.name));
if (givenPath.isEmpty()) {
result << BuildSystemTask(Task::Warning,
- tr("CMake variable %1 not defined.").arg(dependency.name));
+ Tr::tr("CMake variable %1 not defined.").arg(dependency.name));
} else {
const auto detectionPath = givenPath.resolvePath(dependency.value);
if (!detectionPath.exists()) {
result << BuildSystemTask(Task::Warning,
- tr("CMake variable %1: path %2 does not exist.")
+ Tr::tr("CMake variable %1: path %2 does not exist.")
.arg(dependency.name, detectionPath.toUserOutput()));
}
}
diff --git a/src/plugins/mcusupport/mcukitmanager.cpp b/src/plugins/mcusupport/mcukitmanager.cpp
index bf5cc7f1813..793e02b3230 100644
--- a/src/plugins/mcusupport/mcukitmanager.cpp
+++ b/src/plugins/mcusupport/mcukitmanager.cpp
@@ -288,7 +288,7 @@ public:
cMakeToolchainFile.toString().toUtf8());
if (!cMakeToolchainFile.exists()) {
printMessage(
- McuTarget::tr(
+ Tr::tr(
"Warning for target %1: missing CMake toolchain file expected at %2.")
.arg(generateKitNameFromTarget(mcuTarget),
cMakeToolchainFile.toUserOutput()),
@@ -300,7 +300,7 @@ public:
"/lib/cmake/Qul/QulGenerators.cmake");
configMap.insert("QUL_GENERATORS", generatorsPath.toString().toUtf8());
if (!generatorsPath.exists()) {
- printMessage(McuTarget::tr(
+ printMessage(Tr::tr(
"Warning for target %1: missing QulGenerators expected at %2.")
.arg(generateKitNameFromTarget(mcuTarget),
generatorsPath.toUserOutput()),
@@ -493,14 +493,14 @@ void createAutomaticKits(const SettingsHandler::Ptr &settingsHandler)
if (!qtForMCUsPackage->isValidStatus()) {
switch (qtForMCUsPackage->status()) {
case McuAbstractPackage::Status::ValidPathInvalidPackage: {
- printMessage(McuPackage::tr("Path %1 exists, but does not contain %2.")
+ printMessage(Tr::tr("Path %1 exists, but does not contain %2.")
.arg(qtForMCUsPackage->path().toUserOutput(),
qtForMCUsPackage->detectionPath().toUserOutput()),
true);
break;
}
case McuAbstractPackage::Status::InvalidPath: {
- printMessage(McuPackage::tr(
+ printMessage(Tr::tr(
"Path %1 does not exist. Add the path in Edit > Preferences > "
"Devices > MCU.")
.arg(qtForMCUsPackage->path().toUserOutput()),
@@ -509,7 +509,7 @@ void createAutomaticKits(const SettingsHandler::Ptr &settingsHandler)
}
case McuAbstractPackage::Status::EmptyPath: {
printMessage(
- McuPackage::tr(
+ Tr::tr(
"Missing %1. Add the path in Edit > Preferences > Devices > MCU.")
.arg(qtForMCUsPackage->detectionPath().toUserOutput()),
true);
@@ -523,7 +523,7 @@ void createAutomaticKits(const SettingsHandler::Ptr &settingsHandler)
if (CMakeProjectManager::CMakeToolManager::cmakeTools().isEmpty()) {
printMessage(
- McuPackage::tr(
+ Tr::tr(
"No CMake tool was detected. Add a CMake tool in Edit > Preferences > "
"Kits > CMake."),
true);
diff --git a/src/plugins/mcusupport/mcupackage.cpp b/src/plugins/mcusupport/mcupackage.cpp
index 13c010f91df..287c89b93ec 100644
--- a/src/plugins/mcusupport/mcupackage.cpp
+++ b/src/plugins/mcusupport/mcupackage.cpp
@@ -183,7 +183,7 @@ void McuPackage::updateStatusUi()
QString McuPackage::statusText() const
{
const QString displayPackagePath = m_path.toUserOutput();
- const QString displayVersions = m_versions.join(tr(" or "));
+ const QString displayVersions = m_versions.join(Tr::tr(" or "));
const QString outDetectionPath = m_detectionPath.toUserOutput();
const QString displayRequiredPath = m_versions.empty() ? outDetectionPath
: QString("%1 %2").arg(outDetectionPath,
@@ -198,35 +198,35 @@ QString McuPackage::statusText() const
case Status::ValidPackage:
response = m_detectionPath.isEmpty()
? (m_detectedVersion.isEmpty()
- ? tr("Path %1 exists.").arg(displayPackagePath)
- : tr("Path %1 exists. Version %2 was found.")
+ ? Tr::tr("Path %1 exists.").arg(displayPackagePath)
+ : Tr::tr("Path %1 exists. Version %2 was found.")
.arg(displayPackagePath, m_detectedVersion))
- : tr("Path %1 is valid, %2 was found.")
+ : Tr::tr("Path %1 is valid, %2 was found.")
.arg(displayPackagePath, displayDetectedPath);
break;
case Status::ValidPackageMismatchedVersion: {
const QString versionWarning
= m_versions.size() == 1
- ? tr("but only version %1 is supported").arg(m_versions.first())
- : tr("but only versions %1 are supported").arg(displayVersions);
- response = tr("Path %1 is valid, %2 was found, %3.")
+ ? Tr::tr("but only version %1 is supported").arg(m_versions.first())
+ : Tr::tr("but only versions %1 are supported").arg(displayVersions);
+ response = Tr::tr("Path %1 is valid, %2 was found, %3.")
.arg(displayPackagePath, displayDetectedPath, versionWarning);
break;
}
case Status::ValidPathInvalidPackage:
- response = tr("Path %1 exists, but does not contain %2.")
+ response = Tr::tr("Path %1 exists, but does not contain %2.")
.arg(displayPackagePath, displayRequiredPath);
break;
case Status::InvalidPath:
- response = tr("Path %1 does not exist.").arg(displayPackagePath);
+ response = Tr::tr("Path %1 does not exist.").arg(displayPackagePath);
break;
case Status::EmptyPath:
response = m_detectionPath.isEmpty()
- ? tr("Path is empty.")
- : tr("Path is empty, %1 not found.").arg(displayRequiredPath);
+ ? Tr::tr("Path is empty.")
+ : Tr::tr("Path is empty, %1 not found.").arg(displayRequiredPath);
break;
case Status::ValidPackageVersionNotDetected:
- response = tr("Path %1 exists, but version %2 could not be detected.")
+ response = Tr::tr("Path %1 exists, but version %2 could not be detected.")
.arg(displayPackagePath, displayVersions);
break;
}
@@ -262,7 +262,7 @@ QWidget *McuPackage::widget()
if (!m_downloadUrl.isEmpty()) {
auto downLoadButton = new QToolButton(widget);
downLoadButton->setIcon(Icons::ONLINE.icon());
- downLoadButton->setToolTip(tr("Download from \"%1\"").arg(m_downloadUrl));
+ downLoadButton->setToolTip(Tr::tr("Download from \"%1\"").arg(m_downloadUrl));
QObject::connect(downLoadButton, &QToolButton::pressed, this, [this] {
QDesktopServices::openUrl(m_downloadUrl);
});
@@ -531,7 +531,7 @@ QVariant McuToolChainPackage::debuggerId() const
switch (m_type) {
case ToolChainType::ArmGcc: {
sub = QString::fromLatin1("bin/arm-none-eabi-gdb-py");
- displayName = McuPackage::tr("Arm GDB at %1");
+ displayName = Tr::tr("Arm GDB at %1");
engineType = Debugger::GdbEngineType;
break;
}
diff --git a/src/plugins/mcusupport/mcusupportdevice.cpp b/src/plugins/mcusupport/mcusupportdevice.cpp
index cf90fdfadc6..9e3118cab6a 100644
--- a/src/plugins/mcusupport/mcusupportdevice.cpp
+++ b/src/plugins/mcusupport/mcusupportdevice.cpp
@@ -3,6 +3,7 @@
#include "mcusupportdevice.h"
#include "mcusupportconstants.h"
+#include "mcusupporttr.h"
using namespace ProjectExplorer;
using namespace Utils;
@@ -14,7 +15,7 @@ McuSupportDevice::McuSupportDevice()
{
setupId(IDevice::AutoDetected, Constants::DEVICE_ID);
setType(Constants::DEVICE_TYPE);
- const QString displayNameAndType = tr("MCU Device");
+ const QString displayNameAndType = Tr::tr("MCU Device");
setDefaultDisplayName(displayNameAndType);
setDisplayType(displayNameAndType);
setDeviceState(IDevice::DeviceStateUnknown);
@@ -31,7 +32,7 @@ ProjectExplorer::IDevice::Ptr McuSupportDevice::create()
McuSupportDeviceFactory::McuSupportDeviceFactory()
: ProjectExplorer::IDeviceFactory(Constants::DEVICE_TYPE)
{
- setDisplayName(McuSupportDevice::tr("MCU Device"));
+ setDisplayName(Tr::tr("MCU Device"));
setCombinedIcon(":/mcusupport/images/mcusupportdevicesmall.png",
":/mcusupport/images/mcusupportdevice.png");
setConstructionFunction(&McuSupportDevice::create);
diff --git a/src/plugins/mcusupport/mcusupportdevice.h b/src/plugins/mcusupport/mcusupportdevice.h
index fac2a57bf9d..262edc39ab8 100644
--- a/src/plugins/mcusupport/mcusupportdevice.h
+++ b/src/plugins/mcusupport/mcusupportdevice.h
@@ -10,8 +10,6 @@ namespace Internal {
class McuSupportDevice final : public ProjectExplorer::DesktopDevice
{
- Q_DECLARE_TR_FUNCTIONS(McuSupport::Internal::McuSupportDevice)
-
public:
static ProjectExplorer::IDevice::Ptr create();
diff --git a/src/plugins/mcusupport/mcusupportoptions.cpp b/src/plugins/mcusupport/mcusupportoptions.cpp
index 6978d30ba28..e66c87ff5e5 100644
--- a/src/plugins/mcusupport/mcusupportoptions.cpp
+++ b/src/plugins/mcusupport/mcusupportoptions.cpp
@@ -8,6 +8,7 @@
#include "mcupackage.h"
#include "mcusupportconstants.h"
#include "mcusupportsdk.h"
+#include "mcusupporttr.h"
#include "mcutarget.h"
#include "settingshandler.h"
@@ -184,8 +185,8 @@ void McuSupportOptions::registerExamples() const
if (docsDir.isEmpty())
return;
- auto examples = {std::make_pair(QStringLiteral("demos"), tr("Qt for MCUs Demos")),
- std::make_pair(QStringLiteral("examples"), tr("Qt for MCUs Examples"))};
+ auto examples = {std::make_pair(QStringLiteral("demos"), Tr::tr("Qt for MCUs Demos")),
+ std::make_pair(QStringLiteral("examples"), Tr::tr("Qt for MCUs Examples"))};
for (const auto &dir : examples) {
const FilePath examplesDir = qulDirFromSettings() / dir.first;
if (!examplesDir.exists())
@@ -235,11 +236,11 @@ McuKitManager::UpgradeOption McuSupportOptions::askForKitUpgrades()
{
QMessageBox upgradePopup(Core::ICore::dialogParent());
upgradePopup.setStandardButtons(QMessageBox::Cancel);
- QPushButton *replaceButton = upgradePopup.addButton(tr("Replace Existing Kits"),
+ QPushButton *replaceButton = upgradePopup.addButton(Tr::tr("Replace Existing Kits"),
QMessageBox::NoRole);
- QPushButton *keepButton = upgradePopup.addButton(tr("Create New Kits"), QMessageBox::NoRole);
- upgradePopup.setWindowTitle(tr("Qt for MCUs"));
- upgradePopup.setText(tr("New version of Qt for MCUs detected. Upgrade existing kits?"));
+ QPushButton *keepButton = upgradePopup.addButton(Tr::tr("Create New Kits"), QMessageBox::NoRole);
+ upgradePopup.setWindowTitle(Tr::tr("Qt for MCUs"));
+ upgradePopup.setText(Tr::tr("New version of Qt for MCUs detected. Upgrade existing kits?"));
upgradePopup.exec();
diff --git a/src/plugins/mcusupport/mcusupportoptionspage.cpp b/src/plugins/mcusupport/mcusupportoptionspage.cpp
index eff4fb94be2..7a8a7d046c8 100644
--- a/src/plugins/mcusupport/mcusupportoptionspage.cpp
+++ b/src/plugins/mcusupport/mcusupportoptionspage.cpp
@@ -37,8 +37,6 @@ namespace McuSupport::Internal {
class McuSupportOptionsWidget : public Core::IOptionsPageWidget
{
- Q_DECLARE_TR_FUNCTIONS(McuSupport::Internal::McuSupportOptionsWidget)
-
public:
McuSupportOptionsWidget(McuSupportOptions &, const SettingsHandler::Ptr &);
@@ -89,7 +87,7 @@ McuSupportOptionsWidget::McuSupportOptionsWidget(McuSupportOptions &options,
}
{
- m_qtForMCUsSdkGroupBox = new QGroupBox(tr("Qt for MCUs SDK"));
+ m_qtForMCUsSdkGroupBox = new QGroupBox(Tr::tr("Qt for MCUs SDK"));
m_qtForMCUsSdkGroupBox->setFlat(true);
auto *layout = new QVBoxLayout(m_qtForMCUsSdkGroupBox);
layout->addWidget(m_options.qtForMCUsSdkPackage->widget());
@@ -98,7 +96,7 @@ McuSupportOptionsWidget::McuSupportOptionsWidget(McuSupportOptions &options,
{
m_mcuTargetsGroupBox = new QGroupBox(
- tr("Targets supported by the %1").arg(m_qtForMCUsSdkGroupBox->title()));
+ Tr::tr("Targets supported by the %1").arg(m_qtForMCUsSdkGroupBox->title()));
m_mcuTargetsGroupBox->setFlat(true);
mainLayout->addWidget(m_mcuTargetsGroupBox);
m_mcuTargetsComboBox = new QComboBox;
@@ -115,7 +113,7 @@ McuSupportOptionsWidget::McuSupportOptionsWidget(McuSupportOptions &options,
}
{
- m_packagesGroupBox = new QGroupBox(tr("Requirements"));
+ m_packagesGroupBox = new QGroupBox(Tr::tr("Requirements"));
m_packagesGroupBox->setFlat(true);
mainLayout->addWidget(m_packagesGroupBox);
m_packagesLayout = new QFormLayout;
@@ -129,7 +127,7 @@ McuSupportOptionsWidget::McuSupportOptionsWidget(McuSupportOptions &options,
{
m_kitAutomaticCreationCheckBox = new QCheckBox(
- tr("Automatically create kits for all available targets on start"));
+ Tr::tr("Automatically create kits for all available targets on start"));
connect(m_kitAutomaticCreationCheckBox, &QCheckBox::stateChanged, this, [this](int state) {
m_options.setAutomaticKitCreationEnabled(state == Qt::CheckState::Checked);
});
@@ -137,20 +135,20 @@ McuSupportOptionsWidget::McuSupportOptionsWidget(McuSupportOptions &options,
}
{
- m_kitCreationGroupBox = new QGroupBox(tr("Create a Kit"));
+ m_kitCreationGroupBox = new QGroupBox(Tr::tr("Create a Kit"));
m_kitCreationGroupBox->setFlat(true);
mainLayout->addWidget(m_kitCreationGroupBox);
m_kitCreationInfoLabel = new Utils::InfoLabel;
auto *vLayout = new QHBoxLayout(m_kitCreationGroupBox);
vLayout->addWidget(m_kitCreationInfoLabel);
- m_kitCreationPushButton = new QPushButton(tr("Create Kit"));
+ m_kitCreationPushButton = new QPushButton(Tr::tr("Create Kit"));
m_kitCreationPushButton->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred);
connect(m_kitCreationPushButton, &QPushButton::clicked, this, [this] {
McuKitManager::newKit(currentMcuTarget().get(), m_options.qtForMCUsSdkPackage);
m_options.registerQchFiles();
updateStatus();
});
- m_kitUpdatePushButton = new QPushButton(tr("Update Kit"));
+ m_kitUpdatePushButton = new QPushButton(Tr::tr("Update Kit"));
m_kitUpdatePushButton->setSizePolicy(m_kitCreationPushButton->sizePolicy());
connect(m_kitUpdatePushButton, &QPushButton::clicked, this, [this] {
for (auto *kit : McuKitManager::upgradeableKits(currentMcuTarget().get(),
@@ -196,7 +194,7 @@ void McuSupportOptionsWidget::updateStatus()
if (checkDeprecatedSdkError(sdkPath, deprecationMessage))
m_mcuTargetsInfoLabel->setText(deprecationMessage);
else
- m_mcuTargetsInfoLabel->setText(tr("No valid kit descriptions found at %1.")
+ m_mcuTargetsInfoLabel->setText(Tr::tr("No valid kit descriptions found at %1.")
.arg(kitsPath(sdkPath).toUserOutput()));
}
}
@@ -223,12 +221,12 @@ void McuSupportOptionsWidget::updateStatus()
m_kitCreationInfoLabel->setText(
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."));
+ ? Tr::tr("A kit for the selected target and SDK version already exists.")
+ : hasUpgradeableKits ? Tr::tr("Kits for a different SDK version exist.")
+ : Tr::tr("A kit for the selected target can be created."));
} else {
m_kitCreationInfoLabel->setType(Utils::InfoLabel::NotOk);
- m_kitCreationInfoLabel->setText(tr("Provide the package paths in order to create a kit "
+ m_kitCreationInfoLabel->setText(Tr::tr("Provide the package paths in order to create a kit "
"for your target."));
}
}
@@ -241,7 +239,7 @@ void McuSupportOptionsWidget::updateStatus()
m_statusInfoLabel->setVisible(!cMakeAvailable);
if (m_statusInfoLabel->isVisible()) {
m_statusInfoLabel->setType(Utils::InfoLabel::NotOk);
- m_statusInfoLabel->setText(tr("No CMake tool was detected. Add a CMake tool in the "
+ m_statusInfoLabel->setText(Tr::tr("No CMake tool was detected. Add a CMake tool in the "
"CMake options and press Apply."));
}
}
@@ -351,7 +349,7 @@ McuSupportOptionsPage::McuSupportOptionsPage(McuSupportOptions &options,
const SettingsHandler::Ptr &settingsHandler)
{
setId(Utils::Id(Constants::SETTINGS_ID));
- setDisplayName(McuSupportOptionsWidget::tr("MCU"));
+ setDisplayName(Tr::tr("MCU"));
setCategory(ProjectExplorer::Constants::DEVICE_SETTINGS_CATEGORY);
setWidgetCreator([&options, &settingsHandler] {
return new McuSupportOptionsWidget(options, settingsHandler);
diff --git a/src/plugins/mcusupport/mcusupportplugin.cpp b/src/plugins/mcusupport/mcusupportplugin.cpp
index 608588aa9d1..835e619a3ce 100644
--- a/src/plugins/mcusupport/mcusupportplugin.cpp
+++ b/src/plugins/mcusupport/mcusupportplugin.cpp
@@ -2,6 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include "mcusupportplugin.h"
+
#include "mcukitinformation.h"
#include "mcukitmanager.h"
#include "mcusupportconstants.h"
@@ -9,6 +10,7 @@
#include "mcusupportoptions.h"
#include "mcusupportoptionspage.h"
#include "mcusupportrunconfiguration.h"
+#include "mcusupporttr.h"
#if defined(WITH_TESTS) && defined(GOOGLE_TEST_IS_FOUND)
#include "test/unittest.h"
@@ -40,8 +42,7 @@ namespace Internal {
void printMessage(const QString &message, bool important)
{
- const QString displayMessage = QCoreApplication::translate("QtForMCUs", "Qt for MCUs: %1")
- .arg(message);
+ const QString displayMessage = Tr::tr("Qt for MCUs: %1").arg(message);
if (important)
Core::MessageManager::writeFlashing(displayMessage);
else
@@ -98,11 +99,11 @@ void McuSupportPlugin::askUserAboutMcuSupportKitsSetup()
return;
Utils::InfoBarEntry info(setupMcuSupportKits,
- tr("Create Kits for Qt for MCUs? "
+ Tr::tr("Create Kits for Qt for MCUs? "
"To do it later, select Edit > Preferences > Devices > MCU."),
Utils::InfoBarEntry::GlobalSuppression::Enabled);
// clazy:excludeall=connect-3arg-lambda
- info.addCustomButton(tr("Create Kits for Qt for MCUs"), [] {
+ info.addCustomButton(Tr::tr("Create Kits for Qt for MCUs"), [] {
ICore::infoBar()->removeInfo(setupMcuSupportKits);
QTimer::singleShot(0, []() { ICore::showOptionsDialog(Constants::SETTINGS_ID); });
});
@@ -117,20 +118,20 @@ void McuSupportPlugin::askUserAboutMcuSupportKitsUpgrade(const SettingsHandler::
return;
Utils::InfoBarEntry info(upgradeMcuSupportKits,
- tr("New version of Qt for MCUs detected. Upgrade existing Kits?"),
+ Tr::tr("New version of Qt for MCUs detected. Upgrade existing Kits?"),
Utils::InfoBarEntry::GlobalSuppression::Enabled);
using McuKitManager::UpgradeOption;
static UpgradeOption selectedOption = UpgradeOption::Keep;
const QList infos
- = {{tr("Create new kits"), QVariant::fromValue(UpgradeOption::Keep)},
- {tr("Replace existing kits"), QVariant::fromValue(UpgradeOption::Replace)}};
+ = {{Tr::tr("Create new kits"), QVariant::fromValue(UpgradeOption::Keep)},
+ {Tr::tr("Replace existing kits"), QVariant::fromValue(UpgradeOption::Replace)}};
info.setComboInfo(infos, [](const Utils::InfoBarEntry::ComboInfo &selected) {
selectedOption = selected.data.value();
});
- info.addCustomButton(tr("Proceed"), [upgradeMcuSupportKits, settingsHandler] {
+ info.addCustomButton(Tr::tr("Proceed"), [upgradeMcuSupportKits, settingsHandler] {
ICore::infoBar()->removeInfo(upgradeMcuSupportKits);
QTimer::singleShot(0, [settingsHandler]() {
McuKitManager::upgradeKitsByCreatingNewPackage(settingsHandler, selectedOption);
diff --git a/src/plugins/mcusupport/mcusupportrunconfiguration.cpp b/src/plugins/mcusupport/mcusupportrunconfiguration.cpp
index b2eba0e1797..8b80f09fccc 100644
--- a/src/plugins/mcusupport/mcusupportrunconfiguration.cpp
+++ b/src/plugins/mcusupport/mcusupportrunconfiguration.cpp
@@ -2,7 +2,9 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include "mcusupportrunconfiguration.h"
+
#include "mcusupportconstants.h"
+#include "mcusupporttr.h"
#include
#include
@@ -39,14 +41,12 @@ static QStringList flashAndRunArgs(const RunConfiguration *rc, const Target *tar
class FlashAndRunConfiguration final : public RunConfiguration
{
- Q_DECLARE_TR_FUNCTIONS(McuSupport::Internal::FlashAndRunConfiguration)
-
public:
FlashAndRunConfiguration(Target *target, Utils::Id id)
: RunConfiguration(target, id)
{
auto flashAndRunParameters = addAspect();
- flashAndRunParameters->setLabelText(tr("Flash and run CMake parameters:"));
+ flashAndRunParameters->setLabelText(Tr::tr("Flash and run CMake parameters:"));
flashAndRunParameters->setDisplayStyle(StringAspect::TextEditDisplay);
flashAndRunParameters->setSettingsKey("FlashAndRunConfiguration.Parameters");
diff --git a/src/plugins/mcusupport/mcusupportsdk.cpp b/src/plugins/mcusupport/mcusupportsdk.cpp
index 9ae7e9eb50a..d29aea4a54f 100644
--- a/src/plugins/mcusupport/mcusupportsdk.cpp
+++ b/src/plugins/mcusupport/mcusupportsdk.cpp
@@ -195,7 +195,7 @@ McuToolChainPackagePtr createMsvcToolChainPackage(const SettingsHandler::Ptr &se
R"(\b(\d+\.\d+)\.\d+\b)");
return McuToolChainPackagePtr{new McuToolChainPackage(settingsHandler,
- McuPackage::tr("MSVC Binary directory"),
+ Tr::tr("MSVC Binary directory"),
defaultPath,
detectionPath,
"MsvcToolchain",
@@ -221,7 +221,7 @@ McuToolChainPackagePtr createGccToolChainPackage(const SettingsHandler::Ptr &set
R"(\b(\d+\.\d+\.\d+)\b)");
return McuToolChainPackagePtr{new McuToolChainPackage(settingsHandler,
- McuPackage::tr("GCC Toolchain"),
+ Tr::tr("GCC Toolchain"),
defaultPath,
detectionPath,
"GnuToolchain",
@@ -258,7 +258,7 @@ McuToolChainPackagePtr createArmGccToolchainPackage(const SettingsHandler::Ptr &
return McuToolChainPackagePtr{
new McuToolChainPackage(settingsHandler,
- McuPackage::tr("GNU Arm Embedded Toolchain"),
+ Tr::tr("GNU Arm Embedded Toolchain"),
defaultPath,
detectionPath,
"GNUArmEmbeddedToolchain", // settingsKey
@@ -374,7 +374,7 @@ McuPackagePtr createStm32CubeProgrammerPackage(const SettingsHandler::Ptr &setti
return McuPackagePtr{
new McuPackage(settingsHandler,
- McuPackage::tr("STM32CubeProgrammer"),
+ Tr::tr("STM32CubeProgrammer"),
defaultPath,
detectionPath,
"Stm32CubeProgrammer",
@@ -779,9 +779,9 @@ bool checkDeprecatedSdkError(const FilePath &qulDir, QString &message)
const QString legacyVersion = legacySupportVersionFor(sdkDetectedVersion);
if (!legacyVersion.isEmpty()) {
- message = McuTarget::tr("Qt for MCUs SDK version %1 detected, "
- "only supported by Qt Creator version %2. "
- "This version of Qt Creator requires Qt for MCUs %3 or greater.")
+ message = Tr::tr("Qt for MCUs SDK version %1 detected, "
+ "only supported by Qt Creator version %2. "
+ "This version of Qt Creator requires Qt for MCUs %3 or greater.")
.arg(sdkDetectedVersion,
legacyVersion,
McuSupportOptions::minimalQulVersion().toString());
@@ -808,7 +808,7 @@ McuSdkRepository targetsAndPackages(const McuPackagePtr &qtForMCUsPackage,
bool ok = false;
const int compatVersion = desc.compatVersion.toInt(&ok);
if (!desc.compatVersion.isEmpty() && ok && compatVersion > MAX_COMPATIBILITY_VERSION) {
- printMessage(McuTarget::tr("Skipped %1. Unsupported version \"%2\".")
+ printMessage(Tr::tr("Skipped %1. Unsupported version \"%2\".")
.arg(QDir::toNativeSeparators(filePath.fileNameWithPathComponents(1)),
desc.qulVersion),
false);
@@ -822,10 +822,10 @@ McuSdkRepository targetsAndPackages(const McuPackagePtr &qtForMCUsPackage,
const QString legacyVersion = legacySupportVersionFor(desc.qulVersion);
const QString qtcSupportText
= !legacyVersion.isEmpty()
- ? McuTarget::tr("Detected version \"%1\", only supported by Qt Creator %2.")
+ ? Tr::tr("Detected version \"%1\", only supported by Qt Creator %2.")
.arg(desc.qulVersion, legacyVersion)
- : McuTarget::tr("Unsupported version \"%1\".").arg(desc.qulVersion);
- printMessage(McuTarget::tr("Skipped %1. %2 Qt for MCUs version >= %3 required.")
+ : Tr::tr("Unsupported version \"%1\".").arg(desc.qulVersion);
+ printMessage(Tr::tr("Skipped %1. %2 Qt for MCUs version >= %3 required.")
.arg(QDir::toNativeSeparators(filePath.fileNameWithPathComponents(1)),
qtcSupportText,
McuSupportOptions::minimalQulVersion().toString()),
@@ -838,7 +838,7 @@ McuSdkRepository targetsAndPackages(const McuPackagePtr &qtForMCUsPackage,
// No valid description means invalid or old SDK installation.
if (descriptions.empty()) {
if (kitsPath(qtForMCUSdkPath).exists()) {
- printMessage(McuTarget::tr("No valid kit descriptions found at %1.")
+ printMessage(Tr::tr("No valid kit descriptions found at %1.")
.arg(kitsPath(qtForMCUSdkPath).toUserOutput()),
true);
return McuSdkRepository{};
diff --git a/src/plugins/mcusupport/mcutarget.cpp b/src/plugins/mcusupport/mcutarget.cpp
index 8effd45dd6d..2040c260398 100644
--- a/src/plugins/mcusupport/mcutarget.cpp
+++ b/src/plugins/mcusupport/mcutarget.cpp
@@ -1,10 +1,11 @@
// Copyright (C) 2022 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
-#include "mcutarget.h"
#include "mcukitmanager.h"
#include "mcupackage.h"
#include "mcusupportplugin.h"
+#include "mcusupporttr.h"
+#include "mcutarget.h"
#include
@@ -86,13 +87,13 @@ void McuTarget::printPackageProblems() const
for (auto package : packages()) {
package->updateStatus();
if (!package->isValidStatus())
- printMessage(tr("Error creating kit for target %1, package %2: %3")
+ printMessage(Tr::tr("Error creating kit for target %1, package %2: %3")
.arg(McuKitManager::generateKitNameFromTarget(this),
package->label(),
package->statusText()),
true);
if (package->status() == McuAbstractPackage::Status::ValidPackageMismatchedVersion)
- printMessage(tr("Warning creating kit for target %1, package %2: %3")
+ printMessage(Tr::tr("Warning creating kit for target %1, package %2: %3")
.arg(McuKitManager::generateKitNameFromTarget(this),
package->label(),
package->statusText()),
diff --git a/src/plugins/mcusupport/mcutargetfactory.cpp b/src/plugins/mcusupport/mcutargetfactory.cpp
index 5e6945a339a..24c8119972d 100644
--- a/src/plugins/mcusupport/mcutargetfactory.cpp
+++ b/src/plugins/mcusupport/mcutargetfactory.cpp
@@ -1,14 +1,15 @@
// Copyright (C) 2022 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
-#include "mcutargetfactory.h"
#include "mcuhelpers.h"
#include "mcupackage.h"
#include "mcusupport_global.h"
#include "mcusupportplugin.h"
+#include "mcusupporttr.h"
#include "mcusupportversiondetection.h"
#include "mcutarget.h"
#include "mcutargetdescription.h"
+#include "mcutargetfactory.h"
#include
#include
@@ -178,24 +179,24 @@ McuToolChainPackage *McuTargetFactory::createToolchain(
QString errorMessage;
if (toolchain.id.isEmpty()) {
- errorMessage = McuPackage::tr("the toolchain.id JSON entry is empty");
+ errorMessage = Tr::tr("the toolchain.id JSON entry is empty");
} else if (!toolchainTypeMapping.contains(toolchain.id)) {
- errorMessage = McuPackage::tr("the given toolchain \"%1\" is not supported").arg(toolchain.id);
+ errorMessage = Tr::tr("the given toolchain \"%1\" is not supported").arg(toolchain.id);
} else if (toolchain.compiler.cmakeVar.isEmpty()) {
- errorMessage = McuPackage::tr("the toolchain.compiler.cmakeVar JSON entry is empty");
+ errorMessage = Tr::tr("the toolchain.compiler.cmakeVar JSON entry is empty");
} else if (toolchain.file.cmakeVar.isEmpty()) {
- errorMessage = McuPackage::tr("the toolchain.file.cmakeVar JSON entry is empty");
+ errorMessage = Tr::tr("the toolchain.file.cmakeVar JSON entry is empty");
}
if (!errorMessage.isEmpty()) {
toolchainType = McuToolChainPackage::ToolChainType::Unsupported;
if (toolchain.id.isEmpty()) {
- printMessage(McuPackage::tr("Toolchain is invalid because %2 in file \"%3\".")
+ printMessage(Tr::tr("Toolchain is invalid because %2 in file \"%3\".")
.arg(errorMessage).arg(sourceFile.toUserOutput()),
true);
} else {
- printMessage(McuPackage::tr("Toolchain description for \"%1\" is invalid because %2 in file \"%3\".")
+ printMessage(Tr::tr("Toolchain description for \"%1\" is invalid because %2 in file \"%3\".")
.arg(toolchain.id).arg(errorMessage).arg(sourceFile.toUserOutput()),
true);
}