())
@@ -799,8 +794,8 @@ DeviceTypeKitAspect::DeviceTypeKitAspect()
{
setObjectName(QLatin1String("DeviceTypeInformation"));
setId(DeviceTypeKitAspect::id());
- setDisplayName(tr("Device type"));
- setDescription(tr("The type of device to run applications on."));
+ setDisplayName(Tr::tr("Device type"));
+ setDescription(Tr::tr("The type of device to run applications on."));
setPriority(33000);
makeEssential();
}
@@ -827,12 +822,12 @@ KitAspect::ItemList DeviceTypeKitAspect::toUserOutput(const Kit *k) const
{
QTC_ASSERT(k, return {});
Id type = deviceTypeId(k);
- QString typeDisplayName = tr("Unknown device type");
+ QString typeDisplayName = Tr::tr("Unknown device type");
if (type.isValid()) {
if (IDeviceFactory *factory = IDeviceFactory::find(type))
typeDisplayName = factory->displayName();
}
- return {{tr("Device type"), typeDisplayName}};
+ return {{Tr::tr("Device type"), typeDisplayName}};
}
const Id DeviceTypeKitAspect::id()
@@ -870,8 +865,6 @@ QSet DeviceTypeKitAspect::availableFeatures(const Kit *k) const
namespace Internal {
class DeviceKitAspectWidget final : public KitAspectWidget
{
- Q_DECLARE_TR_FUNCTIONS(ProjectExplorer::DeviceKitAspect)
-
public:
DeviceKitAspectWidget(Kit *workingCopy, const KitAspect *ki)
: KitAspectWidget(workingCopy, ki),
@@ -948,8 +941,8 @@ DeviceKitAspect::DeviceKitAspect()
{
setObjectName(QLatin1String("DeviceInformation"));
setId(DeviceKitAspect::id());
- setDisplayName(tr("Device"));
- setDescription(tr("The device to run the applications on."));
+ setDisplayName(Tr::tr("Device"));
+ setDescription(Tr::tr("The device to run the applications on."));
setPriority(32000);
connect(KitManager::instance(), &KitManager::kitsLoaded,
@@ -978,9 +971,9 @@ Tasks DeviceKitAspect::validate(const Kit *k) const
IDevice::ConstPtr dev = DeviceKitAspect::device(k);
Tasks result;
if (dev.isNull())
- result.append(BuildSystemTask(Task::Warning, tr("No device set.")));
+ result.append(BuildSystemTask(Task::Warning, Tr::tr("No device set.")));
else if (!dev->isCompatibleWith(k))
- result.append(BuildSystemTask(Task::Error, tr("Device is incompatible with this kit.")));
+ result.append(BuildSystemTask(Task::Error, Tr::tr("Device is incompatible with this kit.")));
if (dev)
result.append(dev->validate());
@@ -1023,33 +1016,33 @@ QString DeviceKitAspect::displayNamePostfix(const Kit *k) const
KitAspect::ItemList DeviceKitAspect::toUserOutput(const Kit *k) const
{
IDevice::ConstPtr dev = device(k);
- return {{tr("Device"), dev.isNull() ? tr("Unconfigured") : dev->displayName()}};
+ return {{Tr::tr("Device"), dev.isNull() ? Tr::tr("Unconfigured") : dev->displayName()}};
}
void DeviceKitAspect::addToMacroExpander(Kit *kit, MacroExpander *expander) const
{
QTC_ASSERT(kit, return);
- expander->registerVariable("Device:HostAddress", tr("Host address"),
+ expander->registerVariable("Device:HostAddress", Tr::tr("Host address"),
[kit]() -> QString {
const IDevice::ConstPtr device = DeviceKitAspect::device(kit);
return device ? device->sshParameters().host() : QString();
});
- expander->registerVariable("Device:SshPort", tr("SSH port"),
+ expander->registerVariable("Device:SshPort", Tr::tr("SSH port"),
[kit]() -> QString {
const IDevice::ConstPtr device = DeviceKitAspect::device(kit);
return device ? QString::number(device->sshParameters().port()) : QString();
});
- expander->registerVariable("Device:UserName", tr("User name"),
+ expander->registerVariable("Device:UserName", Tr::tr("User name"),
[kit]() -> QString {
const IDevice::ConstPtr device = DeviceKitAspect::device(kit);
return device ? device->sshParameters().userName() : QString();
});
- expander->registerVariable("Device:KeyFile", tr("Private key file"),
+ expander->registerVariable("Device:KeyFile", Tr::tr("Private key file"),
[kit]() -> QString {
const IDevice::ConstPtr device = DeviceKitAspect::device(kit);
return device ? device->sshParameters().privateKeyFile.toString() : QString();
});
- expander->registerVariable("Device:Name", tr("Device name"),
+ expander->registerVariable("Device:Name", Tr::tr("Device name"),
[kit]() -> QString {
const IDevice::ConstPtr device = DeviceKitAspect::device(kit);
return device ? device->displayName() : QString();
@@ -1135,8 +1128,6 @@ void DeviceKitAspect::devicesChanged()
namespace Internal {
class BuildDeviceKitAspectWidget final : public KitAspectWidget
{
- Q_DECLARE_TR_FUNCTIONS(ProjectExplorer::BuildDeviceKitAspect)
-
public:
BuildDeviceKitAspectWidget(Kit *workingCopy, const KitAspect *ki)
: KitAspectWidget(workingCopy, ki),
@@ -1219,8 +1210,8 @@ BuildDeviceKitAspect::BuildDeviceKitAspect()
{
setObjectName("BuildDeviceInformation");
setId(BuildDeviceKitAspect::id());
- setDisplayName(tr("Build device"));
- setDescription(tr("The device used to build applications on."));
+ setDisplayName(Tr::tr("Build device"));
+ setDescription(Tr::tr("The device used to build applications on."));
setPriority(31900);
connect(KitManager::instance(), &KitManager::kitsLoaded,
@@ -1248,7 +1239,7 @@ Tasks BuildDeviceKitAspect::validate(const Kit *k) const
IDevice::ConstPtr dev = BuildDeviceKitAspect::device(k);
Tasks result;
if (dev.isNull())
- result.append(BuildSystemTask(Task::Warning, tr("No build device set.")));
+ result.append(BuildSystemTask(Task::Warning, Tr::tr("No build device set.")));
return result;
}
@@ -1268,33 +1259,33 @@ QString BuildDeviceKitAspect::displayNamePostfix(const Kit *k) const
KitAspect::ItemList BuildDeviceKitAspect::toUserOutput(const Kit *k) const
{
IDevice::ConstPtr dev = device(k);
- return {{tr("Build device"), dev.isNull() ? tr("Unconfigured") : dev->displayName()}};
+ return {{Tr::tr("Build device"), dev.isNull() ? Tr::tr("Unconfigured") : dev->displayName()}};
}
void BuildDeviceKitAspect::addToMacroExpander(Kit *kit, MacroExpander *expander) const
{
QTC_ASSERT(kit, return);
- expander->registerVariable("BuildDevice:HostAddress", tr("Build host address"),
+ expander->registerVariable("BuildDevice:HostAddress", Tr::tr("Build host address"),
[kit]() -> QString {
const IDevice::ConstPtr device = BuildDeviceKitAspect::device(kit);
return device ? device->sshParameters().host() : QString();
});
- expander->registerVariable("BuildDevice:SshPort", tr("Build SSH port"),
+ expander->registerVariable("BuildDevice:SshPort", Tr::tr("Build SSH port"),
[kit]() -> QString {
const IDevice::ConstPtr device = BuildDeviceKitAspect::device(kit);
return device ? QString::number(device->sshParameters().port()) : QString();
});
- expander->registerVariable("BuildDevice:UserName", tr("Build user name"),
+ expander->registerVariable("BuildDevice:UserName", Tr::tr("Build user name"),
[kit]() -> QString {
const IDevice::ConstPtr device = BuildDeviceKitAspect::device(kit);
return device ? device->sshParameters().userName() : QString();
});
- expander->registerVariable("BuildDevice:KeyFile", tr("Build private key file"),
+ expander->registerVariable("BuildDevice:KeyFile", Tr::tr("Build private key file"),
[kit]() -> QString {
const IDevice::ConstPtr device = BuildDeviceKitAspect::device(kit);
return device ? device->sshParameters().privateKeyFile.toString() : QString();
});
- expander->registerVariable("BuildDevice:Name", tr("Build device name"),
+ expander->registerVariable("BuildDevice:Name", Tr::tr("Build device name"),
[kit]() -> QString {
const IDevice::ConstPtr device = BuildDeviceKitAspect::device(kit);
return device ? device->displayName() : QString();
@@ -1376,8 +1367,6 @@ void BuildDeviceKitAspect::devicesChanged()
namespace Internal {
class EnvironmentKitAspectWidget final : public KitAspectWidget
{
- Q_DECLARE_TR_FUNCTIONS(ProjectExplorer::EnvironmentKitAspect)
-
public:
EnvironmentKitAspectWidget(Kit *workingCopy, const KitAspect *ki)
: KitAspectWidget(workingCopy, ki),
@@ -1392,7 +1381,7 @@ public:
initMSVCOutputSwitch(layout);
m_mainWidget->setLayout(layout);
refresh();
- m_manageButton->setText(tr("Change..."));
+ m_manageButton->setText(Tr::tr("Change..."));
connect(m_manageButton, &QAbstractButton::clicked,
this, &EnvironmentKitAspectWidget::editEnvironmentChanges);
}
@@ -1411,7 +1400,7 @@ private:
{
const EnvironmentItems changes = currentEnvironment();
const QString shortSummary = EnvironmentItem::toStringList(changes).join("; ");
- m_summaryLabel->setText(shortSummary.isEmpty() ? tr("No changes to apply.") : shortSummary);
+ m_summaryLabel->setText(shortSummary.isEmpty() ? Tr::tr("No changes to apply.") : shortSummary);
}
void editEnvironmentChanges()
@@ -1454,9 +1443,9 @@ private:
void initMSVCOutputSwitch(QVBoxLayout *layout)
{
- m_vslangCheckbox = new QCheckBox(tr("Force UTF-8 MSVC compiler output"));
+ m_vslangCheckbox = new QCheckBox(Tr::tr("Force UTF-8 MSVC compiler output"));
layout->addWidget(m_vslangCheckbox);
- m_vslangCheckbox->setToolTip(tr("Either switches MSVC to English or keeps the language and "
+ m_vslangCheckbox->setToolTip(Tr::tr("Either switches MSVC to English or keeps the language and "
"just forces UTF-8 output (may vary depending on the used MSVC "
"compiler)."));
connect(m_vslangCheckbox, &QCheckBox::toggled, this, [this](bool checked) {
@@ -1481,8 +1470,8 @@ EnvironmentKitAspect::EnvironmentKitAspect()
{
setObjectName(QLatin1String("EnvironmentKitAspect"));
setId(EnvironmentKitAspect::id());
- setDisplayName(tr("Environment"));
- setDescription(tr("Additional build environment settings when using this kit."));
+ setDisplayName(Tr::tr("Environment"));
+ setDescription(Tr::tr("Additional build environment settings when using this kit."));
setPriority(29000);
}
@@ -1493,7 +1482,7 @@ Tasks EnvironmentKitAspect::validate(const Kit *k) const
const QVariant variant = k->value(EnvironmentKitAspect::id());
if (!variant.isNull() && !variant.canConvert(QVariant::List))
- result << BuildSystemTask(Task::Error, tr("The environment setting value is invalid."));
+ result << BuildSystemTask(Task::Error, Tr::tr("The environment setting value is invalid."));
return result;
}
@@ -1530,7 +1519,7 @@ KitAspectWidget *EnvironmentKitAspect::createConfigWidget(Kit *k) const
KitAspect::ItemList EnvironmentKitAspect::toUserOutput(const Kit *k) const
{
- return {{tr("Environment"), EnvironmentItem::toStringList(environmentChanges(k)).join("
")}};
+ return {{Tr::tr("Environment"), EnvironmentItem::toStringList(environmentChanges(k)).join("
")}};
}
Id EnvironmentKitAspect::id()
diff --git a/src/plugins/projectexplorer/kitmanager.cpp b/src/plugins/projectexplorer/kitmanager.cpp
index 363a024b5f2..ba92819c39a 100644
--- a/src/plugins/projectexplorer/kitmanager.cpp
+++ b/src/plugins/projectexplorer/kitmanager.cpp
@@ -11,6 +11,7 @@
#include "kitmanagerconfigwidget.h"
#include "project.h"
#include "projectexplorerconstants.h"
+#include "projectexplorertr.h"
#include "task.h"
#include "toolchainmanager.h"
@@ -344,7 +345,7 @@ void KitManager::restoreKits()
continue;
}
if (isHostKit(kit.get()))
- kit->setUnexpandedDisplayName(tr("Desktop (%1)").arg(it.key().toString()));
+ kit->setUnexpandedDisplayName(Tr::tr("Desktop (%1)").arg(it.key().toString()));
else
kit->setUnexpandedDisplayName(it.key().toString());
DeviceTypeKitAspect::setDeviceTypeId(kit.get(), deviceTypeForKit(kit.get()));
@@ -396,7 +397,7 @@ void KitManager::restoreKits()
}
if (hostKits.size() == 1)
- hostKits.first()->setUnexpandedDisplayName(tr("Desktop"));
+ hostKits.first()->setUnexpandedDisplayName(Tr::tr("Desktop"));
}
Kit *k = kitForBinary;
@@ -726,7 +727,7 @@ KitAspectWidget::KitAspectWidget(Kit *kit, const KitAspect *ki)
: m_kit(kit), m_kitInformation(ki)
{
const Id id = ki->id();
- m_mutableAction = new QAction(tr("Mark as Mutable"));
+ m_mutableAction = new QAction(Tr::tr("Mark as Mutable"));
m_mutableAction->setCheckable(true);
m_mutableAction->setChecked(m_kit->isMutable(id));
m_mutableAction->setEnabled(!m_kit->isSticky(id));
@@ -773,7 +774,7 @@ QWidget *KitAspectWidget::createManageButton(Id pageId)
QString KitAspectWidget::msgManage()
{
- return tr("Manage...");
+ return Tr::tr("Manage...");
}
// --------------------------------------------------------------------
diff --git a/src/plugins/projectexplorer/kitmanagerconfigwidget.cpp b/src/plugins/projectexplorer/kitmanagerconfigwidget.cpp
index bf69875dae2..908238d3a7f 100644
--- a/src/plugins/projectexplorer/kitmanagerconfigwidget.cpp
+++ b/src/plugins/projectexplorer/kitmanagerconfigwidget.cpp
@@ -2,13 +2,12 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include "kitmanagerconfigwidget.h"
-#include "projectconfiguration.h"
#include "devicesupport/idevicefactory.h"
#include "kit.h"
#include "kitinformation.h"
#include "kitmanager.h"
-#include "projectexplorerconstants.h"
+#include "projectexplorertr.h"
#include "task.h"
#include
@@ -46,11 +45,11 @@ KitManagerConfigWidget::KitManagerConfigWidget(Kit *k) :
{
setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
- auto label = new QLabel(tr("Name:"));
- label->setToolTip(tr("Kit name and icon."));
+ auto label = new QLabel(Tr::tr("Name:"));
+ label->setToolTip(Tr::tr("Kit name and icon."));
QString toolTip =
- tr("The name of the kit suitable for generating "
+ Tr::tr("
The name of the kit suitable for generating "
"directory names. This value is used for the variable %1, "
"which for example determines the name of the shadow build directory."
"
").arg(QLatin1String("Kit:FileSystemName"));
@@ -59,7 +58,7 @@ KitManagerConfigWidget::KitManagerConfigWidget(Kit *k) :
Q_ASSERT(fileSystemFriendlyNameRegexp.isValid());
m_fileSystemFriendlyNameLineEdit->setValidator(new QRegularExpressionValidator(fileSystemFriendlyNameRegexp, m_fileSystemFriendlyNameLineEdit));
- auto fsLabel = new QLabel(tr("File system name:"));
+ auto fsLabel = new QLabel(Tr::tr("File system name:"));
fsLabel->setToolTip(toolTip);
connect(m_fileSystemFriendlyNameLineEdit, &QLineEdit::textChanged,
this, &KitManagerConfigWidget::setFileSystemFriendlyName);
@@ -70,10 +69,10 @@ KitManagerConfigWidget::KitManagerConfigWidget(Kit *k) :
fsLabel, m_fileSystemFriendlyNameLineEdit
}.attachTo(this, WithFormAlignment);
- m_iconButton->setToolTip(tr("Kit icon."));
- auto setIconAction = new QAction(tr("Select Icon..."), this);
+ m_iconButton->setToolTip(Tr::tr("Kit icon."));
+ auto setIconAction = new QAction(Tr::tr("Select Icon..."), this);
m_iconButton->addAction(setIconAction);
- auto resetIconAction = new QAction(tr("Reset to Device Default Icon"), this);
+ auto resetIconAction = new QAction(Tr::tr("Reset to Device Default Icon"), this);
m_iconButton->addAction(resetIconAction);
discard();
@@ -183,7 +182,7 @@ QString KitManagerConfigWidget::validityMessage() const
{
Tasks tmp;
if (!m_hasUniqueName)
- tmp.append(CompileTask(Task::Warning, tr("Display name is not unique.")));
+ tmp.append(CompileTask(Task::Warning, Tr::tr("Display name is not unique.")));
return m_modifiedKit->toHtml(tmp);
}
@@ -276,7 +275,7 @@ void KitManagerConfigWidget::setIcon()
if (factory->icon().isNull())
continue;
QAction *action = iconMenu.addAction(factory->icon(),
- tr("Default for %1").arg(factory->displayName()),
+ Tr::tr("Default for %1").arg(factory->displayName()),
[this, factory] {
m_iconButton->setIcon(factory->icon());
m_modifiedKit->setDeviceTypeForIcon(
@@ -287,9 +286,9 @@ void KitManagerConfigWidget::setIcon()
}
iconMenu.addSeparator();
iconMenu.addAction(PathChooser::browseButtonLabel(), [this] {
- const FilePath path = FileUtils::getOpenFilePath(this, tr("Select Icon"),
+ const FilePath path = FileUtils::getOpenFilePath(this, Tr::tr("Select Icon"),
m_modifiedKit->iconPath(),
- tr("Images (*.png *.xpm *.jpg)"));
+ Tr::tr("Images (*.png *.xpm *.jpg)"));
if (path.isEmpty())
return;
const QIcon icon(path.toString());
diff --git a/src/plugins/projectexplorer/kitmodel.cpp b/src/plugins/projectexplorer/kitmodel.cpp
index 92b69561402..4b250f23c98 100644
--- a/src/plugins/projectexplorer/kitmodel.cpp
+++ b/src/plugins/projectexplorer/kitmodel.cpp
@@ -6,8 +6,9 @@
#include "kit.h"
#include "kitmanagerconfigwidget.h"
#include "kitmanager.h"
+#include "projectexplorerconstants.h"
+#include "projectexplorertr.h"
-#include
#include
#include
#include
@@ -60,7 +61,7 @@ public:
QString baseName = widget->displayName();
if (widget->isDefaultKit())
//: Mark up a kit as the default one.
- baseName = KitModel::tr("%1 (default)").arg(baseName);
+ baseName = Tr::tr("%1 (default)").arg(baseName);
return baseName;
}
if (role == Qt::DecorationRole) {
@@ -84,7 +85,7 @@ KitModel::KitModel(QBoxLayout *parentLayout, QObject *parent)
: TreeModel(parent),
m_parentLayout(parentLayout)
{
- setHeader(QStringList(tr("Name")));
+ setHeader(QStringList(Tr::tr("Name")));
m_autoRoot = new StaticTreeItem({ProjectExplorer::Constants::msgAutoDetected()},
{ProjectExplorer::Constants::msgAutoDetectedToolTip()});
m_manualRoot = new StaticTreeItem(ProjectExplorer::Constants::msgManual());
diff --git a/src/plugins/projectexplorer/kitoptionspage.cpp b/src/plugins/projectexplorer/kitoptionspage.cpp
index caf95211be2..d5c709194a1 100644
--- a/src/plugins/projectexplorer/kitoptionspage.cpp
+++ b/src/plugins/projectexplorer/kitoptionspage.cpp
@@ -7,7 +7,7 @@
#include "kitmodel.h"
#include "kit.h"
#include "projectexplorerconstants.h"
-#include "projectexplorericons.h"
+#include "projectexplorertr.h"
#include "kitmanagerconfigwidget.h"
#include "kitmanager.h"
@@ -29,8 +29,6 @@ namespace Internal {
class KitOptionsPageWidget : public QWidget
{
- Q_DECLARE_TR_FUNCTIONS(ProjextExplorer::Internal::KitOptionsPageWidget)
-
public:
KitOptionsPageWidget();
@@ -66,14 +64,14 @@ KitOptionsPageWidget::KitOptionsPageWidget()
m_kitsView->setSizePolicy(m_kitsView->sizePolicy().horizontalPolicy(),
QSizePolicy::Ignored);
- m_addButton = new QPushButton(tr("Add"), this);
- m_cloneButton = new QPushButton(tr("Clone"), this);
- m_delButton = new QPushButton(tr("Remove"), this);
- m_makeDefaultButton = new QPushButton(tr("Make Default"), this);
- m_filterButton = new QPushButton(tr("Settings Filter..."), this);
- m_filterButton->setToolTip(tr("Choose which settings to display for this kit."));
- m_defaultFilterButton = new QPushButton(tr("Default Settings Filter..."), this);
- m_defaultFilterButton->setToolTip(tr("Choose which kit settings to display by default."));
+ m_addButton = new QPushButton(Tr::tr("Add"), this);
+ m_cloneButton = new QPushButton(Tr::tr("Clone"), this);
+ m_delButton = new QPushButton(Tr::tr("Remove"), this);
+ m_makeDefaultButton = new QPushButton(Tr::tr("Make Default"), this);
+ m_filterButton = new QPushButton(Tr::tr("Settings Filter..."), this);
+ m_filterButton->setToolTip(Tr::tr("Choose which settings to display for this kit."));
+ m_defaultFilterButton = new QPushButton(Tr::tr("Default Settings Filter..."), this);
+ m_defaultFilterButton->setToolTip(Tr::tr("Choose which kit settings to display by default."));
auto buttonLayout = new QVBoxLayout;
buttonLayout->setSpacing(6);
@@ -247,9 +245,9 @@ KitOptionsPage::KitOptionsPage()
{
theKitOptionsPage = this;
setId(Constants::KITS_SETTINGS_PAGE_ID);
- setDisplayName(Internal::KitOptionsPageWidget::tr("Kits"));
+ setDisplayName(Tr::tr("Kits"));
setCategory(Constants::KITS_SETTINGS_CATEGORY);
- setDisplayCategory(QCoreApplication::translate("::ProjectExplorer", "Kits"));
+ setDisplayCategory(Tr::tr("Kits"));
setCategoryIconPath(":/projectexplorer/images/settingscategory_kits.png");
}
diff --git a/src/plugins/projectexplorer/localenvironmentaspect.cpp b/src/plugins/projectexplorer/localenvironmentaspect.cpp
index 2167c5ee633..7510d636e5f 100644
--- a/src/plugins/projectexplorer/localenvironmentaspect.cpp
+++ b/src/plugins/projectexplorer/localenvironmentaspect.cpp
@@ -4,8 +4,8 @@
#include "localenvironmentaspect.h"
#include "buildconfiguration.h"
-#include "environmentaspectwidget.h"
#include "kit.h"
+#include "projectexplorertr.h"
#include "target.h"
using namespace Utils;
@@ -15,14 +15,14 @@ namespace ProjectExplorer {
LocalEnvironmentAspect::LocalEnvironmentAspect(Target *target, bool includeBuildEnvironment)
{
setIsLocal(true);
- addSupportedBaseEnvironment(tr("Clean Environment"), {});
+ addSupportedBaseEnvironment(Tr::tr("Clean Environment"), {});
- addSupportedBaseEnvironment(tr("System Environment"), [] {
+ addSupportedBaseEnvironment(Tr::tr("System Environment"), [] {
return Environment::systemEnvironment();
});
if (includeBuildEnvironment) {
- addPreferredBaseEnvironment(tr("Build Environment"), [target] {
+ addPreferredBaseEnvironment(Tr::tr("Build Environment"), [target] {
Environment env;
if (BuildConfiguration *bc = target->activeBuildConfiguration()) {
env = bc->environment();
diff --git a/src/plugins/projectexplorer/makestep.cpp b/src/plugins/projectexplorer/makestep.cpp
index 2503c570d11..57ebc2490b3 100644
--- a/src/plugins/projectexplorer/makestep.cpp
+++ b/src/plugins/projectexplorer/makestep.cpp
@@ -9,6 +9,7 @@
#include "processparameters.h"
#include "projectexplorer.h"
#include "projectexplorerconstants.h"
+#include "projectexplorertr.h"
#include "target.h"
#include "toolchain.h"
@@ -57,41 +58,41 @@ MakeStep::MakeStep(BuildStepList *parent, Id id)
m_userArgumentsAspect = addAspect();
m_userArgumentsAspect->setSettingsKey(id.withSuffix(MAKE_ARGUMENTS_SUFFIX).toString());
- m_userArgumentsAspect->setLabelText(tr("Make arguments:"));
+ m_userArgumentsAspect->setLabelText(Tr::tr("Make arguments:"));
m_userArgumentsAspect->setDisplayStyle(StringAspect::LineEditDisplay);
m_userJobCountAspect = addAspect();
m_userJobCountAspect->setSettingsKey(id.withSuffix(JOBCOUNT_SUFFIX).toString());
- m_userJobCountAspect->setLabel(tr("Parallel jobs:"));
+ m_userJobCountAspect->setLabel(Tr::tr("Parallel jobs:"));
m_userJobCountAspect->setRange(1, 999);
m_userJobCountAspect->setValue(defaultJobCount());
m_userJobCountAspect->setDefaultValue(defaultJobCount());
- const QString text = tr("Override MAKEFLAGS");
+ const QString text = Tr::tr("Override MAKEFLAGS");
m_overrideMakeflagsAspect = addAspect();
m_overrideMakeflagsAspect->setSettingsKey(id.withSuffix(OVERRIDE_MAKEFLAGS_SUFFIX).toString());
m_overrideMakeflagsAspect->setLabel(text, BoolAspect::LabelPlacement::AtCheckBox);
m_nonOverrideWarning = addAspect();
m_nonOverrideWarning->setText("" +
- tr("MAKEFLAGS
specifies parallel jobs. Check \"%1\" to override.")
+ Tr::tr("MAKEFLAGS
specifies parallel jobs. Check \"%1\" to override.")
.arg(text) + "
");
m_nonOverrideWarning->setIconType(InfoLabel::Warning);
m_disabledForSubdirsAspect = addAspect();
m_disabledForSubdirsAspect->setSettingsKey(id.withSuffix(".disabledForSubdirs").toString());
- m_disabledForSubdirsAspect->setLabel(tr("Disable in subdirectories:"));
- m_disabledForSubdirsAspect->setToolTip(tr("Runs this step only for a top-level build."));
+ m_disabledForSubdirsAspect->setLabel(Tr::tr("Disable in subdirectories:"));
+ m_disabledForSubdirsAspect->setToolTip(Tr::tr("Runs this step only for a top-level build."));
m_buildTargetsAspect = addAspect();
m_buildTargetsAspect->setSettingsKey(id.withSuffix(BUILD_TARGETS_SUFFIX).toString());
- m_buildTargetsAspect->setLabelText(tr("Targets:"));
+ m_buildTargetsAspect->setLabelText(Tr::tr("Targets:"));
const auto updateMakeLabel = [this] {
const FilePath defaultMake = defaultMakeCommand();
const QString labelText = defaultMake.isEmpty()
- ? tr("Make:")
- : tr("Override %1:").arg(defaultMake.toUserOutput());
+ ? Tr::tr("Make:")
+ : Tr::tr("Override %1:").arg(defaultMake.toUserOutput());
m_makeCommandAspect->setLabelText(labelText);
};
@@ -137,7 +138,7 @@ void MakeStep::setupOutputFormatter(OutputFormatter *formatter)
QString MakeStep::defaultDisplayName()
{
- return tr("Make");
+ return Tr::tr("Make");
}
static const QList preferredToolChains(const Kit *kit)
@@ -169,7 +170,7 @@ FilePath MakeStep::defaultMakeCommand() const
QString MakeStep::msgNoMakeCommand()
{
- return tr("Make command missing. Specify Make command in step configuration.");
+ return Tr::tr("Make command missing. Specify Make command in step configuration.");
}
Task MakeStep::makeCommandMissingTask()
@@ -331,10 +332,10 @@ QWidget *MakeStep::createConfigWidget()
setSummaryUpdater([this] {
const CommandLine make = effectiveMakeCommand(MakeStep::Display);
if (make.executable().isEmpty())
- return tr("Make: %1").arg(MakeStep::msgNoMakeCommand());
+ return Tr::tr("Make: %1").arg(MakeStep::msgNoMakeCommand());
if (!buildConfiguration())
- return tr("Make: No build configuration.");
+ return Tr::tr("Make: No build configuration.");
ProcessParameters param;
param.setMacroExpander(macroExpander());
@@ -343,7 +344,7 @@ QWidget *MakeStep::createConfigWidget()
param.setEnvironment(buildEnvironment());
if (param.commandMissing()) {
- return tr("Make: %1 not found in the environment.")
+ return Tr::tr("Make: %1 not found in the environment.")
.arg(param.command().executable().toUserOutput()); // Override display text
}
diff --git a/src/plugins/projectexplorer/miniprojecttargetselector.cpp b/src/plugins/projectexplorer/miniprojecttargetselector.cpp
index 46cfa068c01..77a515d818a 100644
--- a/src/plugins/projectexplorer/miniprojecttargetselector.cpp
+++ b/src/plugins/projectexplorer/miniprojecttargetselector.cpp
@@ -12,6 +12,7 @@
#include "projectexplorer.h"
#include "projectexplorerconstants.h"
#include "projectexplorericons.h"
+#include "projectexplorertr.h"
#include "runconfiguration.h"
#include "session.h"
#include "target.h"
@@ -121,7 +122,7 @@ private:
QVariant data(int column, int role) const override
{
if (column == 1 && role == Qt::ToolTipRole)
- return QCoreApplication::translate("RunConfigSelector", "Run Without Deployment");
+ return Tr::tr("Run Without Deployment");
if (column != 0)
return {};
switch (role) {
@@ -676,14 +677,14 @@ MiniProjectTargetSelector::MiniProjectTargetSelector(QAction *targetSelectorActi
m_titleWidgets.resize(LAST);
m_listWidgets[PROJECT] = nullptr; //project is not a generic list widget
- m_titleWidgets[PROJECT] = createTitleLabel(tr("Project"));
+ m_titleWidgets[PROJECT] = createTitleLabel(Tr::tr("Project"));
m_projectListWidget = new ProjectListView(this);
connect(m_projectListWidget, &QAbstractItemView::doubleClicked,
this, &MiniProjectTargetSelector::hide);
QStringList titles;
- titles << tr("Kit") << tr("Build")
- << tr("Deploy") << tr("Run");
+ titles << Tr::tr("Kit") << Tr::tr("Build")
+ << Tr::tr("Deploy") << Tr::tr("Run");
for (int i = TARGET; i < LAST; ++i) {
m_titleWidgets[i] = createTitleLabel(titles.at(i -1));
@@ -1487,24 +1488,24 @@ void MiniProjectTargetSelector::updateActionAndSummary()
}
m_projectAction->setProperty("heading", projectName);
if (project && project->needsConfiguration())
- m_projectAction->setProperty("subtitle", tr("Unconfigured"));
+ m_projectAction->setProperty("subtitle", Tr::tr("Unconfigured"));
else
m_projectAction->setProperty("subtitle", buildConfig);
m_projectAction->setIcon(targetIcon);
QStringList lines;
- lines << tr("Project: %1").arg(projectName);
+ lines << Tr::tr("Project: %1").arg(projectName);
if (!fileName.isEmpty())
- lines << tr("Path: %1").arg(fileName);
+ lines << Tr::tr("Path: %1").arg(fileName);
if (!targetName.isEmpty())
- lines << tr("Kit: %1").arg(targetName);
+ lines << Tr::tr("Kit: %1").arg(targetName);
if (!buildConfig.isEmpty())
- lines << tr("Build: %1").arg(buildConfig);
+ lines << Tr::tr("Build: %1").arg(buildConfig);
if (!deployConfig.isEmpty())
- lines << tr("Deploy: %1").arg(deployConfig);
+ lines << Tr::tr("Deploy: %1").arg(deployConfig);
if (!runConfig.isEmpty())
- lines << tr("Run: %1").arg(runConfig);
+ lines << Tr::tr("Run: %1").arg(runConfig);
if (!targetToolTipText.isEmpty())
- lines << tr("%1").arg(targetToolTipText);
+ lines << Tr::tr("%1").arg(targetToolTipText);
QString toolTip = QString("%1")
.arg(lines.join(QLatin1String("
")));
m_projectAction->setToolTip(toolTip);
@@ -1516,21 +1517,21 @@ void MiniProjectTargetSelector::updateSummary()
QString summary;
if (Project *startupProject = SessionManager::startupProject()) {
if (!m_projectListWidget->isVisibleTo(this))
- summary.append(tr("Project: %1
").arg(startupProject->displayName()));
+ summary.append(Tr::tr("Project: %1
").arg(startupProject->displayName()));
if (Target *activeTarget = startupProject->activeTarget()) {
if (!m_listWidgets[TARGET]->isVisibleTo(this))
- summary.append(tr("Kit: %1
").arg( activeTarget->displayName()));
+ summary.append(Tr::tr("Kit: %1
").arg( activeTarget->displayName()));
if (!m_listWidgets[BUILD]->isVisibleTo(this) && activeTarget->activeBuildConfiguration())
- summary.append(tr("Build: %1
").arg(
+ summary.append(Tr::tr("Build: %1
").arg(
activeTarget->activeBuildConfiguration()->displayName()));
if (!m_listWidgets[DEPLOY]->isVisibleTo(this) && activeTarget->activeDeployConfiguration())
- summary.append(tr("Deploy: %1
").arg(
+ summary.append(Tr::tr("Deploy: %1
").arg(
activeTarget->activeDeployConfiguration()->displayName()));
if (!m_listWidgets[RUN]->isVisibleTo(this) && activeTarget->activeRunConfiguration())
- summary.append(tr("Run: %1
").arg(
+ summary.append(Tr::tr("Run: %1
").arg(
activeTarget->activeRunConfiguration()->expandedDisplayName()));
} else if (startupProject->needsConfiguration()) {
- summary = tr(""
"The project %1 is not yet configured
"
"You can configure it in the Projects mode
")
diff --git a/src/plugins/projectexplorer/msvctoolchain.cpp b/src/plugins/projectexplorer/msvctoolchain.cpp
index 180eb3d3b55..704bc92d12b 100644
--- a/src/plugins/projectexplorer/msvctoolchain.cpp
+++ b/src/plugins/projectexplorer/msvctoolchain.cpp
@@ -859,7 +859,7 @@ MsvcToolChain::MsvcToolChain(Utils::Id typeId)
: ToolChain(typeId)
{
setDisplayName("Microsoft Visual C++ Compiler");
- setTypeDisplayName(tr("MSVC"));
+ setTypeDisplayName(Tr::tr("MSVC"));
addToAvailableMsvcToolchains(this);
setTargetAbiKey(KEY_ROOT "SupportedAbi");
}
@@ -1274,7 +1274,7 @@ MsvcBasedToolChainConfigWidget::MsvcBasedToolChainConfigWidget(ToolChain *tc)
m_nameDisplayLabel->setTextInteractionFlags(Qt::TextBrowserInteraction);
m_mainLayout->addRow(m_nameDisplayLabel);
m_varsBatDisplayLabel->setTextInteractionFlags(Qt::TextBrowserInteraction);
- m_mainLayout->addRow(tr("Initialization:"), m_varsBatDisplayLabel);
+ m_mainLayout->addRow(Tr::tr("Initialization:"), m_varsBatDisplayLabel);
}
static QString msvcVarsToDisplay(const MsvcToolChain &tc)
@@ -1322,7 +1322,7 @@ MsvcToolChainConfigWidget::MsvcToolChainConfigWidget(ToolChain *tc)
const bool isAmd64
= Utils::HostOsInfo::hostArchitecture() == Utils::HostOsInfo::HostArchitectureAMD64;
// TODO: Add missing values to MsvcToolChain::Platform
- m_varsBatArchCombo->addItem(tr(""), isAmd64 ? MsvcToolChain::amd64 : MsvcToolChain::x86);
+ m_varsBatArchCombo->addItem(Tr::tr(""), isAmd64 ? MsvcToolChain::amd64 : MsvcToolChain::x86);
m_varsBatArchCombo->addItem("x86", MsvcToolChain::x86);
m_varsBatArchCombo->addItem("amd64", MsvcToolChain::amd64);
m_varsBatArchCombo->addItem("arm", MsvcToolChain::arm);
@@ -1338,12 +1338,12 @@ MsvcToolChainConfigWidget::MsvcToolChainConfigWidget(ToolChain *tc)
m_varsBatArchCombo->addItem("arm64_x86", MsvcToolChain::arm64_x86);
m_varsBatArchCombo->addItem("arm64_amd64", MsvcToolChain::arm64_amd64);
m_varsBatArgumentsEdit->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
- m_varsBatArgumentsEdit->setToolTip(tr("Additional arguments for the vcvarsall.bat call"));
+ m_varsBatArgumentsEdit->setToolTip(Tr::tr("Additional arguments for the vcvarsall.bat call"));
hLayout->addWidget(m_varsBatPathCombo);
hLayout->addWidget(m_varsBatArchCombo);
hLayout->addWidget(m_varsBatArgumentsEdit);
- m_mainLayout->addRow(tr("Initialization:"), hLayout);
- m_mainLayout->addRow(tr("&ABI:"), m_abiWidget);
+ m_mainLayout->addRow(Tr::tr("Initialization:"), hLayout);
+ m_mainLayout->addRow(Tr::tr("&ABI:"), m_abiWidget);
addErrorLabel();
setFromMsvcToolChain();
@@ -1472,7 +1472,7 @@ void MsvcToolChainConfigWidget::handleVcVarsArchChange(const QString &)
QString MsvcToolChainConfigWidget::vcVarsArguments() const
{
QString varsBatArg
- = m_varsBatArchCombo->currentText() == tr("")
+ = m_varsBatArchCombo->currentText() == Tr::tr("")
? "" : m_varsBatArchCombo->currentText();
if (!m_varsBatArgumentsEdit->text().isEmpty())
varsBatArg += QLatin1Char(' ') + m_varsBatArgumentsEdit->text();
@@ -1491,19 +1491,19 @@ ClangClToolChainConfigWidget::ClangClToolChainConfigWidget(ToolChain *tc) :
m_varsBatDisplayCombo->setObjectName("varsBatCombo");
m_varsBatDisplayCombo->setSizeAdjustPolicy(QComboBox::AdjustToContents);
- m_mainLayout->addRow(tr("Initialization:"), m_varsBatDisplayCombo);
+ m_mainLayout->addRow(Tr::tr("Initialization:"), m_varsBatDisplayCombo);
if (tc->isAutoDetected()) {
m_llvmDirLabel = new QLabel(this);
m_llvmDirLabel->setTextInteractionFlags(Qt::TextBrowserInteraction);
- m_mainLayout->addRow(tr("&Compiler path:"), m_llvmDirLabel);
+ m_mainLayout->addRow(Tr::tr("&Compiler path:"), m_llvmDirLabel);
} else {
const QStringList gnuVersionArgs = QStringList("--version");
m_compilerCommand = new Utils::PathChooser(this);
m_compilerCommand->setExpectedKind(Utils::PathChooser::ExistingCommand);
m_compilerCommand->setCommandVersionArguments(gnuVersionArgs);
m_compilerCommand->setHistoryCompleter("PE.Clang.Command.History");
- m_mainLayout->addRow(tr("&Compiler path:"), m_compilerCommand);
+ m_mainLayout->addRow(Tr::tr("&Compiler path:"), m_compilerCommand);
}
addErrorLabel();
setFromClangClToolChain();
@@ -1697,7 +1697,7 @@ ClangClToolChain::ClangClToolChain()
: MsvcToolChain(Constants::CLANG_CL_TOOLCHAIN_TYPEID)
{
setDisplayName("clang-cl");
- setTypeDisplayName(QCoreApplication::translate("ProjectExplorer::ClangToolChainFactory", "Clang"));
+ setTypeDisplayName(Tr::tr("Clang"));
}
bool ClangClToolChain::isValid() const
@@ -1820,7 +1820,7 @@ ClangClToolChain::BuiltInHeaderPathsRunner ClangClToolChain::createBuiltInHeader
MsvcToolChainFactory::MsvcToolChainFactory()
{
- setDisplayName(MsvcToolChain::tr("MSVC"));
+ setDisplayName(Tr::tr("MSVC"));
setSupportedToolChainType(Constants::MSVC_TOOLCHAIN_TYPEID);
setSupportedLanguages({Constants::C_LANGUAGE_ID, Constants::CXX_LANGUAGE_ID});
setToolchainConstructor([] { return new MsvcToolChain(Constants::MSVC_TOOLCHAIN_TYPEID); });
@@ -2017,7 +2017,7 @@ Toolchains MsvcToolChainFactory::autoDetect(const ToolchainDetector &detector) c
ClangClToolChainFactory::ClangClToolChainFactory()
{
- setDisplayName(ClangClToolChain::tr("clang-cl"));
+ setDisplayName(Tr::tr("clang-cl"));
setSupportedLanguages({Constants::C_LANGUAGE_ID, Constants::CXX_LANGUAGE_ID});
setSupportedToolChainType(Constants::CLANG_CL_TOOLCHAIN_TYPEID);
setToolchainConstructor([] { return new ClangClToolChain; });
@@ -2153,9 +2153,7 @@ std::optional MsvcToolChain::generateEnvironmentSettings(const Utils::E
QString command = QDir::toNativeSeparators(batchFile);
if (!batchArgs.isEmpty())
command += ' ' + batchArgs;
- return QCoreApplication::translate("ProjectExplorer::Internal::MsvcToolChain",
- "Failed to retrieve MSVC Environment from \"%1\":\n"
- "%2")
+ return Tr::tr("Failed to retrieve MSVC Environment from \"%1\":\n%2")
.arg(command, message);
}
diff --git a/src/plugins/projectexplorer/msvctoolchain.h b/src/plugins/projectexplorer/msvctoolchain.h
index 7cd94ba6610..042bbfe38f8 100644
--- a/src/plugins/projectexplorer/msvctoolchain.h
+++ b/src/plugins/projectexplorer/msvctoolchain.h
@@ -31,8 +31,6 @@ namespace Internal {
class MsvcToolChain : public ToolChain
{
- Q_DECLARE_TR_FUNCTIONS(ProjectExplorer::Internal::MsvcToolChain)
-
public:
enum Type { WindowsSDK, VS };
enum Platform { x86, amd64, x86_amd64, ia64, x86_ia64, arm, x86_arm, amd64_arm, amd64_x86,
@@ -139,8 +137,6 @@ protected:
class PROJECTEXPLORER_EXPORT ClangClToolChain : public MsvcToolChain
{
- Q_DECLARE_TR_FUNCTIONS(ProjectExplorer::Internal::ClangClToolChain)
-
public:
ClangClToolChain();
diff --git a/src/plugins/projectexplorer/osparser.cpp b/src/plugins/projectexplorer/osparser.cpp
index b72f3f801a1..42c65f2cb5d 100644
--- a/src/plugins/projectexplorer/osparser.cpp
+++ b/src/plugins/projectexplorer/osparser.cpp
@@ -2,12 +2,13 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include "osparser.h"
-#include "projectexplorerconstants.h"
+
+#include "projectexplorertr.h"
#include "task.h"
#include
-using namespace ProjectExplorer;
+namespace ProjectExplorer {
OsParser::OsParser()
{
@@ -21,7 +22,7 @@ Utils::OutputLineParser::Result OsParser::handleLine(const QString &line, Utils:
const QString trimmed = line.trimmed();
if (trimmed == QLatin1String("The process cannot access the file because it is "
"being used by another process.")) {
- scheduleTask(CompileTask(Task::Error, tr(
+ scheduleTask(CompileTask(Task::Error, Tr::tr(
"The process cannot access the file because it is being used "
"by another process.\n"
"Please close all running instances of your application before "
@@ -41,3 +42,5 @@ Utils::OutputLineParser::Result OsParser::handleLine(const QString &line, Utils:
}
return Status::NotHandled;
}
+
+} // ProjectExplorer
diff --git a/src/plugins/projectexplorer/parseissuesdialog.cpp b/src/plugins/projectexplorer/parseissuesdialog.cpp
index d9e9ab81aea..331773fe7b6 100644
--- a/src/plugins/projectexplorer/parseissuesdialog.cpp
+++ b/src/plugins/projectexplorer/parseissuesdialog.cpp
@@ -8,6 +8,7 @@
#include "kitchooser.h"
#include "kitmanager.h"
#include "projectexplorerconstants.h"
+#include "projectexplorertr.h"
#include "taskhub.h"
#include
@@ -40,23 +41,23 @@ public:
ParseIssuesDialog::ParseIssuesDialog(QWidget *parent) : QDialog(parent), d(new Private)
{
- setWindowTitle(tr("Parse Build Output"));
+ setWindowTitle(Tr::tr("Parse Build Output"));
- d->stderrCheckBox.setText(tr("Output went to stderr"));
+ d->stderrCheckBox.setText(Tr::tr("Output went to stderr"));
d->stderrCheckBox.setChecked(true);
- d->clearTasksCheckBox.setText(tr("Clear existing tasks"));
+ d->clearTasksCheckBox.setText(Tr::tr("Clear existing tasks"));
d->clearTasksCheckBox.setChecked(true);
- const auto loadFileButton = new QPushButton(tr("Load from File..."));
+ const auto loadFileButton = new QPushButton(Tr::tr("Load from File..."));
connect(loadFileButton, &QPushButton::clicked, this, [this] {
- const FilePath filePath = FileUtils::getOpenFilePath(this, tr("Choose File"));
+ const FilePath filePath = FileUtils::getOpenFilePath(this, Tr::tr("Choose File"));
if (filePath.isEmpty())
return;
QFile file(filePath.toString());
if (!file.open(QIODevice::ReadOnly)) {
- QMessageBox::critical(this, tr("Could Not Open File"),
- tr("Could not open file: \"%1\": %2")
+ QMessageBox::critical(this, Tr::tr("Could Not Open File"),
+ Tr::tr("Could not open file: \"%1\": %2")
.arg(filePath.toUserOutput(), file.errorString()));
return;
}
@@ -79,7 +80,7 @@ ParseIssuesDialog::ParseIssuesDialog(QWidget *parent) : QDialog(parent), d(new P
buttonBox->button(QDialogButtonBox::Ok)->setEnabled(d->kitChooser.currentKit());
const auto layout = new QVBoxLayout(this);
- const auto outputGroupBox = new QGroupBox(tr("Build Output"));
+ const auto outputGroupBox = new QGroupBox(Tr::tr("Build Output"));
layout->addWidget(outputGroupBox);
const auto outputLayout = new QHBoxLayout(outputGroupBox);
outputLayout->addWidget(&d->compileOutputEdit);
@@ -93,13 +94,13 @@ ParseIssuesDialog::ParseIssuesDialog(QWidget *parent) : QDialog(parent), d(new P
// TODO: Only very few parsers are available from a Kit (basically just the Toolchain one).
// If we introduced factories for IOutputParsers, we could offer the user
// to combine arbitrary parsers here.
- const auto parserGroupBox = new QGroupBox(tr("Parsing Options"));
+ const auto parserGroupBox = new QGroupBox(Tr::tr("Parsing Options"));
layout->addWidget(parserGroupBox);
const auto parserLayout = new QVBoxLayout(parserGroupBox);
const auto kitChooserWidget = new QWidget;
const auto kitChooserLayout = new QHBoxLayout(kitChooserWidget);
kitChooserLayout->setContentsMargins(0, 0, 0, 0);
- kitChooserLayout->addWidget(new QLabel(tr("Use parsers from kit:")));
+ kitChooserLayout->addWidget(new QLabel(Tr::tr("Use parsers from kit:")));
kitChooserLayout->addWidget(&d->kitChooser);
parserLayout->addWidget(kitChooserWidget);
parserLayout->addWidget(&d->clearTasksCheckBox);
@@ -117,7 +118,7 @@ void ParseIssuesDialog::accept()
const QList lineParsers =
d->kitChooser.currentKit()->createOutputParsers();
if (lineParsers.isEmpty()) {
- QMessageBox::critical(this, tr("Cannot Parse"), tr("Cannot parse: The chosen kit does "
+ QMessageBox::critical(this, Tr::tr("Cannot Parse"), Tr::tr("Cannot parse: The chosen kit does "
"not provide an output parser."));
return;
}
diff --git a/src/plugins/projectexplorer/processstep.cpp b/src/plugins/projectexplorer/processstep.cpp
index 11b1d1d24ec..3ced1622d0d 100644
--- a/src/plugins/projectexplorer/processstep.cpp
+++ b/src/plugins/projectexplorer/processstep.cpp
@@ -8,8 +8,7 @@
#include "kit.h"
#include "processparameters.h"
#include "projectexplorerconstants.h"
-#include "projectexplorer_export.h"
-#include "target.h"
+#include "projectexplorertr.h"
#include
#include
@@ -26,8 +25,6 @@ const char PROCESS_ARGUMENTS_KEY[] = "ProjectExplorer.ProcessStep.Arguments";
class ProcessStep final : public AbstractProcessStep
{
- Q_DECLARE_TR_FUNCTIONS(ProjectExplorer::ProcessStep)
-
public:
ProcessStep(BuildStepList *bsl, Id id);
@@ -40,20 +37,20 @@ ProcessStep::ProcessStep(BuildStepList *bsl, Id id)
auto command = addAspect();
command->setSettingsKey(PROCESS_COMMAND_KEY);
command->setDisplayStyle(StringAspect::PathChooserDisplay);
- command->setLabelText(tr("Command:"));
+ command->setLabelText(Tr::tr("Command:"));
command->setExpectedKind(PathChooser::Command);
command->setHistoryCompleter("PE.ProcessStepCommand.History");
auto arguments = addAspect();
arguments->setSettingsKey(PROCESS_ARGUMENTS_KEY);
arguments->setDisplayStyle(StringAspect::LineEditDisplay);
- arguments->setLabelText(tr("Arguments:"));
+ arguments->setLabelText(Tr::tr("Arguments:"));
auto workingDirectory = addAspect();
workingDirectory->setSettingsKey(PROCESS_WORKINGDIRECTORY_KEY);
workingDirectory->setValue(Constants::DEFAULT_WORKING_DIR);
workingDirectory->setDisplayStyle(StringAspect::PathChooserDisplay);
- workingDirectory->setLabelText(tr("Working directory:"));
+ workingDirectory->setLabelText(Tr::tr("Working directory:"));
workingDirectory->setExpectedKind(PathChooser::Directory);
setWorkingDirectoryProvider([this, workingDirectory] {
@@ -70,7 +67,7 @@ ProcessStep::ProcessStep(BuildStepList *bsl, Id id)
setSummaryUpdater([this] {
QString display = displayName();
if (display.isEmpty())
- display = tr("Custom Process Step");
+ display = Tr::tr("Custom Process Step");
ProcessParameters param;
setupProcessParameters(¶m);
return param.summary(display);
@@ -91,7 +88,7 @@ ProcessStepFactory::ProcessStepFactory()
{
registerStep("ProjectExplorer.ProcessStep");
//: Default ProcessStep display name
- setDisplayName(ProcessStep::tr("Custom Process Step"));
+ setDisplayName(Tr::tr("Custom Process Step"));
}
} // Internal
diff --git a/src/plugins/projectexplorer/project.cpp b/src/plugins/projectexplorer/project.cpp
index 256d8c17cd3..6bff1aa781b 100644
--- a/src/plugins/projectexplorer/project.cpp
+++ b/src/plugins/projectexplorer/project.cpp
@@ -13,6 +13,7 @@
#include "kitinformation.h"
#include "projectexplorer.h"
#include "projectexplorerconstants.h"
+#include "projectexplorertr.h"
#include "projectnodes.h"
#include "runconfiguration.h"
#include "runconfigurationaspects.h"
@@ -204,8 +205,8 @@ Project::Project(const QString &mimeType, const FilePath &fileName)
d->m_document = std::make_unique(mimeType, fileName, this);
DocumentManager::addDocument(d->m_document.get());
- d->m_macroExpander.setDisplayName(tr("Project"));
- d->m_macroExpander.registerVariable("Project:Name", tr("Project Name"),
+ d->m_macroExpander.setDisplayName(Tr::tr("Project"));
+ d->m_macroExpander.registerVariable("Project:Name", Tr::tr("Project Name"),
[this] { return displayName(); });
// Only set up containernode after d is set so that it will find the project directory!
@@ -417,7 +418,7 @@ Tasks Project::projectIssues(const Kit *k) const
{
Tasks result;
if (!k->isValid())
- result.append(createProjectTask(Task::TaskType::Error, tr("Kit is not valid.")));
+ result.append(createProjectTask(Task::TaskType::Error, Tr::tr("Kit is not valid.")));
return {};
}
@@ -498,8 +499,8 @@ bool Project::copySteps(Target *sourceTarget, Target *newTarget)
if (fatalError) {
// That could be a more granular error message
QMessageBox::critical(ICore::dialogParent(),
- tr("Incompatible Kit"),
- tr("Kit %1 is incompatible with kit %2.")
+ Tr::tr("Incompatible Kit"),
+ Tr::tr("Kit %1 is incompatible with kit %2.")
.arg(sourceTarget->kit()->displayName())
.arg(newTarget->kit()->displayName()));
} else if (!buildconfigurationError.isEmpty()
@@ -508,27 +509,27 @@ bool Project::copySteps(Target *sourceTarget, Target *newTarget)
QString error;
if (!buildconfigurationError.isEmpty())
- error += tr("Build configurations:") + QLatin1Char('\n')
+ error += Tr::tr("Build configurations:") + QLatin1Char('\n')
+ buildconfigurationError.join(QLatin1Char('\n'));
if (!deployconfigurationError.isEmpty()) {
if (!error.isEmpty())
error.append(QLatin1Char('\n'));
- error += tr("Deploy configurations:") + QLatin1Char('\n')
+ error += Tr::tr("Deploy configurations:") + QLatin1Char('\n')
+ deployconfigurationError.join(QLatin1Char('\n'));
}
if (!runconfigurationError.isEmpty()) {
if (!error.isEmpty())
error.append(QLatin1Char('\n'));
- error += tr("Run configurations:") + QLatin1Char('\n')
+ error += Tr::tr("Run configurations:") + QLatin1Char('\n')
+ runconfigurationError.join(QLatin1Char('\n'));
}
QMessageBox msgBox(ICore::dialogParent());
msgBox.setIcon(QMessageBox::Warning);
- msgBox.setWindowTitle(tr("Partially Incompatible Kit"));
- msgBox.setText(tr("Some configurations could not be copied."));
+ msgBox.setWindowTitle(Tr::tr("Partially Incompatible Kit"));
+ msgBox.setText(Tr::tr("Some configurations could not be copied."));
msgBox.setDetailedText(error);
msgBox.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel);
fatalError = msgBox.exec() != QDialog::Accepted;
@@ -704,7 +705,7 @@ void Project::changeRootProjectDirectory()
{
FilePath rootPath = FileUtils::getExistingDirectory(
nullptr,
- tr("Select the Root Directory"),
+ Tr::tr("Select the Root Directory"),
rootProjectDirectory(),
QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks);
if (rootPath != d->m_rootProjectDirectory) {
@@ -792,8 +793,8 @@ void Project::createTargetFromMap(const QVariantMap &map, int index)
deviceTypeId = Constants::DESKTOP_DEVICE_TYPE;
const QString formerKitName = targetMap.value(Target::displayNameKey()).toString();
k = KitManager::registerKit([deviceTypeId, &formerKitName](Kit *kit) {
- const QString kitNameSuggestion = formerKitName.contains(tr("Replacement for"))
- ? formerKitName : tr("Replacement for \"%1\"").arg(formerKitName);
+ const QString kitNameSuggestion = formerKitName.contains(Tr::tr("Replacement for"))
+ ? formerKitName : Tr::tr("Replacement for \"%1\"").arg(formerKitName);
const QString tempKitName = makeUniquelyNumbered(kitNameSuggestion,
transform(KitManager::kits(), &Kit::unexpandedDisplayName));
kit->setUnexpandedDisplayName(tempKitName);
@@ -802,7 +803,7 @@ void Project::createTargetFromMap(const QVariantMap &map, int index)
kit->setup();
}, id);
QTC_ASSERT(k, return);
- TaskHub::addTask(BuildSystemTask(Task::Warning, tr("Project \"%1\" was configured for "
+ TaskHub::addTask(BuildSystemTask(Task::Warning, Tr::tr("Project \"%1\" was configured for "
"kit \"%2\" with id %3, which does not exist anymore. The new kit \"%4\" was "
"created in its place, in an attempt not to lose custom project settings.")
.arg(displayName(), formerKitName, id.toString(), k->displayName())));
@@ -1027,7 +1028,7 @@ QStringList Project::availableQmlPreviewTranslations(QString *errorMessage)
const QDir languageDirectory(projectDirectory + "/i18n");
const auto qmFiles = languageDirectory.entryList({"qml_*.qm"});
if (qmFiles.isEmpty() && errorMessage)
- errorMessage->append(tr("Could not find any qml_*.qm file at \"%1\"").arg(languageDirectory.absolutePath()));
+ errorMessage->append(Tr::tr("Could not find any qml_*.qm file at \"%1\"").arg(languageDirectory.absolutePath()));
return transform(qmFiles, [](const QString &qmFile) {
const int localeStartPosition = qmFile.lastIndexOf("_") + 1;
const int localeEndPosition = qmFile.size() - QString(".qm").size();
@@ -1113,7 +1114,7 @@ void Project::addVariablesToMacroExpander(const QByteArray &prefix,
const QByteArray prefixWithoutColon = fullPrefix.chopped(1);
expander->registerVariable(fullPrefix + "Name",
//: %1 is something like "Active project"
- tr("%1: Name.").arg(descriptor),
+ Tr::tr("%1: Name.").arg(descriptor),
[projectGetter]() -> QString {
if (const Project *const project = projectGetter())
return project->displayName();
@@ -1121,7 +1122,7 @@ void Project::addVariablesToMacroExpander(const QByteArray &prefix,
});
expander->registerFileVariables(prefixWithoutColon,
//: %1 is something like "Active project"
- tr("%1: Full path to main file.").arg(descriptor),
+ Tr::tr("%1: Full path to main file.").arg(descriptor),
[projectGetter]() -> FilePath {
if (const Project *const project = projectGetter())
return project->projectFilePath();
@@ -1129,7 +1130,7 @@ void Project::addVariablesToMacroExpander(const QByteArray &prefix,
});
expander->registerVariable(fullPrefix + "Kit:Name",
//: %1 is something like "Active project"
- tr("%1: The name the active kit.").arg(descriptor),
+ Tr::tr("%1: The name the active kit.").arg(descriptor),
[targetGetter]() -> QString {
if (const Target *const target = targetGetter())
return target->kit()->displayName();
@@ -1137,7 +1138,7 @@ void Project::addVariablesToMacroExpander(const QByteArray &prefix,
});
expander->registerVariable(fullPrefix + "BuildConfig:Name",
//: %1 is something like "Active project"
- tr("%1: Name of the active build configuration.").arg(descriptor),
+ Tr::tr("%1: Name of the active build configuration.").arg(descriptor),
[bcGetter]() -> QString {
if (const BuildConfiguration *const bc = bcGetter())
return bc->displayName();
@@ -1145,7 +1146,7 @@ void Project::addVariablesToMacroExpander(const QByteArray &prefix,
});
expander->registerVariable(fullPrefix + "BuildConfig:Type",
//: %1 is something like "Active project"
- tr("%1: Type of the active build configuration.").arg(descriptor),
+ Tr::tr("%1: Type of the active build configuration.").arg(descriptor),
[bcGetter]() -> QString {
const BuildConfiguration *const bc = bcGetter();
const BuildConfiguration::BuildType type
@@ -1155,7 +1156,7 @@ void Project::addVariablesToMacroExpander(const QByteArray &prefix,
expander
->registerVariable(fullPrefix + "BuildConfig:Path",
//: %1 is something like "Active project"
- tr("%1: Full build path of active build configuration.").arg(descriptor),
+ Tr::tr("%1: Full build path of active build configuration.").arg(descriptor),
[bcGetter]() -> QString {
if (const BuildConfiguration *const bc = bcGetter())
return bc->buildDirectory().toUserOutput();
@@ -1163,7 +1164,7 @@ void Project::addVariablesToMacroExpander(const QByteArray &prefix,
});
expander->registerPrefix(fullPrefix + "BuildConfig:Env",
//: %1 is something like "Active project"
- tr("%1: Variables in the active build environment.").arg(descriptor),
+ Tr::tr("%1: Variables in the active build environment.").arg(descriptor),
[bcGetter](const QString &var) {
if (BuildConfiguration *const bc = bcGetter())
return bc->environment().expandedValueForKey(var);
@@ -1172,7 +1173,7 @@ void Project::addVariablesToMacroExpander(const QByteArray &prefix,
expander->registerVariable(fullPrefix + "RunConfig:Name",
//: %1 is something like "Active project"
- tr("%1: Name of the active run configuration.").arg(descriptor),
+ Tr::tr("%1: Name of the active run configuration.").arg(descriptor),
[rcGetter]() -> QString {
if (const RunConfiguration *const rc = rcGetter())
return rc->displayName();
@@ -1180,7 +1181,7 @@ void Project::addVariablesToMacroExpander(const QByteArray &prefix,
});
expander->registerFileVariables(fullPrefix + "RunConfig:Executable",
//: %1 is something like "Active project"
- tr("%1: Executable of the active run configuration.")
+ Tr::tr("%1: Executable of the active run configuration.")
.arg(descriptor),
[rcGetter]() -> FilePath {
if (const RunConfiguration *const rc = rcGetter())
@@ -1189,7 +1190,7 @@ void Project::addVariablesToMacroExpander(const QByteArray &prefix,
});
expander->registerPrefix(fullPrefix + "RunConfig:Env",
//: %1 is something like "Active project"
- tr("%1: Variables in the environment of the active run configuration.")
+ Tr::tr("%1: Variables in the environment of the active run configuration.")
.arg(descriptor),
[rcGetter](const QString &var) {
if (const RunConfiguration *const rc = rcGetter()) {
@@ -1200,7 +1201,7 @@ void Project::addVariablesToMacroExpander(const QByteArray &prefix,
});
expander->registerVariable(fullPrefix + "RunConfig:WorkingDir",
//: %1 is something like "Active project"
- tr("%1: Working directory of the active run configuration.")
+ Tr::tr("%1: Working directory of the active run configuration.")
.arg(descriptor),
[rcGetter] {
if (const RunConfiguration *const rc = rcGetter()) {
diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp
index 96d36381c70..7e3388c440b 100644
--- a/src/plugins/projectexplorer/projectexplorer.cpp
+++ b/src/plugins/projectexplorer/projectexplorer.cpp
@@ -364,7 +364,7 @@ public:
ProjectsMode()
{
setContext(Context(Constants::C_PROJECTEXPLORER));
- setDisplayName(QCoreApplication::translate("ProjectExplorer::ProjectsMode", "Projects"));
+ setDisplayName(Tr::tr("Projects"));
setIcon(Icon::modeIcon(Icons::MODE_PROJECT_CLASSIC,
Icons::MODE_PROJECT_FLAT, Icons::MODE_PROJECT_FLAT_ACTIVE));
setPriority(Constants::P_MODE_SESSION);
@@ -373,13 +373,10 @@ public:
}
};
-
class ProjectEnvironmentWidget : public NamedWidget
{
- Q_DECLARE_TR_FUNCTIONS(ProjectEnvironmentWidget)
-
public:
- explicit ProjectEnvironmentWidget(Project *project) : NamedWidget(tr("Project Environment"))
+ explicit ProjectEnvironmentWidget(Project *project) : NamedWidget(Tr::tr("Project Environment"))
{
setUseGlobalSettingsCheckBoxVisible(false);
setUseGlobalSettingsLabelVisible(false);
@@ -445,8 +442,6 @@ public:
class ProjectExplorerPluginPrivate : public QObject
{
- Q_DECLARE_TR_FUNCTIONS(ProjectExplorer::ProjectExplorerPlugin)
-
public:
ProjectExplorerPluginPrivate();
@@ -829,8 +824,8 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
dd->m_toolChainManager = new ToolChainManager;
// Register languages
- ToolChainManager::registerLanguage(Constants::C_LANGUAGE_ID, tr("C"));
- ToolChainManager::registerLanguage(Constants::CXX_LANGUAGE_ID, tr("C++"));
+ ToolChainManager::registerLanguage(Constants::C_LANGUAGE_ID, Tr::tr("C"));
+ ToolChainManager::registerLanguage(Constants::CXX_LANGUAGE_ID, Tr::tr("C++"));
IWizardFactory::registerFeatureProvider(new KitFeatureProvider);
IWizardFactory::registerFactoryCreator([] { return new SimpleProjectWizard; });
@@ -913,25 +908,25 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
// ProjectPanelFactories
auto panelFactory = new ProjectPanelFactory;
panelFactory->setPriority(30);
- panelFactory->setDisplayName(QCoreApplication::translate("EditorSettingsPanelFactory", "Editor"));
+ panelFactory->setDisplayName(Tr::tr("Editor"));
panelFactory->setCreateWidgetFunction([](Project *project) { return new EditorSettingsWidget(project); });
ProjectPanelFactory::registerFactory(panelFactory);
panelFactory = new ProjectPanelFactory;
panelFactory->setPriority(40);
- panelFactory->setDisplayName(QCoreApplication::translate("CodeStyleSettingsPanelFactory", "Code Style"));
+ panelFactory->setDisplayName(Tr::tr("Code Style"));
panelFactory->setCreateWidgetFunction([](Project *project) { return new CodeStyleSettingsWidget(project); });
ProjectPanelFactory::registerFactory(panelFactory);
panelFactory = new ProjectPanelFactory;
panelFactory->setPriority(50);
- panelFactory->setDisplayName(QCoreApplication::translate("DependenciesPanelFactory", "Dependencies"));
+ panelFactory->setDisplayName(Tr::tr("Dependencies"));
panelFactory->setCreateWidgetFunction([](Project *project) { return new DependenciesWidget(project); });
ProjectPanelFactory::registerFactory(panelFactory);
panelFactory = new ProjectPanelFactory;
panelFactory->setPriority(60);
- panelFactory->setDisplayName(QCoreApplication::translate("EnvironmentPanelFactory", "Environment"));
+ panelFactory->setDisplayName(Tr::tr("Environment"));
panelFactory->setCreateWidgetFunction([](Project *project) {
return new ProjectEnvironmentWidget(project);
});
@@ -959,32 +954,32 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
// context menu sub menus:
ActionContainer *folderOpenLocationCtxMenu =
ActionManager::createMenu(Constants::FOLDER_OPEN_LOCATIONS_CONTEXT_MENU);
- folderOpenLocationCtxMenu->menu()->setTitle(tr("Open..."));
+ folderOpenLocationCtxMenu->menu()->setTitle(Tr::tr("Open..."));
folderOpenLocationCtxMenu->setOnAllDisabledBehavior(ActionContainer::Hide);
ActionContainer *projectOpenLocationCtxMenu =
ActionManager::createMenu(Constants::PROJECT_OPEN_LOCATIONS_CONTEXT_MENU);
- projectOpenLocationCtxMenu->menu()->setTitle(tr("Open..."));
+ projectOpenLocationCtxMenu->menu()->setTitle(Tr::tr("Open..."));
projectOpenLocationCtxMenu->setOnAllDisabledBehavior(ActionContainer::Hide);
// build menu
ActionContainer *mbuild =
ActionManager::createMenu(Constants::M_BUILDPROJECT);
- mbuild->menu()->setTitle(tr("&Build"));
+ mbuild->menu()->setTitle(Tr::tr("&Build"));
if (!hideBuildMenu())
menubar->addMenu(mbuild, Core::Constants::G_VIEW);
// debug menu
ActionContainer *mdebug =
ActionManager::createMenu(Constants::M_DEBUG);
- mdebug->menu()->setTitle(tr("&Debug"));
+ mdebug->menu()->setTitle(Tr::tr("&Debug"));
if (!hideDebugMenu())
menubar->addMenu(mdebug, Core::Constants::G_VIEW);
ActionContainer *mstartdebugging =
ActionManager::createMenu(Constants::M_DEBUG_STARTDEBUGGING);
- mstartdebugging->menu()->setTitle(tr("&Start Debugging"));
+ mstartdebugging->menu()->setTitle(Tr::tr("&Start Debugging"));
mdebug->addMenu(mstartdebugging, Core::Constants::G_DEFAULT_ONE);
//
@@ -1040,7 +1035,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
const QIcon runIcon = Icon::combinedIcon({Utils::Icons::RUN_SMALL.icon(), runSideBarIcon});
runMenu->menu()->setIcon(runIcon);
- runMenu->menu()->setTitle(tr("Run"));
+ runMenu->menu()->setTitle(Tr::tr("Run"));
msubProjectContextMenu->addMenu(runMenu, ProjectExplorer::Constants::G_PROJECT_RUN);
mfolderContextMenu->appendGroup(Constants::G_FOLDER_LOCATIONS);
@@ -1066,7 +1061,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
ActionManager::createMenu(ProjectExplorer::Constants::M_OPENFILEWITHCONTEXT);
openWith->setOnAllDisabledBehavior(ActionContainer::Show);
dd->m_openWithMenu = openWith->menu();
- dd->m_openWithMenu->setTitle(tr("Open With"));
+ dd->m_openWithMenu->setTitle(Tr::tr("Open With"));
mfolderContextMenu->addMenu(folderOpenLocationCtxMenu, Constants::G_FOLDER_LOCATIONS);
connect(mfolderContextMenu->menu(), &QMenu::aboutToShow,
@@ -1104,19 +1099,19 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
//
// new action
- dd->m_newAction = new QAction(tr("New Project..."), this);
+ dd->m_newAction = new QAction(Tr::tr("New Project..."), this);
cmd = ActionManager::registerAction(dd->m_newAction, Core::Constants::NEW, projectTreeContext);
msessionContextMenu->addAction(cmd, Constants::G_SESSION_FILES);
// open action
- dd->m_loadAction = new QAction(tr("Load Project..."), this);
+ dd->m_loadAction = new QAction(Tr::tr("Load Project..."), this);
cmd = ActionManager::registerAction(dd->m_loadAction, Constants::LOAD);
if (!HostOsInfo::isMacHost())
- cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+O")));
+ cmd->setDefaultKeySequence(QKeySequence(Tr::tr("Ctrl+Shift+O")));
msessionContextMenu->addAction(cmd, Constants::G_SESSION_FILES);
// Default open action
- dd->m_openFileAction = new QAction(tr("Open File"), this);
+ dd->m_openFileAction = new QAction(Tr::tr("Open File"), this);
cmd = ActionManager::registerAction(dd->m_openFileAction, Constants::OPENFILE,
projectTreeContext);
mfileContextMenu->addAction(cmd, Constants::G_FILE_OPEN);
@@ -1162,8 +1157,8 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
mprojectContextMenu->addMenu(openTerminal, Constants::G_PROJECT_LAST);
- dd->m_openTerminalHereBuildEnv = new QAction(tr("Build Environment"), this);
- dd->m_openTerminalHereRunEnv = new QAction(tr("Run Environment"), this);
+ dd->m_openTerminalHereBuildEnv = new QAction(Tr::tr("Build Environment"), this);
+ dd->m_openTerminalHereRunEnv = new QAction(Tr::tr("Run Environment"), this);
cmd = ActionManager::registerAction(dd->m_openTerminalHereBuildEnv,
"ProjectExplorer.OpenTerminalHereBuildEnv",
projectTreeContext);
@@ -1180,7 +1175,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
// recent projects menu
ActionContainer *mrecent =
ActionManager::createMenu(Constants::M_RECENTPROJECTS);
- mrecent->menu()->setTitle(tr("Recent P&rojects"));
+ mrecent->menu()->setTitle(Tr::tr("Recent P&rojects"));
mrecent->setOnAllDisabledBehavior(ActionContainer::Show);
mfile->addMenu(mrecent, Core::Constants::G_FILE_OPEN);
connect(mfile->menu(), &QMenu::aboutToShow,
@@ -1188,7 +1183,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
// session menu
ActionContainer *msession = ActionManager::createMenu(Constants::M_SESSION);
- msession->menu()->setTitle(tr("S&essions"));
+ msession->menu()->setTitle(Tr::tr("S&essions"));
msession->setOnAllDisabledBehavior(ActionContainer::Show);
mfile->addMenu(msession, Core::Constants::G_FILE_OPEN);
dd->m_sessionMenu = msession->menu();
@@ -1196,7 +1191,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
dd, &ProjectExplorerPluginPrivate::updateSessionMenu);
// session manager action
- dd->m_sessionManagerAction = new QAction(tr("&Manage..."), this);
+ dd->m_sessionManagerAction = new QAction(Tr::tr("&Manage..."), this);
dd->m_sessionMenu->addAction(dd->m_sessionManagerAction);
dd->m_sessionMenu->addSeparator();
cmd = ActionManager::registerAction(dd->m_sessionManagerAction,
@@ -1204,7 +1199,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
cmd->setDefaultKeySequence(QKeySequence());
// unload action
- dd->m_unloadAction = new ParameterAction(tr("Close Project"), tr("Close Pro&ject \"%1\""),
+ dd->m_unloadAction = new ParameterAction(Tr::tr("Close Project"), Tr::tr("Close Pro&ject \"%1\""),
ParameterAction::AlwaysEnabled, this);
cmd = ActionManager::registerAction(dd->m_unloadAction, Constants::UNLOAD);
cmd->setAttribute(Command::CA_UpdateText);
@@ -1212,7 +1207,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
mfile->addAction(cmd, Core::Constants::G_FILE_PROJECT);
dd->m_closeProjectFilesActionFileMenu = new ParameterAction(
- tr("Close All Files in Project"), tr("Close All Files in Project \"%1\""),
+ Tr::tr("Close All Files in Project"), Tr::tr("Close All Files in Project \"%1\""),
ParameterAction::AlwaysEnabled, this);
cmd = ActionManager::registerAction(dd->m_closeProjectFilesActionFileMenu,
"ProjectExplorer.CloseProjectFilesFileMenu");
@@ -1222,14 +1217,14 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
ActionContainer *munload =
ActionManager::createMenu(Constants::M_UNLOADPROJECTS);
- munload->menu()->setTitle(tr("Close Pro&ject"));
+ munload->menu()->setTitle(Tr::tr("Close Pro&ject"));
munload->setOnAllDisabledBehavior(ActionContainer::Show);
mfile->addMenu(munload, Core::Constants::G_FILE_PROJECT);
connect(mfile->menu(), &QMenu::aboutToShow,
dd, &ProjectExplorerPluginPrivate::updateUnloadProjectMenu);
// unload session action
- dd->m_closeAllProjects = new QAction(tr("Close All Projects and Editors"), this);
+ dd->m_closeAllProjects = new QAction(Tr::tr("Close All Projects and Editors"), this);
cmd = ActionManager::registerAction(dd->m_closeAllProjects, Constants::CLEARSESSION);
mfile->addAction(cmd, Core::Constants::G_FILE_PROJECT);
msessionContextMenu->addAction(cmd, Constants::G_SESSION_FILES);
@@ -1237,41 +1232,41 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
// build session action
const QIcon sideBarIcon = Icon::sideBarIcon(Icons::BUILD, Icons::BUILD_FLAT);
const QIcon buildIcon = Icon::combinedIcon({Icons::BUILD_SMALL.icon(), sideBarIcon});
- dd->m_buildSessionAction = new QAction(buildIcon, tr("Build All Projects"), this);
+ dd->m_buildSessionAction = new QAction(buildIcon, Tr::tr("Build All Projects"), this);
cmd = ActionManager::registerAction(dd->m_buildSessionAction, Constants::BUILDSESSION);
- cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+B")));
+ cmd->setDefaultKeySequence(QKeySequence(Tr::tr("Ctrl+Shift+B")));
mbuild->addAction(cmd, Constants::G_BUILD_ALLPROJECTS);
msessionContextMenu->addAction(cmd, Constants::G_SESSION_BUILD);
dd->m_buildSessionForAllConfigsAction
- = new QAction(buildIcon, tr("Build All Projects for All Configurations"), this);
+ = new QAction(buildIcon, Tr::tr("Build All Projects for All Configurations"), this);
cmd = ActionManager::registerAction(dd->m_buildSessionForAllConfigsAction,
Constants::BUILDSESSIONALLCONFIGS);
mbuild->addAction(cmd, Constants::G_BUILD_ALLPROJECTS_ALLCONFIGURATIONS);
msessionContextMenu->addAction(cmd, Constants::G_SESSION_BUILD);
// deploy session
- dd->m_deploySessionAction = new QAction(tr("Deploy"), this);
- dd->m_deploySessionAction->setWhatsThis(tr("Deploy All Projects"));
+ dd->m_deploySessionAction = new QAction(Tr::tr("Deploy"), this);
+ dd->m_deploySessionAction->setWhatsThis(Tr::tr("Deploy All Projects"));
cmd = ActionManager::registerAction(dd->m_deploySessionAction, Constants::DEPLOYSESSION);
cmd->setDescription(dd->m_deploySessionAction->whatsThis());
mbuild->addAction(cmd, Constants::G_BUILD_ALLPROJECTS);
msessionContextMenu->addAction(cmd, Constants::G_SESSION_BUILD);
// rebuild session action
- dd->m_rebuildSessionAction = new QAction(Icons::REBUILD.icon(), tr("Rebuild"),
+ dd->m_rebuildSessionAction = new QAction(Icons::REBUILD.icon(), Tr::tr("Rebuild"),
this);
- dd->m_rebuildSessionAction->setWhatsThis(tr("Rebuild All Projects"));
+ dd->m_rebuildSessionAction->setWhatsThis(Tr::tr("Rebuild All Projects"));
cmd = ActionManager::registerAction(dd->m_rebuildSessionAction, Constants::REBUILDSESSION);
cmd->setDescription(dd->m_rebuildSessionAction->whatsThis());
mbuild->addAction(cmd, Constants::G_BUILD_ALLPROJECTS);
msessionContextMenu->addAction(cmd, Constants::G_SESSION_REBUILD);
dd->m_rebuildSessionForAllConfigsAction
- = new QAction(Icons::REBUILD.icon(), tr("Rebuild"),
+ = new QAction(Icons::REBUILD.icon(), Tr::tr("Rebuild"),
this);
dd->m_rebuildSessionForAllConfigsAction->setWhatsThis(
- tr("Rebuild All Projects for All Configurations"));
+ Tr::tr("Rebuild All Projects for All Configurations"));
cmd = ActionManager::registerAction(dd->m_rebuildSessionForAllConfigsAction,
Constants::REBUILDSESSIONALLCONFIGS);
cmd->setDescription(dd->m_rebuildSessionForAllConfigsAction->whatsThis());
@@ -1279,18 +1274,18 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
msessionContextMenu->addAction(cmd, Constants::G_SESSION_REBUILD);
// clean session
- dd->m_cleanSessionAction = new QAction(Utils::Icons::CLEAN.icon(), tr("Clean"),
+ dd->m_cleanSessionAction = new QAction(Utils::Icons::CLEAN.icon(), Tr::tr("Clean"),
this);
- dd->m_cleanSessionAction->setWhatsThis(tr("Clean All Projects"));
+ dd->m_cleanSessionAction->setWhatsThis(Tr::tr("Clean All Projects"));
cmd = ActionManager::registerAction(dd->m_cleanSessionAction, Constants::CLEANSESSION);
cmd->setDescription(dd->m_cleanSessionAction->whatsThis());
mbuild->addAction(cmd, Constants::G_BUILD_ALLPROJECTS);
msessionContextMenu->addAction(cmd, Constants::G_SESSION_REBUILD);
dd->m_cleanSessionForAllConfigsAction = new QAction(Utils::Icons::CLEAN.icon(),
- tr("Clean"), this);
+ Tr::tr("Clean"), this);
dd->m_cleanSessionForAllConfigsAction->setWhatsThis(
- tr("Clean All Projects for All Configurations"));
+ Tr::tr("Clean All Projects for All Configurations"));
cmd = ActionManager::registerAction(dd->m_cleanSessionForAllConfigsAction,
Constants::CLEANSESSIONALLCONFIGS);
cmd->setDescription(dd->m_cleanSessionForAllConfigsAction->whatsThis());
@@ -1298,18 +1293,18 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
msessionContextMenu->addAction(cmd, Constants::G_SESSION_REBUILD);
// build action
- dd->m_buildAction = new ParameterAction(tr("Build Project"), tr("Build Project \"%1\""),
+ dd->m_buildAction = new ParameterAction(Tr::tr("Build Project"), Tr::tr("Build Project \"%1\""),
ParameterAction::AlwaysEnabled, this);
dd->m_buildAction->setIcon(buildIcon);
cmd = ActionManager::registerAction(dd->m_buildAction, Constants::BUILD);
cmd->setAttribute(Command::CA_UpdateText);
cmd->setDescription(dd->m_buildAction->text());
- cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+B")));
+ cmd->setDefaultKeySequence(QKeySequence(Tr::tr("Ctrl+B")));
mbuild->addAction(cmd, Constants::G_BUILD_PROJECT);
dd->m_buildProjectForAllConfigsAction
- = new ParameterAction(tr("Build Project for All Configurations"),
- tr("Build Project \"%1\" for All Configurations"),
+ = new ParameterAction(Tr::tr("Build Project for All Configurations"),
+ Tr::tr("Build Project \"%1\" for All Configurations"),
ParameterAction::AlwaysEnabled, this);
dd->m_buildProjectForAllConfigsAction->setIcon(buildIcon);
cmd = ActionManager::registerAction(dd->m_buildProjectForAllConfigsAction,
@@ -1329,7 +1324,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
// build for run config
dd->m_buildForRunConfigAction = new ParameterAction(
- tr("Build for &Run Configuration"), tr("Build for &Run Configuration \"%1\""),
+ Tr::tr("Build for &Run Configuration"), Tr::tr("Build for &Run Configuration \"%1\""),
ParameterAction::EnabledWithParameter, this);
dd->m_buildForRunConfigAction->setIcon(buildIcon);
cmd = ActionManager::registerAction(dd->m_buildForRunConfigAction,
@@ -1342,7 +1337,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
ActionContainer * const generatorContainer
= ActionManager::createMenu(Id(Constants::M_GENERATORS));
generatorContainer->setOnAllDisabledBehavior(ActionContainer::Show);
- generatorContainer->menu()->setTitle(tr("Run Generator"));
+ generatorContainer->menu()->setTitle(Tr::tr("Run Generator"));
mbuild->addMenu(generatorContainer, Constants::G_BUILD_BUILD);
// FIXME: This menu will never become visible if the user tried to open it once
@@ -1359,25 +1354,25 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
});
// deploy action
- dd->m_deployAction = new QAction(tr("Deploy"), this);
- dd->m_deployAction->setWhatsThis(tr("Deploy Project"));
+ dd->m_deployAction = new QAction(Tr::tr("Deploy"), this);
+ dd->m_deployAction->setWhatsThis(Tr::tr("Deploy Project"));
cmd = ActionManager::registerAction(dd->m_deployAction, Constants::DEPLOY);
cmd->setAttribute(Command::CA_UpdateText);
cmd->setDescription(dd->m_deployAction->whatsThis());
mbuild->addAction(cmd, Constants::G_BUILD_PROJECT);
// rebuild action
- dd->m_rebuildAction = new QAction(Icons::REBUILD.icon(), tr("Rebuild"), this);
- dd->m_rebuildAction->setWhatsThis(tr("Rebuild Project"));
+ dd->m_rebuildAction = new QAction(Icons::REBUILD.icon(), Tr::tr("Rebuild"), this);
+ dd->m_rebuildAction->setWhatsThis(Tr::tr("Rebuild Project"));
cmd = ActionManager::registerAction(dd->m_rebuildAction, Constants::REBUILD);
cmd->setAttribute(Command::CA_UpdateText);
cmd->setDescription(dd->m_rebuildAction->whatsThis());
mbuild->addAction(cmd, Constants::G_BUILD_PROJECT);
dd->m_rebuildProjectForAllConfigsAction
- = new QAction(Icons::REBUILD.icon(), tr("Rebuild"), this);
+ = new QAction(Icons::REBUILD.icon(), Tr::tr("Rebuild"), this);
dd->m_rebuildProjectForAllConfigsAction->setWhatsThis(
- tr("Rebuild Project for All Configurations"));
+ Tr::tr("Rebuild Project for All Configurations"));
cmd = ActionManager::registerAction(dd->m_rebuildProjectForAllConfigsAction,
Constants::REBUILDALLCONFIGS);
cmd->setAttribute(Command::CA_UpdateText);
@@ -1385,16 +1380,16 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
mbuild->addAction(cmd, Constants::G_BUILD_PROJECT_ALLCONFIGURATIONS);
// clean action
- dd->m_cleanAction = new QAction(Utils::Icons::CLEAN.icon(), tr("Clean"), this);
- dd->m_cleanAction->setWhatsThis(tr("Clean Project"));
+ dd->m_cleanAction = new QAction(Utils::Icons::CLEAN.icon(), Tr::tr("Clean"), this);
+ dd->m_cleanAction->setWhatsThis(Tr::tr("Clean Project"));
cmd = ActionManager::registerAction(dd->m_cleanAction, Constants::CLEAN);
cmd->setAttribute(Command::CA_UpdateText);
cmd->setDescription(dd->m_cleanAction->whatsThis());
mbuild->addAction(cmd, Constants::G_BUILD_PROJECT);
dd->m_cleanProjectForAllConfigsAction
- = new QAction(Utils::Icons::CLEAN.icon(), tr("Clean"), this);
- dd->m_cleanProjectForAllConfigsAction->setWhatsThis(tr("Clean Project for All Configurations"));
+ = new QAction(Utils::Icons::CLEAN.icon(), Tr::tr("Clean"), this);
+ dd->m_cleanProjectForAllConfigsAction->setWhatsThis(Tr::tr("Clean Project for All Configurations"));
cmd = ActionManager::registerAction(dd->m_cleanProjectForAllConfigsAction,
Constants::CLEANALLCONFIGS);
cmd->setAttribute(Command::CA_UpdateText);
@@ -1402,91 +1397,91 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
mbuild->addAction(cmd, Constants::G_BUILD_PROJECT_ALLCONFIGURATIONS);
// cancel build action
- dd->m_cancelBuildAction = new QAction(Utils::Icons::STOP_SMALL.icon(), tr("Cancel Build"), this);
+ dd->m_cancelBuildAction = new QAction(Utils::Icons::STOP_SMALL.icon(), Tr::tr("Cancel Build"), this);
cmd = ActionManager::registerAction(dd->m_cancelBuildAction, Constants::CANCELBUILD);
- cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Meta+Backspace") : tr("Alt+Backspace")));
+ cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? Tr::tr("Meta+Backspace") : Tr::tr("Alt+Backspace")));
mbuild->addAction(cmd, Constants::G_BUILD_CANCEL);
// run action
- dd->m_runAction = new QAction(runIcon, tr("Run"), this);
+ dd->m_runAction = new QAction(runIcon, Tr::tr("Run"), this);
cmd = ActionManager::registerAction(dd->m_runAction, Constants::RUN);
cmd->setAttribute(Command::CA_UpdateText);
- cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+R")));
+ cmd->setDefaultKeySequence(QKeySequence(Tr::tr("Ctrl+R")));
mbuild->addAction(cmd, Constants::G_BUILD_RUN);
cmd->action()->setObjectName("Run"); // used for UI introduction
ModeManager::addAction(cmd->action(), Constants::P_ACTION_RUN);
// Run without deployment action
- dd->m_runWithoutDeployAction = new QAction(tr("Run Without Deployment"), this);
+ dd->m_runWithoutDeployAction = new QAction(Tr::tr("Run Without Deployment"), this);
cmd = ActionManager::registerAction(dd->m_runWithoutDeployAction, Constants::RUNWITHOUTDEPLOY);
mbuild->addAction(cmd, Constants::G_BUILD_RUN);
// build action with dependencies (context menu)
- dd->m_buildDependenciesActionContextMenu = new QAction(tr("Build"), this);
+ dd->m_buildDependenciesActionContextMenu = new QAction(Tr::tr("Build"), this);
cmd = ActionManager::registerAction(dd->m_buildDependenciesActionContextMenu, Constants::BUILDDEPENDCM, projectTreeContext);
cmd->setAttribute(Command::CA_UpdateText);
mprojectContextMenu->addAction(cmd, Constants::G_PROJECT_BUILD);
// build action (context menu)
- dd->m_buildActionContextMenu = new QAction(tr("Build Without Dependencies"), this);
+ dd->m_buildActionContextMenu = new QAction(Tr::tr("Build Without Dependencies"), this);
cmd = ActionManager::registerAction(dd->m_buildActionContextMenu, Constants::BUILDCM, projectTreeContext);
cmd->setAttribute(Command::CA_UpdateText);
mprojectContextMenu->addAction(cmd, Constants::G_PROJECT_BUILD);
// rebuild action with dependencies (context menu)
- dd->m_rebuildDependenciesActionContextMenu = new QAction(tr("Rebuild"), this);
+ dd->m_rebuildDependenciesActionContextMenu = new QAction(Tr::tr("Rebuild"), this);
cmd = ActionManager::registerAction(dd->m_rebuildDependenciesActionContextMenu, Constants::REBUILDDEPENDCM, projectTreeContext);
cmd->setAttribute(Command::CA_UpdateText);
mprojectContextMenu->addAction(cmd, Constants::G_PROJECT_REBUILD);
// rebuild action (context menu)
- dd->m_rebuildActionContextMenu = new QAction(tr("Rebuild Without Dependencies"), this);
+ dd->m_rebuildActionContextMenu = new QAction(Tr::tr("Rebuild Without Dependencies"), this);
cmd = ActionManager::registerAction(dd->m_rebuildActionContextMenu, Constants::REBUILDCM, projectTreeContext);
cmd->setAttribute(Command::CA_UpdateText);
mprojectContextMenu->addAction(cmd, Constants::G_PROJECT_REBUILD);
// clean action with dependencies (context menu)
- dd->m_cleanDependenciesActionContextMenu = new QAction(tr("Clean"), this);
+ dd->m_cleanDependenciesActionContextMenu = new QAction(Tr::tr("Clean"), this);
cmd = ActionManager::registerAction(dd->m_cleanDependenciesActionContextMenu, Constants::CLEANDEPENDCM, projectTreeContext);
cmd->setAttribute(Command::CA_UpdateText);
mprojectContextMenu->addAction(cmd, Constants::G_PROJECT_REBUILD);
// clean action (context menu)
- dd->m_cleanActionContextMenu = new QAction(tr("Clean Without Dependencies"), this);
+ dd->m_cleanActionContextMenu = new QAction(Tr::tr("Clean Without Dependencies"), this);
cmd = ActionManager::registerAction(dd->m_cleanActionContextMenu, Constants::CLEANCM, projectTreeContext);
cmd->setAttribute(Command::CA_UpdateText);
mprojectContextMenu->addAction(cmd, Constants::G_PROJECT_REBUILD);
// build without dependencies action
- dd->m_buildProjectOnlyAction = new QAction(tr("Build Without Dependencies"), this);
+ dd->m_buildProjectOnlyAction = new QAction(Tr::tr("Build Without Dependencies"), this);
ActionManager::registerAction(dd->m_buildProjectOnlyAction, Constants::BUILDPROJECTONLY);
// rebuild without dependencies action
- dd->m_rebuildProjectOnlyAction = new QAction(tr("Rebuild Without Dependencies"), this);
+ dd->m_rebuildProjectOnlyAction = new QAction(Tr::tr("Rebuild Without Dependencies"), this);
ActionManager::registerAction(dd->m_rebuildProjectOnlyAction, Constants::REBUILDPROJECTONLY);
// deploy without dependencies action
- dd->m_deployProjectOnlyAction = new QAction(tr("Deploy Without Dependencies"), this);
+ dd->m_deployProjectOnlyAction = new QAction(Tr::tr("Deploy Without Dependencies"), this);
ActionManager::registerAction(dd->m_deployProjectOnlyAction, Constants::DEPLOYPROJECTONLY);
// clean without dependencies action
- dd->m_cleanProjectOnlyAction = new QAction(tr("Clean Without Dependencies"), this);
+ dd->m_cleanProjectOnlyAction = new QAction(Tr::tr("Clean Without Dependencies"), this);
ActionManager::registerAction(dd->m_cleanProjectOnlyAction, Constants::CLEANPROJECTONLY);
// deploy action (context menu)
- dd->m_deployActionContextMenu = new QAction(tr("Deploy"), this);
+ dd->m_deployActionContextMenu = new QAction(Tr::tr("Deploy"), this);
cmd = ActionManager::registerAction(dd->m_deployActionContextMenu, Constants::DEPLOYCM, projectTreeContext);
mprojectContextMenu->addAction(cmd, Constants::G_PROJECT_RUN);
- dd->m_runActionContextMenu = new QAction(runIcon, tr("Run"), this);
+ dd->m_runActionContextMenu = new QAction(runIcon, Tr::tr("Run"), this);
cmd = ActionManager::registerAction(dd->m_runActionContextMenu, Constants::RUNCONTEXTMENU, projectTreeContext);
mprojectContextMenu->addAction(cmd, Constants::G_PROJECT_RUN);
msubProjectContextMenu->addAction(cmd, Constants::G_PROJECT_RUN);
// add new file action
- dd->m_addNewFileAction = new QAction(tr("Add New..."), this);
+ dd->m_addNewFileAction = new QAction(Tr::tr("Add New..."), this);
cmd = ActionManager::registerAction(dd->m_addNewFileAction, Constants::ADDNEWFILE,
projectTreeContext);
mprojectContextMenu->addAction(cmd, Constants::G_PROJECT_FILES);
@@ -1494,7 +1489,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
mfolderContextMenu->addAction(cmd, Constants::G_FOLDER_FILES);
// add existing file action
- dd->m_addExistingFilesAction = new QAction(tr("Add Existing Files..."), this);
+ dd->m_addExistingFilesAction = new QAction(Tr::tr("Add Existing Files..."), this);
cmd = ActionManager::registerAction(dd->m_addExistingFilesAction, Constants::ADDEXISTINGFILES,
projectTreeContext);
mprojectContextMenu->addAction(cmd, Constants::G_PROJECT_FILES);
@@ -1502,14 +1497,14 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
mfolderContextMenu->addAction(cmd, Constants::G_FOLDER_FILES);
// add existing projects action
- dd->m_addExistingProjectsAction = new QAction(tr("Add Existing Projects..."), this);
+ dd->m_addExistingProjectsAction = new QAction(Tr::tr("Add Existing Projects..."), this);
cmd = ActionManager::registerAction(dd->m_addExistingProjectsAction,
"ProjectExplorer.AddExistingProjects", projectTreeContext);
mprojectContextMenu->addAction(cmd, Constants::G_PROJECT_FILES);
msubProjectContextMenu->addAction(cmd, Constants::G_PROJECT_FILES);
// add existing directory action
- dd->m_addExistingDirectoryAction = new QAction(tr("Add Existing Directory..."), this);
+ dd->m_addExistingDirectoryAction = new QAction(Tr::tr("Add Existing Directory..."), this);
cmd = ActionManager::registerAction(dd->m_addExistingDirectoryAction,
Constants::ADDEXISTINGDIRECTORY,
projectTreeContext);
@@ -1518,14 +1513,14 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
mfolderContextMenu->addAction(cmd, Constants::G_FOLDER_FILES);
// new subproject action
- dd->m_addNewSubprojectAction = new QAction(tr("New Subproject..."), this);
+ dd->m_addNewSubprojectAction = new QAction(Tr::tr("New Subproject..."), this);
cmd = ActionManager::registerAction(dd->m_addNewSubprojectAction, Constants::ADDNEWSUBPROJECT,
projectTreeContext);
mprojectContextMenu->addAction(cmd, Constants::G_PROJECT_FILES);
msubProjectContextMenu->addAction(cmd, Constants::G_PROJECT_FILES);
dd->m_closeProjectFilesActionContextMenu = new ParameterAction(
- tr("Close All Files"), tr("Close All Files in Project \"%1\""),
+ Tr::tr("Close All Files"), Tr::tr("Close All Files in Project \"%1\""),
ParameterAction::EnabledWithParameter, this);
cmd = ActionManager::registerAction(dd->m_closeProjectFilesActionContextMenu,
"ProjectExplorer.CloseAllFilesInProjectContextMenu");
@@ -1534,14 +1529,14 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
mprojectContextMenu->addAction(cmd, Constants::G_PROJECT_CLOSE);
// unload project again, in right position
- dd->m_unloadActionContextMenu = new ParameterAction(tr("Close Project"), tr("Close Project \"%1\""),
+ dd->m_unloadActionContextMenu = new ParameterAction(Tr::tr("Close Project"), Tr::tr("Close Project \"%1\""),
ParameterAction::EnabledWithParameter, this);
cmd = ActionManager::registerAction(dd->m_unloadActionContextMenu, Constants::UNLOADCM);
cmd->setAttribute(Command::CA_UpdateText);
cmd->setDescription(dd->m_unloadActionContextMenu->text());
mprojectContextMenu->addAction(cmd, Constants::G_PROJECT_CLOSE);
- dd->m_unloadOthersActionContextMenu = new ParameterAction(tr("Close Other Projects"), tr("Close All Projects Except \"%1\""),
+ dd->m_unloadOthersActionContextMenu = new ParameterAction(Tr::tr("Close Other Projects"), Tr::tr("Close All Projects Except \"%1\""),
ParameterAction::EnabledWithParameter, this);
cmd = ActionManager::registerAction(dd->m_unloadOthersActionContextMenu, Constants::UNLOADOTHERSCM);
cmd->setAttribute(Command::CA_UpdateText);
@@ -1549,39 +1544,39 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
mprojectContextMenu->addAction(cmd, Constants::G_PROJECT_CLOSE);
// file properties action
- dd->m_filePropertiesAction = new QAction(tr("Properties..."), this);
+ dd->m_filePropertiesAction = new QAction(Tr::tr("Properties..."), this);
cmd = ActionManager::registerAction(dd->m_filePropertiesAction, Constants::FILEPROPERTIES,
projectTreeContext);
mfileContextMenu->addAction(cmd, Constants::G_FILE_OTHER);
// remove file action
- dd->m_removeFileAction = new QAction(tr("Remove..."), this);
+ dd->m_removeFileAction = new QAction(Tr::tr("Remove..."), this);
cmd = ActionManager::registerAction(dd->m_removeFileAction, Constants::REMOVEFILE,
projectTreeContext);
cmd->setDefaultKeySequences({QKeySequence::Delete, QKeySequence::Backspace});
mfileContextMenu->addAction(cmd, Constants::G_FILE_OTHER);
// duplicate file action
- dd->m_duplicateFileAction = new QAction(tr("Duplicate File..."), this);
+ dd->m_duplicateFileAction = new QAction(Tr::tr("Duplicate File..."), this);
cmd = ActionManager::registerAction(dd->m_duplicateFileAction, Constants::DUPLICATEFILE,
projectTreeContext);
mfileContextMenu->addAction(cmd, Constants::G_FILE_OTHER);
//: Remove project from parent profile (Project explorer view); will not physically delete any files.
- dd->m_removeProjectAction = new QAction(tr("Remove Project..."), this);
+ dd->m_removeProjectAction = new QAction(Tr::tr("Remove Project..."), this);
cmd = ActionManager::registerAction(dd->m_removeProjectAction, Constants::REMOVEPROJECT,
projectTreeContext);
msubProjectContextMenu->addAction(cmd, Constants::G_PROJECT_FILES);
// delete file action
- dd->m_deleteFileAction = new QAction(tr("Delete File..."), this);
+ dd->m_deleteFileAction = new QAction(Tr::tr("Delete File..."), this);
cmd = ActionManager::registerAction(dd->m_deleteFileAction, Constants::DELETEFILE,
projectTreeContext);
cmd->setDefaultKeySequences({QKeySequence::Delete, QKeySequence::Backspace});
mfileContextMenu->addAction(cmd, Constants::G_FILE_OTHER);
// renamefile action
- dd->m_renameFileAction = new QAction(tr("Rename..."), this);
+ dd->m_renameFileAction = new QAction(Tr::tr("Rename..."), this);
cmd = ActionManager::registerAction(dd->m_renameFileAction, Constants::RENAMEFILE,
projectTreeContext);
mfileContextMenu->addAction(cmd, Constants::G_FILE_OTHER);
@@ -1598,8 +1593,8 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
// mproject->addAction(cmd, Constants::G_FOLDER_FILES);
// set startup project action
- dd->m_setStartupProjectAction = new ParameterAction(tr("Set as Active Project"),
- tr("Set \"%1\" as Active Project"),
+ dd->m_setStartupProjectAction = new ParameterAction(Tr::tr("Set as Active Project"),
+ Tr::tr("Set \"%1\" as Active Project"),
ParameterAction::AlwaysEnabled, this);
cmd = ActionManager::registerAction(dd->m_setStartupProjectAction, Constants::SETSTARTUP,
projectTreeContext);
@@ -1610,17 +1605,17 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
// Collapse & Expand.
const Id treeGroup = Constants::G_PROJECT_TREE;
- dd->m_projectTreeExpandNodeAction = new QAction(tr("Expand"), this);
+ dd->m_projectTreeExpandNodeAction = new QAction(Tr::tr("Expand"), this);
connect(dd->m_projectTreeExpandNodeAction, &QAction::triggered,
ProjectTree::instance(), &ProjectTree::expandCurrentNodeRecursively);
Command * const expandNodeCmd = ActionManager::registerAction(
dd->m_projectTreeExpandNodeAction, "ProjectExplorer.ExpandNode",
projectTreeContext);
- dd->m_projectTreeCollapseAllAction = new QAction(tr("Collapse All"), this);
+ dd->m_projectTreeCollapseAllAction = new QAction(Tr::tr("Collapse All"), this);
Command * const collapseCmd = ActionManager::registerAction(
dd->m_projectTreeCollapseAllAction, Constants::PROJECTTREE_COLLAPSE_ALL,
projectTreeContext);
- dd->m_projectTreeExpandAllAction = new QAction(tr("Expand All"), this);
+ dd->m_projectTreeExpandAllAction = new QAction(Tr::tr("Expand All"), this);
Command * const expandCmd = ActionManager::registerAction(
dd->m_projectTreeExpandAllAction, Constants::PROJECTTREE_EXPAND_ALL,
projectTreeContext);
@@ -1644,7 +1639,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
dd->m_projectSelectorActionMenu = new QAction(this);
dd->m_projectSelectorActionMenu->setEnabled(false);
- dd->m_projectSelectorActionMenu->setText(tr("Open Build and Run Kit Selector..."));
+ dd->m_projectSelectorActionMenu->setText(Tr::tr("Open Build and Run Kit Selector..."));
connect(dd->m_projectSelectorActionMenu, &QAction::triggered,
dd->m_targetSelector,
&MiniProjectTargetSelector::toggleVisible);
@@ -1653,11 +1648,11 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
dd->m_projectSelectorActionQuick = new QAction(this);
dd->m_projectSelectorActionQuick->setEnabled(false);
- dd->m_projectSelectorActionQuick->setText(tr("Quick Switch Kit Selector"));
+ dd->m_projectSelectorActionQuick->setText(Tr::tr("Quick Switch Kit Selector"));
connect(dd->m_projectSelectorActionQuick, &QAction::triggered,
dd->m_targetSelector, &MiniProjectTargetSelector::nextOrShow);
cmd = ActionManager::registerAction(dd->m_projectSelectorActionQuick, Constants::SELECTTARGETQUICK);
- cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+T")));
+ cmd->setDefaultKeySequence(QKeySequence(Tr::tr("Ctrl+T")));
connect(ICore::instance(), &ICore::saveSettingsRequested,
dd, &ProjectExplorerPluginPrivate::savePersistentSettings);
@@ -1948,13 +1943,13 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
expander,
&ProjectTree::currentProject);
EnvironmentProvider::addProvider(
- {"CurrentDocument:Project:BuildConfig:Env", tr("Current Build Environment"), [] {
+ {"CurrentDocument:Project:BuildConfig:Env", Tr::tr("Current Build Environment"), [] {
if (BuildConfiguration *bc = currentBuildConfiguration())
return bc->environment();
return Environment::systemEnvironment();
}});
EnvironmentProvider::addProvider(
- {"CurrentDocument:Project:RunConfig:Env", tr("Current Run Environment"), [] {
+ {"CurrentDocument:Project:RunConfig:Env", Tr::tr("Current Run Environment"), [] {
const Project *const project = ProjectTree::currentProject();
const Target *const target = project ? project->activeTarget() : nullptr;
const RunConfiguration *const rc = target ? target->activeRunConfiguration() : nullptr;
@@ -1971,13 +1966,13 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
expander,
&SessionManager::startupProject);
EnvironmentProvider::addProvider(
- {"ActiveProject:BuildConfig:Env", tr("Active build environment of the active project."), [] {
+ {"ActiveProject:BuildConfig:Env", Tr::tr("Active build environment of the active project."), [] {
if (const BuildConfiguration * const bc = activeBuildConfiguration())
return bc->environment();
return Environment::systemEnvironment();
}});
EnvironmentProvider::addProvider(
- {"ActiveProject:RunConfig:Env", tr("Active run environment of the active project."), [] {
+ {"ActiveProject:RunConfig:Env", Tr::tr("Active run environment of the active project."), [] {
if (const RunConfiguration *const rc = activeRunConfiguration()) {
if (auto envAspect = rc->aspect())
return envAspect->environment();
@@ -1988,9 +1983,9 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
const auto fileHandler = [] {
return SessionManager::sessionNameToFileName(SessionManager::activeSession());
};
- expander->registerFileVariables("Session", tr("File where current session is saved."),
+ expander->registerFileVariables("Session", Tr::tr("File where current session is saved."),
fileHandler);
- expander->registerVariable("Session:Name", tr("Name of current session."), [] {
+ expander->registerVariable("Session:Name", Tr::tr("Name of current session."), [] {
return SessionManager::activeSession();
});
@@ -2012,7 +2007,7 @@ void ProjectExplorerPluginPrivate::loadAction()
}
FilePath filePath = Utils::FileUtils::getOpenFilePath(ICore::dialogParent(),
- tr("Load Project"), dir,
+ Tr::tr("Load Project"), dir,
dd->m_projectFilterString);
if (filePath.isEmpty())
return;
@@ -2056,12 +2051,12 @@ void ProjectExplorerPlugin::unloadProject(Project *project)
{
if (BuildManager::isBuilding(project)) {
QMessageBox box;
- QPushButton *closeAnyway = box.addButton(tr("Cancel Build && Unload"), QMessageBox::AcceptRole);
- QPushButton *cancelClose = box.addButton(tr("Do Not Unload"), QMessageBox::RejectRole);
+ QPushButton *closeAnyway = box.addButton(Tr::tr("Cancel Build && Unload"), QMessageBox::AcceptRole);
+ QPushButton *cancelClose = box.addButton(Tr::tr("Do Not Unload"), QMessageBox::RejectRole);
box.setDefaultButton(cancelClose);
- box.setWindowTitle(tr("Unload Project %1?").arg(project->displayName()));
- box.setText(tr("The project %1 is currently being built.").arg(project->displayName()));
- box.setInformativeText(tr("Do you want to cancel the build process and unload the project anyway?"));
+ box.setWindowTitle(Tr::tr("Unload Project %1?").arg(project->displayName()));
+ box.setText(Tr::tr("The project %1 is currently being built.").arg(project->displayName()));
+ box.setInformativeText(Tr::tr("Do you want to cancel the build process and unload the project anyway?"));
box.exec();
if (box.clickedButton() != closeAnyway)
return;
@@ -2127,7 +2122,7 @@ void ProjectExplorerPlugin::extensionsInitialized()
return TaskFile::openTasks(filePath);
});
- QString allProjectsFilter = tr("All Projects");
+ QString allProjectsFilter = Tr::tr("All Projects");
allProjectsFilter += QLatin1String(" (") + allGlobPatterns.join(QLatin1Char(' '))
+ QLatin1Char(')');
filterStrings.prepend(allProjectsFilter);
@@ -2135,8 +2130,8 @@ void ProjectExplorerPlugin::extensionsInitialized()
BuildManager::extensionsInitialized();
TaskHub::addCategory(Constants::TASK_CATEGORY_SANITIZER,
- tr("Sanitizer", "Category for sanitizer issues listed under 'Issues'"));
- TaskHub::addCategory(Constants::TASK_CATEGORY_TASKLIST_ID, TaskFile::tr("My Tasks"));
+ Tr::tr("Sanitizer", "Category for sanitizer issues listed under 'Issues'"));
+ TaskHub::addCategory(Constants::TASK_CATEGORY_TASKLIST_ID, Tr::tr("My Tasks"));
SshSettings::loadSettings(Core::ICore::settings());
const auto searchPathRetriever = [] {
@@ -2159,7 +2154,7 @@ void ProjectExplorerPlugin::extensionsInitialized()
};
SshSettings::setExtraSearchPathRetriever(searchPathRetriever);
- const auto parseIssuesAction = new QAction(tr("Parse Build Output..."), this);
+ const auto parseIssuesAction = new QAction(Tr::tr("Parse Build Output..."), this);
ActionContainer *mtools = ActionManager::actionContainer(Core::Constants::M_TOOLS);
Command * const cmd = ActionManager::registerAction(parseIssuesAction,
"ProjectExplorer.ParseIssuesAction");
@@ -2224,7 +2219,7 @@ void ProjectExplorerPlugin::showSessionManager()
void ProjectExplorerPlugin::openNewProjectDialog()
{
if (!ICore::isNewItemDialogRunning()) {
- ICore::showNewItemDialog(tr("New Project", "Title of dialog"),
+ ICore::showNewItemDialog(Tr::tr("New Project", "Title of dialog"),
Utils::filtered(IWizardFactory::allWizardFactories(),
[](IWizardFactory *f) { return !f->supportedProjectTypes().isEmpty(); }));
} else {
@@ -2398,12 +2393,12 @@ void ProjectExplorerPlugin::showOpenProjectError(const OpenProjectResult &result
QString errorMessage = result.errorMessage();
if (!errorMessage.isEmpty()) {
// ignore alreadyOpen
- QMessageBox::critical(ICore::dialogParent(), tr("Failed to Open Project"), errorMessage);
+ QMessageBox::critical(ICore::dialogParent(), Tr::tr("Failed to Open Project"), errorMessage);
} else {
// ignore multiple alreadyOpen
Project *alreadyOpen = result.alreadyOpen().constFirst();
ProjectTree::highlightProject(alreadyOpen,
- tr("Project already open
"));
+ Tr::tr("Project already open
"));
}
}
@@ -2438,7 +2433,7 @@ ProjectExplorerPlugin::OpenProjectResult ProjectExplorerPlugin::openProjects(con
if (ProjectManager::canOpenProjectForMimeType(mt)) {
if (!filePath.isFile()) {
appendError(errorString,
- tr("Failed opening project \"%1\": Project is not a file.").arg(filePath.toUserOutput()));
+ Tr::tr("Failed opening project \"%1\": Project is not a file.").arg(filePath.toUserOutput()));
} else if (Project *pro = ProjectManager::openProject(mt, filePath)) {
QString restoreError;
Project::RestoreResult restoreResult = pro->restoreSettings(&restoreError);
@@ -2454,7 +2449,7 @@ ProjectExplorerPlugin::OpenProjectResult ProjectExplorerPlugin::openProjects(con
}
}
} else {
- appendError(errorString, tr("Failed opening project \"%1\": No plugin can open project type \"%2\".")
+ appendError(errorString, Tr::tr("Failed opening project \"%1\": No plugin can open project type \"%2\".")
.arg(filePath.toUserOutput())
.arg(mt.name()));
}
@@ -2702,16 +2697,16 @@ void ProjectExplorerPluginPrivate::buildQueueFinished(bool success)
bool ignoreErrors = true;
if (!m_delayedRunConfiguration.isNull() && success && BuildManager::getErrorTaskCount() > 0) {
ignoreErrors = QMessageBox::question(ICore::dialogParent(),
- ProjectExplorerPlugin::tr("Ignore All Errors?"),
- ProjectExplorerPlugin::tr("Found some build errors in current task.\n"
+ Tr::tr("Ignore All Errors?"),
+ Tr::tr("Found some build errors in current task.\n"
"Do you want to ignore them?"),
QMessageBox::Yes | QMessageBox::No,
QMessageBox::No) == QMessageBox::Yes;
}
if (m_delayedRunConfiguration.isNull() && m_shouldHaveRunConfiguration) {
QMessageBox::warning(ICore::dialogParent(),
- ProjectExplorerPlugin::tr("Run Configuration Removed"),
- ProjectExplorerPlugin::tr("The configuration that was supposed to run is no longer "
+ Tr::tr("Run Configuration Removed"),
+ Tr::tr("The configuration that was supposed to run is no longer "
"available."), QMessageBox::Ok);
}
@@ -2872,7 +2867,7 @@ bool ProjectExplorerPlugin::saveModifiedFiles()
bool cancelled = false;
bool alwaysSave = false;
if (!DocumentManager::saveModifiedDocuments(documentsToSave, QString(), &cancelled,
- tr("Always save files before build"), &alwaysSave)) {
+ Tr::tr("Always save files before build"), &alwaysSave)) {
if (cancelled)
return false;
}
@@ -2895,7 +2890,7 @@ void ProjectExplorerPluginPrivate::extendFolderNavigationWidgetFactory()
[this](QMenu *menu, const FilePath &filePath, bool isDir) {
if (isDir) {
QAction *actionOpenProjects = menu->addAction(
- ProjectExplorerPlugin::tr("Open Project in \"%1\"")
+ Tr::tr("Open Project in \"%1\"")
.arg(filePath.toUserOutput()));
connect(actionOpenProjects, &QAction::triggered, this, [filePath] {
openProjectsInDirectory(filePath);
@@ -2904,7 +2899,7 @@ void ProjectExplorerPluginPrivate::extendFolderNavigationWidgetFactory()
actionOpenProjects->setEnabled(false);
} else if (ProjectExplorerPlugin::isProjectFile(filePath)) {
QAction *actionOpenAsProject = menu->addAction(
- tr("Open Project \"%1\"").arg(filePath.toUserOutput()));
+ Tr::tr("Open Project \"%1\"").arg(filePath.toUserOutput()));
connect(actionOpenAsProject, &QAction::triggered, this, [filePath] {
ProjectExplorerPlugin::openProject(filePath);
});
@@ -2923,13 +2918,13 @@ void ProjectExplorerPluginPrivate::extendFolderNavigationWidgetFactory()
if (!failedNodes.isEmpty()) {
const QString projects = projectNames(failedNodes).join(", ");
const QString errorMessage
- = ProjectExplorerPlugin::tr(
+ = Tr::tr(
"The file \"%1\" was renamed to \"%2\", "
"but the following projects could not be automatically changed: %3")
.arg(before.toUserOutput(), after.toUserOutput(), projects);
QTimer::singleShot(0, Core::ICore::instance(), [errorMessage] {
QMessageBox::warning(Core::ICore::dialogParent(),
- ProjectExplorerPlugin::tr("Project Editing Failed"),
+ Tr::tr("Project Editing Failed"),
errorMessage);
});
}
@@ -2946,11 +2941,11 @@ void ProjectExplorerPluginPrivate::extendFolderNavigationWidgetFactory()
if (!failedNodes.isEmpty()) {
const QString projects = projectNames(failedNodes).join(", ");
const QString errorMessage
- = tr("The following projects failed to automatically remove the file: %1")
+ = Tr::tr("The following projects failed to automatically remove the file: %1")
.arg(projects);
QTimer::singleShot(0, Core::ICore::instance(), [errorMessage] {
QMessageBox::warning(Core::ICore::dialogParent(),
- tr("Project Editing Failed"),
+ Tr::tr("Project Editing Failed"),
errorMessage);
});
}
@@ -2990,8 +2985,7 @@ static QPair subprojectEnabledState(const Project *pro)
&& !project->activeTarget()->activeBuildConfiguration()->isEnabled()) {
result.first = false;
result.second
- += QCoreApplication::translate("ProjectExplorerPluginPrivate",
- "Building \"%1\" is disabled: %2
")
+ += Tr::tr("Building \"%1\" is disabled: %2
")
.arg(project->displayName(),
project->activeTarget()->activeBuildConfiguration()->disabledReason());
}
@@ -3006,16 +3000,16 @@ QPair ProjectExplorerPluginPrivate::buildSettingsEnabled(const Pr
result.first = true;
if (!pro) {
result.first = false;
- result.second = tr("No project loaded.");
+ result.second = Tr::tr("No project loaded.");
} else if (BuildManager::isBuilding(pro)) {
result.first = false;
- result.second = tr("Currently building the active project.");
+ result.second = Tr::tr("Currently building the active project.");
} else if (pro->needsConfiguration()) {
result.first = false;
- result.second = tr("The project %1 is not configured.").arg(pro->displayName());
+ result.second = Tr::tr("The project %1 is not configured.").arg(pro->displayName());
} else if (!hasBuildSettings(pro)) {
result.first = false;
- result.second = tr("Project has no build settings.");
+ result.second = Tr::tr("Project has no build settings.");
} else {
result = subprojectEnabledState(pro);
}
@@ -3028,13 +3022,13 @@ QPair ProjectExplorerPluginPrivate::buildSettingsEnabledForSessio
result.first = true;
if (!SessionManager::hasProjects()) {
result.first = false;
- result.second = tr("No project loaded.");
+ result.second = Tr::tr("No project loaded.");
} else if (BuildManager::isBuilding()) {
result.first = false;
- result.second = tr("A build is in progress.");
+ result.second = Tr::tr("A build is in progress.");
} else if (!hasBuildSettings(nullptr)) {
result.first = false;
- result.second = tr("Project has no build settings.");
+ result.second = Tr::tr("Project has no build settings.");
} else {
result = subprojectEnabledState(nullptr);
}
@@ -3047,12 +3041,12 @@ bool ProjectExplorerPlugin::coreAboutToClose()
return true;
if (BuildManager::isBuilding()) {
QMessageBox box;
- QPushButton *closeAnyway = box.addButton(tr("Cancel Build && Close"), QMessageBox::AcceptRole);
- QPushButton *cancelClose = box.addButton(tr("Do Not Close"), QMessageBox::RejectRole);
+ QPushButton *closeAnyway = box.addButton(Tr::tr("Cancel Build && Close"), QMessageBox::AcceptRole);
+ QPushButton *cancelClose = box.addButton(Tr::tr("Do Not Close"), QMessageBox::RejectRole);
box.setDefaultButton(cancelClose);
- box.setWindowTitle(tr("Close %1?").arg(Core::Constants::IDE_DISPLAY_NAME));
- box.setText(tr("A project is currently being built."));
- box.setInformativeText(tr("Do you want to cancel the build process and close %1 anyway?")
+ box.setWindowTitle(Tr::tr("Close %1?").arg(Core::Constants::IDE_DISPLAY_NAME));
+ box.setText(Tr::tr("A project is currently being built."));
+ box.setInformativeText(Tr::tr("Do you want to cancel the build process and close %1 anyway?")
.arg(Core::Constants::IDE_DISPLAY_NAME));
box.exec();
if (box.clickedButton() != closeAnyway)
@@ -3223,27 +3217,27 @@ bool ProjectExplorerPlugin::canRunStartupProject(Id runMode, QString *whyNot)
Project *project = SessionManager::startupProject();
if (!project) {
if (whyNot)
- *whyNot = tr("No active project.");
+ *whyNot = Tr::tr("No active project.");
return false;
}
if (project->needsConfiguration()) {
if (whyNot)
- *whyNot = tr("The project \"%1\" is not configured.").arg(project->displayName());
+ *whyNot = Tr::tr("The project \"%1\" is not configured.").arg(project->displayName());
return false;
}
Target *target = project->activeTarget();
if (!target) {
if (whyNot)
- *whyNot = tr("The project \"%1\" has no active kit.").arg(project->displayName());
+ *whyNot = Tr::tr("The project \"%1\" has no active kit.").arg(project->displayName());
return false;
}
RunConfiguration *activeRC = target->activeRunConfiguration();
if (!activeRC) {
if (whyNot)
- *whyNot = tr("The kit \"%1\" for the project \"%2\" has no active run configuration.")
+ *whyNot = Tr::tr("The kit \"%1\" for the project \"%2\" has no active run configuration.")
.arg(target->displayName(), project->displayName());
return false;
}
@@ -3267,7 +3261,7 @@ bool ProjectExplorerPlugin::canRunStartupProject(Id runMode, QString *whyNot)
if (BuildManager::isBuilding()) {
if (whyNot)
- *whyNot = tr("A build is still in progress.");
+ *whyNot = Tr::tr("A build is still in progress.");
return false;
}
}
@@ -3277,13 +3271,13 @@ bool ProjectExplorerPlugin::canRunStartupProject(Id runMode, QString *whyNot)
DeviceTypeKitAspect::deviceTypeId(target->kit()),
activeRC->id())) {
if (whyNot)
- *whyNot = tr("Cannot run \"%1\".").arg(activeRC->displayName());
+ *whyNot = Tr::tr("Cannot run \"%1\".").arg(activeRC->displayName());
return false;
}
if (dd->m_delayedRunConfiguration && dd->m_delayedRunConfiguration->project() == project) {
if (whyNot)
- *whyNot = tr("A run action is already scheduled for the active project.");
+ *whyNot = Tr::tr("A run action is already scheduled for the active project.");
return false;
}
@@ -3326,7 +3320,7 @@ void ProjectExplorerPluginPrivate::updateUnloadProjectMenu()
QMenu *menu = aci->menu();
menu->clear();
for (Project *project : SessionManager::projects()) {
- QAction *action = menu->addAction(tr("Close Project \"%1\"").arg(project->displayName()));
+ QAction *action = menu->addAction(Tr::tr("Close Project \"%1\"").arg(project->displayName()));
connect(action, &QAction::triggered,
[project] { ProjectExplorerPlugin::unloadProject(project); } );
}
@@ -3468,7 +3462,7 @@ void ProjectExplorerPluginPrivate::updateContextMenuActions(Node *currentNode)
runMenu->menu()->menuAction()->setVisible(true);
for (RunConfiguration *rc : std::as_const(runConfigs)) {
auto *act = new QAction(runMenu->menu());
- act->setText(tr("Run %1").arg(rc->displayName()));
+ act->setText(Tr::tr("Run %1").arg(rc->displayName()));
runMenu->menu()->addAction(act);
connect(act, &QAction::triggered,
this, [this, rc] { runProjectContextMenu(rc); });
@@ -3592,7 +3586,7 @@ void ProjectExplorerPluginPrivate::updateLocationSubMenus()
const FilePath path = li.path;
QString displayName = fn->filePath() == li.path
? li.displayName
- : tr("%1 in %2").arg(li.displayName).arg(li.path.toUserOutput());
+ : Tr::tr("%1 in %2").arg(li.displayName).arg(li.path.toUserOutput());
auto *action = new QAction(displayName, nullptr);
connect(action, &QAction::triggered, this, [line, path] {
Core::EditorManager::openEditorAt(Link(path, line),
@@ -3625,7 +3619,7 @@ void ProjectExplorerPluginPrivate::addNewFile()
map.insert(QLatin1String(Constants::PROJECT_KIT_IDS), profileIds);
map.insert(Constants::PROJECT_POINTER, QVariant::fromValue(static_cast(p)));
}
- ICore::showNewItemDialog(ProjectExplorerPlugin::tr("New File", "Title of dialog"),
+ ICore::showNewItemDialog(Tr::tr("New File", "Title of dialog"),
Utils::filtered(IWizardFactory::allWizardFactories(),
[](IWizardFactory *f) {
return f->supportedProjectTypes().isEmpty();
@@ -3654,7 +3648,7 @@ void ProjectExplorerPluginPrivate::addNewSubproject()
projectType = project->id();
}
- ICore::showNewItemDialog(tr("New Subproject", "Title of dialog"),
+ ICore::showNewItemDialog(Tr::tr("New Subproject", "Title of dialog"),
Utils::filtered(IWizardFactory::allWizardFactories(),
[projectType](IWizardFactory *f) {
return projectType.isValid() ? f->supportedProjectTypes().contains(projectType)
@@ -3674,7 +3668,7 @@ void ProjectExplorerPluginPrivate::addExistingProjects()
QTC_ASSERT(projectNode, return);
const FilePath dir = currentNode->directory();
FilePaths subProjectFilePaths = Utils::FileUtils::getOpenFilePaths(
- nullptr, tr("Choose Project File"), dir,
+ nullptr, Tr::tr("Choose Project File"), dir,
projectNode->subProjectFileNamePatterns().join(";;"));
if (!ProjectTree::hasNode(projectNode))
return;
@@ -3695,9 +3689,9 @@ void ProjectExplorerPluginPrivate::addExistingProjects()
failedProjects << filePath;
}
if (!failedProjects.empty()) {
- const QString message = tr("The following subprojects could not be added to project "
+ const QString message = Tr::tr("The following subprojects could not be added to project "
"\"%1\":").arg(projectNode->managingProject()->displayName());
- QMessageBox::warning(ICore::dialogParent(), tr("Adding Subproject Failed"),
+ QMessageBox::warning(ICore::dialogParent(), Tr::tr("Adding Subproject Failed"),
message + "\n " + FilePath::formatFilePaths(failedProjects, "\n "));
return;
}
@@ -3712,7 +3706,7 @@ void ProjectExplorerPluginPrivate::handleAddExistingFiles()
QTC_ASSERT(folderNode, return);
const FilePaths filePaths =
- Utils::FileUtils::getOpenFilePaths(nullptr, tr("Add Existing Files"), node->directory());
+ Utils::FileUtils::getOpenFilePaths(nullptr, Tr::tr("Add Existing Files"), node->directory());
if (filePaths.isEmpty())
return;
@@ -3745,9 +3739,9 @@ void ProjectExplorerPlugin::addExistingFiles(FolderNode *folderNode, const FileP
folderNode->addFiles(fileNames, ¬Added);
if (!notAdded.isEmpty()) {
- const QString message = tr("Could not add following files to project %1:")
+ const QString message = Tr::tr("Could not add following files to project %1:")
.arg(folderNode->managingProject()->displayName()) + QLatin1Char('\n');
- QMessageBox::warning(ICore::dialogParent(), tr("Adding Files to Project Failed"),
+ QMessageBox::warning(ICore::dialogParent(), Tr::tr("Adding Files to Project Failed"),
message + FilePath::formatFilePaths(notAdded, "\n"));
fileNames = Utils::filtered(fileNames,
[¬Added](const FilePath &f) { return !notAdded.contains(f); });
@@ -3855,8 +3849,8 @@ void ProjectExplorerPluginPrivate::removeFile()
if (!siblings.isEmpty()) {
const QMessageBox::StandardButton reply = QMessageBox::question(
- Core::ICore::dialogParent(), tr("Remove More Files?"),
- tr("Remove these files as well?\n %1")
+ Core::ICore::dialogParent(), Tr::tr("Remove More Files?"),
+ Tr::tr("Remove these files as well?\n %1")
.arg(Utils::transform(siblings, [](const NodeAndPath &np) {
return np.second.fileName();
}).join("\n ")));
@@ -3867,8 +3861,8 @@ void ProjectExplorerPluginPrivate::removeFile()
for (const NodeAndPath &file : std::as_const(filesToRemove)) {
// Nodes can become invalid if the project was re-parsed while the dialog was open
if (!ProjectTree::hasNode(file.first)) {
- QMessageBox::warning(ICore::dialogParent(), tr("Removing File Failed"),
- tr("File \"%1\" was not removed, because the project has changed "
+ QMessageBox::warning(ICore::dialogParent(), Tr::tr("Removing File Failed"),
+ Tr::tr("File \"%1\" was not removed, because the project has changed "
"in the meantime.\nPlease try again.")
.arg(file.second.toUserOutput()));
return;
@@ -3885,7 +3879,7 @@ void ProjectExplorerPluginPrivate::removeFile()
&& removeFileDialog.isDeleteFileChecked());
if (!success) {
TaskHub::addTask(BuildSystemTask(Task::Error,
- tr("Could not remove file \"%1\" from project \"%2\".")
+ Tr::tr("Could not remove file \"%1\" from project \"%2\".")
.arg(currentFilePath.toUserOutput(), folderNode->managingProject()->displayName()),
folderNode->managingProject()->filePath()));
}
@@ -3921,11 +3915,11 @@ void ProjectExplorerPluginPrivate::duplicateFile()
QString newFileName = sourceFileInfo.fileName();
int copyTokenIndex = newFileName.lastIndexOf(baseName)+baseName.length();
- newFileName.insert(copyTokenIndex, tr("_copy"));
+ newFileName.insert(copyTokenIndex, Tr::tr("_copy"));
bool okPressed;
- newFileName = QInputDialog::getText(ICore::dialogParent(), tr("Choose File Name"),
- tr("New file name:"), QLineEdit::Normal, newFileName, &okPressed);
+ newFileName = QInputDialog::getText(ICore::dialogParent(), Tr::tr("Choose File Name"),
+ Tr::tr("New file name:"), QLineEdit::Normal, newFileName, &okPressed);
if (!okPressed)
return;
if (!ProjectTree::hasNode(currentNode))
@@ -3936,8 +3930,8 @@ void ProjectExplorerPluginPrivate::duplicateFile()
QTC_ASSERT(folderNode, return);
QFile sourceFile(filePath);
if (!sourceFile.copy(newFilePath)) {
- QMessageBox::critical(ICore::dialogParent(), tr("Duplicating File Failed"),
- tr("Failed to copy file \"%1\" to \"%2\": %3.")
+ QMessageBox::critical(ICore::dialogParent(), Tr::tr("Duplicating File Failed"),
+ Tr::tr("Failed to copy file \"%1\" to \"%2\": %3.")
.arg(QDir::toNativeSeparators(filePath),
QDir::toNativeSeparators(newFilePath), sourceFile.errorString()));
return;
@@ -3946,8 +3940,8 @@ void ProjectExplorerPluginPrivate::duplicateFile()
FilePath::fromString(newFilePath),
canTryToRenameIncludeGuards(currentNode));
if (!folderNode->addFiles({FilePath::fromString(newFilePath)})) {
- QMessageBox::critical(ICore::dialogParent(), tr("Duplicating File Failed"),
- tr("Failed to add new file \"%1\" to the project.")
+ QMessageBox::critical(ICore::dialogParent(), Tr::tr("Duplicating File Failed"),
+ Tr::tr("Failed to add new file \"%1\" to the project.")
.arg(QDir::toNativeSeparators(newFilePath)));
}
}
@@ -3964,8 +3958,8 @@ void ProjectExplorerPluginPrivate::deleteFile()
FilePath filePath = currentNode->filePath();
QMessageBox::StandardButton button =
QMessageBox::question(ICore::dialogParent(),
- tr("Delete File"),
- tr("Delete %1 from file system?")
+ Tr::tr("Delete File"),
+ Tr::tr("Delete %1 from file system?")
.arg(filePath.toUserOutput()),
QMessageBox::Yes | QMessageBox::No);
if (button != QMessageBox::Yes)
@@ -3982,8 +3976,8 @@ void ProjectExplorerPluginPrivate::deleteFile()
if (filePath.exists()) {
if (!filePath.removeFile())
- QMessageBox::warning(ICore::dialogParent(), tr("Deleting File Failed"),
- tr("Could not delete file %1.")
+ QMessageBox::warning(ICore::dialogParent(), Tr::tr("Deleting File Failed"),
+ Tr::tr("Could not delete file %1.")
.arg(filePath.toUserOutput()));
}
}
@@ -4017,8 +4011,8 @@ void ProjectExplorerPlugin::renameFile(Node *node, const QString &newFileName)
if (!folderNode->canRenameFile(oldFilePath, newFilePath)) {
QTimer::singleShot(0, [oldFilePath, newFilePath, projectFileName, handleGuards] {
int res = QMessageBox::question(ICore::dialogParent(),
- tr("Project Editing Failed"),
- tr("The project file %1 cannot be automatically changed.\n\n"
+ Tr::tr("Project Editing Failed"),
+ Tr::tr("The project file %1 cannot be automatically changed.\n\n"
"Rename %2 to %3 anyway?")
.arg(projectFileName)
.arg(oldFilePath.toUserOutput())
@@ -4033,7 +4027,7 @@ void ProjectExplorerPlugin::renameFile(Node *node, const QString &newFileName)
if (Core::FileUtils::renameFile(oldFilePath, newFilePath, handleGuards)) {
// Tell the project plugin about rename
if (!folderNode->renameFile(oldFilePath, newFilePath)) {
- const QString renameFileError = tr("The file %1 was renamed to %2, but the project "
+ const QString renameFileError = Tr::tr("The file %1 was renamed to %2, but the project "
"file %3 could not be automatically changed.")
.arg(oldFilePath.toUserOutput())
.arg(newFilePath.toUserOutput())
@@ -4041,17 +4035,17 @@ void ProjectExplorerPlugin::renameFile(Node *node, const QString &newFileName)
QTimer::singleShot(0, [renameFileError] {
QMessageBox::warning(ICore::dialogParent(),
- tr("Project Editing Failed"),
+ Tr::tr("Project Editing Failed"),
renameFileError);
});
}
} else {
- const QString renameFileError = tr("The file %1 could not be renamed %2.")
+ const QString renameFileError = Tr::tr("The file %1 could not be renamed %2.")
.arg(oldFilePath.toUserOutput())
.arg(newFilePath.toUserOutput());
QTimer::singleShot(0, [renameFileError] {
- QMessageBox::warning(ICore::dialogParent(), tr("Cannot Rename File"), renameFileError);
+ QMessageBox::warning(ICore::dialogParent(), Tr::tr("Cannot Rename File"), renameFileError);
});
}
}
@@ -4322,7 +4316,7 @@ AllProjectFilesFilter::AllProjectFilesFilter()
setDefaultIncludedByDefault(false); // but not included in default
setFilters({});
setIsCustomFilter(false);
- setDescription(ProjectExplorerPluginPrivate::tr(
+ setDescription(Tr::tr(
"Matches all files from all project directories. Append \"+