aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/plugins/android/androidavdmanager.cpp27
-rw-r--r--src/plugins/android/androidavdmanager.h2
-rw-r--r--src/plugins/android/androidbuildapkstep.cpp137
-rw-r--r--src/plugins/android/androidconfigurations.cpp14
-rw-r--r--src/plugins/android/androidcreatekeystorecertificate.cpp62
-rw-r--r--src/plugins/android/androiddeployqtstep.cpp111
-rw-r--r--src/plugins/android/androiddevice.cpp80
-rw-r--r--src/plugins/android/androiddevice.h2
-rw-r--r--src/plugins/android/androiderrormessage.cpp21
-rw-r--r--src/plugins/android/androiderrormessage.h1
-rw-r--r--src/plugins/android/androidmanager.cpp14
-rw-r--r--src/plugins/android/androidmanifesteditor.cpp9
-rw-r--r--src/plugins/android/androidmanifesteditorfactory.cpp7
-rw-r--r--src/plugins/android/androidmanifesteditoriconcontainerwidget.cpp28
-rw-r--r--src/plugins/android/androidmanifesteditoriconwidget.cpp7
-rw-r--r--src/plugins/android/androidmanifesteditorwidget.cpp89
-rw-r--r--src/plugins/android/androidpackageinstallationstep.cpp22
-rw-r--r--src/plugins/android/androidplugin.cpp21
-rw-r--r--src/plugins/android/androidpotentialkit.cpp11
-rw-r--r--src/plugins/android/androidqmlpreviewworker.cpp48
-rw-r--r--src/plugins/android/androidqtversion.cpp15
-rw-r--r--src/plugins/android/androidqtversion.h2
-rw-r--r--src/plugins/android/androidrunconfiguration.cpp14
-rw-r--r--src/plugins/android/androidrunner.cpp6
-rw-r--r--src/plugins/android/androidrunnerworker.cpp36
-rw-r--r--src/plugins/android/androidsdkdownloader.cpp20
-rw-r--r--src/plugins/android/androidsdkmanager.cpp30
-rw-r--r--src/plugins/android/androidsdkmanagerwidget.cpp102
-rw-r--r--src/plugins/android/androidsdkmodel.cpp14
-rw-r--r--src/plugins/android/androidservicewidget.cpp41
-rw-r--r--src/plugins/android/androidsettingswidget.cpp166
-rw-r--r--src/plugins/android/androidtoolchain.cpp9
-rw-r--r--src/plugins/android/androidtoolchain.h2
-rw-r--r--src/plugins/android/avddialog.cpp26
-rw-r--r--src/plugins/android/createandroidmanifestwizard.cpp45
-rw-r--r--src/plugins/android/createandroidmanifestwizard.h2
-rw-r--r--src/plugins/android/javalanguageserver.cpp13
-rw-r--r--src/plugins/android/splashscreencontainerwidget.cpp71
-rw-r--r--src/plugins/android/splashscreenwidget.cpp7
39 files changed, 655 insertions, 679 deletions
diff --git a/src/plugins/android/androidavdmanager.cpp b/src/plugins/android/androidavdmanager.cpp
index 2e998efd499..7fdc9960c6d 100644
--- a/src/plugins/android/androidavdmanager.cpp
+++ b/src/plugins/android/androidavdmanager.cpp
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
#include "androidavdmanager.h"
-
+#include "androidtr.h"
#include "avdmanageroutputparser.h"
#include <coreplugin/icore.h>
@@ -72,8 +72,7 @@ static CreateAvdInfo createAvdCommand(const AndroidConfig &config, const CreateA
if (!result.isValid()) {
qCDebug(avdManagerLog) << "AVD Create failed. Invalid CreateAvdInfo" << result.name
<< result.systemImage->displayText() << result.systemImage->apiLevel();
- result.error = QApplication::translate("AndroidAvdManager",
- "Cannot create AVD. Invalid input.");
+ result.error = Tr::tr("Cannot create AVD. Invalid input.");
return result;
}
@@ -99,8 +98,7 @@ static CreateAvdInfo createAvdCommand(const AndroidConfig &config, const CreateA
proc.setCommand({avdManagerTool, arguments});
proc.start();
if (!proc.waitForStarted()) {
- result.error = QApplication::translate("AndroidAvdManager",
- "Could not start process \"%1 %2\"")
+ result.error = Tr::tr("Could not start process \"%1 %2\"")
.arg(avdManagerTool.toString(), arguments.join(' '));
return result;
}
@@ -131,10 +129,8 @@ static CreateAvdInfo createAvdCommand(const AndroidConfig &config, const CreateA
break;
// For a sane input and command, process should finish before timeout.
- if (checkForTimeout(start, avdCreateTimeoutMs)) {
- result.error = QApplication::translate("AndroidAvdManager",
- "Cannot create AVD. Command timed out.");
- }
+ if (checkForTimeout(start, avdCreateTimeoutMs))
+ result.error = Tr::tr("Cannot create AVD. Command timed out.");
}
result.error = errorOutput;
@@ -244,11 +240,10 @@ bool AndroidAvdManager::startAvdAsync(const QString &avdName) const
if (!emulator.exists()) {
QMetaObject::invokeMethod(Core::ICore::mainWindow(), [emulator] {
QMessageBox::critical(Core::ICore::dialogParent(),
- AndroidAvdManager::tr("Emulator Tool Is Missing"),
- AndroidAvdManager::tr(
- "Install the missing emulator tool (%1) to the"
- " installed Android SDK.")
- .arg(emulator.displayName()));
+ Tr::tr("Emulator Tool Is Missing"),
+ Tr::tr("Install the missing emulator tool (%1) to the"
+ " installed Android SDK.")
+ .arg(emulator.displayName()));
});
return false;
}
@@ -263,9 +258,7 @@ bool AndroidAvdManager::startAvdAsync(const QString &avdName) const
if (avdProcess->exitCode()) {
const QString errorOutput = QString::fromLatin1(avdProcess->readAllStandardOutput());
QMetaObject::invokeMethod(Core::ICore::mainWindow(), [errorOutput] {
- const QString title
- = QCoreApplication::translate("Android::Internal::AndroidAvdManager",
- "AVD Start Error");
+ const QString title = Tr::tr("AVD Start Error");
QMessageBox::critical(Core::ICore::dialogParent(), title, errorOutput);
});
}
diff --git a/src/plugins/android/androidavdmanager.h b/src/plugins/android/androidavdmanager.h
index 670016ed7f3..44a8454e65f 100644
--- a/src/plugins/android/androidavdmanager.h
+++ b/src/plugins/android/androidavdmanager.h
@@ -11,8 +11,6 @@ namespace Android::Internal {
class AndroidAvdManager
{
- Q_DECLARE_TR_FUNCTIONS(Android::Internal::AndroidAvdManager)
-
public:
AndroidAvdManager(const AndroidConfig& config = AndroidConfigurations::currentConfig());
~AndroidAvdManager();
diff --git a/src/plugins/android/androidbuildapkstep.cpp b/src/plugins/android/androidbuildapkstep.cpp
index 47ac8a746b3..918a4e39770 100644
--- a/src/plugins/android/androidbuildapkstep.cpp
+++ b/src/plugins/android/androidbuildapkstep.cpp
@@ -3,7 +3,6 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
#include "androidbuildapkstep.h"
-
#include "androidconfigurations.h"
#include "androidconstants.h"
#include "androidcreatekeystorecertificate.h"
@@ -11,9 +10,9 @@
#include "androidmanager.h"
#include "androidqtversion.h"
#include "androidsdkmanager.h"
+#include "androidtr.h"
#include "certificatesmodel.h"
#include "createandroidmanifestwizard.h"
-
#include "javaparser.h"
#include <coreplugin/fileutils.h>
@@ -76,8 +75,6 @@ const char VerboseOutputKey[] = "VerboseOutput";
class PasswordInputDialog : public QDialog
{
- Q_DECLARE_TR_FUNCTIONS(Android::Internal::AndroidBuildApkStep)
-
public:
enum Context{
KeystorePassword = 1,
@@ -95,7 +92,7 @@ private:
std::function<bool (const QString &)> verifyCallback = [](const QString &) { return true; };
QLabel *inputContextlabel = new QLabel(this);
QLineEdit *inputEdit = new QLineEdit(this);
- Utils::InfoLabel *warningLabel = new Utils::InfoLabel(tr("Incorrect password."),
+ Utils::InfoLabel *warningLabel = new Utils::InfoLabel(::Android::Tr::tr("Incorrect password."),
Utils::InfoLabel::Warning, this);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel,
this);
@@ -105,8 +102,6 @@ private:
class AndroidBuildApkWidget : public QWidget
{
- Q_DECLARE_TR_FUNCTIONS(Android::Internal::AndroidBuildApkStep)
-
public:
explicit AndroidBuildApkWidget(AndroidBuildApkStep *step);
@@ -162,7 +157,7 @@ QWidget *AndroidBuildApkWidget::createApplicationGroup()
filteredSdkPlatforms(minApiSupported));
targets.removeDuplicates();
- auto group = new QGroupBox(tr("Application"), this);
+ auto group = new QGroupBox(Tr::tr("Application"), this);
auto targetSDKComboBox = new QComboBox();
targetSDKComboBox->addItems(targets);
@@ -175,17 +170,17 @@ QWidget *AndroidBuildApkWidget::createApplicationGroup()
});
auto formLayout = new QFormLayout(group);
- formLayout->addRow(tr("Android build platform SDK:"), targetSDKComboBox);
+ formLayout->addRow(Tr::tr("Android build platform SDK:"), targetSDKComboBox);
- auto createAndroidTemplatesButton = new QPushButton(tr("Create Templates"));
+ auto createAndroidTemplatesButton = new QPushButton(Tr::tr("Create Templates"));
createAndroidTemplatesButton->setToolTip(
- tr("Create an Android package for Custom Java code, assets, and Gradle configurations."));
+ Tr::tr("Create an Android package for Custom Java code, assets, and Gradle configurations."));
connect(createAndroidTemplatesButton, &QAbstractButton::clicked, this, [this] {
CreateAndroidManifestWizard wizard(m_step->buildSystem());
wizard.exec();
});
- formLayout->addRow(tr("Android customization:"), createAndroidTemplatesButton);
+ formLayout->addRow(Tr::tr("Android customization:"), createAndroidTemplatesButton);
return group;
}
@@ -196,9 +191,9 @@ QWidget *AndroidBuildApkWidget::createSignPackageGroup()
sizePolicy.setHorizontalStretch(0);
sizePolicy.setVerticalStretch(0);
- auto group = new QGroupBox(tr("Application Signature"), this);
+ auto group = new QGroupBox(Tr::tr("Application Signature"), this);
- auto keystoreLocationLabel = new QLabel(tr("Keystore:"), group);
+ auto keystoreLocationLabel = new QLabel(Tr::tr("Keystore:"), group);
keystoreLocationLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
auto keystoreLocationChooser = new PathChooser(group);
@@ -206,8 +201,8 @@ QWidget *AndroidBuildApkWidget::createSignPackageGroup()
keystoreLocationChooser->lineEdit()->setReadOnly(true);
keystoreLocationChooser->setFilePath(m_step->keystorePath());
keystoreLocationChooser->setInitialBrowsePathBackup(FileUtils::homePath());
- keystoreLocationChooser->setPromptDialogFilter(tr("Keystore files (*.keystore *.jks)"));
- keystoreLocationChooser->setPromptDialogTitle(tr("Select Keystore File"));
+ keystoreLocationChooser->setPromptDialogFilter(Tr::tr("Keystore files (*.keystore *.jks)"));
+ keystoreLocationChooser->setPromptDialogTitle(Tr::tr("Select Keystore File"));
connect(keystoreLocationChooser, &PathChooser::textChanged, this, [this, keystoreLocationChooser] {
const FilePath file = keystoreLocationChooser->rawFilePath();
m_step->setKeystorePath(file);
@@ -216,7 +211,7 @@ QWidget *AndroidBuildApkWidget::createSignPackageGroup()
setCertificates();
});
- auto keystoreCreateButton = new QPushButton(tr("Create..."), group);
+ auto keystoreCreateButton = new QPushButton(Tr::tr("Create..."), group);
connect(keystoreCreateButton, &QAbstractButton::clicked, this, [this, keystoreLocationChooser] {
AndroidCreateKeystoreCertificate d;
if (d.exec() != QDialog::Accepted)
@@ -229,14 +224,14 @@ QWidget *AndroidBuildApkWidget::createSignPackageGroup()
setCertificates();
});
- m_signPackageCheckBox = new QCheckBox(tr("Sign package"), group);
+ m_signPackageCheckBox = new QCheckBox(Tr::tr("Sign package"), group);
m_signPackageCheckBox->setChecked(m_step->signPackage());
- m_signingDebugWarningLabel = new Utils::InfoLabel(tr("Signing a debug package"),
+ m_signingDebugWarningLabel = new Utils::InfoLabel(Tr::tr("Signing a debug package"),
Utils::InfoLabel::Warning, group);
m_signingDebugWarningLabel->hide();
- auto certificateAliasLabel = new QLabel(tr("Certificate alias:"), group);
+ auto certificateAliasLabel = new QLabel(Tr::tr("Certificate alias:"), group);
certificateAliasLabel->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
m_certificatesAliasComboBox = new QComboBox(group);
@@ -267,28 +262,28 @@ QWidget *AndroidBuildApkWidget::createSignPackageGroup()
QWidget *AndroidBuildApkWidget::createAdvancedGroup()
{
- auto group = new QGroupBox(tr("Advanced Actions"), this);
+ auto group = new QGroupBox(Tr::tr("Advanced Actions"), this);
- auto openPackageLocationCheckBox = new QCheckBox(tr("Open package location after build"), group);
+ auto openPackageLocationCheckBox = new QCheckBox(Tr::tr("Open package location after build"), group);
openPackageLocationCheckBox->setChecked(m_step->openPackageLocation());
connect(openPackageLocationCheckBox, &QAbstractButton::toggled,
this, [this](bool checked) { m_step->setOpenPackageLocation(checked); });
- m_addDebuggerCheckBox = new QCheckBox(tr("Add debug server"), group);
+ m_addDebuggerCheckBox = new QCheckBox(Tr::tr("Add debug server"), group);
m_addDebuggerCheckBox->setEnabled(false);
- m_addDebuggerCheckBox->setToolTip(tr("Packages debug server with "
+ m_addDebuggerCheckBox->setToolTip(Tr::tr("Packages debug server with "
"the APK to enable debugging. For the signed APK this option is unchecked by default."));
m_addDebuggerCheckBox->setChecked(m_step->addDebugger());
connect(m_addDebuggerCheckBox, &QAbstractButton::toggled,
m_step, &AndroidBuildApkStep::setAddDebugger);
- auto verboseOutputCheckBox = new QCheckBox(tr("Verbose output"), group);
+ auto verboseOutputCheckBox = new QCheckBox(Tr::tr("Verbose output"), group);
verboseOutputCheckBox->setChecked(m_step->verboseOutput());
auto vbox = new QVBoxLayout(group);
QtSupport::QtVersion *version = QtSupport::QtKitAspect::qtVersion(m_step->kit());
if (version && version->qtVersion() >= QVersionNumber(5, 14)) {
- auto buildAAB = new QCheckBox(tr("Build Android App Bundle (*.aab)"), group);
+ auto buildAAB = new QCheckBox(Tr::tr("Build Android App Bundle (*.aab)"), group);
buildAAB->setChecked(m_step->buildAAB());
connect(buildAAB, &QAbstractButton::toggled, m_step, &AndroidBuildApkStep::setBuildAAB);
vbox->addWidget(buildAAB);
@@ -305,7 +300,7 @@ QWidget *AndroidBuildApkWidget::createAdvancedGroup()
QWidget *AndroidBuildApkWidget::createAdditionalLibrariesGroup()
{
- auto group = new QGroupBox(tr("Additional Libraries"));
+ auto group = new QGroupBox(Tr::tr("Additional Libraries"));
group->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
auto libsModel = new AndroidExtraLibraryListModel(m_step->buildSystem(), this);
@@ -317,32 +312,32 @@ QWidget *AndroidBuildApkWidget::createAdditionalLibrariesGroup()
auto libsView = new QListView;
libsView->setSelectionMode(QAbstractItemView::ExtendedSelection);
- libsView->setToolTip(tr("List of extra libraries to include in Android package and load on startup."));
+ libsView->setToolTip(Tr::tr("List of extra libraries to include in Android package and load on startup."));
libsView->setModel(libsModel);
auto addLibButton = new QPushButton;
- addLibButton->setText(tr("Add..."));
- addLibButton->setToolTip(tr("Select library to include in package."));
+ addLibButton->setText(Tr::tr("Add..."));
+ addLibButton->setToolTip(Tr::tr("Select library to include in package."));
addLibButton->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
connect(addLibButton, &QAbstractButton::clicked, this, [this, libsModel] {
QStringList fileNames = QFileDialog::getOpenFileNames(this,
- tr("Select additional libraries"),
+ Tr::tr("Select additional libraries"),
QDir::homePath(),
- tr("Libraries (*.so)"));
+ Tr::tr("Libraries (*.so)"));
if (!fileNames.isEmpty())
libsModel->addEntries(fileNames);
});
auto removeLibButton = new QPushButton;
- removeLibButton->setText(tr("Remove"));
- removeLibButton->setToolTip(tr("Remove currently selected library from list."));
+ removeLibButton->setText(Tr::tr("Remove"));
+ removeLibButton->setToolTip(Tr::tr("Remove currently selected library from list."));
connect(removeLibButton, &QAbstractButton::clicked, this, [libsModel, libsView] {
QModelIndexList removeList = libsView->selectionModel()->selectedIndexes();
libsModel->removeEntries(removeList);
});
- m_openSslCheckBox = new QCheckBox(tr("Include prebuilt OpenSSL libraries"));
- m_openSslCheckBox->setToolTip(tr("This is useful for apps that use SSL operations. The path "
+ m_openSslCheckBox = new QCheckBox(Tr::tr("Include prebuilt OpenSSL libraries"));
+ m_openSslCheckBox->setToolTip(Tr::tr("This is useful for apps that use SSL operations. The path "
"can be defined in Edit > Preferences > Devices > Android."));
connect(m_openSslCheckBox, &QAbstractButton::clicked, this,
&AndroidBuildApkWidget::onOpenSslCheckBoxChanged);
@@ -461,13 +456,13 @@ AndroidBuildApkStep::AndroidBuildApkStep(BuildStepList *parent, Utils::Id id)
sdkManager()->latestAndroidSdkPlatform()))
{
setImmutable(true);
- setDisplayName(tr("Build Android APK"));
+ setDisplayName(Tr::tr("Build Android APK"));
}
bool AndroidBuildApkStep::init()
{
if (!AbstractProcessStep::init()) {
- reportWarningOrError(tr("\"%1\" step failed initialization.").arg(displayName()),
+ reportWarningOrError(Tr::tr("\"%1\" step failed initialization.").arg(displayName()),
Task::Error);
return false;
}
@@ -476,18 +471,18 @@ bool AndroidBuildApkStep::init()
qCDebug(buildapkstepLog) << "Signing enabled";
// check keystore and certificate passwords
if (!verifyKeystorePassword() || !verifyCertificatePassword()) {
- reportWarningOrError(tr("Keystore/Certificate password verification failed."),
+ reportWarningOrError(Tr::tr("Keystore/Certificate password verification failed."),
Task::Error);
return false;
}
if (buildType() != BuildConfiguration::Release)
- reportWarningOrError(tr("Warning: Signing a debug or profile package."), Task::Warning);
+ reportWarningOrError(Tr::tr("Warning: Signing a debug or profile package."), Task::Warning);
}
QtSupport::QtVersion *version = QtSupport::QtKitAspect::qtVersion(kit());
if (!version) {
- reportWarningOrError(tr("The Qt version for kit %1 is invalid.").arg(kit()->displayName()),
+ reportWarningOrError(Tr::tr("The Qt version for kit %1 is invalid.").arg(kit()->displayName()),
Task::Error);
return false;
}
@@ -497,18 +492,18 @@ bool AndroidBuildApkStep::init()
&& AndroidConfigurations::currentConfig().preCmdlineSdkToolsInstalled()) {
if (!version->sourcePath().pathAppended("src/3rdparty/gradle").exists()) {
const QString error
- = tr("The installed SDK tools version (%1) does not include Gradle "
- "scripts. The minimum Qt version required for Gradle build to work "
- "is %2")
- .arg(sdkToolsVersion.toString())
- .arg("5.9.0/5.6.3");
+ = Tr::tr("The installed SDK tools version (%1) does not include Gradle "
+ "scripts. The minimum Qt version required for Gradle build to work "
+ "is %2")
+ .arg(sdkToolsVersion.toString())
+ .arg("5.9.0/5.6.3");
reportWarningOrError(error, Task::Error);
return false;
}
} else if (version->qtVersion() < QVersionNumber(5, 4, 0)) {
- const QString error = tr("The minimum Qt version required for Gradle build to work is %1. "
- "It is recommended to install the latest Qt version.")
- .arg("5.4.0");
+ const QString error = Tr::tr("The minimum Qt version required for Gradle build to work is %1. "
+ "It is recommended to install the latest Qt version.")
+ .arg("5.4.0");
reportWarningOrError(error, Task::Error);
return false;
}
@@ -516,9 +511,9 @@ bool AndroidBuildApkStep::init()
const int minSDKForKit = AndroidManager::minimumSDK(kit());
if (AndroidManager::minimumSDK(target()) < minSDKForKit) {
const QString error
- = tr("The API level set for the APK is less than the minimum required by the kit."
- "\nThe minimum API level required by the kit is %1.")
- .arg(minSDKForKit);
+ = Tr::tr("The API level set for the APK is less than the minimum required by the kit."
+ "\nThe minimum API level required by the kit is %1.")
+ .arg(minSDKForKit);
reportWarningOrError(error, Task::Error);
return false;
}
@@ -542,14 +537,14 @@ bool AndroidBuildApkStep::init()
m_inputFile = AndroidQtVersion::androidDeploymentSettings(target());
if (m_inputFile.isEmpty()) {
m_skipBuilding = true;
- reportWarningOrError(tr("No valid input file for \"%1\".").arg(target()->activeBuildKey()),
+ reportWarningOrError(Tr::tr("No valid input file for \"%1\".").arg(target()->activeBuildKey()),
Task::Warning);
return true;
}
m_skipBuilding = false;
if (m_buildTargetSdk.isEmpty()) {
- reportWarningOrError(tr("Android build SDK version is not defined. Check Android settings.")
+ reportWarningOrError(Tr::tr("Android build SDK version is not defined. Check Android settings.")
, Task::Error);
return false;
}
@@ -642,7 +637,7 @@ void AndroidBuildApkStep::processFinished(int exitCode, QProcess::ExitStatus sta
bool AndroidBuildApkStep::verifyKeystorePassword()
{
if (!m_keystorePath.exists()) {
- reportWarningOrError(tr("Cannot sign the package. Invalid keystore path (%1).")
+ reportWarningOrError(Tr::tr("Cannot sign the package. Invalid keystore path (%1).")
.arg(m_keystorePath.toString()), Task::Error);
return false;
}
@@ -662,7 +657,7 @@ bool AndroidBuildApkStep::verifyCertificatePassword()
{
if (!AndroidManager::checkCertificateExists(m_keystorePath.toString(), m_keystorePasswd,
m_certificateAlias)) {
- reportWarningOrError(tr("Cannot sign the package. Certificate alias %1 does not exist.")
+ reportWarningOrError(Tr::tr("Cannot sign the package. Certificate alias %1 does not exist.")
.arg(m_certificateAlias), Task::Error);
return false;
}
@@ -704,7 +699,7 @@ static bool copyFileIfNewer(const FilePath &sourceFilePath,
void AndroidBuildApkStep::doRun()
{
if (m_skipBuilding) {
- reportWarningOrError(tr("Android deploy settings file not found, not building an APK."),
+ reportWarningOrError(Tr::tr("Android deploy settings file not found, not building an APK."),
Task::Error);
emit finished(true);
return;
@@ -716,7 +711,7 @@ void AndroidBuildApkStep::doRun()
QtSupport::QtVersion *version = QtSupport::QtKitAspect::qtVersion(kit());
if (!version) {
- reportWarningOrError(tr("The Qt version for kit %1 is invalid.")
+ reportWarningOrError(Tr::tr("The Qt version for kit %1 is invalid.")
.arg(kit()->displayName()), Task::Error);
return false;
}
@@ -727,8 +722,8 @@ void AndroidBuildApkStep::doRun()
FilePath androidLibsDir = androidBuildDir / "libs" / abi;
if (!androidLibsDir.exists()) {
if (!androidLibsDir.ensureWritableDir()) {
- reportWarningOrError(tr("The Android build folder %1 was not found and could "
- "not be created.").arg(androidLibsDir.toUserOutput()),
+ reportWarningOrError(Tr::tr("The Android build folder %1 was not found and could "
+ "not be created.").arg(androidLibsDir.toUserOutput()),
Task::Error);
return false;
} else if (version->qtVersion() >= QVersionNumber(6, 0, 0)
@@ -743,7 +738,7 @@ void AndroidBuildApkStep::doRun()
continue;
if (!from.copyFile(to)) {
- reportWarningOrError(tr("Cannot copy the target's lib file %1 to the "
+ reportWarningOrError(Tr::tr("Cannot copy the target's lib file %1 to the "
"Android build folder %2.")
.arg(fileName, androidLibsDir.toUserOutput()),
Task::Error);
@@ -774,7 +769,7 @@ void AndroidBuildApkStep::doRun()
for (const FilePath &target : targets) {
if (!copyFileIfNewer(target, androidLibsDir.pathAppended(target.fileName()))) {
reportWarningOrError(
- tr("Cannot copy file \"%1\" to Android build libs folder \"%2\".")
+ Tr::tr("Cannot copy file \"%1\" to Android build libs folder \"%2\".")
.arg(target.toUserOutput()).arg(androidLibsDir.toUserOutput()),
Task::Error);
return false;
@@ -799,7 +794,7 @@ void AndroidBuildApkStep::doRun()
const FilePath destination = androidLibsDir.pathAppended(target.fileName());
if (!copyFileIfNewer(target, destination)) {
reportWarningOrError(
- tr("Cannot copy file \"%1\" to Android build libs folder \"%2\".")
+ Tr::tr("Cannot copy file \"%1\" to Android build libs folder \"%2\".")
.arg(target.toUserOutput()).arg(androidLibsDir.toUserOutput()),
Task::Error);
return false;
@@ -831,7 +826,7 @@ void AndroidBuildApkStep::doRun()
QFile f{m_inputFile.toString()};
if (!f.open(QIODevice::WriteOnly)) {
- reportWarningOrError(tr("Cannot open androiddeployqt input file \"%1\" for writing.")
+ reportWarningOrError(Tr::tr("Cannot open androiddeployqt input file \"%1\" for writing.")
.arg(m_inputFile.toUserOutput()), Task::Error);
return false;
}
@@ -840,7 +835,7 @@ void AndroidBuildApkStep::doRun()
};
if (!setup()) {
- reportWarningOrError(tr("Cannot set up \"%1\", not building an APK.").arg(displayName()),
+ reportWarningOrError(Tr::tr("Cannot set up \"%1\", not building an APK.").arg(displayName()),
Task::Error);
emit finished(false);
return;
@@ -858,7 +853,7 @@ void AndroidBuildApkStep::reportWarningOrError(const QString &message, Task::Tas
void AndroidBuildApkStep::processStarted()
{
- emit addOutput(tr("Starting: \"%1\" %2")
+ emit addOutput(Tr::tr("Starting: \"%1\" %2")
.arg(m_command.toUserOutput(), m_argumentsPasswordConcealed),
BuildStep::OutputFormat::NormalMessage);
}
@@ -1026,7 +1021,7 @@ QAbstractItemModel *AndroidBuildApkStep::keystoreCertificates()
keytoolProc.setCommand({AndroidConfigurations::currentConfig().keytoolPath(), params});
keytoolProc.runBlocking(EventLoopMode::On);
if (keytoolProc.result() > ProcessResult::FinishedWithError)
- QMessageBox::critical(nullptr, tr("Error"), tr("Failed to run keytool."));
+ QMessageBox::critical(nullptr, Tr::tr("Error"), Tr::tr("Failed to run keytool."));
else
model = new CertificatesModel(keytoolProc.cleanedStdOut(), this);
@@ -1067,13 +1062,13 @@ PasswordInputDialog::PasswordInputDialog(PasswordInputDialog::Context context,
connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
- setWindowTitle(context == KeystorePassword ? tr("Keystore") : tr("Certificate"));
+ setWindowTitle(context == KeystorePassword ? Tr::tr("Keystore") : Tr::tr("Certificate"));
QString contextStr;
if (context == KeystorePassword)
- contextStr = tr("Enter keystore password");
+ contextStr = Tr::tr("Enter keystore password");
else
- contextStr = tr("Enter certificate password");
+ contextStr = Tr::tr("Enter certificate password");
contextStr += extraContextStr.isEmpty() ? QStringLiteral(":") :
QStringLiteral(" (%1):").arg(extraContextStr);
@@ -1099,7 +1094,7 @@ AndroidBuildApkStepFactory::AndroidBuildApkStepFactory()
registerStep<AndroidBuildApkStep>(Constants::ANDROID_BUILD_APK_ID);
setSupportedDeviceType(Constants::ANDROID_DEVICE_TYPE);
setSupportedStepList(ProjectExplorer::Constants::BUILDSTEPS_BUILD);
- setDisplayName(AndroidBuildApkStep::tr("Build Android APK"));
+ setDisplayName(Tr::tr("Build Android APK"));
setRepeatable(false);
}
diff --git a/src/plugins/android/androidconfigurations.cpp b/src/plugins/android/androidconfigurations.cpp
index 4612f8b9fd6..dd55ccefa07 100644
--- a/src/plugins/android/androidconfigurations.cpp
+++ b/src/plugins/android/androidconfigurations.cpp
@@ -4,10 +4,11 @@
#include "androidconfigurations.h"
#include "androidconstants.h"
-#include "androidtoolchain.h"
#include "androiddevice.h"
#include "androidmanager.h"
#include "androidqtversion.h"
+#include "androidtoolchain.h"
+#include "androidtr.h"
#include "avddialog.h"
#include <coreplugin/icore.h>
@@ -658,8 +659,7 @@ QVector<AndroidDeviceInfo> AndroidConfig::connectedDevices(QString *error) const
adbProc.runBlocking();
if (adbProc.result() != ProcessResult::FinishedWithSuccess) {
if (error)
- *error = QApplication::translate("AndroidConfiguration", "Could not run: %1")
- .arg(cmd.toUserOutput());
+ *error = Tr::tr("Could not run: %1").arg(cmd.toUserOutput());
return devices;
}
QStringList adbDevs = adbProc.allOutput().split('\n', Qt::SkipEmptyParts);
@@ -700,9 +700,7 @@ QVector<AndroidDeviceInfo> AndroidConfig::connectedDevices(QString *error) const
Utils::sort(devices);
if (devices.isEmpty() && error)
- *error = QApplication::translate("AndroidConfiguration",
- "No devices found in output of: %1")
- .arg(cmd.toUserOutput());
+ *error = Tr::tr("No devices found in output of: %1").arg(cmd.toUserOutput());
return devices;
}
@@ -1276,7 +1274,7 @@ static QVariant findOrRegisterDebugger(ToolChain *tc,
if (existingGdb)
return existingGdb->id();
- const QString mainName = AndroidConfigurations::tr("Android Debugger (%1, NDK %2)");
+ const QString mainName = Tr::tr("Android Debugger (%1, NDK %2)");
const QString custom = customDebugger ? QString{"Custom "} : QString{};
// debugger not found, register a new one
// check lldb
@@ -1424,7 +1422,7 @@ void AndroidConfigurations::updateAutomaticKitList()
QString versionStr = QLatin1String("Qt %{Qt:Version}");
if (!qt->isAutodetected())
versionStr = QString("%1").arg(qt->displayName());
- k->setUnexpandedDisplayName(tr("Android %1 Clang %2")
+ k->setUnexpandedDisplayName(Tr::tr("Android %1 Clang %2")
.arg(versionStr)
.arg(getMultiOrSingleAbiString(abis)));
k->setValueSilently(Constants::ANDROID_KIT_NDK, currentConfig().ndkLocation(qt).toString());
diff --git a/src/plugins/android/androidcreatekeystorecertificate.cpp b/src/plugins/android/androidcreatekeystorecertificate.cpp
index 9a535aa4d8f..962a8cd2346 100644
--- a/src/plugins/android/androidcreatekeystorecertificate.cpp
+++ b/src/plugins/android/androidcreatekeystorecertificate.cpp
@@ -1,9 +1,9 @@
// Copyright (C) 2016 BogDan Vatra <[email protected]>
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
-#include "androidcreatekeystorecertificate.h"
-
#include "androidconfigurations.h"
+#include "androidcreatekeystorecertificate.h"
+#include "androidtr.h"
#include <utils/infolabel.h>
#include <utils/layoutbuilder.h>
@@ -25,7 +25,7 @@ AndroidCreateKeystoreCertificate::AndroidCreateKeystoreCertificate(QWidget *pare
: QDialog(parent)
{
resize(638, 473);
- setWindowTitle(tr("Create a keystore and a certificate"));
+ setWindowTitle(Tr::tr("Create a keystore and a certificate"));
m_commonNameLineEdit = new QLineEdit;
@@ -44,7 +44,7 @@ AndroidCreateKeystoreCertificate::AndroidCreateKeystoreCertificate(QWidget *pare
m_certificateRetypePassLineEdit = new QLineEdit;
m_certificateRetypePassLineEdit->setEchoMode(QLineEdit::Password);
- m_certificateShowPassCheckBox = new QCheckBox(tr("Show password"));
+ m_certificateShowPassCheckBox = new QCheckBox(Tr::tr("Show password"));
m_validitySpinBox = new QSpinBox;
m_validitySpinBox->setRange(10000, 100000);
@@ -59,7 +59,7 @@ AndroidCreateKeystoreCertificate::AndroidCreateKeystoreCertificate(QWidget *pare
m_keySizeSpinBox = new QSpinBox;
m_keySizeSpinBox->setRange(2048, 2097152);
- m_samePasswordCheckBox = new QCheckBox(tr("Use Keystore password"));
+ m_samePasswordCheckBox = new QCheckBox(Tr::tr("Use Keystore password"));
m_keystorePassLineEdit = new QLineEdit;
m_keystorePassLineEdit->setEchoMode(QLineEdit::Password);
@@ -72,7 +72,7 @@ AndroidCreateKeystoreCertificate::AndroidCreateKeystoreCertificate(QWidget *pare
m_infoLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Preferred);
m_infoLabel->hide();
- auto keystoreShowPassCheckBox = new QCheckBox(tr("Show password"));
+ auto keystoreShowPassCheckBox = new QCheckBox(Tr::tr("Show password"));
auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Close|QDialogButtonBox::Save);
@@ -80,36 +80,36 @@ AndroidCreateKeystoreCertificate::AndroidCreateKeystoreCertificate(QWidget *pare
Column {
Group {
- title(tr("Keystore")),
+ title(Tr::tr("Keystore")),
Form {
- tr("Password:"), m_keystorePassLineEdit, br,
- tr("Retype password:"), m_keystoreRetypePassLineEdit, br,
+ Tr::tr("Password:"), m_keystorePassLineEdit, br,
+ Tr::tr("Retype password:"), m_keystoreRetypePassLineEdit, br,
Span(2, keystoreShowPassCheckBox), br,
}
},
Group {
- title(tr("Certificate")),
+ title(Tr::tr("Certificate")),
Form {
- tr("Alias name:"), m_certificateAliasLineEdit, br,
- tr("Keysize:"), m_keySizeSpinBox, br,
- tr("Validity (days):"), m_validitySpinBox, br,
- tr("Password:"), m_certificatePassLineEdit, br,
- tr("Retype password:"), m_certificateRetypePassLineEdit, br,
+ Tr::tr("Alias name:"), m_certificateAliasLineEdit, br,
+ Tr::tr("Keysize:"), m_keySizeSpinBox, br,
+ Tr::tr("Validity (days):"), m_validitySpinBox, br,
+ Tr::tr("Password:"), m_certificatePassLineEdit, br,
+ Tr::tr("Retype password:"), m_certificateRetypePassLineEdit, br,
Span(2, m_samePasswordCheckBox), br,
Span(2, m_certificateShowPassCheckBox), br,
}
},
Group {
- title(tr("Certificate Distinguished Names")),
+ title(Tr::tr("Certificate Distinguished Names")),
Form {
- tr("First and last name:"), m_commonNameLineEdit, br,
- tr("Organizational unit (e.g. Necessitas):"), m_organizationUnitLineEdit, br,
- tr("Organization (e.g. KDE):"), m_organizationNameLineEdit, br,
- tr("City or locality:"), m_localityNameLineEdit, br,
- tr("State or province:"), m_stateNameLineEdit, br,
- tr("Two-letter country code for this unit (e.g. RO):"), m_countryLineEdit,
+ Tr::tr("First and last name:"), m_commonNameLineEdit, br,
+ Tr::tr("Organizational unit (e.g. Necessitas):"), m_organizationUnitLineEdit, br,
+ Tr::tr("Organization (e.g. KDE):"), m_organizationNameLineEdit, br,
+ Tr::tr("City or locality:"), m_localityNameLineEdit, br,
+ Tr::tr("State or province:"), m_stateNameLineEdit, br,
+ Tr::tr("Two-letter country code for this unit (e.g. RO):"), m_countryLineEdit,
}
},
@@ -170,12 +170,12 @@ AndroidCreateKeystoreCertificate::PasswordStatus AndroidCreateKeystoreCertificat
{
if (m_keystorePassLineEdit->text().length() < 6) {
m_infoLabel->show();
- m_infoLabel->setText(tr("Keystore password is too short."));
+ m_infoLabel->setText(Tr::tr("Keystore password is too short."));
return Invalid;
}
if (m_keystorePassLineEdit->text() != m_keystoreRetypePassLineEdit->text()) {
m_infoLabel->show();
- m_infoLabel->setText(tr("Keystore passwords do not match."));
+ m_infoLabel->setText(Tr::tr("Keystore passwords do not match."));
return NoMatch;
}
@@ -190,12 +190,12 @@ AndroidCreateKeystoreCertificate::PasswordStatus AndroidCreateKeystoreCertificat
if (m_certificatePassLineEdit->text().length() < 6) {
m_infoLabel->show();
- m_infoLabel->setText(tr("Certificate password is too short."));
+ m_infoLabel->setText(Tr::tr("Certificate password is too short."));
return Invalid;
}
if (m_certificatePassLineEdit->text() != m_certificateRetypePassLineEdit->text()) {
m_infoLabel->show();
- m_infoLabel->setText(tr("Certificate passwords do not match."));
+ m_infoLabel->setText(Tr::tr("Certificate passwords do not match."));
return NoMatch;
}
@@ -207,7 +207,7 @@ bool AndroidCreateKeystoreCertificate::checkCertificateAlias()
{
if (m_certificateAliasLineEdit->text().length() == 0) {
m_infoLabel->show();
- m_infoLabel->setText(tr("Certificate alias is missing."));
+ m_infoLabel->setText(Tr::tr("Certificate alias is missing."));
return false;
}
@@ -219,7 +219,7 @@ bool AndroidCreateKeystoreCertificate::checkCountryCode()
{
if (!m_countryLineEdit->text().contains(QRegularExpression("[A-Z]{2}"))) {
m_infoLabel->show();
- m_infoLabel->setText(tr("Invalid country code."));
+ m_infoLabel->setText(Tr::tr("Invalid country code."));
return false;
}
@@ -244,9 +244,9 @@ void AndroidCreateKeystoreCertificate::buttonBoxAccepted()
if (!validateUserInput())
return;
- m_keystoreFilePath = FileUtils::getSaveFilePath(this, tr("Keystore Filename"),
+ m_keystoreFilePath = FileUtils::getSaveFilePath(this, Tr::tr("Keystore Filename"),
FileUtils::homePath() / "android_release.keystore",
- tr("Keystore files (*.keystore *.jks)"));
+ Tr::tr("Keystore files (*.keystore *.jks)"));
if (m_keystoreFilePath.isEmpty())
return;
QString distinguishedNames(QString::fromLatin1("CN=%1, O=%2, L=%3, C=%4")
@@ -277,7 +277,7 @@ void AndroidCreateKeystoreCertificate::buttonBoxAccepted()
genKeyCertProc.runBlocking(EventLoopMode::On);
if (genKeyCertProc.result() != ProcessResult::FinishedWithSuccess) {
- QMessageBox::critical(this, tr("Error"),
+ QMessageBox::critical(this, Tr::tr("Error"),
genKeyCertProc.exitMessage() + '\n' + genKeyCertProc.allOutput());
return;
}
diff --git a/src/plugins/android/androiddeployqtstep.cpp b/src/plugins/android/androiddeployqtstep.cpp
index 128de01afea..70e8ec4c8ad 100644
--- a/src/plugins/android/androiddeployqtstep.cpp
+++ b/src/plugins/android/androiddeployqtstep.cpp
@@ -2,16 +2,17 @@
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
-#include "androiddeployqtstep.h"
-#include "certificatesmodel.h"
-
-#include "javaparser.h"
-#include "androidmanager.h"
+#include "androidavdmanager.h"
#include "androidconstants.h"
+#include "androiddeployqtstep.h"
+#include "androiddevice.h"
#include "androidglobal.h"
-#include "androidavdmanager.h"
+#include "androidmanager.h"
#include "androidqtversion.h"
-#include "androiddevice.h"
+#include "androidtr.h"
+#include "androidtr.h"
+#include "certificatesmodel.h"
+#include "javaparser.h"
#include <coreplugin/fileutils.h>
#include <coreplugin/icore.h>
@@ -71,7 +72,7 @@ AndroidDeployQtStep::AndroidDeployQtStep(BuildStepList *parent, Utils::Id id)
m_uninstallPreviousPackage = addAspect<BoolAspect>();
m_uninstallPreviousPackage->setSettingsKey(UninstallPreviousPackageKey);
- m_uninstallPreviousPackage->setLabel(tr("Uninstall the existing app before deployment"),
+ m_uninstallPreviousPackage->setLabel(Tr::tr("Uninstall the existing app before deployment"),
BoolAspect::LabelPlacement::AtCheckBox);
m_uninstallPreviousPackage->setValue(false);
@@ -91,7 +92,7 @@ bool AndroidDeployQtStep::init()
{
QtSupport::QtVersion *version = QtSupport::QtKitAspect::qtVersion(kit());
if (!version) {
- reportWarningOrError(tr("The Qt version for kit %1 is invalid.").arg(kit()->displayName()),
+ reportWarningOrError(Tr::tr("The Qt version for kit %1 is invalid.").arg(kit()->displayName()),
Task::Error);
return false;
}
@@ -100,19 +101,19 @@ bool AndroidDeployQtStep::init()
m_androidABIs = AndroidManager::applicationAbis(target());
if (m_androidABIs.isEmpty()) {
- reportWarningOrError(tr("No Android architecture (ABI) is set by the project."),
+ reportWarningOrError(Tr::tr("No Android architecture (ABI) is set by the project."),
Task::Error);
return false;
}
- emit addOutput(tr("Initializing deployment to Android device/simulator"),
+ emit addOutput(Tr::tr("Initializing deployment to Android device/simulator"),
OutputFormat::NormalMessage);
RunConfiguration *rc = target()->activeRunConfiguration();
- QTC_ASSERT(rc, reportWarningOrError(tr("The kit's run configuration is invalid."), Task::Error);
+ QTC_ASSERT(rc, reportWarningOrError(Tr::tr("The kit's run configuration is invalid."), Task::Error);
return false);
BuildConfiguration *bc = target()->activeBuildConfiguration();
- QTC_ASSERT(bc, reportWarningOrError(tr("The kit's build configuration is invalid."),
+ QTC_ASSERT(bc, reportWarningOrError(Tr::tr("The kit's build configuration is invalid."),
Task::Error);
return false);
@@ -123,11 +124,11 @@ bool AndroidDeployQtStep::init()
// Try to re-use user-provided information from an earlier step of the same type.
BuildStepList *bsl = stepList();
- QTC_ASSERT(bsl, reportWarningOrError(tr("The kit's build steps list is invalid."), Task::Error);
+ QTC_ASSERT(bsl, reportWarningOrError(Tr::tr("The kit's build steps list is invalid."), Task::Error);
return false);
auto androidDeployQtStep = bsl->firstOfType<AndroidDeployQtStep>();
QTC_ASSERT(androidDeployQtStep,
- reportWarningOrError(tr("The kit's deploy configuration is invalid."), Task::Error);
+ reportWarningOrError(Tr::tr("The kit's deploy configuration is invalid."), Task::Error);
return false);
AndroidDeviceInfo info;
if (androidDeployQtStep != this)
@@ -147,7 +148,7 @@ bool AndroidDeployQtStep::init()
const auto dev =
static_cast<const AndroidDevice *>(DeviceKitAspect::device(kit()).data());
if (!dev) {
- reportWarningOrError(tr("No valid deployment device is set."), Task::Error);
+ reportWarningOrError(Tr::tr("No valid deployment device is set."), Task::Error);
return false;
}
@@ -156,24 +157,24 @@ bool AndroidDeployQtStep::init()
m_deviceInfo = info; // Keep around for later steps
if (!info.isValid()) {
- reportWarningOrError(tr("The deployment device \"%1\" is invalid.")
+ reportWarningOrError(Tr::tr("The deployment device \"%1\" is invalid.")
.arg(dev->displayName()), Task::Error);
return false;
}
const bool abiListNotEmpty = !selectedAbis.isEmpty() && !dev->supportedAbis().isEmpty();
if (abiListNotEmpty && !dev->canSupportAbis(selectedAbis)) {
- const QString error = tr("The deployment device \"%1\" does not support the "
- "architectures used by the kit.\n"
- "The kit supports \"%2\", but the device uses \"%3\".")
- .arg(dev->displayName()).arg(selectedAbis.join(", "))
- .arg(dev->supportedAbis().join(", "));
+ const QString error = Tr::tr("The deployment device \"%1\" does not support the "
+ "architectures used by the kit.\n"
+ "The kit supports \"%2\", but the device uses \"%3\".")
+ .arg(dev->displayName()).arg(selectedAbis.join(", "))
+ .arg(dev->supportedAbis().join(", "));
reportWarningOrError(error, Task::Error);
return false;
}
if (!dev->canHandleDeployments()) {
- reportWarningOrError(tr("The deployment device \"%1\" is disconnected.")
+ reportWarningOrError(Tr::tr("The deployment device \"%1\" is disconnected.")
.arg(dev->displayName()), Task::Error);
return false;
}
@@ -182,10 +183,10 @@ bool AndroidDeployQtStep::init()
const QtSupport::QtVersion * const qt = QtSupport::QtKitAspect::qtVersion(kit());
if (qt && qt->supportsMultipleQtAbis() && !selectedAbis.contains(info.cpuAbi.first())) {
TaskHub::addTask(DeploymentTask(Task::Warning,
- tr("Android: The main ABI of the deployment device (%1) is not selected. The app "
- "execution or debugging might not work properly. Add it from Projects > Build > "
- "Build Steps > qmake > ABIs.")
- .arg(info.cpuAbi.first())));
+ Tr::tr("Android: The main ABI of the deployment device (%1) is not selected. The app "
+ "execution or debugging might not work properly. Add it from Projects > Build > "
+ "Build Steps > qmake > ABIs.")
+ .arg(info.cpuAbi.first())));
}
m_avdName = info.avdName;
@@ -198,7 +199,7 @@ bool AndroidDeployQtStep::init()
gatherFilesToPull();
- emit addOutput(tr("Deploying to %1").arg(m_serialNumber), OutputFormat::NormalMessage);
+ emit addOutput(Tr::tr("Deploying to %1").arg(m_serialNumber), OutputFormat::NormalMessage);
m_uninstallPreviousPackageRun = m_uninstallPreviousPackage->value();
if (m_uninstallPreviousPackageRun)
@@ -209,7 +210,7 @@ bool AndroidDeployQtStep::init()
const QString buildKey = target()->activeBuildKey();
const ProjectNode *node = target()->project()->findNodeForBuildKey(buildKey);
if (!node) {
- reportWarningOrError(tr("The deployment step's project node is invalid."), Task::Error);
+ reportWarningOrError(Tr::tr("The deployment step's project node is invalid."), Task::Error);
return false;
}
m_apkPath = Utils::FilePath::fromString(node->data(Constants::AndroidApk).toString());
@@ -220,13 +221,13 @@ bool AndroidDeployQtStep::init()
} else {
QString jsonFile = AndroidQtVersion::androidDeploymentSettings(target()).toString();
if (jsonFile.isEmpty()) {
- reportWarningOrError(tr("Cannot find the androiddeployqt input JSON file."),
+ reportWarningOrError(Tr::tr("Cannot find the androiddeployqt input JSON file."),
Task::Error);
return false;
}
m_command = version->hostBinPath();
if (m_command.isEmpty()) {
- reportWarningOrError(tr("Cannot find the androiddeployqt tool."), Task::Error);
+ reportWarningOrError(Tr::tr("Cannot find the androiddeployqt tool."), Task::Error);
return false;
}
m_command = m_command.pathAppended("androiddeployqt").withExecutableSuffix();
@@ -289,12 +290,12 @@ AndroidDeployQtStep::DeployErrorCode AndroidDeployQtStep::runDeploy()
if (m_uninstallPreviousPackageRun) {
packageName = AndroidManager::packageName(m_manifestName);
if (packageName.isEmpty()) {
- reportWarningOrError(tr("Cannot find the package name from the Android Manifest "
- "file \"%1\".").arg(m_manifestName.toUserOutput()),
+ reportWarningOrError(Tr::tr("Cannot find the package name from the Android Manifest "
+ "file \"%1\".").arg(m_manifestName.toUserOutput()),
Task::Error);
return Failure;
}
- const QString msg = tr("Uninstalling the previous package \"%1\".").arg(packageName);
+ const QString msg = Tr::tr("Uninstalling the previous package \"%1\".").arg(packageName);
qCDebug(deployStepLog) << msg;
emit addOutput(msg, OutputFormat::NormalMessage);
runCommand({m_adbPath,
@@ -325,7 +326,7 @@ AndroidDeployQtStep::DeployErrorCode AndroidDeployQtStep::runDeploy()
process.start();
- emit addOutput(tr("Starting: \"%1\"").arg(cmd.toUserOutput()), OutputFormat::NormalMessage);
+ emit addOutput(Tr::tr("Starting: \"%1\"").arg(cmd.toUserOutput()), OutputFormat::NormalMessage);
while (!process.waitForFinished(200)) {
if (process.state() == QProcess::NotRunning)
@@ -341,14 +342,14 @@ AndroidDeployQtStep::DeployErrorCode AndroidDeployQtStep::runDeploy()
const int exitCode = process.exitCode();
if (exitStatus == QProcess::NormalExit && exitCode == 0) {
- emit addOutput(tr("The process \"%1\" exited normally.").arg(m_command.toUserOutput()),
+ emit addOutput(Tr::tr("The process \"%1\" exited normally.").arg(m_command.toUserOutput()),
OutputFormat::NormalMessage);
} else if (exitStatus == QProcess::NormalExit) {
- const QString error = tr("The process \"%1\" exited with code %2.")
- .arg(m_command.toUserOutput(), QString::number(exitCode));
+ const QString error = Tr::tr("The process \"%1\" exited with code %2.")
+ .arg(m_command.toUserOutput(), QString::number(exitCode));
reportWarningOrError(error, Task::Error);
} else {
- const QString error = tr("The process \"%1\" crashed.").arg(m_command.toUserOutput());
+ const QString error = Tr::tr("The process \"%1\" crashed.").arg(m_command.toUserOutput());
reportWarningOrError(error, Task::Error);
}
@@ -356,13 +357,13 @@ AndroidDeployQtStep::DeployErrorCode AndroidDeployQtStep::runDeploy()
if (m_uninstallPreviousPackageRun) {
deployError = Failure; // Even re-install failed. Set to Failure.
reportWarningOrError(
- tr("Installing the app failed even after uninstalling the previous one."),
+ Tr::tr("Installing the app failed even after uninstalling the previous one."),
Task::Error);
}
} else if (exitCode != 0 || exitStatus != QProcess::NormalExit) {
// Set the deployError to Failure when no deployError code was detected
// but the adb tool failed otherwise relay the detected deployError.
- reportWarningOrError(tr("Installing the app failed with an unknown error."), Task::Error);
+ reportWarningOrError(Tr::tr("Installing the app failed with an unknown error."), Task::Error);
deployError = Failure;
}
@@ -373,7 +374,7 @@ void AndroidDeployQtStep::slotAskForUninstall(DeployErrorCode errorCode)
{
Q_ASSERT(errorCode > 0);
- QString uninstallMsg = tr("Deployment failed with the following errors:\n\n");
+ QString uninstallMsg = Tr::tr("Deployment failed with the following errors:\n\n");
uint errorCodeFlags = errorCode;
uint mask = 1;
while (errorCodeFlags) {
@@ -397,9 +398,9 @@ void AndroidDeployQtStep::slotAskForUninstall(DeployErrorCode errorCode)
mask <<= 1;
}
- uninstallMsg.append(tr("\nUninstalling the installed package may solve the issue.\n"
- "Do you want to uninstall the existing package?"));
- int button = QMessageBox::critical(nullptr, tr("Install failed"), uninstallMsg,
+ uninstallMsg.append(Tr::tr("\nUninstalling the installed package may solve the issue.\n"
+ "Do you want to uninstall the existing package?"));
+ int button = QMessageBox::critical(nullptr, Tr::tr("Install failed"), uninstallMsg,
QMessageBox::Yes, QMessageBox::No);
m_askForUninstall = button == QMessageBox::Yes;
}
@@ -410,7 +411,7 @@ bool AndroidDeployQtStep::runImpl()
QString serialNumber = AndroidAvdManager().waitForAvd(m_avdName, cancelChecker());
qCDebug(deployStepLog) << "Deploying to AVD:" << m_avdName << serialNumber;
if (serialNumber.isEmpty()) {
- reportWarningOrError(tr("The deployment AVD \"%1\" cannot be started.")
+ reportWarningOrError(Tr::tr("The deployment AVD \"%1\" cannot be started.")
.arg(m_avdName), Task::Error);
return false;
}
@@ -429,7 +430,7 @@ bool AndroidDeployQtStep::runImpl()
}
if (!m_filesToPull.isEmpty())
- emit addOutput(tr("Pulling files necessary for debugging."), OutputFormat::NormalMessage);
+ emit addOutput(Tr::tr("Pulling files necessary for debugging."), OutputFormat::NormalMessage);
// Note that values are not necessarily unique, e.g. app_process is looked up in several
// directories
@@ -442,9 +443,9 @@ bool AndroidDeployQtStep::runImpl()
AndroidDeviceInfo::adbSelector(m_serialNumber)
<< "pull" << itr.key() << itr.value()});
if (!QFileInfo::exists(itr.value())) {
- const QString error = tr("Package deploy: Failed to pull \"%1\" to \"%2\".")
- .arg(itr.key())
- .arg(itr.value());
+ const QString error = Tr::tr("Package deploy: Failed to pull \"%1\" to \"%2\".")
+ .arg(itr.key())
+ .arg(itr.value());
reportWarningOrError(error, Task::Error);
}
}
@@ -493,7 +494,7 @@ void AndroidDeployQtStep::runCommand(const CommandLine &command)
{
QtcProcess buildProc;
buildProc.setTimeoutS(2 * 60);
- emit addOutput(tr("Package deploy: Running command \"%1\".").arg(command.toUserOutput()),
+ emit addOutput(Tr::tr("Package deploy: Running command \"%1\".").arg(command.toUserOutput()),
OutputFormat::NormalMessage);
buildProc.setCommand(command);
@@ -506,14 +507,14 @@ QWidget *AndroidDeployQtStep::createConfigWidget()
{
auto widget = new QWidget;
auto installCustomApkButton = new QPushButton(widget);
- installCustomApkButton->setText(tr("Install an APK File"));
+ installCustomApkButton->setText(Tr::tr("Install an APK File"));
connect(installCustomApkButton, &QAbstractButton::clicked, this, [this, widget] {
const FilePath packagePath
= FileUtils::getOpenFilePath(widget,
- tr("Qt Android Installer"),
+ Tr::tr("Qt Android Installer"),
FileUtils::homePath(),
- tr("Android package (*.apk)"));
+ Tr::tr("Android package (*.apk)"));
if (!packagePath.isEmpty())
AndroidManager::installQASIPackage(target(), packagePath);
});
@@ -582,7 +583,7 @@ AndroidDeployQtStepFactory::AndroidDeployQtStepFactory()
setSupportedStepList(ProjectExplorer::Constants::BUILDSTEPS_DEPLOY);
setSupportedDeviceType(Constants::ANDROID_DEVICE_TYPE);
setRepeatable(false);
- setDisplayName(AndroidDeployQtStep::tr("Deploy to Android device"));
+ setDisplayName(Tr::tr("Deploy to Android device"));
}
} // Internal
diff --git a/src/plugins/android/androiddevice.cpp b/src/plugins/android/androiddevice.cpp
index 4a96b1ccc26..7600c9fd096 100644
--- a/src/plugins/android/androiddevice.cpp
+++ b/src/plugins/android/androiddevice.cpp
@@ -2,13 +2,13 @@
// Copyright (C) 2016 BogDan Vatra <[email protected]>
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
-#include "androiddevice.h"
-
#include "androidavdmanager.h"
#include "androidconfigurations.h"
#include "androidconstants.h"
+#include "androiddevice.h"
#include "androidmanager.h"
#include "androidsignaloperation.h"
+#include "androidtr.h"
#include "avddialog.h"
#include <coreplugin/icore.h>
@@ -75,40 +75,40 @@ AndroidDeviceWidget::AndroidDeviceWidget(const IDevice::Ptr &device)
if (!dev->isValid())
return;
- formLayout->addRow(AndroidDevice::tr("Device name:"), new QLabel(dev->displayName()));
- formLayout->addRow(AndroidDevice::tr("Device type:"), new QLabel(dev->deviceTypeName()));
+ formLayout->addRow(Tr::tr("Device name:"), new QLabel(dev->displayName()));
+ formLayout->addRow(Tr::tr("Device type:"), new QLabel(dev->deviceTypeName()));
const QString serialNumber = dev->serialNumber();
- const QString printableSerialNumber = serialNumber.isEmpty() ? AndroidDevice::tr("Unknown")
+ const QString printableSerialNumber = serialNumber.isEmpty() ? Tr::tr("Unknown")
: serialNumber;
- formLayout->addRow(AndroidDevice::tr("Serial number:"), new QLabel(printableSerialNumber));
+ formLayout->addRow(Tr::tr("Serial number:"), new QLabel(printableSerialNumber));
const QString abis = dev->supportedAbis().join(", ");
- formLayout->addRow(AndroidDevice::tr("CPU architecture:"), new QLabel(abis));
+ formLayout->addRow(Tr::tr("CPU architecture:"), new QLabel(abis));
const auto osString = QString("%1 (SDK %2)").arg(dev->androidVersion()).arg(dev->sdkLevel());
- formLayout->addRow(AndroidDevice::tr("OS version:"), new QLabel(osString));
+ formLayout->addRow(Tr::tr("OS version:"), new QLabel(osString));
if (dev->machineType() == IDevice::Hardware) {
const QString authorizedStr = dev->deviceState() == IDevice::DeviceReadyToUse
- ? AndroidDevice::tr("Yes")
- : AndroidDevice::tr("No");
- formLayout->addRow(AndroidDevice::tr("Authorized:"), new QLabel(authorizedStr));
+ ? Tr::tr("Yes")
+ : Tr::tr("No");
+ formLayout->addRow(Tr::tr("Authorized:"), new QLabel(authorizedStr));
}
if (dev->machineType() == IDevice::Emulator) {
const QString targetName = dev->androidTargetName();
- formLayout->addRow(AndroidDevice::tr("Android target flavor:"), new QLabel(targetName));
- formLayout->addRow(AndroidDevice::tr("SD card size:"), new QLabel(dev->sdcardSize()));
- formLayout->addRow(AndroidDevice::tr("Skin type:"), new QLabel(dev->skinName()));
+ formLayout->addRow(Tr::tr("Android target flavor:"), new QLabel(targetName));
+ formLayout->addRow(Tr::tr("SD card size:"), new QLabel(dev->sdcardSize()));
+ formLayout->addRow(Tr::tr("Skin type:"), new QLabel(dev->skinName()));
const QString openGlStatus = dev->openGLStatus();
- formLayout->addRow(AndroidDevice::tr("OpenGL status:"), new QLabel(openGlStatus));
+ formLayout->addRow(Tr::tr("OpenGL status:"), new QLabel(openGlStatus));
}
}
QString AndroidDeviceWidget::dialogTitle()
{
- return AndroidDevice::tr("Android Device Manager");
+ return Tr::tr("Android Device Manager");
}
bool AndroidDeviceWidget::messageDialog(const QString &msg, QMessageBox::Icon icon, QWidget *parent)
@@ -152,13 +152,13 @@ AndroidDevice::AndroidDevice()
{
setupId(IDevice::AutoDetected, Constants::ANDROID_DEVICE_ID);
setType(Constants::ANDROID_DEVICE_TYPE);
- setDefaultDisplayName(tr("Run on Android"));
- setDisplayType(tr("Android"));
+ setDefaultDisplayName(Tr::tr("Run on Android"));
+ setDisplayType(Tr::tr("Android"));
setMachineType(IDevice::Hardware);
setOsType(OsType::OsTypeOtherUnix);
setDeviceState(DeviceDisconnected);
- addDeviceAction({tr("Refresh"), [](const IDevice::Ptr &device, QWidget *parent) {
+ addDeviceAction({Tr::tr("Refresh"), [](const IDevice::Ptr &device, QWidget *parent) {
Q_UNUSED(parent)
AndroidDeviceManager::instance()->updateDeviceState(device);
}});
@@ -166,10 +166,10 @@ AndroidDevice::AndroidDevice()
void AndroidDevice::addActionsIfNotFound()
{
- static const QString startAvdAction = tr("Start AVD");
- static const QString eraseAvdAction = tr("Erase AVD");
- static const QString avdArgumentsAction = tr("AVD Arguments");
- static const QString setupWifi = tr("Setup Wi-Fi");
+ static const QString startAvdAction = Tr::tr("Start AVD");
+ static const QString eraseAvdAction = Tr::tr("Erase AVD");
+ static const QString avdArgumentsAction = Tr::tr("AVD Arguments");
+ static const QString setupWifi = Tr::tr("Setup Wi-Fi");
bool hasStartAction = false;
bool hasEraseAction = false;
@@ -351,32 +351,32 @@ QString AndroidDevice::androidVersion() const
QString AndroidDevice::deviceTypeName() const
{
if (machineType() == Emulator)
- return tr("Emulator for \"%1\"").arg(avdSettings()->value("hw.device.name").toString());
- return tr("Physical device");
+ return Tr::tr("Emulator for \"%1\"").arg(avdSettings()->value("hw.device.name").toString());
+ return Tr::tr("Physical device");
}
QString AndroidDevice::skinName() const
{
const QString skin = avdSettings()->value("skin.name").toString();
- return skin.isEmpty() ? tr("None") : skin;
+ return skin.isEmpty() ? Tr::tr("None") : skin;
}
QString AndroidDevice::androidTargetName() const
{
const QString target = avdSettings()->value("tag.display").toString();
- return target.isEmpty() ? tr("Unknown") : target;
+ return target.isEmpty() ? Tr::tr("Unknown") : target;
}
QString AndroidDevice::sdcardSize() const
{
const QString size = avdSettings()->value("sdcard.size").toString();
- return size.isEmpty() ? tr("Unknown") : size;
+ return size.isEmpty() ? Tr::tr("Unknown") : size;
}
QString AndroidDevice::openGLStatus() const
{
const QString openGL = avdSettings()->value("hw.gpu.enabled").toString();
- return openGL.isEmpty() ? tr("Unknown") : openGL;
+ return openGL.isEmpty() ? Tr::tr("Unknown") : openGL;
}
IDevice::DeviceInfo AndroidDevice::deviceInformation() const
@@ -475,7 +475,7 @@ void AndroidDeviceManager::eraseAvd(const IDevice::Ptr &device, QWidget *parent)
const QString name = static_cast<const AndroidDevice *>(device.data())->avdName();
const QString question
- = AndroidDevice::tr("Erase the Android AVD \"%1\"?\nThis cannot be undone.").arg(name);
+ = Tr::tr("Erase the Android AVD \"%1\"?\nThis cannot be undone.").arg(name);
if (!AndroidDeviceWidget::questionDialog(question, parent))
return;
@@ -494,7 +494,7 @@ void AndroidDeviceManager::setupWifiForDevice(const IDevice::Ptr &device, QWidge
{
if (device->deviceState() != IDevice::DeviceReadyToUse) {
AndroidDeviceWidget::infoDialog(
- AndroidDevice::tr("The device has to be connected with ADB debugging "
+ Tr::tr("The device has to be connected with ADB debugging "
"enabled to use this feature."), parent);
return;
}
@@ -507,7 +507,7 @@ void AndroidDeviceManager::setupWifiForDevice(const IDevice::Ptr &device, QWidge
const SdkToolResult result = AndroidManager::runAdbCommand(args);
if (!result.success()) {
AndroidDeviceWidget::criticalDialog(
- AndroidDevice::tr("Opening connection port %1 failed.").arg(wifiDevicePort),
+ Tr::tr("Opening connection port %1 failed.").arg(wifiDevicePort),
parent);
return;
}
@@ -519,7 +519,7 @@ void AndroidDeviceManager::setupWifiForDevice(const IDevice::Ptr &device, QWidge
const SdkToolResult ipRes = AndroidManager::runAdbCommand(args);
if (!ipRes.success()) {
AndroidDeviceWidget::criticalDialog(
- AndroidDevice::tr("Retrieving the device IP address failed."), parent);
+ Tr::tr("Retrieving the device IP address failed."), parent);
return;
}
@@ -533,7 +533,7 @@ void AndroidDeviceManager::setupWifiForDevice(const IDevice::Ptr &device, QWidge
}
if (!ipRegex.match(ipParts.last()).hasMatch()) {
AndroidDeviceWidget::criticalDialog(
- AndroidDevice::tr("The retrieved IP address is invalid."), parent);
+ Tr::tr("The retrieved IP address is invalid."), parent);
return;
}
@@ -543,7 +543,7 @@ void AndroidDeviceManager::setupWifiForDevice(const IDevice::Ptr &device, QWidge
const SdkToolResult connectRes = AndroidManager::runAdbCommand(args);
if (!connectRes.success()) {
AndroidDeviceWidget::criticalDialog(
- AndroidDevice::tr("Connecting to to the device IP \"%1\" failed.").arg(ip),
+ Tr::tr("Connecting to to the device IP \"%1\" failed.").arg(ip),
parent);
return;
}
@@ -559,7 +559,7 @@ void AndroidDeviceManager::handleAvdRemoved()
// Remove the device from QtC after it's been removed using avdmanager.
DeviceManager::instance()->removeDevice(result.first->id());
} else {
- AndroidDeviceWidget::criticalDialog(QObject::tr("An error occurred while removing the "
+ AndroidDeviceWidget::criticalDialog(Tr::tr("An error occurred while removing the "
"Android AVD \"%1\" using avdmanager tool.").arg(name));
}
}
@@ -577,8 +577,8 @@ void AndroidDeviceManager::setEmulatorArguments(QWidget *parent)
"https://developer.android.com/studio/run/emulator-commandline#startup-options";
QInputDialog dialog(parent ? parent : Core::ICore::dialogParent());
- dialog.setWindowTitle(AndroidDevice::tr("Emulator Command-line Startup Options"));
- dialog.setLabelText(AndroidDevice::tr("Emulator command-line startup options "
+ dialog.setWindowTitle(Tr::tr("Emulator Command-line Startup Options"));
+ dialog.setLabelText(Tr::tr("Emulator command-line startup options "
"(<a href=\"%1\">Help Web Page</a>):")
.arg(helpUrl));
dialog.setTextValue(m_androidConfig.emulatorArgs());
@@ -844,7 +844,7 @@ AndroidDeviceFactory::AndroidDeviceFactory()
: IDeviceFactory(Constants::ANDROID_DEVICE_TYPE),
m_androidConfig(AndroidConfigurations::currentConfig())
{
- setDisplayName(AndroidDevice::tr("Android Device"));
+ setDisplayName(Tr::tr("Android Device"));
setCombinedIcon(":/android/images/androiddevicesmall.png",
":/android/images/androiddevice.png");
@@ -861,7 +861,7 @@ AndroidDeviceFactory::AndroidDeviceFactory()
qPrintable(androidDev->avdName()));
} else {
AndroidDeviceWidget::criticalDialog(
- AndroidDevice::tr("The device info returned from AvdDialog is invalid."));
+ Tr::tr("The device info returned from AvdDialog is invalid."));
}
return IDevice::Ptr(dev);
diff --git a/src/plugins/android/androiddevice.h b/src/plugins/android/androiddevice.h
index 646cea80c1e..e19ffd96d6d 100644
--- a/src/plugins/android/androiddevice.h
+++ b/src/plugins/android/androiddevice.h
@@ -22,8 +22,6 @@ namespace Internal {
class AndroidDevice final : public ProjectExplorer::IDevice
{
- Q_DECLARE_TR_FUNCTIONS(Android::Internal::AndroidDevice)
-
public:
AndroidDevice();
diff --git a/src/plugins/android/androiderrormessage.cpp b/src/plugins/android/androiderrormessage.cpp
index 3841d80493e..b1db1e7e0b3 100644
--- a/src/plugins/android/androiderrormessage.cpp
+++ b/src/plugins/android/androiderrormessage.cpp
@@ -2,6 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
#include "androiderrormessage.h"
+#include "androidtr.h"
#include <QObject>
@@ -13,34 +14,34 @@ QString AndroidErrorMessage::getMessage(ErrorCode errorCode, const QVariantList
Q_UNUSED(parameters)
switch (errorCode) {
case SDKInstallationError:
- return tr("Android: SDK installation error 0x%1").arg(errorCode, 0, 16);
+ return Tr::tr("Android: SDK installation error 0x%1").arg(errorCode, 0, 16);
case NDKInstallationError:
- return tr("Android: NDK installation error 0x%1").arg(errorCode, 0, 16);
+ return Tr::tr("Android: NDK installation error 0x%1").arg(errorCode, 0, 16);
case JavaInstallationError:
- return tr("Android: Java installation error 0x%1").arg(errorCode, 0, 16);
+ return Tr::tr("Android: Java installation error 0x%1").arg(errorCode, 0, 16);
case AntInstallationError:
- return tr("Android: ant installation error 0x%1").arg(errorCode, 0, 16);
+ return Tr::tr("Android: ant installation error 0x%1").arg(errorCode, 0, 16);
case AdbInstallationError:
- return tr("Android: adb installation error 0x%1").arg(errorCode, 0, 16);
+ return Tr::tr("Android: adb installation error 0x%1").arg(errorCode, 0, 16);
case DeviceConnectionError:
- return tr("Android: Device connection error 0x%1").arg(errorCode, 0, 16);
+ return Tr::tr("Android: Device connection error 0x%1").arg(errorCode, 0, 16);
case DevicePermissionError:
- return tr("Android: Device permission error 0x%1").arg(errorCode, 0, 16);
+ return Tr::tr("Android: Device permission error 0x%1").arg(errorCode, 0, 16);
case DeviceAuthorizationError:
- return tr("Android: Device authorization error 0x%1").arg(errorCode, 0, 16);
+ return Tr::tr("Android: Device authorization error 0x%1").arg(errorCode, 0, 16);
case DeviceAPILevelError:
- return tr("Android: Device API level not supported: error 0x%1").arg(errorCode, 0, 16);
+ return Tr::tr("Android: Device API level not supported: error 0x%1").arg(errorCode, 0, 16);
default:
- return tr("Android: Unknown error 0x%1").arg(errorCode, 0, 16);
+ return Tr::tr("Android: Unknown error 0x%1").arg(errorCode, 0, 16);
}
}
diff --git a/src/plugins/android/androiderrormessage.h b/src/plugins/android/androiderrormessage.h
index 5d5b90af4eb..4c7e45b539a 100644
--- a/src/plugins/android/androiderrormessage.h
+++ b/src/plugins/android/androiderrormessage.h
@@ -11,7 +11,6 @@ namespace Internal {
class AndroidErrorMessage
{
- Q_DECLARE_TR_FUNCTIONS(Android::Internal::AndroidErrorMessage)
public:
enum ErrorCode {
UnknownError = 0x3000,
diff --git a/src/plugins/android/androidmanager.cpp b/src/plugins/android/androidmanager.cpp
index 3467e71fb42..65440bb502e 100644
--- a/src/plugins/android/androidmanager.cpp
+++ b/src/plugins/android/androidmanager.cpp
@@ -1,8 +1,6 @@
// Copyright (C) 2016 BogDan Vatra <[email protected]>
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
-#include "androidmanager.h"
-
#include "androidavdmanager.h"
#include "androidbuildapkstep.h"
#include "androidconfigurations.h"
@@ -10,10 +8,12 @@
#include "androiddeployqtstep.h"
#include "androiddevice.h"
#include "androidglobal.h"
+#include "androidmanager.h"
#include "androidqtversion.h"
#include "androidrunconfiguration.h"
#include "androidsdkmanager.h"
#include "androidtoolchain.h"
+#include "androidtr.h"
#include <coreplugin/documentmanager.h>
#include <coreplugin/messagemanager.h>
@@ -505,13 +505,13 @@ QString AndroidManager::androidNameForApiLevel(int x)
case 33:
return QLatin1String("Android Tiramisu");
default:
- return tr("Unknown Android version. API Level: %1").arg(x);
+ return Tr::tr("Unknown Android version. API Level: %1").arg(x);
}
}
static void raiseError(const QString &reason)
{
- QMessageBox::critical(nullptr, AndroidManager::tr("Error creating Android templates."), reason);
+ QMessageBox::critical(nullptr, Tr::tr("Error creating Android templates."), reason);
}
static bool openXmlFile(QDomDocument &doc, const FilePath &fileName)
@@ -521,7 +521,7 @@ static bool openXmlFile(QDomDocument &doc, const FilePath &fileName)
return false;
if (!doc.setContent(f.readAll())) {
- raiseError(AndroidManager::tr("Cannot parse \"%1\".").arg(fileName.toUserOutput()));
+ raiseError(Tr::tr("Cannot parse \"%1\".").arg(fileName.toUserOutput()));
return false;
}
return true;
@@ -560,7 +560,7 @@ void AndroidManager::installQASIPackage(Target *target, const FilePath &packageP
if (info.type == IDevice::Emulator) {
deviceSerialNumber = AndroidAvdManager().startAvd(info.avdName);
if (deviceSerialNumber.isEmpty())
- Core::MessageManager::writeDisrupting(tr("Starting Android virtual device failed."));
+ Core::MessageManager::writeDisrupting(Tr::tr("Starting Android virtual device failed."));
}
QStringList arguments = AndroidDeviceInfo::adbSelector(deviceSerialNumber);
@@ -568,7 +568,7 @@ void AndroidManager::installQASIPackage(Target *target, const FilePath &packageP
QString error;
if (!runAdbCommandDetached(arguments, &error, true))
Core::MessageManager::writeDisrupting(
- tr("Android package installation failed.\n%1").arg(error));
+ Tr::tr("Android package installation failed.\n%1").arg(error));
}
bool AndroidManager::checkKeystorePassword(const QString &keystorePath, const QString &keystorePasswd)
diff --git a/src/plugins/android/androidmanifesteditor.cpp b/src/plugins/android/androidmanifesteditor.cpp
index f0d48a5dd32..f45d52b4215 100644
--- a/src/plugins/android/androidmanifesteditor.cpp
+++ b/src/plugins/android/androidmanifesteditor.cpp
@@ -1,10 +1,11 @@
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
-#include "androidmanifesteditor.h"
+#include "androidconstants.h"
#include "androidmanifestdocument.h"
+#include "androidmanifesteditor.h"
#include "androidmanifesteditorwidget.h"
-#include "androidconstants.h"
+#include "androidtr.h"
#include <texteditor/texteditorconstants.h>
@@ -23,12 +24,12 @@ AndroidManifestEditor::AndroidManifestEditor(AndroidManifestEditorWidget *editor
connect(m_actionGroup, &QActionGroup::triggered,
this, &AndroidManifestEditor::changeEditorPage);
- QAction *generalAction = m_toolBar->addAction(tr("General"));
+ QAction *generalAction = m_toolBar->addAction(Tr::tr("General"));
generalAction->setData(AndroidManifestEditorWidget::General);
generalAction->setCheckable(true);
m_actionGroup->addAction(generalAction);
- QAction *sourceAction = m_toolBar->addAction(tr("XML Source"));
+ QAction *sourceAction = m_toolBar->addAction(Tr::tr("XML Source"));
sourceAction->setData(AndroidManifestEditorWidget::Source);
sourceAction->setCheckable(true);
m_actionGroup->addAction(sourceAction);
diff --git a/src/plugins/android/androidmanifesteditorfactory.cpp b/src/plugins/android/androidmanifesteditorfactory.cpp
index 63cb02b4433..9de20831a39 100644
--- a/src/plugins/android/androidmanifesteditorfactory.cpp
+++ b/src/plugins/android/androidmanifesteditorfactory.cpp
@@ -1,10 +1,11 @@
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
-#include "androidmanifesteditorfactory.h"
#include "androidconstants.h"
-#include "androidmanifesteditorwidget.h"
#include "androidmanifesteditor.h"
+#include "androidmanifesteditorfactory.h"
+#include "androidmanifesteditorwidget.h"
+#include "androidtr.h"
#include <texteditor/texteditorsettings.h>
@@ -18,7 +19,7 @@ AndroidManifestEditorFactory::AndroidManifestEditorFactory()
[](Core::IEditor *editor) { return static_cast<AndroidManifestEditor *>(editor)->textEditor(); })
{
setId(Constants::ANDROID_MANIFEST_EDITOR_ID);
- setDisplayName(AndroidManifestEditorWidget::tr("Android Manifest editor"));
+ setDisplayName(Tr::tr("Android Manifest editor"));
addMimeType(Constants::ANDROID_MANIFEST_MIME_TYPE);
setEditorCreator([] {
auto androidManifestEditorWidget = new AndroidManifestEditorWidget;
diff --git a/src/plugins/android/androidmanifesteditoriconcontainerwidget.cpp b/src/plugins/android/androidmanifesteditoriconcontainerwidget.cpp
index 30770980dc3..5b8e4a5a739 100644
--- a/src/plugins/android/androidmanifesteditoriconcontainerwidget.cpp
+++ b/src/plugins/android/androidmanifesteditoriconcontainerwidget.cpp
@@ -3,6 +3,7 @@
#include "androidmanifesteditoriconcontainerwidget.h"
#include "androidmanifesteditoriconwidget.h"
+#include "androidtr.h"
#include <utils/utilsicons.h>
@@ -37,7 +38,8 @@ AndroidManifestEditorIconContainerWidget::AndroidManifestEditorIconContainerWidg
auto masterIconButton = new AndroidManifestEditorIconWidget(this,
lowDpiIconSize,
lowDpiIconSize,
- tr("Master icon"), tr("Select master icon."));
+ Tr::tr("Master icon"),
+ Tr::tr("Select master icon."));
masterIconButton->setIcon(QIcon::fromTheme(QLatin1String("document-open"), Utils::Icons::OPENFILE.icon()));
iconLayout->addWidget(masterIconButton);
iconLayout->addStretch(1);
@@ -53,8 +55,8 @@ AndroidManifestEditorIconContainerWidget::AndroidManifestEditorIconContainerWidg
auto lIconButton = new AndroidManifestEditorIconWidget(this,
lowDpiIconSize,
lowDpiIconSize,
- tr("LDPI icon"),
- tr("Select an icon suitable for low-density (ldpi) screens (~120dpi)."),
+ Tr::tr("LDPI icon"),
+ Tr::tr("Select an icon suitable for low-density (ldpi) screens (~120dpi)."),
textEditorWidget,
lowDpiIconPath,
iconFileName);
@@ -65,8 +67,8 @@ AndroidManifestEditorIconContainerWidget::AndroidManifestEditorIconContainerWidg
auto mIconButton = new AndroidManifestEditorIconWidget(this,
mediumDpiIconSize,
mediumDpiIconSize,
- tr("MDPI icon"),
- tr("Select an icon for medium-density (mdpi) screens (~160dpi)."),
+ Tr::tr("MDPI icon"),
+ Tr::tr("Select an icon for medium-density (mdpi) screens (~160dpi)."),
textEditorWidget,
mediumDpiIconPath,
iconFileName);
@@ -77,8 +79,8 @@ AndroidManifestEditorIconContainerWidget::AndroidManifestEditorIconContainerWidg
auto hIconButton = new AndroidManifestEditorIconWidget(this,
highDpiIconSize,
highDpiIconSize,
- tr("HDPI icon"),
- tr("Select an icon for high-density (hdpi) screens (~240dpi)."),
+ Tr::tr("HDPI icon"),
+ Tr::tr("Select an icon for high-density (hdpi) screens (~240dpi)."),
textEditorWidget,
highDpiIconPath,
iconFileName);
@@ -89,8 +91,8 @@ AndroidManifestEditorIconContainerWidget::AndroidManifestEditorIconContainerWidg
auto xhIconButton = new AndroidManifestEditorIconWidget(this,
extraHighDpiIconSize,
extraHighDpiIconSize,
- tr("XHDPI icon"),
- tr("Select an icon for extra-high-density (xhdpi) screens (~320dpi)."),
+ Tr::tr("XHDPI icon"),
+ Tr::tr("Select an icon for extra-high-density (xhdpi) screens (~320dpi)."),
textEditorWidget,
extraHighDpiIconPath,
iconFileName);
@@ -101,8 +103,8 @@ AndroidManifestEditorIconContainerWidget::AndroidManifestEditorIconContainerWidg
auto xxhIconButton = new AndroidManifestEditorIconWidget(this,
extraExtraHighDpiIconSize,
extraExtraHighDpiIconSize,
- tr("XXHDPI icon"),
- tr("Select an icon for extra-extra-high-density (xxhdpi) screens (~480dpi)."),
+ Tr::tr("XXHDPI icon"),
+ Tr::tr("Select an icon for extra-extra-high-density (xxhdpi) screens (~480dpi)."),
textEditorWidget,
extraExtraHighDpiIconPath,
iconFileName);
@@ -113,8 +115,8 @@ AndroidManifestEditorIconContainerWidget::AndroidManifestEditorIconContainerWidg
auto xxxhIconButton = new AndroidManifestEditorIconWidget(this,
extraExtraExtraHighDpiIconSize,
extraExtraExtraHighDpiIconSize,
- tr("XXXHDPI icon"),
- tr("Select an icon for extra-extra-extra-high-density (xxxhdpi) screens (~640dpi)."),
+ Tr::tr("XXXHDPI icon"),
+ Tr::tr("Select an icon for extra-extra-extra-high-density (xxxhdpi) screens (~640dpi)."),
textEditorWidget,
extraExtraExtraHighDpiIconPath,
iconFileName);
diff --git a/src/plugins/android/androidmanifesteditoriconwidget.cpp b/src/plugins/android/androidmanifesteditoriconwidget.cpp
index 770baf761a4..037ed684ca3 100644
--- a/src/plugins/android/androidmanifesteditoriconwidget.cpp
+++ b/src/plugins/android/androidmanifesteditoriconwidget.cpp
@@ -2,6 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
#include "androidmanifesteditoriconwidget.h"
+#include "androidtr.h"
#include <texteditor/textdocument.h>
#include <texteditor/texteditor.h>
@@ -65,10 +66,10 @@ AndroidManifestEditorIconWidget::AndroidManifestEditorIconWidget(
m_scaleWarningLabel->setMinimumSize(clearAndWarningSize);
m_scaleWarningLabel->setMaximumSize(clearAndWarningSize);
m_scaleWarningLabel->setPixmap(Utils::Icons::WARNING.icon().pixmap(clearAndWarningSize));
- m_scaleWarningLabel->setToolTip(tr("Icon scaled up."));
+ m_scaleWarningLabel->setToolTip(Tr::tr("Icon scaled up."));
m_scaleWarningLabel->setVisible(false);
}
- auto label = new QLabel(tr("Click to select..."), parent);
+ auto label = new QLabel(Tr::tr("Click to select..."), parent);
iconLayout->addWidget(iconTitle);
iconLayout->setAlignment(iconTitle, Qt::AlignHCenter);
iconLayout->addStretch(50);
@@ -144,7 +145,7 @@ void AndroidManifestEditorIconWidget::selectIcon()
{
FilePath file = FileUtils::getOpenFilePath(this, m_iconSelectionText,
FileUtils::homePath(),
- tr("Images (*.png *.jpg *.jpeg *.webp *.svg)"));
+ Tr::tr("Images (*.png *.jpg *.jpeg *.webp *.svg)")); // TODO: See SplashContainterWidget
if (file.isEmpty())
return;
setIconFromPath(file);
diff --git a/src/plugins/android/androidmanifesteditorwidget.cpp b/src/plugins/android/androidmanifesteditorwidget.cpp
index 04bd7446b52..83095383917 100644
--- a/src/plugins/android/androidmanifesteditorwidget.cpp
+++ b/src/plugins/android/androidmanifesteditorwidget.cpp
@@ -1,14 +1,15 @@
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
-#include "androidmanifesteditorwidget.h"
-#include "androidmanifesteditoriconcontainerwidget.h"
-#include "androidmanifesteditor.h"
#include "androidconfigurations.h"
#include "androidconstants.h"
-#include "androidmanifestdocument.h"
#include "androidmanager.h"
+#include "androidmanifestdocument.h"
+#include "androidmanifesteditor.h"
+#include "androidmanifesteditoriconcontainerwidget.h"
+#include "androidmanifesteditorwidget.h"
#include "androidservicewidget.h"
+#include "androidtr.h"
#include "splashscreencontainerwidget.h"
#include <coreplugin/icore.h>
@@ -116,15 +117,15 @@ AndroidManifestEditorWidget::AndroidManifestEditorWidget()
QGroupBox *AndroidManifestEditorWidget::createPermissionsGroupBox(QWidget *parent)
{
auto permissionsGroupBox = new QGroupBox(parent);
- permissionsGroupBox->setTitle(tr("Permissions"));
+ permissionsGroupBox->setTitle(Tr::tr("Permissions"));
auto layout = new QGridLayout(permissionsGroupBox);
m_defaultPermissonsCheckBox = new QCheckBox(this);
- m_defaultPermissonsCheckBox->setText(tr("Include default permissions for Qt modules."));
+ m_defaultPermissonsCheckBox->setText(Tr::tr("Include default permissions for Qt modules."));
layout->addWidget(m_defaultPermissonsCheckBox, 0, 0);
m_defaultFeaturesCheckBox = new QCheckBox(this);
- m_defaultFeaturesCheckBox->setText(tr("Include default features for Qt modules."));
+ m_defaultFeaturesCheckBox->setText(Tr::tr("Include default features for Qt modules."));
layout->addWidget(m_defaultFeaturesCheckBox, 1, 0);
m_permissionsComboBox = new QComboBox(permissionsGroupBox);
@@ -264,7 +265,7 @@ QGroupBox *AndroidManifestEditorWidget::createPermissionsGroupBox(QWidget *paren
layout->addWidget(m_permissionsComboBox, 2, 0);
m_addPermissionButton = new QPushButton(permissionsGroupBox);
- m_addPermissionButton->setText(tr("Add"));
+ m_addPermissionButton->setText(Tr::tr("Add"));
layout->addWidget(m_addPermissionButton, 2, 1);
m_permissionsModel = new PermissionsModel(this);
@@ -274,7 +275,7 @@ QGroupBox *AndroidManifestEditorWidget::createPermissionsGroupBox(QWidget *paren
layout->addWidget(m_permissionsListView, 3, 0, 3, 1);
m_removePermissionButton = new QPushButton(permissionsGroupBox);
- m_removePermissionButton->setText(tr("Remove"));
+ m_removePermissionButton->setText(Tr::tr("Remove"));
layout->addWidget(m_removePermissionButton, 3, 1);
permissionsGroupBox->setLayout(layout);
@@ -297,11 +298,11 @@ QGroupBox *AndroidManifestEditorWidget::createPermissionsGroupBox(QWidget *paren
QGroupBox *AndroidManifestEditorWidget::createPackageFormLayout(QWidget *parent)
{
auto packageGroupBox = new QGroupBox(parent);
- packageGroupBox->setTitle(tr("Package"));
+ packageGroupBox->setTitle(Tr::tr("Package"));
auto formLayout = new QFormLayout();
m_packageNameLineEdit = new QLineEdit(packageGroupBox);
- m_packageNameLineEdit->setToolTip(tr(
+ m_packageNameLineEdit->setToolTip(Tr::tr(
"<p align=\"justify\">Please choose a valid package name for your application (for "
"example, \"org.example.myapplication\").</p><p align=\"justify\">Packages are usually "
"defined using a hierarchical naming pattern, with levels in the hierarchy separated "
@@ -313,10 +314,10 @@ QGroupBox *AndroidManifestEditorWidget::createPackageFormLayout(QWidget *parent)
"conventions for disambiguating package names and rules for naming packages when the "
"Internet domain name cannot be directly used as a package name are described in "
"section 7.7 of the Java Language Specification.</p>"));
- formLayout->addRow(tr("Package name:"), m_packageNameLineEdit);
+ formLayout->addRow(Tr::tr("Package name:"), m_packageNameLineEdit);
m_packageNameWarning = new QLabel;
- m_packageNameWarning->setText(tr("The package name is not valid."));
+ m_packageNameWarning->setText(Tr::tr("The package name is not valid."));
m_packageNameWarning->setVisible(false);
m_packageNameWarningIcon = new QLabel;
@@ -332,25 +333,25 @@ QGroupBox *AndroidManifestEditorWidget::createPackageFormLayout(QWidget *parent)
formLayout->addRow(QString(), warningRow);
m_versionCodeLineEdit = new QLineEdit(packageGroupBox);
- formLayout->addRow(tr("Version code:"), m_versionCodeLineEdit);
+ formLayout->addRow(Tr::tr("Version code:"), m_versionCodeLineEdit);
m_versionNameLinedit = new QLineEdit(packageGroupBox);
- formLayout->addRow(tr("Version name:"), m_versionNameLinedit);
+ formLayout->addRow(Tr::tr("Version name:"), m_versionNameLinedit);
m_androidMinSdkVersion = new QComboBox(packageGroupBox);
m_androidMinSdkVersion->setToolTip(
- tr("Sets the minimum required version on which this application can be run."));
- m_androidMinSdkVersion->addItem(tr("Not set"), 0);
+ Tr::tr("Sets the minimum required version on which this application can be run."));
+ m_androidMinSdkVersion->addItem(Tr::tr("Not set"), 0);
- formLayout->addRow(tr("Minimum required SDK:"), m_androidMinSdkVersion);
+ formLayout->addRow(Tr::tr("Minimum required SDK:"), m_androidMinSdkVersion);
m_androidTargetSdkVersion = new QComboBox(packageGroupBox);
m_androidTargetSdkVersion->setToolTip(
- tr("Sets the target SDK. Set this to the highest tested version. "
- "This disables compatibility behavior of the system for your application."));
- m_androidTargetSdkVersion->addItem(tr("Not set"), 0);
+ Tr::tr("Sets the target SDK. Set this to the highest tested version. "
+ "This disables compatibility behavior of the system for your application."));
+ m_androidTargetSdkVersion->addItem(Tr::tr("Not set"), 0);
- formLayout->addRow(tr("Target SDK:"), m_androidTargetSdkVersion);
+ formLayout->addRow(Tr::tr("Target SDK:"), m_androidTargetSdkVersion);
packageGroupBox->setLayout(formLayout);
@@ -370,17 +371,17 @@ QGroupBox *AndroidManifestEditorWidget::createPackageFormLayout(QWidget *parent)
QGroupBox *Android::Internal::AndroidManifestEditorWidget::createApplicationGroupBox(QWidget *parent)
{
auto applicationGroupBox = new QGroupBox(parent);
- applicationGroupBox->setTitle(tr("Application"));
+ applicationGroupBox->setTitle(Tr::tr("Application"));
auto formLayout = new QFormLayout();
m_appNameLineEdit = new QLineEdit(applicationGroupBox);
- formLayout->addRow(tr("Application name:"), m_appNameLineEdit);
+ formLayout->addRow(Tr::tr("Application name:"), m_appNameLineEdit);
m_activityNameLineEdit = new QLineEdit(applicationGroupBox);
- formLayout->addRow(tr("Activity name:"), m_activityNameLineEdit);
+ formLayout->addRow(Tr::tr("Activity name:"), m_activityNameLineEdit);
m_styleExtractMethod = new QComboBox(applicationGroupBox);
- formLayout->addRow(tr("Style extraction:"), m_styleExtractMethod);
+ formLayout->addRow(Tr::tr("Style extraction:"), m_styleExtractMethod);
const QList<QStringList> styleMethodsMap = {
{"default",
"In most cases this will be the same as \"full\", but it can also be something else "
@@ -394,7 +395,7 @@ QGroupBox *Android::Internal::AndroidManifestEditorWidget::createApplicationGrou
}
m_screenOrientation = new QComboBox(applicationGroupBox);
- formLayout->addRow(tr("Screen orientation:"), m_screenOrientation);
+ formLayout->addRow(Tr::tr("Screen orientation:"), m_screenOrientation);
// https://developer.android.com/guide/topics/manifest/activity-element#screen
const QList<QStringList> screenOrientationMap = {
{"unspecified", "The default value. The system chooses the orientation. The policy it uses, and therefore the "
@@ -443,19 +444,19 @@ QGroupBox *Android::Internal::AndroidManifestEditorWidget::createApplicationGrou
QGroupBox *AndroidManifestEditorWidget::createAdvancedGroupBox(QWidget *parent)
{
auto otherGroupBox = new QGroupBox(parent);
- otherGroupBox->setTitle(tr("Advanced"));
+ otherGroupBox->setTitle(Tr::tr("Advanced"));
m_advanvedTabWidget = new QTabWidget(otherGroupBox);
auto formLayout = new QFormLayout();
m_iconButtons = new AndroidManifestEditorIconContainerWidget(otherGroupBox, m_textEditorWidget);
- m_advanvedTabWidget->addTab(m_iconButtons, tr("Application icon"));
+ m_advanvedTabWidget->addTab(m_iconButtons, Tr::tr("Application icon"));
m_services = new AndroidServiceWidget(otherGroupBox);
- m_advanvedTabWidget->addTab(m_services, tr("Android services"));
+ m_advanvedTabWidget->addTab(m_services, Tr::tr("Android services"));
m_splashButtons = new SplashScreenContainerWidget(otherGroupBox,
m_textEditorWidget);
- m_advanvedTabWidget->addTab(m_splashButtons, tr("Splash screen"));
+ m_advanvedTabWidget->addTab(m_splashButtons, Tr::tr("Splash screen"));
connect(m_services, &AndroidServiceWidget::servicesModified, this, [this] { setDirty(); });
connect(m_services, &AndroidServiceWidget::servicesModified,
@@ -556,8 +557,8 @@ bool AndroidManifestEditorWidget::setActivePage(EditorPage page)
if (page == Source) {
if (!servicesValid(m_services->services())) {
- QMessageBox::critical(nullptr, tr("Service Definition Invalid"),
- tr("Cannot switch to source when there are invalid services."));
+ QMessageBox::critical(nullptr, Tr::tr("Service Definition Invalid"),
+ Tr::tr("Cannot switch to source when there are invalid services."));
m_advanvedTabWidget->setCurrentIndex(1);
return false;
}
@@ -583,8 +584,8 @@ void AndroidManifestEditorWidget::preSave()
{
if (activePage() != Source) {
if (!servicesValid(m_services->services())) {
- QMessageBox::critical(nullptr, tr("Service Definition Invalid"),
- tr("Cannot save when there are invalid services."));
+ QMessageBox::critical(nullptr, Tr::tr("Service Definition Invalid"),
+ Tr::tr("Cannot save when there are invalid services."));
return;
}
syncToEditor();
@@ -644,13 +645,13 @@ bool AndroidManifestEditorWidget::checkDocument(const QDomDocument &doc, QString
{
QDomElement manifest = doc.documentElement();
if (manifest.tagName() != QLatin1String("manifest")) {
- *errorMessage = tr("The structure of the Android manifest file is corrupted. Expected a top level 'manifest' node.");
+ *errorMessage = Tr::tr("The structure of the Android manifest file is corrupted. Expected a top level 'manifest' node.");
*errorLine = -1;
*errorColumn = -1;
return false;
} else if (manifest.firstChildElement(QLatin1String("application")).firstChildElement(QLatin1String("activity")).isNull()) {
// missing either application or activity element
- *errorMessage = tr("The structure of the Android manifest file is corrupted. Expected an 'application' and 'activity' sub node.");
+ *errorMessage = Tr::tr("The structure of the Android manifest file is corrupted. Expected an 'application' and 'activity' sub node.");
*errorLine = -1;
*errorColumn = -1;
return false;
@@ -699,8 +700,8 @@ void AndroidManifestEditorWidget::updateSdkVersions()
}
for (int i = minSdk; i <= targetSdk; ++i) {
- const QString apiStr = tr("API %1: %2").arg(i)
- .arg(AndroidManager::androidNameForApiLevel(i));
+ const QString apiStr = Tr::tr("API %1: %2").arg(i)
+ .arg(AndroidManager::androidNameForApiLevel(i));
m_androidMinSdkVersion->addItem(apiStr, i);
m_androidTargetSdkVersion->addItem(apiStr, i);
}
@@ -711,11 +712,11 @@ void AndroidManifestEditorWidget::updateInfoBar(const QString &errorMessage, int
Utils::InfoBar *infoBar = m_textEditorWidget->textDocument()->infoBar();
QString text;
if (line < 0)
- text = tr("Could not parse file: \"%1\".").arg(errorMessage);
+ text = Tr::tr("Could not parse file: \"%1\".").arg(errorMessage);
else
- text = tr("%2: Could not parse file: \"%1\".").arg(errorMessage).arg(line);
+ text = Tr::tr("%2: Could not parse file: \"%1\".").arg(errorMessage).arg(line);
Utils::InfoBarEntry infoBarEntry(infoBarId, text);
- infoBarEntry.addCustomButton(tr("Goto error"), [this] {
+ infoBarEntry.addCustomButton(Tr::tr("Goto error"), [this] {
m_textEditorWidget->gotoLine(m_errorLine, m_errorColumn);
});
infoBar->removeInfo(infoBarId);
@@ -741,8 +742,8 @@ void AndroidManifestEditorWidget::setInvalidServiceInfo()
if (m_textEditorWidget->textDocument()->infoBar()->containsInfo(id))
return;
Utils::InfoBarEntry info(id,
- tr("Services invalid. "
- "Manifest cannot be saved. Correct the service definitions before saving."));
+ Tr::tr("Services invalid. "
+ "Manifest cannot be saved. Correct the service definitions before saving."));
m_textEditorWidget->textDocument()->infoBar()->addInfo(info);
}
diff --git a/src/plugins/android/androidpackageinstallationstep.cpp b/src/plugins/android/androidpackageinstallationstep.cpp
index 5757fa8a233..0cc5dc5539c 100644
--- a/src/plugins/android/androidpackageinstallationstep.cpp
+++ b/src/plugins/android/androidpackageinstallationstep.cpp
@@ -1,10 +1,10 @@
// Copyright (C) 2016 BogDan Vatra <[email protected]>
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
-#include "androidpackageinstallationstep.h"
-
#include "androidconstants.h"
#include "androidmanager.h"
+#include "androidpackageinstallationstep.h"
+#include "androidtr.h"
#include <projectexplorer/abstractprocessstep.h>
#include <projectexplorer/buildconfiguration.h>
@@ -39,8 +39,6 @@ namespace Internal {
class AndroidPackageInstallationStep final : public AbstractProcessStep
{
- Q_DECLARE_TR_FUNCTIONS(Android::AndroidPackageInstallationStep)
-
public:
AndroidPackageInstallationStep(BuildStepList *bsl, Id id);
@@ -58,11 +56,11 @@ private:
AndroidPackageInstallationStep::AndroidPackageInstallationStep(BuildStepList *bsl, Id id)
: AbstractProcessStep(bsl, id)
{
- setDisplayName(tr("Copy application data"));
+ setDisplayName(Tr::tr("Copy application data"));
setWidgetExpandedByDefault(false);
setImmutable(true);
setSummaryUpdater([this] {
- return tr("<b>Make install:</b> Copy App Files to %1")
+ return Tr::tr("<b>Make install:</b> Copy App Files to %1")
.arg(QDir::toNativeSeparators(nativeAndroidBuildPath()));
});
setUseEnglishOutput();
@@ -71,13 +69,13 @@ AndroidPackageInstallationStep::AndroidPackageInstallationStep(BuildStepList *bs
bool AndroidPackageInstallationStep::init()
{
if (!AbstractProcessStep::init()) {
- reportWarningOrError(tr("\"%1\" step failed initialization.").arg(displayName()),
+ reportWarningOrError(Tr::tr("\"%1\" step failed initialization.").arg(displayName()),
Task::TaskType::Error);
return false;
}
ToolChain *tc = ToolChainKitAspect::cxxToolChain(kit());
- QTC_ASSERT(tc, reportWarningOrError(tr("\"%1\" step has an invalid C++ toolchain.")
+ QTC_ASSERT(tc, reportWarningOrError(Tr::tr("\"%1\" step has an invalid C++ toolchain.")
.arg(displayName()), Task::TaskType::Error);
return false);
@@ -128,10 +126,10 @@ void AndroidPackageInstallationStep::doRun()
for (const QString &dir : qAsConst(m_androidDirsToClean)) {
FilePath androidDir = FilePath::fromString(dir);
if (!dir.isEmpty() && androidDir.exists()) {
- emit addOutput(tr("Removing directory %1").arg(dir), OutputFormat::NormalMessage);
+ emit addOutput(Tr::tr("Removing directory %1").arg(dir), OutputFormat::NormalMessage);
if (!androidDir.removeRecursively(&error)) {
- reportWarningOrError(tr("Failed to clean \"%1\" from the previous build, with "
- "error:\n%2").arg(androidDir.toUserOutput()).arg(error),
+ reportWarningOrError(Tr::tr("Failed to clean \"%1\" from the previous build, with "
+ "error:\n%2").arg(androidDir.toUserOutput()).arg(error),
Task::TaskType::Error);
emit finished(false);
return;
@@ -183,7 +181,7 @@ AndroidPackageInstallationFactory::AndroidPackageInstallationFactory()
setSupportedStepList(ProjectExplorer::Constants::BUILDSTEPS_BUILD);
setSupportedDeviceType(Android::Constants::ANDROID_DEVICE_TYPE);
setRepeatable(false);
- setDisplayName(AndroidPackageInstallationStep::tr("Deploy to device"));
+ setDisplayName(Tr::tr("Deploy to device"));
}
} // namespace Internal
diff --git a/src/plugins/android/androidplugin.cpp b/src/plugins/android/androidplugin.cpp
index 2a7a048ed1c..f3f92a5e56a 100644
--- a/src/plugins/android/androidplugin.cpp
+++ b/src/plugins/android/androidplugin.cpp
@@ -1,8 +1,6 @@
// Copyright (C) 2016 BogDan Vatra <[email protected]>
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
-#include "androidplugin.h"
-
#include "androidconfigurations.h"
#include "androidconstants.h"
#include "androiddebugsupport.h"
@@ -11,6 +9,7 @@
#include "androidmanager.h"
#include "androidmanifesteditorfactory.h"
#include "androidpackageinstallationstep.h"
+#include "androidplugin.h"
#include "androidpotentialkit.h"
#include "androidqmlpreviewworker.h"
#include "androidqmltoolingsupport.h"
@@ -19,6 +18,7 @@
#include "androidruncontrol.h"
#include "androidsettingswidget.h"
#include "androidtoolchain.h"
+#include "androidtr.h"
#include "javaeditor.h"
#include "javalanguageserver.h"
@@ -58,8 +58,7 @@ public:
{
setConfigBaseId("Qt4ProjectManager.AndroidDeployConfiguration2");
addSupportedTargetDeviceType(Constants::ANDROID_DEVICE_TYPE);
- setDefaultDisplayName(QCoreApplication::translate("Android::Internal",
- "Deploy to Android Device"));
+ setDefaultDisplayName(Tr::tr("Deploy to Android Device"));
addInitialStep(Constants::ANDROID_DEPLOY_QT_ID);
}
};
@@ -133,7 +132,7 @@ bool AndroidPlugin::initialize(const QStringList &arguments, QString *errorMessa
this, &AndroidPlugin::kitsRestored);
LanguageClient::LanguageClientSettings::registerClientType({Android::Constants::JLS_SETTINGS_ID,
- tr("Java Language Server"),
+ Tr::tr("Java Language Server"),
[]() { return new JLSSettings; }});
return true;
@@ -169,12 +168,12 @@ void AndroidPlugin::askUserAboutAndroidSetup()
return;
Utils::InfoBarEntry
- info(kSetupAndroidSetting,
- tr("Would you like to configure Android options? This will ensure "
- "Android kits can be usable and all essential packages are installed. "
- "To do it later, select Edit > Preferences > Devices > Android."),
- Utils::InfoBarEntry::GlobalSuppression::Enabled);
- info.addCustomButton(tr("Configure Android"), [this] {
+ info(kSetupAndroidSetting,
+ Tr::tr("Would you like to configure Android options? This will ensure "
+ "Android kits can be usable and all essential packages are installed. "
+ "To do it later, select Edit > Preferences > Devices > Android."),
+ Utils::InfoBarEntry::GlobalSuppression::Enabled);
+ info.addCustomButton(Tr::tr("Configure Android"), [this] {
Core::ICore::infoBar()->removeInfo(kSetupAndroidSetting);
Core::ICore::infoBar()->globallySuppressInfo(kSetupAndroidSetting);
QTimer::singleShot(0, this, [this] { d->potentialKit.executeFromMenu(); });
diff --git a/src/plugins/android/androidpotentialkit.cpp b/src/plugins/android/androidpotentialkit.cpp
index 09564f76625..d17ca19e8b3 100644
--- a/src/plugins/android/androidpotentialkit.cpp
+++ b/src/plugins/android/androidpotentialkit.cpp
@@ -1,9 +1,10 @@
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
-#include "androidpotentialkit.h"
-#include "androidconstants.h"
#include "androidconfigurations.h"
+#include "androidconstants.h"
+#include "androidpotentialkit.h"
+#include "androidtr.h"
#include <app/app_version.h>
@@ -27,7 +28,7 @@ using namespace Android::Internal;
QString AndroidPotentialKit::displayName() const
{
- return tr("Configure Android...");
+ return Tr::tr("Configure Android...");
}
void AndroidPotentialKit::executeFromMenu()
@@ -68,8 +69,8 @@ AndroidPotentialKitWidget::AndroidPotentialKitWidget(QWidget *parent)
auto layout = new QGridLayout(mainWidget);
layout->setContentsMargins(0, 0, 0, 0);
auto label = new QLabel;
- label->setText(tr("%1 needs additional settings to enable Android support."
- " You can configure those settings in the Options dialog.")
+ label->setText(Tr::tr("%1 needs additional settings to enable Android support."
+ " You can configure those settings in the Options dialog.")
.arg(Core::Constants::IDE_DISPLAY_NAME));
label->setWordWrap(true);
layout->addWidget(label, 0, 0, 1, 2);
diff --git a/src/plugins/android/androidqmlpreviewworker.cpp b/src/plugins/android/androidqmlpreviewworker.cpp
index 490ddc71afa..e89f87dfbca 100644
--- a/src/plugins/android/androidqmlpreviewworker.cpp
+++ b/src/plugins/android/androidqmlpreviewworker.cpp
@@ -1,12 +1,12 @@
// Copyright (C) 2021 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
-#include "androidqmlpreviewworker.h"
-
#include "androidavdmanager.h"
#include "androiddevice.h"
#include "androiddeviceinfo.h"
#include "androidmanager.h"
+#include "androidqmlpreviewworker.h"
+#include "androidtr.h"
#include <coreplugin/icore.h>
@@ -199,7 +199,7 @@ void AndroidQmlPreviewWorker::start()
void AndroidQmlPreviewWorker::stop()
{
if (!isPreviewRunning(m_viewerPid) || stopPreviewApp())
- appendMessage(tr("%1 has been stopped.").arg(apkInfo()->name), NormalMessageFormat);
+ appendMessage(Tr::tr("%1 has been stopped.").arg(apkInfo()->name), NormalMessageFormat);
m_viewerPid = -1;
reportStopped();
}
@@ -216,29 +216,29 @@ bool AndroidQmlPreviewWorker::ensureAvdIsRunning()
using namespace ProjectExplorer;
const IDevice *dev = DeviceKitAspect::device(m_rc->target()->kit()).data();
if (!dev) {
- appendMessage(tr("Selected device is invalid."), ErrorMessageFormat);
+ appendMessage(Tr::tr("Selected device is invalid."), ErrorMessageFormat);
return false;
}
if (dev->deviceState() == IDevice::DeviceDisconnected) {
- appendMessage(tr("Selected device is disconnected."), ErrorMessageFormat);
+ appendMessage(Tr::tr("Selected device is disconnected."), ErrorMessageFormat);
return false;
}
AndroidDeviceInfo devInfoLocal = AndroidDevice::androidDeviceInfoFromIDevice(dev);
if (devInfoLocal.isValid()) {
if (dev->machineType() == IDevice::Emulator) {
- appendMessage(tr("Launching AVD."), NormalMessageFormat);
+ appendMessage(Tr::tr("Launching AVD."), NormalMessageFormat);
devInfoLocal.serialNumber = avdMananager.startAvd(devInfoLocal.avdName);
}
if (devInfoLocal.serialNumber.isEmpty()) {
- appendMessage(tr("Could not start AVD."), ErrorMessageFormat);
+ appendMessage(Tr::tr("Could not start AVD."), ErrorMessageFormat);
} else {
m_serialNumber = devInfoLocal.serialNumber;
m_avdAbis = m_androidConfig.getAbis(m_serialNumber);
}
return !devInfoLocal.serialNumber.isEmpty();
} else {
- appendMessage(tr("No valid AVD has been selected."), ErrorMessageFormat);
+ appendMessage(Tr::tr("No valid AVD has been selected."), ErrorMessageFormat);
}
return false;
}
@@ -249,7 +249,7 @@ bool AndroidQmlPreviewWorker::ensureAvdIsRunning()
bool AndroidQmlPreviewWorker::checkAndInstallPreviewApp()
{
const QStringList command {"pm", "list", "packages", apkInfo()->appId};
- appendMessage(tr("Checking if %1 app is installed.").arg(apkInfo()->name), NormalMessageFormat);
+ appendMessage(Tr::tr("Checking if %1 app is installed.").arg(apkInfo()->name), NormalMessageFormat);
const SdkToolResult res = runAdbShellCommand(command);
if (!res.success()) {
appendMessage(res.stdErr(), ErrorMessageFormat);
@@ -258,19 +258,19 @@ bool AndroidQmlPreviewWorker::checkAndInstallPreviewApp()
if (res.stdOut().isEmpty()) {
if (m_avdAbis.isEmpty()) {
- appendMessage(tr("ABI of the selected device is unknown. Cannot install APK."),
+ appendMessage(Tr::tr("ABI of the selected device is unknown. Cannot install APK."),
ErrorMessageFormat);
return false;
}
const FilePath apkPath = designViewerApkPath(m_avdAbis.first());
if (!apkPath.exists()) {
- appendMessage(tr("Cannot install %1 app for %2 architecture. "
- "The appropriate APK was not found in resources folders.").
+ appendMessage(Tr::tr("Cannot install %1 app for %2 architecture. "
+ "The appropriate APK was not found in resources folders.").
arg(apkInfo()->name, m_avdAbis.first()), ErrorMessageFormat);
return false;
}
- appendMessage(tr("Installing %1 APK.").arg(apkInfo()->name), NormalMessageFormat);
+ appendMessage(Tr::tr("Installing %1 APK.").arg(apkInfo()->name), NormalMessageFormat);
const SdkToolResult res = runAdbCommand({"install", apkPath.toString()});
if (!res.success())
@@ -297,11 +297,11 @@ bool AndroidQmlPreviewWorker::preparePreviewArtefacts()
});
if (filesToExport.size() > 1) {
- appendMessage(tr("Too many .qmlproject files in your project. Open directly the "
- ".qmlproject file you want to work with and then run the preview."),
+ appendMessage(Tr::tr("Too many .qmlproject files in your project. Open directly the "
+ ".qmlproject file you want to work with and then run the preview."),
ErrorMessageFormat);
} else if (filesToExport.size() < 1) {
- appendMessage(tr("No .qmlproject file found among project files."), ErrorMessageFormat);
+ appendMessage(Tr::tr("No .qmlproject file found among project files."), ErrorMessageFormat);
} else {
const FilePath qmlprojectFile = filesToExport.first();
m_uploadInfo.uploadPackage = m_uploadInfo.projectFolder.resolvePath(
@@ -310,7 +310,7 @@ bool AndroidQmlPreviewWorker::preparePreviewArtefacts()
return true;
}
}
- appendMessage(tr("Could not gather information on project files."), ErrorMessageFormat);
+ appendMessage(Tr::tr("Could not gather information on project files."), ErrorMessageFormat);
return false;
}
@@ -332,7 +332,7 @@ FilePath AndroidQmlPreviewWorker::createQmlrcFile(const FilePath &workFolder,
rccProcess.setCommand({rccBinary, args});
rccProcess.start();
if (!rccProcess.waitForStarted()) {
- appendMessage(tr("Could not create file for %1 \"%2\"").
+ appendMessage(Tr::tr("Could not create file for %1 \"%2\"").
arg(apkInfo()->name, rccProcess.commandLine().toUserOutput()),
StdErrFormat);
qrcPath.removeFile();
@@ -343,7 +343,7 @@ FilePath AndroidQmlPreviewWorker::createQmlrcFile(const FilePath &workFolder,
if (!rccProcess.readDataFromProcess(&stdOut, &stdErr)) {
rccProcess.stop();
rccProcess.waitForFinished();
- appendMessage(tr("A timeout occurred running \"%1\"").
+ appendMessage(Tr::tr("A timeout occurred running \"%1\"").
arg(rccProcess.commandLine().toUserOutput()), StdErrFormat);
qrcPath.removeFile();
return {};
@@ -355,14 +355,14 @@ FilePath AndroidQmlPreviewWorker::createQmlrcFile(const FilePath &workFolder,
appendMessage(QString::fromLocal8Bit(stdErr), StdErrFormat);
if (rccProcess.exitStatus() != QProcess::NormalExit) {
- appendMessage(tr("Crash while creating file for %1 \"%2\"").
+ appendMessage(Tr::tr("Crash while creating file for %1 \"%2\"").
arg(apkInfo()->name, rccProcess.commandLine().toUserOutput()),
StdErrFormat);
qrcPath.removeFile();
return {};
}
if (rccProcess.exitCode() != 0) {
- appendMessage(tr("Creating file for %1 failed. \"%2\" (exit code %3).").
+ appendMessage(Tr::tr("Creating file for %1 failed. \"%2\" (exit code %3).").
arg(apkInfo()->name).
arg(rccProcess.commandLine().toUserOutput()).
arg(rccProcess.exitCode()),
@@ -377,7 +377,7 @@ FilePath AndroidQmlPreviewWorker::createQmlrcFile(const FilePath &workFolder,
bool AndroidQmlPreviewWorker::uploadPreviewArtefacts()
{
- appendMessage(tr("Uploading files."), NormalMessageFormat);
+ appendMessage(Tr::tr("Uploading files."), NormalMessageFormat);
const FilePath qresPath = createQmlrcFile(m_uploadInfo.projectFolder,
m_uploadInfo.uploadPackage.baseName());
if (!qresPath.exists())
@@ -400,7 +400,7 @@ bool AndroidQmlPreviewWorker::uploadPreviewArtefacts()
bool AndroidQmlPreviewWorker::startPreviewApp()
{
stopPreviewApp();
- appendMessage(tr("Starting %1.").arg(apkInfo()->name), NormalMessageFormat);
+ appendMessage(Tr::tr("Starting %1.").arg(apkInfo()->name), NormalMessageFormat);
const QDir destDir(apkInfo()->uploadDir);
const QString qmlrcPath = destDir.filePath(m_uploadInfo.uploadPackage.baseName()
+ packageSuffix);
@@ -414,7 +414,7 @@ bool AndroidQmlPreviewWorker::startPreviewApp()
};
const SdkToolResult result = runAdbShellCommand(command);
if (result.success())
- appendMessage(tr("%1 is running.").arg(apkInfo()->name), NormalMessageFormat);
+ appendMessage(Tr::tr("%1 is running.").arg(apkInfo()->name), NormalMessageFormat);
else
appendMessage(result.stdErr(), ErrorMessageFormat);
diff --git a/src/plugins/android/androidqtversion.cpp b/src/plugins/android/androidqtversion.cpp
index 6a6cc4b0a11..d1aa4946205 100644
--- a/src/plugins/android/androidqtversion.cpp
+++ b/src/plugins/android/androidqtversion.cpp
@@ -1,10 +1,11 @@
// Copyright (C) 2016 BogDan Vatra <[email protected]>
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
-#include "androidqtversion.h"
-#include "androidconstants.h"
#include "androidconfigurations.h"
+#include "androidconstants.h"
#include "androidmanager.h"
+#include "androidqtversion.h"
+#include "androidtr.h"
#include <utils/algorithm.h>
#include <utils/environment.h>
@@ -56,12 +57,12 @@ QString AndroidQtVersion::invalidReason() const
QString tmp = QtVersion::invalidReason();
if (tmp.isEmpty()) {
if (AndroidConfigurations::currentConfig().ndkLocation(this).isEmpty())
- return tr("NDK is not configured in Devices > Android.");
+ return Tr::tr("NDK is not configured in Devices > Android.");
if (AndroidConfigurations::currentConfig().sdkLocation().isEmpty())
- return tr("SDK is not configured in Devices > Android.");
+ return Tr::tr("SDK is not configured in Devices > Android.");
if (qtAbis().isEmpty())
- return tr("Failed to detect the ABIs used by the Qt version. Check the settings in "
- "Devices > Android for errors.");
+ return Tr::tr("Failed to detect the ABIs used by the Qt version. Check the settings in "
+ "Devices > Android for errors.");
}
return tmp;
}
@@ -98,7 +99,7 @@ void AndroidQtVersion::setupQmakeRunEnvironment(Utils::Environment &env) const
QString AndroidQtVersion::description() const
{
//: Qt Version is meant for Android
- return tr("Android");
+ return Tr::tr("Android");
}
const QStringList &AndroidQtVersion::androidAbis() const
diff --git a/src/plugins/android/androidqtversion.h b/src/plugins/android/androidqtversion.h
index 00a74c981db..c2cd89b0d5b 100644
--- a/src/plugins/android/androidqtversion.h
+++ b/src/plugins/android/androidqtversion.h
@@ -13,8 +13,6 @@ namespace Internal {
class AndroidQtVersion : public QtSupport::QtVersion
{
- Q_DECLARE_TR_FUNCTIONS(Android::Internal::AndroidQtVersion)
-
public:
AndroidQtVersion();
diff --git a/src/plugins/android/androidrunconfiguration.cpp b/src/plugins/android/androidrunconfiguration.cpp
index 8e4bc401b61..1edf62b8490 100644
--- a/src/plugins/android/androidrunconfiguration.cpp
+++ b/src/plugins/android/androidrunconfiguration.cpp
@@ -1,12 +1,12 @@
// Copyright (C) 2016 BogDan Vatra <[email protected]>
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
-#include "androidrunconfiguration.h"
-
#include "androidconstants.h"
#include "androidglobal.h"
-#include "androidtoolchain.h"
#include "androidmanager.h"
+#include "androidrunconfiguration.h"
+#include "androidtoolchain.h"
+#include "androidtr.h"
#include <app/app_version.h>
@@ -51,7 +51,7 @@ AndroidRunConfiguration::AndroidRunConfiguration(Target *target, Utils::Id id)
: RunConfiguration(target, id)
{
auto envAspect = addAspect<EnvironmentAspect>();
- envAspect->addSupportedBaseEnvironment(tr("Clean Environment"), {});
+ envAspect->addSupportedBaseEnvironment(Tr::tr("Clean Environment"), {});
auto extraAppArgsAspect = addAspect<ArgumentsAspect>(macroExpander());
@@ -67,7 +67,7 @@ AndroidRunConfiguration::AndroidRunConfiguration(Target *target, Utils::Id id)
auto amStartArgsAspect = addAspect<StringAspect>();
amStartArgsAspect->setId(Constants::ANDROID_AM_START_ARGS);
amStartArgsAspect->setSettingsKey("Android.AmStartArgsKey");
- amStartArgsAspect->setLabelText(tr("Activity manager start arguments:"));
+ amStartArgsAspect->setLabelText(Tr::tr("Activity manager start arguments:"));
amStartArgsAspect->setDisplayStyle(StringAspect::LineEditDisplay);
amStartArgsAspect->setHistoryCompleter("Android.AmStartArgs.History");
@@ -75,13 +75,13 @@ AndroidRunConfiguration::AndroidRunConfiguration(Target *target, Utils::Id id)
preStartShellCmdAspect->setDisplayStyle(StringAspect::TextEditDisplay);
preStartShellCmdAspect->setId(Constants::ANDROID_PRESTARTSHELLCMDLIST);
preStartShellCmdAspect->setSettingsKey("Android.PreStartShellCmdListKey");
- preStartShellCmdAspect->setLabelText(tr("Pre-launch on-device shell commands:"));
+ preStartShellCmdAspect->setLabelText(Tr::tr("Pre-launch on-device shell commands:"));
auto postStartShellCmdAspect = addAspect<BaseStringListAspect>();
postStartShellCmdAspect->setDisplayStyle(StringAspect::TextEditDisplay);
postStartShellCmdAspect->setId(Constants::ANDROID_POSTFINISHSHELLCMDLIST);
postStartShellCmdAspect->setSettingsKey("Android.PostStartShellCmdListKey");
- postStartShellCmdAspect->setLabelText(tr("Post-quit on-device shell commands:"));
+ postStartShellCmdAspect->setLabelText(Tr::tr("Post-quit on-device shell commands:"));
setUpdater([this, target] {
const BuildTargetInfo bti = buildTargetInfo();
diff --git a/src/plugins/android/androidrunner.cpp b/src/plugins/android/androidrunner.cpp
index 5325bd33a35..d0b8c389984 100644
--- a/src/plugins/android/androidrunner.cpp
+++ b/src/plugins/android/androidrunner.cpp
@@ -2,8 +2,6 @@
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
-#include "androidrunner.h"
-
#include "androidavdmanager.h"
#include "androidconfigurations.h"
#include "androidconstants.h"
@@ -11,7 +9,9 @@
#include "androiddevice.h"
#include "androidmanager.h"
#include "androidrunconfiguration.h"
+#include "androidrunner.h"
#include "androidrunnerworker.h"
+#include "androidtr.h"
#include <coreplugin/messagemanager.h>
#include <projectexplorer/projectexplorer.h>
@@ -107,7 +107,7 @@ void AndroidRunner::stop()
{
if (m_checkAVDTimer.isActive()) {
m_checkAVDTimer.stop();
- appendMessage("\n\n" + tr("\"%1\" terminated.").arg(m_packageName),
+ appendMessage("\n\n" + Tr::tr("\"%1\" terminated.").arg(m_packageName),
Utils::NormalMessageFormat);
return;
}
diff --git a/src/plugins/android/androidrunnerworker.cpp b/src/plugins/android/androidrunnerworker.cpp
index b232847188c..abbddb843ce 100644
--- a/src/plugins/android/androidrunnerworker.cpp
+++ b/src/plugins/android/androidrunnerworker.cpp
@@ -1,11 +1,11 @@
// Copyright (C) 2018 BogDan Vatra <[email protected]>
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
-#include "androidrunnerworker.h"
-
#include "androidconfigurations.h"
#include "androidconstants.h"
#include "androidmanager.h"
+#include "androidrunnerworker.h"
+#include "androidtr.h"
#include <debugger/debuggerkitinformation.h>
#include <debugger/debuggerrunconfigurationaspect.h>
@@ -235,7 +235,7 @@ AndroidRunnerWorker::AndroidRunnerWorker(RunWorker *runner, const QString &packa
qCDebug(androidRunWorkerLog) << "QML debugging enabled";
QTcpServer server;
QTC_ASSERT(server.listen(QHostAddress::LocalHost),
- qDebug() << tr("No free ports available on host for QML debugging."));
+ qDebug() << Tr::tr("No free ports available on host for QML debugging."));
m_qmlServer.setScheme(Utils::urlTcpScheme());
m_qmlServer.setHost(server.serverAddress().toString());
m_qmlServer.setPort(server.serverPort());
@@ -537,7 +537,7 @@ void AndroidRunnerWorker::asyncStartHelper()
QString packageDir;
if (!runAdb({"shell", "run-as", m_packageName, "/system/bin/sh", "-c", "pwd"},
&packageDir)) {
- emit remoteProcessFinished(tr("Failed to find application directory."));
+ emit remoteProcessFinished(Tr::tr("Failed to find application directory."));
return;
}
@@ -546,9 +546,9 @@ void AndroidRunnerWorker::asyncStartHelper()
runAdb({"shell", "run-as", m_packageName, "chmod", "a+x", packageDir.trimmed()});
if (!QFileInfo::exists(m_debugServerPath)) {
- QString msg = tr("Cannot find C++ debug server in NDK installation.");
+ QString msg = Tr::tr("Cannot find C++ debug server in NDK installation.");
if (m_useLldb)
- msg += "\n" + tr("The lldb-server binary has not been found.");
+ msg += "\n" + Tr::tr("The lldb-server binary has not been found.");
emit remoteProcessFinished(msg);
return;
}
@@ -558,7 +558,7 @@ void AndroidRunnerWorker::asyncStartHelper()
debugServerFile = "./lldb-server";
runAdb({"shell", "run-as", m_packageName, "killall", "lldb-server"});
if (!uploadDebugServer(debugServerFile)) {
- emit remoteProcessFinished(tr("Cannot copy C++ debug server."));
+ emit remoteProcessFinished(Tr::tr("Cannot copy C++ debug server."));
return;
}
} else {
@@ -576,7 +576,7 @@ void AndroidRunnerWorker::asyncStartHelper()
// Kill the previous instances of gdbserver. Do this before copying the gdbserver.
runAdb({"shell", "run-as", m_packageName, "killall", "gdbserver"});
if (!uploadDebugServer("./gdbserver")) {
- emit remoteProcessFinished(tr("Cannot copy C++ debug server."));
+ emit remoteProcessFinished(Tr::tr("Cannot copy C++ debug server."));
return;
}
}
@@ -594,7 +594,7 @@ void AndroidRunnerWorker::asyncStartHelper()
QStringList removeForward{{"forward", "--remove", port}};
removeForwardPort(port);
if (!runAdb({"forward", port, port})) {
- emit remoteProcessFinished(tr("Failed to forward QML debugging ports."));
+ emit remoteProcessFinished(Tr::tr("Failed to forward QML debugging ports."));
return;
}
m_afterFinishAdbCommands.push_back(removeForward.join(' '));
@@ -632,12 +632,12 @@ void AndroidRunnerWorker::asyncStartHelper()
QString stdErr;
const bool startResult = runAdb(args, nullptr, &stdErr);
if (!startResult) {
- emit remoteProcessFinished(tr("Failed to start the activity."));
+ emit remoteProcessFinished(Tr::tr("Failed to start the activity."));
return;
}
if (!stdErr.isEmpty()) {
- emit remoteErrorOutput(tr("Activity Manager threw the error: %1").arg(stdErr));
+ emit remoteErrorOutput(Tr::tr("Activity Manager threw the error: %1").arg(stdErr));
return;
}
}
@@ -658,7 +658,7 @@ bool AndroidRunnerWorker::startDebuggerServer(const QString &packageDir,
if (!m_debugServerProcess) {
qCDebug(androidRunWorkerLog) << "Debugger process failed to start" << lldbServerErr;
if (errorStr)
- *errorStr = tr("Failed to start debugger server.");
+ *errorStr = Tr::tr("Failed to start debugger server.");
return false;
}
qCDebug(androidRunWorkerLog) << "Debugger process started";
@@ -677,7 +677,7 @@ bool AndroidRunnerWorker::startDebuggerServer(const QString &packageDir,
if (!m_debugServerProcess) {
qCDebug(androidRunWorkerLog) << "Debugger process failed to start" << gdbServerErr;
if (errorStr)
- *errorStr = tr("Failed to start debugger server.");
+ *errorStr = Tr::tr("Failed to start debugger server.");
return false;
}
qCDebug(androidRunWorkerLog) << "Debugger process started";
@@ -689,7 +689,7 @@ bool AndroidRunnerWorker::startDebuggerServer(const QString &packageDir,
if (!runAdb({"forward", port,
"localfilesystem:" + gdbServerSocket})) {
if (errorStr)
- *errorStr = tr("Failed to forward C++ debugging ports.");
+ *errorStr = Tr::tr("Failed to forward C++ debugging ports.");
return false;
}
m_afterFinishAdbCommands.push_back(removeForward.join(' '));
@@ -725,7 +725,7 @@ void AndroidRunnerWorker::handleJdbWaiting()
removeForwardPort(port);
if (!runAdb({"forward", port,
"jdwp:" + QString::number(m_processPID)})) {
- emit remoteProcessFinished(tr("Failed to forward JDB debugging ports."));
+ emit remoteProcessFinished(Tr::tr("Failed to forward JDB debugging ports."));
return;
}
m_afterFinishAdbCommands.push_back(removeForward.join(' '));
@@ -742,7 +742,7 @@ void AndroidRunnerWorker::handleJdbWaiting()
jdbProcess->setProcessChannelMode(QProcess::MergedChannels);
jdbProcess->start(jdbPath.toString(), jdbArgs);
if (!jdbProcess->waitForStarted()) {
- emit remoteProcessFinished(tr("Failed to start JDB."));
+ emit remoteProcessFinished(Tr::tr("Failed to start JDB."));
return;
}
m_jdbProcess = std::move(jdbProcess);
@@ -783,7 +783,7 @@ void AndroidRunnerWorker::handleJdbSettled()
}
}
}
- emit remoteProcessFinished(tr("Cannot attach JDB to the running application."));
+ emit remoteProcessFinished(Tr::tr("Cannot attach JDB to the running application."));
}
void AndroidRunnerWorker::removeForwardPort(const QString &port)
@@ -814,7 +814,7 @@ void AndroidRunnerWorker::onProcessIdChanged(qint64 pid)
<< "to:" << pid;
m_processPID = pid;
if (pid == -1) {
- emit remoteProcessFinished(QLatin1String("\n\n") + tr("\"%1\" died.")
+ emit remoteProcessFinished(QLatin1String("\n\n") + Tr::tr("\"%1\" died.")
.arg(m_packageName));
// App died/killed. Reset log, monitor, jdb & gdbserver/lldb-server processes.
m_adbLogcatProcess.reset();
diff --git a/src/plugins/android/androidsdkdownloader.cpp b/src/plugins/android/androidsdkdownloader.cpp
index a88e015e6a5..434b79c7c07 100644
--- a/src/plugins/android/androidsdkdownloader.cpp
+++ b/src/plugins/android/androidsdkdownloader.cpp
@@ -1,9 +1,9 @@
// Copyright (C) 2020 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
-#include "androidsdkdownloader.h"
-
#include "androidconstants.h"
+#include "androidsdkdownloader.h"
+#include "androidtr.h"
#include <utils/archive.h>
#include <utils/filepath.h>
@@ -39,14 +39,14 @@ void AndroidSdkDownloader::sslErrors(const QList<QSslError> &sslErrors)
{
for (const QSslError &error : sslErrors)
qCDebug(sdkDownloaderLog, "SSL error: %s\n", qPrintable(error.errorString()));
- cancelWithError(tr("Encountered SSL errors, download is aborted."));
+ cancelWithError(Tr::tr("Encountered SSL errors, download is aborted."));
}
#endif
void AndroidSdkDownloader::downloadAndExtractSdk()
{
if (m_androidConfig.sdkToolsUrl().isEmpty()) {
- logError(tr("The SDK Tools download URL is empty."));
+ logError(Tr::tr("The SDK Tools download URL is empty."));
return;
}
@@ -57,7 +57,7 @@ void AndroidSdkDownloader::downloadAndExtractSdk()
connect(m_reply, &QNetworkReply::sslErrors, this, &AndroidSdkDownloader::sslErrors);
#endif
- m_progressDialog = new QProgressDialog(tr("Downloading SDK Tools package..."), tr("Cancel"),
+ m_progressDialog = new QProgressDialog(Tr::tr("Downloading SDK Tools package..."), Tr::tr("Cancel"),
0, 100, Core::ICore::dialogParent());
m_progressDialog->setWindowModality(Qt::ApplicationModal);
m_progressDialog->setWindowTitle(dialogTitle());
@@ -105,7 +105,7 @@ bool AndroidSdkDownloader::verifyFileIntegrity()
QString AndroidSdkDownloader::dialogTitle()
{
- return tr("Download SDK Tools");
+ return Tr::tr("Download SDK Tools");
}
void AndroidSdkDownloader::cancel()
@@ -154,7 +154,7 @@ bool AndroidSdkDownloader::saveToDisk(const FilePath &filename, QIODevice *data)
{
QFile file(filename.toString());
if (!file.open(QIODevice::WriteOnly)) {
- logError(QString(tr("Could not open %1 for writing: %2."))
+ logError(QString(Tr::tr("Could not open %1 for writing: %2."))
.arg(filename.toUserOutput(), file.errorString()));
return false;
}
@@ -176,18 +176,18 @@ void AndroidSdkDownloader::downloadFinished(QNetworkReply *reply)
{
QUrl url = reply->url();
if (reply->error()) {
- cancelWithError(QString(tr("Downloading Android SDK Tools from URL %1 has failed: %2."))
+ cancelWithError(QString(Tr::tr("Downloading Android SDK Tools from URL %1 has failed: %2."))
.arg(url.toString(), reply->errorString()));
} else {
if (isHttpRedirect(reply)) {
- cancelWithError(QString(tr("Download from %1 was redirected.")).arg(url.toString()));
+ cancelWithError(QString(Tr::tr("Download from %1 was redirected.")).arg(url.toString()));
} else {
m_sdkFilename = getSaveFilename(url);
if (saveToDisk(m_sdkFilename, reply) && verifyFileIntegrity())
emit sdkPackageWriteFinished();
else
cancelWithError(
- tr("Writing and verifying the integrity of the downloaded file has failed."));
+ Tr::tr("Writing and verifying the integrity of the downloaded file has failed."));
}
}
diff --git a/src/plugins/android/androidsdkmanager.cpp b/src/plugins/android/androidsdkmanager.cpp
index 0fed77d2312..b82791db07b 100644
--- a/src/plugins/android/androidsdkmanager.cpp
+++ b/src/plugins/android/androidsdkmanager.cpp
@@ -1,11 +1,11 @@
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
-#include "androidsdkmanager.h"
-
#include "androidconfigurations.h"
#include "androidconstants.h"
#include "androidmanager.h"
+#include "androidsdkmanager.h"
+#include "androidtr.h"
#include "avdmanageroutputparser.h"
#include <utils/algorithm.h>
@@ -166,9 +166,8 @@ static void sdkManagerCommand(const AndroidConfig &config, const QStringList &ar
if (assertionFound) {
output.success = false;
output.stdOutput = proc.cleanedStdOut();
- output.stdError = QCoreApplication::translate("Android::Internal::AndroidSdkManager",
- "The operation requires user interaction. "
- "Use the \"sdkmanager\" command-line tool.");
+ output.stdError = Tr::tr("The operation requires user interaction. "
+ "Use the \"sdkmanager\" command-line tool.");
} else {
output.success = proc.result() == ProcessResult::FinishedWithSuccess;
}
@@ -910,8 +909,7 @@ void AndroidSdkManagerPrivate::updateInstalled(SdkCmdFutureInterface &fi)
fi.setProgressValue(0);
AndroidSdkManager::OperationOutput result;
result.type = AndroidSdkManager::UpdateAll;
- result.stdOutput = QCoreApplication::translate("AndroidSdkManager",
- "Updating installed packages.");
+ result.stdOutput = Tr::tr("Updating installed packages.");
fi.reportResult(result);
QStringList args("--update");
args << m_config.sdkManagerToolArgs();
@@ -921,8 +919,8 @@ void AndroidSdkManagerPrivate::updateInstalled(SdkCmdFutureInterface &fi)
qCDebug(sdkManagerLog) << "Update: Operation cancelled before start";
if (result.stdError.isEmpty() && !result.success)
- result.stdError = QCoreApplication::translate("AndroidSdkManager", "Failed.");
- result.stdOutput = QCoreApplication::translate("AndroidSdkManager", "Done\n\n");
+ result.stdError = Tr::tr("Failed.");
+ result.stdOutput = Tr::tr("Done\n\n");
fi.reportResult(result);
fi.setProgressValue(100);
}
@@ -935,8 +933,8 @@ void AndroidSdkManagerPrivate::update(SdkCmdFutureInterface &fi, const QStringLi
double progressQuota = 100.0 / (install.count() + uninstall.count());
int currentProgress = 0;
- QString installTag = QCoreApplication::translate("AndroidSdkManager", "Installing");
- QString uninstallTag = QCoreApplication::translate("AndroidSdkManager", "Uninstalling");
+ QString installTag = Tr::tr("Installing");
+ QString uninstallTag = Tr::tr("Uninstalling");
auto doOperation = [&](const QString& packagePath, const QStringList& args,
bool isInstall) {
@@ -952,8 +950,8 @@ void AndroidSdkManagerPrivate::update(SdkCmdFutureInterface &fi, const QStringLi
currentProgress += progressQuota;
fi.setProgressValue(currentProgress);
if (result.stdError.isEmpty() && !result.success)
- result.stdError = QCoreApplication::translate("AndroidSdkManager", "Failed");
- result.stdOutput = QCoreApplication::translate("AndroidSdkManager", "Done\n\n");
+ result.stdError = Tr::tr("AndroidSdkManager", "Failed");
+ result.stdOutput = Tr::tr("AndroidSdkManager", "Done\n\n");
fi.reportResult(result);
return fi.isCanceled();
};
@@ -1052,10 +1050,8 @@ void AndroidSdkManagerPrivate::getPendingLicense(SdkCmdFutureInterface &fi)
m_licenseTextCache.clear();
result.success = licenseCommand.exitStatus() == QProcess::NormalExit;
- if (!result.success) {
- result.stdError = QCoreApplication::translate("Android::Internal::AndroidSdkManager",
- "License command failed.\n\n");
- }
+ if (!result.success)
+ result.stdError = Tr::tr("License command failed.\n\n");
fi.reportResult(result);
fi.setProgressValue(100);
}
diff --git a/src/plugins/android/androidsdkmanagerwidget.cpp b/src/plugins/android/androidsdkmanagerwidget.cpp
index c4c8d91f481..d17104e3271 100644
--- a/src/plugins/android/androidsdkmanagerwidget.cpp
+++ b/src/plugins/android/androidsdkmanagerwidget.cpp
@@ -1,11 +1,11 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
-#include "androidsdkmanagerwidget.h"
-
#include "androidconfigurations.h"
#include "androidsdkmanager.h"
+#include "androidsdkmanagerwidget.h"
#include "androidsdkmodel.h"
+#include "androidtr.h"
#include <app/app_version.h>
@@ -52,7 +52,7 @@ AndroidSdkManagerWidget::AndroidSdkManagerWidget(AndroidConfig &config,
{
QTC_CHECK(sdkManager);
- setWindowTitle(tr("Android SDK Manager"));
+ setWindowTitle(Tr::tr("Android SDK Manager"));
resize(664, 396);
setModal(true);
@@ -62,41 +62,41 @@ AndroidSdkManagerWidget::AndroidSdkManagerWidget(AndroidConfig &config,
packagesView->setIndentation(20);
packagesView->header()->setCascadingSectionResizes(false);
- auto updateInstalledButton = new QPushButton(tr("Update Installed"));
+ auto updateInstalledButton = new QPushButton(Tr::tr("Update Installed"));
- auto applySelectionButton = new QPushButton(tr("Apply"));
+ auto applySelectionButton = new QPushButton(Tr::tr("Apply"));
applySelectionButton->setEnabled(false);
auto channelCheckbox = new QComboBox;
- channelCheckbox->addItem(tr("Default"));
- channelCheckbox->addItem(tr("Stable"));
- channelCheckbox->addItem(tr("Beta"));
- channelCheckbox->addItem(tr("Dev"));
- channelCheckbox->addItem(tr("Canary"));
+ channelCheckbox->addItem(Tr::tr("Default"));
+ channelCheckbox->addItem(Tr::tr("Stable"));
+ channelCheckbox->addItem(Tr::tr("Beta"));
+ channelCheckbox->addItem(Tr::tr("Dev"));
+ channelCheckbox->addItem(Tr::tr("Canary"));
- auto obsoleteCheckBox = new QCheckBox(tr("Include obsolete"));
+ auto obsoleteCheckBox = new QCheckBox(Tr::tr("Include obsolete"));
- auto showAvailableRadio = new QRadioButton(tr("Available"));
- auto showInstalledRadio = new QRadioButton(tr("Installed"));
- auto showAllRadio = new QRadioButton(tr("All"));
+ auto showAvailableRadio = new QRadioButton(Tr::tr("Available"));
+ auto showInstalledRadio = new QRadioButton(Tr::tr("Installed"));
+ auto showAllRadio = new QRadioButton(Tr::tr("All"));
showAllRadio->setChecked(true);
- auto optionsButton = new QPushButton(tr("Advanced Options..."));
+ auto optionsButton = new QPushButton(Tr::tr("Advanced Options..."));
auto searchField = new FancyLineEdit(m_packagesStack);
searchField->setPlaceholderText("Filter");
- auto expandCheck = new QCheckBox(tr("Expand All"));
+ auto expandCheck = new QCheckBox(Tr::tr("Expand All"));
m_outputStack = new QWidget;
- auto cancelButton = new QPushButton(tr("Cancel"));
+ auto cancelButton = new QPushButton(Tr::tr("Cancel"));
m_operationProgress = new QProgressBar(m_outputStack);
m_outputEdit = new QPlainTextEdit(m_outputStack);
m_outputEdit->setReadOnly(true);
- m_sdkLicenseLabel = new QLabel(tr("Do you want to accept the Android SDK license?"));
+ m_sdkLicenseLabel = new QLabel(Tr::tr("Do you want to accept the Android SDK license?"));
m_sdkLicenseLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
m_sdkLicenseLabel->hide();
@@ -133,9 +133,9 @@ AndroidSdkManagerWidget::AndroidSdkManagerWidget(AndroidConfig &config,
applySelectionButton,
st,
Group {
- title(tr("Show Packages")),
+ title(Tr::tr("Show Packages")),
Column {
- Row { tr("Channel:"), channelCheckbox },
+ Row { Tr::tr("Channel:"), channelCheckbox },
obsoleteCheckBox,
hr,
showAvailableRadio,
@@ -280,21 +280,21 @@ void AndroidSdkManagerWidget::installEssentials()
m_sdkModel->selectMissingEssentials();
if (!m_sdkModel->missingEssentials().isEmpty()) {
QMessageBox::warning(this,
- tr("Android SDK Changes"),
- tr("%1 cannot find the following essential packages: \"%2\".\n"
- "Install them manually after the current operation is done.\n")
- .arg(Core::Constants::IDE_DISPLAY_NAME)
- .arg(m_sdkModel->missingEssentials().join("\", \"")));
+ Tr::tr("Android SDK Changes"),
+ Tr::tr("%1 cannot find the following essential packages: \"%2\".\n"
+ "Install them manually after the current operation is done.\n")
+ .arg(Core::Constants::IDE_DISPLAY_NAME)
+ .arg(m_sdkModel->missingEssentials().join("\", \"")));
}
- onApplyButton(tr("Android SDK installation is missing necessary packages. "
+ onApplyButton(Tr::tr("Android SDK installation is missing necessary packages. "
"Do you want to install the missing packages?"));
}
void AndroidSdkManagerWidget::beginLicenseCheck()
{
- m_formatter->appendMessage(tr("Checking pending licenses...\n"), NormalMessageFormat);
- m_formatter->appendMessage(tr("The installation of Android SDK packages may fail if the "
- "respective licenses are not accepted.\n"),
+ m_formatter->appendMessage(Tr::tr("Checking pending licenses...\n"), NormalMessageFormat);
+ m_formatter->appendMessage(Tr::tr("The installation of Android SDK packages may fail if the "
+ "respective licenses are not accepted.\n"),
LogMessageFormat);
addPackageFuture(m_sdkManager->checkPendingLicenses());
}
@@ -304,7 +304,7 @@ void AndroidSdkManagerWidget::onApplyButton(const QString &extraMessage)
QTC_ASSERT(m_currentView == PackageListing, return);
if (m_sdkManager->isBusy()) {
- m_formatter->appendMessage(tr("\nSDK Manager is busy."), StdErrFormat);
+ m_formatter->appendMessage(Tr::tr("\nSDK Manager is busy."), StdErrFormat);
return;
}
@@ -321,15 +321,15 @@ void AndroidSdkManagerWidget::onApplyButton(const QString &extraMessage)
installPackages << str;
}
- QString message = tr("%n Android SDK packages shall be updated.", "", packagesToUpdate.count());
+ QString message = Tr::tr("%n Android SDK packages shall be updated.", "", packagesToUpdate.count());
if (!extraMessage.isEmpty())
message.prepend(extraMessage + "\n\n");
- QMessageBox messageDlg(QMessageBox::Information, tr("Android SDK Changes"),
+ QMessageBox messageDlg(QMessageBox::Information, Tr::tr("Android SDK Changes"),
message, QMessageBox::Ok | QMessageBox::Cancel, this);
QString details;
if (!uninstallPackages.isEmpty())
- details = tr("[Packages to be uninstalled:]\n").append(uninstallPackages.join("\n"));
+ details = Tr::tr("[Packages to be uninstalled:]\n").append(uninstallPackages.join("\n"));
if (!installPackages.isEmpty()) {
if (!uninstallPackages.isEmpty())
@@ -358,7 +358,7 @@ void AndroidSdkManagerWidget::onApplyButton(const QString &extraMessage)
void AndroidSdkManagerWidget::onUpdatePackages()
{
if (m_sdkManager->isBusy()) {
- m_formatter->appendMessage(tr("\nSDK Manager is busy."), StdErrFormat);
+ m_formatter->appendMessage(Tr::tr("\nSDK Manager is busy."), StdErrFormat);
return;
}
switchView(Operations);
@@ -419,7 +419,7 @@ void AndroidSdkManagerWidget::addPackageFuture(const QFuture<AndroidSdkManager::
} else {
qCDebug(androidSdkMgrUiLog) << "Operation canceled/finished before adding to the queue";
if (m_sdkManager->isBusy()) {
- m_formatter->appendMessage(tr("SDK Manager is busy. Operation cancelled."),
+ m_formatter->appendMessage(Tr::tr("SDK Manager is busy. Operation cancelled."),
StdErrFormat);
}
notifyOperationFinished();
@@ -442,11 +442,11 @@ void AndroidSdkManagerWidget::beginExecution()
else
installSdkPaths << package->sdkStylePath();
}
- m_formatter->appendMessage(tr("Installing/Uninstalling selected packages...\n"),
+ m_formatter->appendMessage(Tr::tr("Installing/Uninstalling selected packages...\n"),
NormalMessageFormat);
- m_formatter->appendMessage(tr("Closing the %1 dialog will cancel the running and scheduled SDK "
+ m_formatter->appendMessage(Tr::tr("Closing the %1 dialog will cancel the running and scheduled SDK "
"operations.\n").arg(HostOsInfo::isMacHost() ?
- tr("preferences") : tr("options")),
+ Tr::tr("preferences") : Tr::tr("options")),
LogMessageFormat);
addPackageFuture(m_sdkManager->update(installSdkPaths, uninstallSdkPaths));
@@ -454,10 +454,10 @@ void AndroidSdkManagerWidget::beginExecution()
void AndroidSdkManagerWidget::beginUpdate()
{
- m_formatter->appendMessage(tr("Updating installed packages...\n"), NormalMessageFormat);
- m_formatter->appendMessage(tr("Closing the %1 dialog will cancel the running and scheduled SDK "
+ m_formatter->appendMessage(Tr::tr("Updating installed packages...\n"), NormalMessageFormat);
+ m_formatter->appendMessage(Tr::tr("Closing the %1 dialog will cancel the running and scheduled SDK "
"operations.\n").arg(HostOsInfo::isMacHost() ?
- tr("preferences") : tr("options")),
+ Tr::tr("preferences") : Tr::tr("options")),
LogMessageFormat);
addPackageFuture(m_sdkManager->updateAll());
}
@@ -471,8 +471,8 @@ void AndroidSdkManagerWidget::beginLicenseWorkflow()
void AndroidSdkManagerWidget::notifyOperationFinished()
{
if (!m_currentOperation || m_currentOperation->isFinished()) {
- QMessageBox::information(this, tr("Android SDK Changes"),
- tr("Android SDK operations finished."), QMessageBox::Ok);
+ QMessageBox::information(this, Tr::tr("Android SDK Changes"),
+ Tr::tr("Android SDK operations finished."), QMessageBox::Ok);
m_operationProgress->setValue(0);
// Once the update/install is done, let's hide the dialog.
hide();
@@ -485,7 +485,7 @@ void AndroidSdkManagerWidget::packageFutureFinished()
bool continueWorkflow = true;
if (m_currentOperation->isCanceled()) {
- m_formatter->appendMessage(tr("Operation cancelled.\n"), StdErrFormat);
+ m_formatter->appendMessage(Tr::tr("Operation cancelled.\n"), StdErrFormat);
continueWorkflow = false;
}
m_operationProgress->setValue(100);
@@ -524,12 +524,12 @@ void AndroidSdkManagerWidget::packageFutureFinished()
void AndroidSdkManagerWidget::cancelPendingOperations()
{
if (!m_sdkManager->isBusy()) {
- m_formatter->appendMessage(tr("\nNo pending operations to cancel...\n"),
+ m_formatter->appendMessage(Tr::tr("\nNo pending operations to cancel...\n"),
NormalMessageFormat);
switchView(PackageListing);
return;
}
- m_formatter->appendMessage(tr("\nCancelling pending operations...\n"),
+ m_formatter->appendMessage(Tr::tr("\nCancelling pending operations...\n"),
NormalMessageFormat);
m_sdkManager->cancelOperatons();
}
@@ -632,15 +632,15 @@ OptionsDialog::OptionsDialog(AndroidSdkManager *sdkManager, const QStringList &a
{
QTC_CHECK(sdkManager);
resize(800, 480);
- setWindowTitle(tr("SDK Manager Arguments"));
+ setWindowTitle(Tr::tr("SDK Manager Arguments"));
m_argumentDetailsEdit = new QPlainTextEdit(this);
m_argumentDetailsEdit->setReadOnly(true);
auto populateOptions = [this](const QString& options) {
if (options.isEmpty()) {
- m_argumentDetailsEdit->setPlainText(tr("Cannot load available arguments for "
- "\"sdkmanager\" command."));
+ m_argumentDetailsEdit->setPlainText(Tr::tr("Cannot load available arguments for "
+ "\"sdkmanager\" command."));
} else {
m_argumentDetailsEdit->setPlainText(options);
}
@@ -657,9 +657,9 @@ OptionsDialog::OptionsDialog(AndroidSdkManager *sdkManager, const QStringList &a
m_argumentsEdit->setText(args.join(" "));
auto gridLayout = new QGridLayout(this);
- gridLayout->addWidget(new QLabel(tr("SDK manager arguments:"), this), 0, 0, 1, 1);
+ gridLayout->addWidget(new QLabel(Tr::tr("SDK manager arguments:"), this), 0, 0, 1, 1);
gridLayout->addWidget(m_argumentsEdit, 0, 1, 1, 1);
- gridLayout->addWidget(new QLabel(tr("Available arguments:"), this), 1, 0, 1, 2);
+ gridLayout->addWidget(new QLabel(Tr::tr("Available arguments:"), this), 1, 0, 1, 2);
gridLayout->addWidget(m_argumentDetailsEdit, 2, 0, 1, 2);
gridLayout->addWidget(dialogButtons, 3, 0, 1, 2);
}
diff --git a/src/plugins/android/androidsdkmodel.cpp b/src/plugins/android/androidsdkmodel.cpp
index 5e2182b4a3a..74e172d0118 100644
--- a/src/plugins/android/androidsdkmodel.cpp
+++ b/src/plugins/android/androidsdkmodel.cpp
@@ -1,8 +1,10 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
-#include "androidsdkmodel.h"
+
#include "androidmanager.h"
#include "androidsdkmanager.h"
+#include "androidsdkmodel.h"
+#include "androidtr.h"
#include <utils/algorithm.h>
#include <utils/qtcassert.h>
@@ -44,13 +46,13 @@ QVariant AndroidSdkModel::headerData(int section, Qt::Orientation orientation, i
if (role == Qt::DisplayRole) {
switch (section) {
case packageNameColumn:
- data = tr("Package");
+ data = Tr::tr("Package");
break;
case packageRevisionColumn:
- data = tr("Revision");
+ data = Tr::tr("Revision");
break;
case apiLevelColumn:
- data = tr("API");
+ data = Tr::tr("API");
break;
default:
break;
@@ -141,7 +143,7 @@ QVariant AndroidSdkModel::data(const QModelIndex &index, int role) const
// Top level tools
if (index.row() == 0) {
return role == Qt::DisplayRole && index.column() == packageNameColumn ?
- QVariant(tr("Tools")) : QVariant();
+ QVariant(Tr::tr("Tools")) : QVariant();
}
// Top level platforms
const SdkPlatform *platform = m_sdkPlatforms.at(index.row() - 1);
@@ -171,7 +173,7 @@ QVariant AndroidSdkModel::data(const QModelIndex &index, int role) const
switch (index.column()) {
case packageNameColumn:
return p->type() == AndroidSdkPackage::SdkPlatformPackage ?
- tr("SDK Platform") : p->displayText();
+ Tr::tr("SDK Platform") : p->displayText();
case packageRevisionColumn:
return p->revision().toString();
case apiLevelColumn:
diff --git a/src/plugins/android/androidservicewidget.cpp b/src/plugins/android/androidservicewidget.cpp
index d71d92cbaa5..5e6c685bdcb 100644
--- a/src/plugins/android/androidservicewidget.cpp
+++ b/src/plugins/android/androidservicewidget.cpp
@@ -3,6 +3,7 @@
#include "androidservicewidget.h"
#include "androidservicewidget_p.h"
+#include "androidtr.h"
#include <utils/utilsicons.h>
@@ -182,31 +183,31 @@ QVariant AndroidServiceWidget::AndroidServiceModel::headerData(int section, Qt::
{
if (role == Qt::ToolTipRole && orientation == Qt::Horizontal) {
if (section == 0)
- return tr("The name of the class implementing the service.");
+ return Tr::tr("The name of the class implementing the service.");
else if (section == 1)
- return tr("Checked if the service is run in an external process.");
+ return Tr::tr("Checked if the service is run in an external process.");
else if (section == 2)
- return tr("The name of the external process.\n"
- "Prefix with : if the process is private, use a lowercase name if the process is global.");
+ return Tr::tr("The name of the external process.\n"
+ "Prefix with : if the process is private, use a lowercase name if the process is global.");
else if (section == 3)
- return tr("Checked if the service is in a separate dynamic library.");
+ return Tr::tr("Checked if the service is in a separate dynamic library.");
else if (section == 4)
- return tr("The name of the separate dynamic library.");
+ return Tr::tr("The name of the separate dynamic library.");
else if (section == 5)
- return tr("The arguments for telling the app to run the service instead of the main activity.");
+ return Tr::tr("The arguments for telling the app to run the service instead of the main activity.");
} else if (role == Qt::DisplayRole && orientation == Qt::Horizontal) {
if (section == 0)
- return tr("Service class name.");
+ return Tr::tr("Service class name.");
else if (section == 1)
- return tr("Run in external process.");
+ return Tr::tr("Run in external process.");
else if (section == 2)
- return tr("Process name.");
+ return Tr::tr("Process name.");
else if (section == 3)
- return tr("Run in external library.");
+ return Tr::tr("Run in external library.");
else if (section == 4)
- return tr("Library name.");
+ return Tr::tr("Library name.");
else if (section == 5)
- return tr("Service arguments.");
+ return Tr::tr("Service arguments.");
}
return {};
}
@@ -225,22 +226,22 @@ QVariant AndroidServiceWidget::AndroidServiceModel::data(const QModelIndex &inde
if (index.column() == 0)
return m_services[index.row()].className();
else if (index.column() == 1)
- return tr("Run in external process.");
+ return Tr::tr("Run in external process.");
else if (index.column() == 2)
return m_services[index.row()].externalProcessName();
else if (index.column() == 3)
- return tr("Run in external library.");
+ return Tr::tr("Run in external library.");
else if (index.column() == 4)
return m_services[index.row()].externalLibraryName();
else if (index.column() == 5)
return m_services[index.row()].serviceArguments();
} else if (role == Qt::ToolTipRole) {
if (index.column() == 0 && m_services[index.row()].className().isEmpty())
- return tr("The class name must be set.");
+ return Tr::tr("The class name must be set.");
else if (index.column() == 2 && m_services[index.row()].isRunInExternalProcess())
- return tr("The process name must be set for a service run in an external process.");
+ return Tr::tr("The process name must be set for a service run in an external process.");
else if (index.column() == 4 && m_services[index.row()].isRunInExternalLibrary())
- return tr("The library name must be set for a service run in an external library.");
+ return Tr::tr("The library name must be set for a service run in an external library.");
} else if (role == Qt::EditRole) {
if (index.column() == 0)
return m_services[index.row()].className();
@@ -317,10 +318,10 @@ AndroidServiceWidget::AndroidServiceWidget(QWidget *parent) : QWidget(parent),
layout->addWidget(m_tableView, 1);
auto buttonLayout = new QGridLayout();
auto addButton = new QPushButton(this);
- addButton->setText(tr("Add"));
+ addButton->setText(Tr::tr("Add"));
buttonLayout->addWidget(addButton, 0, 0);
m_removeButton = new QPushButton(this);
- m_removeButton->setText(tr("Remove"));
+ m_removeButton->setText(Tr::tr("Remove"));
m_removeButton->setEnabled(false);
buttonLayout->addWidget(m_removeButton, 1, 0);
layout->addLayout(buttonLayout);
diff --git a/src/plugins/android/androidsettingswidget.cpp b/src/plugins/android/androidsettingswidget.cpp
index 46effc4995a..148473ce605 100644
--- a/src/plugins/android/androidsettingswidget.cpp
+++ b/src/plugins/android/androidsettingswidget.cpp
@@ -1,13 +1,13 @@
// Copyright (C) 2016 BogDan Vatra <[email protected]>
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
-#include "androidsettingswidget.h"
-
#include "androidconfigurations.h"
#include "androidconstants.h"
#include "androidsdkdownloader.h"
#include "androidsdkmanager.h"
#include "androidsdkmanagerwidget.h"
+#include "androidsettingswidget.h"
+#include "androidtr.h"
#include <projectexplorer/projectexplorerconstants.h>
@@ -139,8 +139,6 @@ private:
class AndroidSettingsWidget final : public Core::IOptionsPageWidget
{
- Q_DECLARE_TR_FUNCTIONS(Android::Internal::AndroidSettingsWidget)
-
public:
// Todo: This would be so much simpler if it just used Utils::PathChooser!!!
AndroidSettingsWidget();
@@ -207,7 +205,7 @@ enum OpenSslValidation {
AndroidSettingsWidget::AndroidSettingsWidget()
{
- setWindowTitle(tr("Android Configuration"));
+ setWindowTitle(Tr::tr("Android Configuration"));
const QIcon downloadIcon = Icons::ONLINE.icon();
@@ -215,20 +213,20 @@ AndroidSettingsWidget::AndroidSettingsWidget()
auto downloadSdkToolButton = new QToolButton;
downloadSdkToolButton->setIcon(downloadIcon);
- downloadSdkToolButton->setToolTip(tr("Open Android SDK download URL in the system's browser."));
+ downloadSdkToolButton->setToolTip(Tr::tr("Open Android SDK download URL in the system's browser."));
- auto addCustomNdkButton = new QPushButton(tr("Add..."));
- addCustomNdkButton->setToolTip(tr("Add the selected custom NDK. The toolchains "
- "and debuggers will be created automatically."));
+ auto addCustomNdkButton = new QPushButton(Tr::tr("Add..."));
+ addCustomNdkButton->setToolTip(Tr::tr("Add the selected custom NDK. The toolchains "
+ "and debuggers will be created automatically."));
- auto removeCustomNdkButton = new QPushButton(tr("Remove"));
+ auto removeCustomNdkButton = new QPushButton(Tr::tr("Remove"));
removeCustomNdkButton->setEnabled(false);
- removeCustomNdkButton->setToolTip(tr("Remove the selected NDK if it has been added manually."));
+ removeCustomNdkButton->setToolTip(Tr::tr("Remove the selected NDK if it has been added manually."));
m_makeDefaultNdkButton = new QPushButton;
- m_makeDefaultNdkButton->setToolTip(tr("Force a specific NDK installation to be used by all "
- "Android kits.<br/>Note that the forced NDK might not "
- "be compatible with all registered Qt versions."));
+ m_makeDefaultNdkButton->setToolTip(Tr::tr("Force a specific NDK installation to be used by all "
+ "Android kits.<br/>Note that the forced NDK might not "
+ "be compatible with all registered Qt versions."));
auto androidDetailsWidget = new DetailsWidget;
@@ -243,70 +241,70 @@ AndroidSettingsWidget::AndroidSettingsWidget()
auto downloadOpenJdkToolButton = new QToolButton;
downloadOpenJdkToolButton->setIcon(downloadIcon);
- downloadOpenJdkToolButton->setToolTip(tr("Open JDK download URL in the system's browser."));
+ downloadOpenJdkToolButton->setToolTip(Tr::tr("Open JDK download URL in the system's browser."));
- auto sdkToolsAutoDownloadButton = new QPushButton(tr("Set Up SDK"));
+ auto sdkToolsAutoDownloadButton = new QPushButton(Tr::tr("Set Up SDK"));
sdkToolsAutoDownloadButton->setToolTip(
- tr("Automatically download Android SDK Tools to selected location.\n\n"
- "If the selected path contains no valid SDK Tools, the SDK Tools package is downloaded\n"
- "from %1,\n"
- "and extracted to the selected path.\n"
- "After the SDK Tools are properly set up, you are prompted to install any essential\n"
- "packages required for Qt to build for Android.")
- .arg(m_androidConfig.sdkToolsUrl().toString()));
+ Tr::tr("Automatically download Android SDK Tools to selected location.\n\n"
+ "If the selected path contains no valid SDK Tools, the SDK Tools package is downloaded\n"
+ "from %1,\n"
+ "and extracted to the selected path.\n"
+ "After the SDK Tools are properly set up, you are prompted to install any essential\n"
+ "packages required for Qt to build for Android.")
+ .arg(m_androidConfig.sdkToolsUrl().toString()));
- auto sdkManagerToolButton = new QPushButton(tr("SDK Manager"));
+ auto sdkManagerToolButton = new QPushButton(Tr::tr("SDK Manager"));
auto downloadNdkToolButton = new QToolButton;
- downloadNdkToolButton->setToolTip(tr("Open Android NDK download URL in the system's browser."));
+ downloadNdkToolButton->setToolTip(Tr::tr("Open Android NDK download URL in the system's browser."));
- m_createKitCheckBox = new QCheckBox(tr("Automatically create kits for Android tool chains"));
+ m_createKitCheckBox = new QCheckBox(Tr::tr("Automatically create kits for Android tool chains"));
m_createKitCheckBox->setChecked(true);
auto openSslDetailsWidget = new DetailsWidget;
m_openSslPathChooser = new PathChooser;
- m_openSslPathChooser->setToolTip(tr("Select the path of the prebuilt OpenSSL binaries."));
+ m_openSslPathChooser->setToolTip(Tr::tr("Select the path of the prebuilt OpenSSL binaries."));
- auto downloadOpenSslPrebuiltLibs = new QPushButton(tr("Download OpenSSL"));
+ auto downloadOpenSslPrebuiltLibs = new QPushButton(Tr::tr("Download OpenSSL"));
downloadOpenSslPrebuiltLibs->setToolTip(
- tr("Automatically download OpenSSL prebuilt libraries.\n\n"
- "These libraries can be shipped with your application if any SSL operations\n"
- "are performed. Find the checkbox under \"Projects > Build > Build Steps >\n"
- "Build Android APK > Additional Libraries\".\n"
- "If the automatic download fails, Qt Creator proposes to open the download URL\n"
- "in the system's browser for manual download."));
+ Tr::tr("Automatically download OpenSSL prebuilt libraries.\n\n"
+ "These libraries can be shipped with your application if any SSL operations\n"
+ "are performed. Find the checkbox under \"Projects > Build > Build Steps >\n"
+ "Build Android APK > Additional Libraries\".\n"
+ "If the automatic download fails, Qt Creator proposes to open the download URL\n"
+ "in the system's browser for manual download."));
m_sdkManagerWidget = new AndroidSdkManagerWidget(m_androidConfig, &m_sdkManager, this);
const QMap<int, QString> androidValidationPoints = {
- { SdkPathExistsAndWritableRow, tr("Android SDK path exists and is writable.") },
- { JavaPathExistsAndWritableRow, tr("JDK path exists and is writable.") },
- { SdkToolsInstalledRow, tr("SDK tools installed.") },
- { SdkManagerSuccessfulRow, tr("SDK manager runs.") },
- { PlatformToolsInstalledRow, tr("Platform tools installed.") },
+ { SdkPathExistsAndWritableRow, Tr::tr("Android SDK path exists and is writable.") },
+ { JavaPathExistsAndWritableRow, Tr::tr("JDK path exists and is writable.") },
+ { SdkToolsInstalledRow, Tr::tr("SDK tools installed.") },
+ { SdkManagerSuccessfulRow, Tr::tr("SDK manager runs.") },
+ { PlatformToolsInstalledRow, Tr::tr("Platform tools installed.") },
{ AllEssentialsInstalledRow,
- tr( "All essential packages installed for all installed Qt versions.") },
- { BuildToolsInstalledRow, tr("Build tools installed.") },
- { PlatformSdkInstalledRow, tr("Platform SDK installed.") }
+ Tr::tr( "All essential packages installed for all installed Qt versions.") },
+ { BuildToolsInstalledRow, Tr::tr("Build tools installed.") },
+ { PlatformSdkInstalledRow, Tr::tr("Platform SDK installed.") }
};
- m_androidSummary = new SummaryWidget(androidValidationPoints, tr("Android settings are OK."),
- tr("Android settings have errors."),
+ m_androidSummary = new SummaryWidget(androidValidationPoints, Tr::tr("Android settings are OK."),
+ Tr::tr("Android settings have errors."),
androidDetailsWidget);
m_androidProgress = new ProgressIndicator(ProgressIndicatorSize::Medium, this);
m_androidProgress->attachToWidget(androidDetailsWidget);
m_androidProgress->hide();
const QMap<int, QString> openSslValidationPoints = {
- { OpenSslPathExistsRow, tr("OpenSSL path exists.") },
- { OpenSslPriPathExists, tr("QMake include project (openssl.pri) exists.") },
- { OpenSslCmakeListsPathExists, tr("CMake include project (CMakeLists.txt) exists.") }
+ { OpenSslPathExistsRow, Tr::tr("OpenSSL path exists.") },
+ { OpenSslPriPathExists, Tr::tr("QMake include project (openssl.pri) exists.") },
+ { OpenSslCmakeListsPathExists, Tr::tr("CMake include project (CMakeLists.txt) exists.") }
};
m_openSslSummary = new SummaryWidget(openSslValidationPoints,
- tr("OpenSSL Settings are OK."),
- tr("OpenSSL settings have errors."),
+ Tr::tr("OpenSSL Settings are OK."),
+ Tr::tr("OpenSSL settings have errors."),
openSslDetailsWidget);
connect(m_openJdkLocationPathChooser, &PathChooser::rawPathChanged,
@@ -314,14 +312,14 @@ AndroidSettingsWidget::AndroidSettingsWidget()
if (m_androidConfig.openJDKLocation().isEmpty())
m_androidConfig.setOpenJDKLocation(AndroidConfig::getJdkPath());
m_openJdkLocationPathChooser->setFilePath(m_androidConfig.openJDKLocation());
- m_openJdkLocationPathChooser->setPromptDialogTitle(tr("Select JDK Path"));
+ m_openJdkLocationPathChooser->setPromptDialogTitle(Tr::tr("Select JDK Path"));
if (m_androidConfig.sdkLocation().isEmpty())
m_androidConfig.setSdkLocation(AndroidConfig::defaultSdkPath());
m_sdkLocationPathChooser->setFilePath(m_androidConfig.sdkLocation());
- m_sdkLocationPathChooser->setPromptDialogTitle(tr("Select Android SDK Folder"));
+ m_sdkLocationPathChooser->setPromptDialogTitle(Tr::tr("Select Android SDK Folder"));
- m_openSslPathChooser->setPromptDialogTitle(tr("Select OpenSSL Include Project File"));
+ m_openSslPathChooser->setPromptDialogTitle(Tr::tr("Select OpenSSL Include Project File"));
if (m_androidConfig.openSslLocation().isEmpty())
m_androidConfig.setOpenSslLocation(m_androidConfig.sdkLocation() / ("android_openssl"));
m_openSslPathChooser->setFilePath(m_androidConfig.openSslLocation());
@@ -334,15 +332,15 @@ AndroidSettingsWidget::AndroidSettingsWidget()
Column {
Group {
- title(tr("Android Settings")),
+ title(Tr::tr("Android Settings")),
Grid {
- tr("JDK location:"),
+ Tr::tr("JDK location:"),
m_openJdkLocationPathChooser,
empty,
downloadOpenJdkToolButton,
br,
- tr("Android SDK location:"),
+ Tr::tr("Android SDK location:"),
m_sdkLocationPathChooser,
sdkToolsAutoDownloadButton,
downloadSdkToolButton,
@@ -350,7 +348,7 @@ AndroidSettingsWidget::AndroidSettingsWidget()
empty, empty, sdkManagerToolButton, br,
- Column { tr("Android NDK list:"), st },
+ Column { Tr::tr("Android NDK list:"), st },
m_ndkListWidget,
Column {
addCustomNdkButton,
@@ -366,9 +364,9 @@ AndroidSettingsWidget::AndroidSettingsWidget()
}
},
Group {
- title(tr("Android OpenSSL settings (Optional)")),
+ title(Tr::tr("Android OpenSSL settings (Optional)")),
Grid {
- tr("OpenSSL binaries location:"),
+ Tr::tr("OpenSSL binaries location:"),
m_openSslPathChooser,
downloadOpenSslPrebuiltLibs,
br,
@@ -437,7 +435,7 @@ AndroidSettingsWidget::AndroidSettingsWidget()
const FilePath sdkPath = m_androidConfig.sdkLocation();
if (!sdkPath.createDir()) {
QMessageBox::warning(this, AndroidSdkDownloader::dialogTitle(),
- tr("Failed to create the SDK Tools path %1.")
+ Tr::tr("Failed to create the SDK Tools path %1.")
.arg("\n\"" + sdkPath.toUserOutput() + "\""));
}
m_sdkManager.reloadPackages(true);
@@ -501,7 +499,7 @@ void AndroidSettingsWidget::addCustomNdkItem()
{
const QString homePath = QStandardPaths::standardLocations(QStandardPaths::HomeLocation)
.constFirst();
- const QString ndkPath = QFileDialog::getExistingDirectory(this, tr("Select an NDK"), homePath);
+ const QString ndkPath = QFileDialog::getExistingDirectory(this, Tr::tr("Select an NDK"), homePath);
if (m_androidConfig.isValidNdk(ndkPath)) {
m_androidConfig.addCustomNdk(ndkPath);
@@ -510,12 +508,12 @@ void AndroidSettingsWidget::addCustomNdkItem()
}
} else if (!ndkPath.isEmpty()) {
QMessageBox::warning(
- this,
- tr("Add Custom NDK"),
- tr("The selected path has an invalid NDK. This might mean that the path contains space "
- "characters, or that it does not have a \"toolchains\" sub-directory, or that the "
- "NDK version could not be retrieved because of a missing \"source.properties\" or "
- "\"RELEASE.TXT\" file"));
+ this,
+ Tr::tr("Add Custom NDK"),
+ Tr::tr("The selected path has an invalid NDK. This might mean that the path contains space "
+ "characters, or that it does not have a \"toolchains\" sub-directory, or that the "
+ "NDK version could not be retrieved because of a missing \"source.properties\" or "
+ "\"RELEASE.TXT\" file"));
}
}
@@ -629,12 +627,12 @@ void AndroidSettingsWidget::openOpenJDKDownloadUrl()
void AndroidSettingsWidget::downloadOpenSslRepo(const bool silent)
{
const FilePath openSslPath = m_openSslPathChooser->filePath();
- const QString openSslCloneTitle(tr("OpenSSL Cloning"));
+ const QString openSslCloneTitle(Tr::tr("OpenSSL Cloning"));
if (m_openSslSummary->allRowsOk()) {
if (!silent) {
QMessageBox::information(this, openSslCloneTitle,
- tr("OpenSSL prebuilt libraries repository is already configured."));
+ Tr::tr("OpenSSL prebuilt libraries repository is already configured."));
}
return;
}
@@ -646,15 +644,15 @@ void AndroidSettingsWidget::downloadOpenSslRepo(const bool silent)
QMessageBox::information(
this,
openSslCloneTitle,
- tr("The selected download path (%1) for OpenSSL already exists and the directory is "
- "not empty. Select a different path or make sure it is an empty directory.")
- .arg(QDir::toNativeSeparators(openSslPath.toString())));
+ Tr::tr("The selected download path (%1) for OpenSSL already exists and the directory is "
+ "not empty. Select a different path or make sure it is an empty directory.")
+ .arg(QDir::toNativeSeparators(openSslPath.toString())));
return;
}
QProgressDialog *openSslProgressDialog
- = new QProgressDialog(tr("Cloning OpenSSL prebuilt libraries..."),
- tr("Cancel"), 0, 0);
+ = new QProgressDialog(Tr::tr("Cloning OpenSSL prebuilt libraries..."),
+ Tr::tr("Cancel"), 0, 0);
openSslProgressDialog->setWindowModality(Qt::ApplicationModal);
openSslProgressDialog->setWindowTitle(openSslCloneTitle);
openSslProgressDialog->setFixedSize(openSslProgressDialog->sizeHint());
@@ -670,14 +668,14 @@ void AndroidSettingsWidget::downloadOpenSslRepo(const bool silent)
auto failDialog = [=](const QString &msgSuffix = {}) {
QStringList sl;
- sl << tr("OpenSSL prebuilt libraries cloning failed.");
+ sl << Tr::tr("OpenSSL prebuilt libraries cloning failed.");
if (!msgSuffix.isEmpty())
sl << msgSuffix;
- sl << tr("Opening OpenSSL URL for manual download.");
+ sl << Tr::tr("Opening OpenSSL URL for manual download.");
QMessageBox msgBox;
msgBox.setText(sl.join(" "));
- msgBox.addButton(tr("Cancel"), QMessageBox::RejectRole);
- QAbstractButton *openButton = msgBox.addButton(tr("Open Download URL"), QMessageBox::ActionRole);
+ msgBox.addButton(Tr::tr("Cancel"), QMessageBox::RejectRole);
+ QAbstractButton *openButton = msgBox.addButton(Tr::tr("Open Download URL"), QMessageBox::ActionRole);
msgBox.exec();
if (msgBox.clickedButton() == openButton)
@@ -689,7 +687,7 @@ void AndroidSettingsWidget::downloadOpenSslRepo(const bool silent)
openSslProgressDialog->close();
if (gitCloner->error() != QProcess::UnknownError) {
if (gitCloner->error() == QProcess::FailedToStart) {
- failDialog(tr("The Git tool might not be installed properly on your system."));
+ failDialog(Tr::tr("The Git tool might not be installed properly on your system."));
return;
} else {
failDialog();
@@ -720,7 +718,7 @@ void AndroidSettingsWidget::updateUI()
const QListWidgetItem *currentItem = m_ndkListWidget->currentItem();
const FilePath currentNdk = FilePath::fromString(currentItem ? currentItem->text() : "");
- const QString infoText = tr("(SDK Version: %1, NDK Version: %2)")
+ const QString infoText = Tr::tr("(SDK Version: %1, NDK Version: %2)")
.arg(m_androidConfig.sdkToolsVersion().toString())
.arg(currentNdk.isEmpty() ? "" : m_androidConfig.ndkVersion(currentNdk).toString());
m_androidSummary->setInfoText(androidSetupOk ? infoText : "");
@@ -741,20 +739,20 @@ void AndroidSettingsWidget::updateUI()
}
}
- m_makeDefaultNdkButton->setText(isDefaultNdkSelected() ? tr("Unset Default")
- : tr("Make Default"));
+ m_makeDefaultNdkButton->setText(isDefaultNdkSelected() ? Tr::tr("Unset Default")
+ : Tr::tr("Make Default"));
}
void AndroidSettingsWidget::downloadSdk()
{
if (m_androidConfig.sdkToolsOk()) {
QMessageBox::warning(this, AndroidSdkDownloader::dialogTitle(),
- tr("The selected path already has a valid SDK Tools package."));
+ Tr::tr("The selected path already has a valid SDK Tools package."));
validateSdk();
return;
}
- const QString message = tr("Download and install Android SDK Tools to %1?")
+ const QString message = Tr::tr("Download and install Android SDK Tools to %1?")
.arg("\n\"" + m_sdkLocationPathChooser->filePath().cleanPath().toUserOutput()
+ "\"");
auto userInput = QMessageBox::information(this, AndroidSdkDownloader::dialogTitle(),
@@ -768,7 +766,7 @@ void AndroidSettingsWidget::downloadSdk()
AndroidSettingsPage::AndroidSettingsPage()
{
setId(Constants::ANDROID_SETTINGS_ID);
- setDisplayName(AndroidSettingsWidget::tr("Android"));
+ setDisplayName(Tr::tr("Android"));
setCategory(ProjectExplorer::Constants::DEVICE_SETTINGS_CATEGORY);
setWidgetCreator([] { return new AndroidSettingsWidget; });
}
diff --git a/src/plugins/android/androidtoolchain.cpp b/src/plugins/android/androidtoolchain.cpp
index 7d3763c2fb8..853c7212f6b 100644
--- a/src/plugins/android/androidtoolchain.cpp
+++ b/src/plugins/android/androidtoolchain.cpp
@@ -1,9 +1,10 @@
// Copyright (C) 2016 BogDan Vatra <[email protected]>
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
-#include "androidtoolchain.h"
-#include "androidconstants.h"
#include "androidconfigurations.h"
+#include "androidconstants.h"
+#include "androidtoolchain.h"
+#include "androidtr.h"
#include <projectexplorer/kitmanager.h>
#include <projectexplorer/toolchainmanager.h>
@@ -48,7 +49,7 @@ static ToolChain *findToolChain(FilePath &compilerPath, Id lang, const QString &
AndroidToolChain::AndroidToolChain()
: ClangToolChain(Constants::ANDROID_TOOLCHAIN_TYPEID)
{
- setTypeDisplayName(AndroidToolChain::tr("Android Clang"));
+ setTypeDisplayName(Tr::tr("Android Clang"));
}
FilePath AndroidToolChain::ndkLocation() const
@@ -135,7 +136,7 @@ GccToolChain::DetectedAbisResult AndroidToolChain::detectSupportedAbis() const
AndroidToolChainFactory::AndroidToolChainFactory()
{
- setDisplayName(AndroidToolChain::tr("Android Clang"));
+ setDisplayName(Tr::tr("Android Clang"));
setSupportedToolChainType(Constants::ANDROID_TOOLCHAIN_TYPEID);
setSupportedLanguages({ProjectExplorer::Constants::CXX_LANGUAGE_ID});
setToolchainConstructor([] { return new AndroidToolChain; });
diff --git a/src/plugins/android/androidtoolchain.h b/src/plugins/android/androidtoolchain.h
index ec042e82e85..10a750c863b 100644
--- a/src/plugins/android/androidtoolchain.h
+++ b/src/plugins/android/androidtoolchain.h
@@ -14,8 +14,6 @@ using ToolChainList = QList<ProjectExplorer::ToolChain *>;
class AndroidToolChain : public ProjectExplorer::ClangToolChain
{
- Q_DECLARE_TR_FUNCTIONS(Android::Internal::AndroidToolChain)
-
public:
~AndroidToolChain() override;
diff --git a/src/plugins/android/avddialog.cpp b/src/plugins/android/avddialog.cpp
index 1f8c3bd2734..4ea5748f594 100644
--- a/src/plugins/android/avddialog.cpp
+++ b/src/plugins/android/avddialog.cpp
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
#include "avddialog.h"
-
+#include "androidtr.h"
#include "androidavdmanager.h"
#include "androidconstants.h"
#include "androiddevice.h"
@@ -43,7 +43,7 @@ AvdDialog::AvdDialog(const AndroidConfig &config, QWidget *parent)
m_sdkManager(m_androidConfig)
{
resize(800, 0);
- setWindowTitle(tr("Create new AVD"));
+ setWindowTitle(Tr::tr("Create new AVD"));
m_abiComboBox = new QComboBox;
m_abiComboBox->addItems({
@@ -54,7 +54,7 @@ AvdDialog::AvdDialog(const AndroidConfig &config, QWidget *parent)
});
m_sdcardSizeSpinBox = new QSpinBox;
- m_sdcardSizeSpinBox->setSuffix(tr(" MiB"));
+ m_sdcardSizeSpinBox->setSuffix(Tr::tr(" MiB"));
m_sdcardSizeSpinBox->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
m_sdcardSizeSpinBox->setRange(0, 1000000);
m_sdcardSizeSpinBox->setValue(512);
@@ -73,7 +73,7 @@ AvdDialog::AvdDialog(const AndroidConfig &config, QWidget *parent)
m_deviceDefinitionTypeComboBox = new QComboBox;
- m_overwriteCheckBox = new QCheckBox(tr("Overwrite existing AVD name"));
+ m_overwriteCheckBox = new QCheckBox(Tr::tr("Overwrite existing AVD name"));
m_buttonBox = new QDialogButtonBox(QDialogButtonBox::Cancel|QDialogButtonBox::Ok);
@@ -84,13 +84,13 @@ AvdDialog::AvdDialog(const AndroidConfig &config, QWidget *parent)
Column {
Form {
- tr("Name:"), m_nameLineEdit, br,
- tr("Device definition:"),
+ Tr::tr("Name:"), m_nameLineEdit, br,
+ Tr::tr("Device definition:"),
Row { m_deviceDefinitionTypeComboBox, m_deviceDefinitionComboBox }, br,
- tr("Architecture (ABI):"), m_abiComboBox, br,
- tr("Target API:"), m_targetApiComboBox, br,
+ Tr::tr("Architecture (ABI):"), m_abiComboBox, br,
+ Tr::tr("Target API:"), m_targetApiComboBox, br,
QString(), m_warningText, br,
- tr("SD card size:"), m_sdcardSizeSpinBox, br,
+ Tr::tr("SD card size:"), m_sdcardSizeSpinBox, br,
QString(), m_overwriteCheckBox,
},
st,
@@ -305,13 +305,13 @@ void AvdDialog::updateApiLevelComboBox()
m_targetApiComboBox->setEnabled(false);
m_warningText->setVisible(true);
m_warningText->setText(
- tr("Cannot create a new AVD. No suitable Android system image is installed.<br/>"
- "Install a system image for the intended Android version from the SDK Manager."));
+ Tr::tr("Cannot create a new AVD. No suitable Android system image is installed.<br/>"
+ "Install a system image for the intended Android version from the SDK Manager."));
m_buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
} else if (filteredList.isEmpty()) {
m_targetApiComboBox->setEnabled(false);
m_warningText->setVisible(true);
- m_warningText->setText(tr("Cannot create an AVD for ABI %1.<br/>Install a system "
+ m_warningText->setText(Tr::tr("Cannot create an AVD for ABI %1.<br/>Install a system "
"image for it from the SDK Manager tab first.")
.arg(abi()));
m_buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
@@ -330,7 +330,7 @@ bool AvdDialog::eventFilter(QObject *obj, QEvent *event)
if (!key.isEmpty() && !m_allowedNameChars.match(key).hasMatch()) {
QPoint position = m_nameLineEdit->parentWidget()->mapToGlobal(m_nameLineEdit->geometry().bottomLeft());
position -= Utils::ToolTip::offsetFromPosition();
- Utils::ToolTip::show(position, tr("Allowed characters are: a-z A-Z 0-9 and . _ -"), m_nameLineEdit);
+ Utils::ToolTip::show(position, Tr::tr("Allowed characters are: a-z A-Z 0-9 and . _ -"), m_nameLineEdit);
m_hideTipTimer.start();
} else {
m_hideTipTimer.stop();
diff --git a/src/plugins/android/createandroidmanifestwizard.cpp b/src/plugins/android/createandroidmanifestwizard.cpp
index 30b2aa5c453..930ead0f576 100644
--- a/src/plugins/android/createandroidmanifestwizard.cpp
+++ b/src/plugins/android/createandroidmanifestwizard.cpp
@@ -1,6 +1,7 @@
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
+#include "androidtr.h"
#include "createandroidmanifestwizard.h"
#include <android/androidconfigurations.h>
@@ -41,8 +42,6 @@ namespace Internal {
class NoApplicationProFilePage : public QWizardPage
{
- Q_DECLARE_TR_FUNCTIONS(Android::NoApplicationProFilePage)
-
public:
NoApplicationProFilePage(CreateAndroidManifestWizard *wizard);
};
@@ -52,9 +51,9 @@ NoApplicationProFilePage::NoApplicationProFilePage(CreateAndroidManifestWizard *
auto layout = new QVBoxLayout(this);
auto label = new QLabel(this);
label->setWordWrap(true);
- label->setText(tr("No application .pro file found in this project."));
+ label->setText(Tr::tr("No application .pro file found in this project."));
layout->addWidget(label);
- setTitle(tr("No Application .pro File"));
+ setTitle(Tr::tr("No Application .pro File"));
}
@@ -64,8 +63,6 @@ NoApplicationProFilePage::NoApplicationProFilePage(CreateAndroidManifestWizard *
class ChooseProFilePage : public QWizardPage
{
- Q_DECLARE_TR_FUNCTIONS(Android::ChooseProfilePage)
-
public:
explicit ChooseProFilePage(CreateAndroidManifestWizard *wizard);
@@ -82,7 +79,7 @@ ChooseProFilePage::ChooseProFilePage(CreateAndroidManifestWizard *wizard)
auto fl = new QFormLayout(this);
QLabel *label = new QLabel(this);
label->setWordWrap(true);
- label->setText(tr("Select the .pro file for which you want to create the Android template files."));
+ label->setText(Tr::tr("Select the .pro file for which you want to create the Android template files."));
fl->addRow(label);
BuildSystem *buildSystem = wizard->buildSystem();
@@ -99,8 +96,8 @@ ChooseProFilePage::ChooseProFilePage(CreateAndroidManifestWizard *wizard)
nodeSelected(m_comboBox->currentIndex());
connect(m_comboBox, &QComboBox::currentIndexChanged, this, &ChooseProFilePage::nodeSelected);
- fl->addRow(tr(".pro file:"), m_comboBox);
- setTitle(tr("Select a .pro File"));
+ fl->addRow(Tr::tr(".pro file:"), m_comboBox);
+ setTitle(Tr::tr("Select a .pro File"));
}
void ChooseProFilePage::nodeSelected(int index)
@@ -116,8 +113,6 @@ void ChooseProFilePage::nodeSelected(int index)
class ChooseDirectoryPage : public QWizardPage
{
- Q_DECLARE_TR_FUNCTIONS(Android::ChooseDirectoryPage)
-
public:
ChooseDirectoryPage(CreateAndroidManifestWizard *wizard);
@@ -144,11 +139,11 @@ ChooseDirectoryPage::ChooseDirectoryPage(CreateAndroidManifestWizard *wizard)
m_androidPackageSourceDir = new PathChooser(this);
m_androidPackageSourceDir->setExpectedKind(PathChooser::Directory);
- m_layout->addRow(tr("Android package source directory:"), m_androidPackageSourceDir);
+ m_layout->addRow(Tr::tr("Android package source directory:"), m_androidPackageSourceDir);
m_sourceDirectoryWarning =
- new InfoLabel(tr("The Android package source directory cannot be the same as "
- "the project directory."), InfoLabel::Error, this);
+ new InfoLabel(Tr::tr("The Android package source directory cannot be the same as "
+ "the project directory."), InfoLabel::Error, this);
m_sourceDirectoryWarning->setVisible(false);
m_sourceDirectoryWarning->setElideMode(Qt::ElideNone);
m_sourceDirectoryWarning->setWordWrap(true);
@@ -162,8 +157,8 @@ ChooseDirectoryPage::ChooseDirectoryPage(CreateAndroidManifestWizard *wizard)
auto checkBox = new QCheckBox(this);
connect(checkBox, &QCheckBox::toggled, wizard, &CreateAndroidManifestWizard::setCopyGradle);
checkBox->setChecked(false);
- checkBox->setText(tr("Copy the Gradle files to Android directory"));
- checkBox->setToolTip(tr("It is highly recommended if you are planning to extend the Java part of your Qt application."));
+ checkBox->setText(Tr::tr("Copy the Gradle files to Android directory"));
+ checkBox->setToolTip(Tr::tr("It is highly recommended if you are planning to extend the Java part of your Qt application."));
m_layout->addRow(checkBox);
}
}
@@ -201,9 +196,9 @@ void ChooseDirectoryPage::initializePage()
androidPackageDir = FilePath::fromVariant(node->data(Android::Constants::AndroidPackageSourceDir));
if (androidPackageDir.isEmpty()) {
- m_label->setText(tr("Select the Android package source directory.\n\n"
- "The files in the Android package source directory are copied to the build directory's "
- "Android directory and the default files are overwritten."));
+ m_label->setText(Tr::tr("Select the Android package source directory.\n\n"
+ "The files in the Android package source directory are copied to the build directory's "
+ "Android directory and the default files are overwritten."));
const FilePath projectPath = bti.projectFilePath.isFile()
? bti.projectFilePath.parentDir() : bti.projectFilePath;
@@ -212,8 +207,8 @@ void ChooseDirectoryPage::initializePage()
connect(m_androidPackageSourceDir, &PathChooser::rawPathChanged,
this, &ChooseDirectoryPage::checkPackageSourceDir);
} else {
- m_label->setText(tr("The Android template files will be created in the %1 set in the .pro "
- "file.").arg(QLatin1String(Constants::ANDROID_PACKAGE_SOURCE_DIR)));
+ m_label->setText(Tr::tr("The Android template files will be created in the %1 set in the .pro "
+ "file.").arg(QLatin1String(Constants::ANDROID_PACKAGE_SOURCE_DIR)));
m_androidPackageSourceDir->setFilePath(androidPackageDir);
m_androidPackageSourceDir->setReadOnly(true);
}
@@ -228,7 +223,7 @@ void ChooseDirectoryPage::initializePage()
CreateAndroidManifestWizard::CreateAndroidManifestWizard(BuildSystem *buildSystem)
: m_buildSystem(buildSystem)
{
- setWindowTitle(tr("Create Android Template Files Wizard"));
+ setWindowTitle(Tr::tr("Create Android Template Files Wizard"));
const QList<BuildTargetInfo> buildTargets = buildSystem->applicationTargets();
QtSupport::QtVersion *version = QtSupport::QtKitAspect::qtVersion(buildSystem->kit());
@@ -319,9 +314,9 @@ void CreateAndroidManifestWizard::createAndroidTemplateFiles()
if (!result) {
QMessageBox::warning(this,
- tr("Project File not Updated"),
- tr("Could not update the project file %1.")
- .arg(bti.projectFilePath.toUserOutput()));
+ Tr::tr("Project File not Updated"),
+ Tr::tr("Could not update the project file %1.")
+ .arg(bti.projectFilePath.toUserOutput()));
}
}
}
diff --git a/src/plugins/android/createandroidmanifestwizard.h b/src/plugins/android/createandroidmanifestwizard.h
index 1436a589056..42deed00446 100644
--- a/src/plugins/android/createandroidmanifestwizard.h
+++ b/src/plugins/android/createandroidmanifestwizard.h
@@ -15,8 +15,6 @@ namespace Internal {
class CreateAndroidManifestWizard : public Utils::Wizard
{
- Q_DECLARE_TR_FUNCTIONS(Android::CreateAndroidManifestWizard)
-
public:
CreateAndroidManifestWizard(ProjectExplorer::BuildSystem *buildSystem);
diff --git a/src/plugins/android/javalanguageserver.cpp b/src/plugins/android/javalanguageserver.cpp
index 4201f92f33b..40fe85d5bcd 100644
--- a/src/plugins/android/javalanguageserver.cpp
+++ b/src/plugins/android/javalanguageserver.cpp
@@ -1,11 +1,11 @@
// Copyright (C) 2021 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
-#include "javalanguageserver.h"
-
#include "androidconfigurations.h"
#include "androidconstants.h"
#include "androidmanager.h"
+#include "androidtr.h"
+#include "javalanguageserver.h"
#include <languageclient/client.h>
#include <languageclient/languageclientinterface.h>
@@ -34,7 +34,6 @@ namespace Internal {
class JLSSettingsWidget : public QWidget
{
- Q_DECLARE_TR_FUNCTIONS(JLSSettingsWidget)
public:
JLSSettingsWidget(const JLSSettings *settings, QWidget *parent);
@@ -56,19 +55,19 @@ JLSSettingsWidget::JLSSettingsWidget(const JLSSettings *settings, QWidget *paren
{
int row = 0;
auto *mainLayout = new QGridLayout;
- mainLayout->addWidget(new QLabel(tr("Name:")), row, 0);
+ mainLayout->addWidget(new QLabel(Tr::tr("Name:")), row, 0);
mainLayout->addWidget(m_name, row, 1);
auto chooser = new VariableChooser(this);
chooser->addSupportedWidget(m_name);
- mainLayout->addWidget(new QLabel(tr("Java:")), ++row, 0);
+ mainLayout->addWidget(new QLabel(Tr::tr("Java:")), ++row, 0);
m_java->setExpectedKind(PathChooser::ExistingCommand);
m_java->setFilePath(settings->m_executable);
mainLayout->addWidget(m_java, row, 1);
- mainLayout->addWidget(new QLabel(tr("Java Language Server:")), ++row, 0);
+ mainLayout->addWidget(new QLabel(Tr::tr("Java Language Server:")), ++row, 0);
m_ls->setExpectedKind(PathChooser::File);
- m_ls->lineEdit()->setPlaceholderText(tr("Path to equinox launcher jar"));
+ m_ls->lineEdit()->setPlaceholderText(Tr::tr("Path to equinox launcher jar"));
m_ls->setPromptDialogFilter("org.eclipse.equinox.launcher_*.jar");
m_ls->setFilePath(settings->m_languageServer);
mainLayout->addWidget(m_ls, row, 1);
diff --git a/src/plugins/android/splashscreencontainerwidget.cpp b/src/plugins/android/splashscreencontainerwidget.cpp
index fb0acee615e..33092491aec 100644
--- a/src/plugins/android/splashscreencontainerwidget.cpp
+++ b/src/plugins/android/splashscreencontainerwidget.cpp
@@ -1,6 +1,7 @@
// Copyright (C) 2020 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
+#include "androidtr.h"
#include "splashscreencontainerwidget.h"
#include "splashscreenwidget.h"
@@ -42,7 +43,7 @@ const char splashscreenFileName[] = "logo";
const char splashscreenPortraitFileName[] = "logo_port";
const char splashscreenLandscapeFileName[] = "logo_land";
const char imageSuffix[] = ".png";
-const QString fileDialogImageFiles = QString(QWidget::tr("Images (*.png *.jpg *.jpeg)"));
+const QString fileDialogImageFiles = QString(QWidget::tr("Images (*.png *.jpg *.jpeg)")); // TODO: Implement a centralized images filter string
const QSize lowDpiImageSize{200, 320};
const QSize mediumDpiImageSize{320, 480};
const QSize highDpiImageSize{480, 800};
@@ -103,8 +104,8 @@ static QWidget *createPage(TextEditor::TextEditorWidget *textEditorWidget,
auto pageLayout = new QHBoxLayout(page);
auto genericWidget= addWidgetToPage(page,
displaySize, size,
- SplashScreenContainerWidget::tr("Splash screen"),
- SplashScreenContainerWidget::tr("Select splash screen image")
+ Tr::tr("Splash screen"),
+ Tr::tr("Select splash screen image")
+ sizeToStr(size),
textEditorWidget,
path,
@@ -114,8 +115,8 @@ static QWidget *createPage(TextEditor::TextEditorWidget *textEditorWidget,
auto portraitWidget = addWidgetToPage(page,
displaySize, portraitSize,
- SplashScreenContainerWidget::tr("Portrait splash screen"),
- SplashScreenContainerWidget::tr("Select portrait splash screen image")
+ Tr::tr("Portrait splash screen"),
+ Tr::tr("Select portrait splash screen image")
+ sizeToStr(portraitSize),
textEditorWidget,
path,
@@ -125,8 +126,8 @@ static QWidget *createPage(TextEditor::TextEditorWidget *textEditorWidget,
auto landscapeWidget = addWidgetToPage(page,
landscapeDisplaySize, landscapeSize,
- SplashScreenContainerWidget::tr("Landscape splash screen"),
- SplashScreenContainerWidget::tr("Select landscape splash screen image")
+ Tr::tr("Landscape splash screen"),
+ Tr::tr("Select landscape splash screen image")
+ sizeToStr(landscapeSize),
textEditorWidget,
path,
@@ -135,7 +136,7 @@ static QWidget *createPage(TextEditor::TextEditorWidget *textEditorWidget,
landscapeWidgetContainer);
auto clearButton = new QToolButton(page);
- clearButton->setText(SplashScreenContainerWidget::tr("Clear All"));
+ clearButton->setText(Tr::tr("Clear All"));
pageLayout->addWidget(clearButton);
pageLayout->setAlignment(clearButton, Qt::AlignVCenter);
SplashScreenContainerWidget::connect(clearButton, &QAbstractButton::clicked,
@@ -163,12 +164,12 @@ SplashScreenContainerWidget::SplashScreenContainerWidget(
QTabWidget *tab = new QTabWidget(this);
m_stickyCheck = new QCheckBox(this);
- m_stickyCheck->setToolTip(tr("A non-sticky splash screen is hidden automatically when an activity is drawn.\n"
- "To hide a sticky splash screen, invoke QtAndroid::hideSplashScreen()."));
- formLayout->addRow(tr("Sticky splash screen:"), m_stickyCheck);
+ m_stickyCheck->setToolTip(Tr::tr("A non-sticky splash screen is hidden automatically when an activity is drawn.\n"
+ "To hide a sticky splash screen, invoke QtAndroid::hideSplashScreen()."));
+ formLayout->addRow(Tr::tr("Sticky splash screen:"), m_stickyCheck);
m_imageShowMode = new QComboBox(this);
- formLayout->addRow(tr("Image show mode:"), m_imageShowMode);
+ formLayout->addRow(Tr::tr("Image show mode:"), m_imageShowMode);
const QList<QStringList> imageShowModeMethodsMap = {
{"center", "Place the object in the center of the screen in both the vertical and horizontal axis,\n"
"not changing its size."},
@@ -179,26 +180,26 @@ SplashScreenContainerWidget::SplashScreenContainerWidget(
}
m_backgroundColor = new QToolButton(this);
- m_backgroundColor->setToolTip(tr("Background color of the splash screen."));
- formLayout->addRow(tr("Background color:"), m_backgroundColor);
+ m_backgroundColor->setToolTip(Tr::tr("Background color of the splash screen."));
+ formLayout->addRow(Tr::tr("Background color:"), m_backgroundColor);
m_masterImage = new QToolButton(this);
- m_masterImage->setToolTip(tr("Select master image to use."));
+ m_masterImage->setToolTip(Tr::tr("Select master image to use."));
m_masterImage->setIcon(QIcon::fromTheme(QLatin1String("document-open"), Utils::Icons::OPENFILE.icon()));
- formLayout->addRow(tr("Master image:"), m_masterImage);
+ formLayout->addRow(Tr::tr("Master image:"), m_masterImage);
m_portraitMasterImage = new QToolButton(this);
- m_portraitMasterImage->setToolTip(tr("Select portrait master image to use."));
+ m_portraitMasterImage->setToolTip(Tr::tr("Select portrait master image to use."));
m_portraitMasterImage->setIcon(QIcon::fromTheme(QLatin1String("document-open"), Utils::Icons::OPENFILE.icon()));
- formLayout->addRow(tr("Portrait master image:"), m_portraitMasterImage);
+ formLayout->addRow(Tr::tr("Portrait master image:"), m_portraitMasterImage);
m_landscapeMasterImage = new QToolButton(this);
- m_landscapeMasterImage->setToolTip(tr("Select landscape master image to use."));
+ m_landscapeMasterImage->setToolTip(Tr::tr("Select landscape master image to use."));
m_landscapeMasterImage->setIcon(QIcon::fromTheme(QLatin1String("document-open"), Utils::Icons::OPENFILE.icon()));
- formLayout->addRow(tr("Landscape master image:"), m_landscapeMasterImage);
+ formLayout->addRow(Tr::tr("Landscape master image:"), m_landscapeMasterImage);
auto clearAllButton = new QToolButton(this);
- clearAllButton->setText(SplashScreenContainerWidget::tr("Clear All"));
+ clearAllButton->setText(Tr::tr("Clear All"));
auto ldpiPage = createPage(textEditorWidget,
m_imageWidgets, m_portraitImageWidgets, m_landscapeImageWidgets,
@@ -207,7 +208,7 @@ SplashScreenContainerWidget::SplashScreenContainerWidget(
lowDpiImageSize,
lowDpiImageSize.transposed(),
lowDpiImagePath);
- tab->addTab(ldpiPage, tr("LDPI"));
+ tab->addTab(ldpiPage, Tr::tr("LDPI"));
auto mdpiPage = createPage(textEditorWidget,
m_imageWidgets, m_portraitImageWidgets, m_landscapeImageWidgets,
mediumDpiScalingRatio,
@@ -215,7 +216,7 @@ SplashScreenContainerWidget::SplashScreenContainerWidget(
mediumDpiImageSize,
mediumDpiImageSize.transposed(),
mediumDpiImagePath);
- tab->addTab(mdpiPage, tr("MDPI"));
+ tab->addTab(mdpiPage, Tr::tr("MDPI"));
auto hdpiPage = createPage(textEditorWidget,
m_imageWidgets, m_portraitImageWidgets, m_landscapeImageWidgets,
highDpiScalingRatio,
@@ -223,7 +224,7 @@ SplashScreenContainerWidget::SplashScreenContainerWidget(
highDpiImageSize,
highDpiImageSize.transposed(),
highDpiImagePath);
- tab->addTab(hdpiPage, tr("HDPI"));
+ tab->addTab(hdpiPage, Tr::tr("HDPI"));
auto xHdpiPage = createPage(textEditorWidget,
m_imageWidgets, m_portraitImageWidgets, m_landscapeImageWidgets,
extraHighDpiScalingRatio,
@@ -231,7 +232,7 @@ SplashScreenContainerWidget::SplashScreenContainerWidget(
extraHighDpiImageSize,
extraHighDpiImageSize.transposed(),
extraHighDpiImagePath);
- tab->addTab(xHdpiPage, tr("XHDPI"));
+ tab->addTab(xHdpiPage, Tr::tr("XHDPI"));
auto xxHdpiPage = createPage(textEditorWidget,
m_imageWidgets, m_portraitImageWidgets, m_landscapeImageWidgets,
extraExtraHighDpiScalingRatio,
@@ -239,7 +240,7 @@ SplashScreenContainerWidget::SplashScreenContainerWidget(
extraExtraHighDpiImageSize,
extraExtraHighDpiImageSize.transposed(),
extraExtraHighDpiImagePath);
- tab->addTab(xxHdpiPage, tr("XXHDPI"));
+ tab->addTab(xxHdpiPage, Tr::tr("XXHDPI"));
auto xxxHdpiPage = createPage(textEditorWidget,
m_imageWidgets, m_portraitImageWidgets, m_landscapeImageWidgets,
extraExtraExtraHighDpiScalingRatio,
@@ -247,7 +248,7 @@ SplashScreenContainerWidget::SplashScreenContainerWidget(
extraExtraExtraHighDpiImageSize,
extraExtraExtraHighDpiImageSize.transposed(),
extraExtraExtraHighDpiImagePath);
- tab->addTab(xxxHdpiPage, tr("XXXHDPI"));
+ tab->addTab(xxxHdpiPage, Tr::tr("XXXHDPI"));
formLayout->setContentsMargins(10, 10, 10, 10);
formLayout->setSpacing(10);
settingsLayout->addLayout(formLayout);
@@ -261,11 +262,11 @@ SplashScreenContainerWidget::SplashScreenContainerWidget(
auto warningLabel = new QLabel(this);
warningLabel->setAlignment(Qt::AlignHCenter);
- warningLabel->setText(tr("An image is used for the splashscreen. Qt Creator manages\n"
- "splashscreen by using a different method which requires changing\n"
- "the manifest file by overriding your settings. Allow override?"));
+ warningLabel->setText(Tr::tr("An image is used for the splashscreen. Qt Creator manages\n"
+ "splashscreen by using a different method which requires changing\n"
+ "the manifest file by overriding your settings. Allow override?"));
m_convertSplashscreen = new QToolButton(this);
- m_convertSplashscreen->setText(tr("Convert"));
+ m_convertSplashscreen->setText(Tr::tr("Convert"));
noSplashscreenLayout->addStretch();
noSplashscreenLayout->addWidget(warningLabel);
noSplashscreenLayout->addWidget(m_convertSplashscreen);
@@ -314,7 +315,7 @@ SplashScreenContainerWidget::SplashScreenContainerWidget(
connect(m_backgroundColor, &QToolButton::clicked, this, [this] {
const QColor color = QColorDialog::getColor(m_splashScreenBackgroundColor,
this,
- tr("Select background color"));
+ Tr::tr("Select background color"));
if (color.isValid()) {
setBackgroundColor(color);
createSplashscreenThemes();
@@ -322,7 +323,7 @@ SplashScreenContainerWidget::SplashScreenContainerWidget(
}
});
connect(m_masterImage, &QToolButton::clicked, this, [this] {
- const FilePath file = FileUtils::getOpenFilePath(this, tr("Select master image"),
+ const FilePath file = FileUtils::getOpenFilePath(this, Tr::tr("Select master image"),
FileUtils::homePath(), fileDialogImageFiles);
if (!file.isEmpty()) {
for (auto &&imageWidget : m_imageWidgets)
@@ -332,7 +333,7 @@ SplashScreenContainerWidget::SplashScreenContainerWidget(
}
});
connect(m_portraitMasterImage, &QToolButton::clicked, this, [this] {
- const FilePath file = FileUtils::getOpenFilePath(this, tr("Select portrait master image"),
+ const FilePath file = FileUtils::getOpenFilePath(this, Tr::tr("Select portrait master image"),
FileUtils::homePath(), fileDialogImageFiles);
if (!file.isEmpty()) {
for (auto &&imageWidget : m_portraitImageWidgets)
@@ -342,7 +343,7 @@ SplashScreenContainerWidget::SplashScreenContainerWidget(
}
});
connect(m_landscapeMasterImage, &QToolButton::clicked, this, [this] {
- const FilePath file = FileUtils::getOpenFilePath(this, tr("Select landscape master image"),
+ const FilePath file = FileUtils::getOpenFilePath(this, Tr::tr("Select landscape master image"),
FileUtils::homePath(), fileDialogImageFiles);
if (!file.isEmpty()) {
for (auto &&imageWidget : m_landscapeImageWidgets)
diff --git a/src/plugins/android/splashscreenwidget.cpp b/src/plugins/android/splashscreenwidget.cpp
index 35bd714970f..d5a371c970b 100644
--- a/src/plugins/android/splashscreenwidget.cpp
+++ b/src/plugins/android/splashscreenwidget.cpp
@@ -1,6 +1,7 @@
// Copyright (C) 2020 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
+#include "androidtr.h"
#include "splashscreenwidget.h"
#include <texteditor/textdocument.h>
@@ -64,10 +65,10 @@ SplashScreenWidget::SplashScreenWidget(
m_scaleWarningLabel->setMinimumSize(clearAndWarningSize);
m_scaleWarningLabel->setMaximumSize(clearAndWarningSize);
m_scaleWarningLabel->setPixmap(Utils::Icons::WARNING.icon().pixmap(clearAndWarningSize));
- m_scaleWarningLabel->setToolTip(tr("Icon scaled up."));
+ m_scaleWarningLabel->setToolTip(Tr::tr("Icon scaled up."));
m_scaleWarningLabel->setVisible(false);
}
- auto label = new QLabel(tr("Click to select..."), parent);
+ auto label = new QLabel(Tr::tr("Click to select..."), parent);
splashLayout->addWidget(splashTitle);
splashLayout->setAlignment(splashTitle, Qt::AlignHCenter);
splashButtonLayout->setColumnMinimumWidth(0, 16);
@@ -166,7 +167,7 @@ void SplashScreenWidget::selectImage()
const FilePath file = FileUtils::getOpenFilePath(this, m_imageSelectionText,
FileUtils::homePath(),
QStringLiteral("%1 (*.png *.jpg *.jpeg)")
- .arg(tr("Images")));
+ .arg(Tr::tr("Images")));
if (file.isEmpty())
return;
setImageFromPath(file, false);