Proliferate Tr::tr in various places

This changes several tr() calls which were either missed during Tr::tr-
ization or were added later.

Found with regular expression: (?<!(Tr::)|([\w]))tr\(

Change-Id: I1c0c03589e941614a7a8449ecfebc7d2cad396c3
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Alessandro Portale
2023-02-10 14:44:09 +01:00
parent 6138414813
commit 64aaf66c3b
25 changed files with 131 additions and 113 deletions

View File

@@ -43,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)")); // TODO: Implement a centralized images filter string
const QString fileDialogImageFiles = Tr::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};

View File

@@ -10,6 +10,7 @@
#include <projectexplorer/buildsteplist.h>
#include <projectexplorer/project.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/projectexplorertr.h>
#include <projectexplorer/target.h>
using namespace ProjectExplorer;
@@ -56,12 +57,12 @@ AutotoolsBuildConfigurationFactory::AutotoolsBuildConfigurationFactory()
setBuildGenerator([](const Kit *, const FilePath &projectPath, bool forSetup) {
BuildInfo info;
info.typeName = BuildConfiguration::tr("Build");
info.typeName = ::ProjectExplorer::Tr::tr("Build");
info.buildDirectory = forSetup
? FilePath::fromString(projectPath.toFileInfo().absolutePath()) : projectPath;
if (forSetup) {
//: The name of the build configuration created by default for a autotools project.
info.displayName = BuildConfiguration::tr("Default");
info.displayName = ::ProjectExplorer::Tr::tr("Default");
}
return QList<BuildInfo>{info};
});

View File

@@ -417,9 +417,9 @@ ClangdClient::ClangdClient(Project *project, const Utils::FilePath &jsonDbDir, c
setClientCapabilities(caps);
setLocatorsEnabled(false);
setAutoRequestCodeActions(false); // clangd sends code actions inside diagnostics
progressManager()->setTitleForToken(indexingToken(),
project ? tr("Indexing %1 with clangd").arg(project->displayName())
: tr("Indexing session with clangd"));
progressManager()->setTitleForToken(
indexingToken(), project ? Tr::tr("Indexing %1 with clangd").arg(project->displayName())
: Tr::tr("Indexing session with clangd"));
progressManager()->setCancelHandlerForToken(indexingToken(), [this, project]() {
CppEditor::ClangdProjectSettings projectSettings(project);
projectSettings.blockIndexing();

View File

@@ -40,6 +40,7 @@
#include <projectexplorer/project.h>
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/projectexplorertr.h>
#include <projectexplorer/session.h>
#include <projectexplorer/target.h>
#include <projectexplorer/taskhub.h>
@@ -1970,12 +1971,12 @@ BuildInfo CMakeBuildConfigurationFactory::createBuildInfo(BuildType buildType)
switch (buildType) {
case BuildTypeNone:
info.typeName = "Build";
info.displayName = BuildConfiguration::tr("Build");
info.displayName = ::ProjectExplorer::Tr::tr("Build");
info.buildType = BuildConfiguration::Unknown;
break;
case BuildTypeDebug: {
info.typeName = "Debug";
info.displayName = BuildConfiguration::tr("Debug");
info.displayName = ::ProjectExplorer::Tr::tr("Debug");
info.buildType = BuildConfiguration::Debug;
QVariantMap extraInfo;
// enable QML debugging by default
@@ -1985,7 +1986,7 @@ BuildInfo CMakeBuildConfigurationFactory::createBuildInfo(BuildType buildType)
}
case BuildTypeRelease:
info.typeName = "Release";
info.displayName = BuildConfiguration::tr("Release");
info.displayName = ::ProjectExplorer::Tr::tr("Release");
info.buildType = BuildConfiguration::Release;
break;
case BuildTypeMinSizeRel:

View File

@@ -3,8 +3,10 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include "cmakeformatter.h"
#include "cmakeformattersettings.h"
#include "cmakeprojectconstants.h"
#include "cmakeprojectmanagertr.h"
#include <coreplugin/actionmanager/actioncontainer.h>
#include <coreplugin/actionmanager/actionmanager.h>
@@ -57,7 +59,7 @@ bool CMakeFormatter::isApplicable(const Core::IDocument *document) const
void CMakeFormatter::initialize()
{
m_formatFile = new QAction(tr("Format &Current File"), this);
m_formatFile = new QAction(Tr::tr("Format &Current File"), this);
Core::Command *cmd = Core::ActionManager::registerAction(m_formatFile, Constants::CMAKEFORMATTER_ACTION_ID);
connect(m_formatFile, &QAction::triggered, this, &CMakeFormatter::formatFile);

View File

@@ -1613,7 +1613,7 @@ void DebuggerPluginPrivate::attachToRunningApplication()
kitChooser->setShowIcons(true);
auto dlg = new DeviceProcessesDialog(kitChooser, ICore::dialogParent());
dlg->addAcceptButton(DeviceProcessesDialog::tr("&Attach to Process"));
dlg->addAcceptButton(Tr::tr("&Attach to Process"));
dlg->showAllDevices();
if (dlg->exec() == QDialog::Rejected) {
delete dlg;
@@ -2261,7 +2261,7 @@ bool wantRunTool(ToolMode toolMode, const QString &toolName)
QAction *createStartAction()
{
auto action = new QAction(DebuggerMainWindow::tr("Start"), m_instance);
auto action = new QAction(Tr::tr("Start"), m_instance);
action->setIcon(ProjectExplorer::Icons::ANALYZER_START_SMALL_TOOLBAR.icon());
action->setEnabled(true);
return action;
@@ -2269,7 +2269,7 @@ QAction *createStartAction()
QAction *createStopAction()
{
auto action = new QAction(DebuggerMainWindow::tr("Stop"), m_instance);
auto action = new QAction(Tr::tr("Stop"), m_instance);
action->setIcon(Utils::Icons::STOP_SMALL_TOOLBAR.icon());
action->setEnabled(true);
return action;

View File

@@ -113,19 +113,20 @@ GerritPushDialog::GerritPushDialog(const Utils::FilePath &workingDir, const QStr
, m_remoteComboBox(new GerritRemoteChooser)
, m_targetBranchComboBox(new QComboBox)
, m_commitView(new LogChangeWidget)
, m_infoLabel(new QLabel(tr("Number of commits")))
, m_infoLabel(new QLabel(::Git::Tr::tr("Number of commits")))
, m_topicLineEdit(new QLineEdit)
, m_draftCheckBox(new QCheckBox(tr("&Draft/private")))
, m_wipCheckBox(new QCheckBox(tr("&Work-in-progress")))
, m_draftCheckBox(new QCheckBox(::Git::Tr::tr("&Draft/private")))
, m_wipCheckBox(new QCheckBox(::Git::Tr::tr("&Work-in-progress")))
, m_reviewersLineEdit(new QLineEdit)
, m_buttonBox(new QDialogButtonBox)
, m_workingDir(workingDir)
{
m_draftCheckBox->setToolTip(tr("Checked - Mark change as private.\n"
m_draftCheckBox->setToolTip(::Git::Tr::tr("Checked - Mark change as private.\n"
"Unchecked - Remove mark.\n"
"Partially checked - Do not change current state."));
m_commitView->setToolTip(tr("Pushes the selected commit and all dependent commits."));
m_reviewersLineEdit->setToolTip(tr("Comma-separated list of reviewers.\n"
m_commitView->setToolTip(::Git::Tr::tr(
"Pushes the selected commit and all dependent commits."));
m_reviewersLineEdit->setToolTip(::Git::Tr::tr("Comma-separated list of reviewers.\n"
"\n"
"Reviewers can be specified by nickname or email address. Spaces not allowed.\n"
"\n"
@@ -138,14 +139,14 @@ GerritPushDialog::GerritPushDialog(const Utils::FilePath &workingDir, const QStr
using namespace Utils::Layouting;
Grid {
tr("Push:"), workingDir.toUserOutput(), m_localBranchComboBox, br,
tr("To:"), m_remoteComboBox, m_targetBranchComboBox, br,
tr("Commits:"), br,
::Git::Tr::tr("Push:"), workingDir.toUserOutput(), m_localBranchComboBox, br,
::Git::Tr::tr("To:"), m_remoteComboBox, m_targetBranchComboBox, br,
::Git::Tr::tr("Commits:"), br,
Span(3, m_commitView), br,
Span(3, m_infoLabel), br,
Span(3, Form {
tr("&Topic:"), Row { m_topicLineEdit, m_draftCheckBox, m_wipCheckBox }, br,
tr("&Reviewers:"), m_reviewersLineEdit, br
::Git::Tr::tr("&Topic:"), Row { m_topicLineEdit, m_draftCheckBox, m_wipCheckBox }, br,
::Git::Tr::tr("&Reviewers:"), m_reviewersLineEdit, br
}), br,
Span(3, m_buttonBox)
}.attachTo(this);
@@ -220,7 +221,8 @@ void GerritPushDialog::setChangeRange()
}
m_infoLabel->show();
const QString remote = selectedRemoteName() + '/' + remoteBranchName;
QString labelText = Git::Tr::tr("Number of commits between %1 and %2: %3").arg(branch, remote, range);
QString labelText =
Git::Tr::tr("Number of commits between %1 and %2: %3").arg(branch, remote, range);
const int currentRange = range.toInt();
QPalette palette = QApplication::palette();
if (currentRange > ReasonableDistance) {

View File

@@ -53,7 +53,7 @@ using namespace Internal;
static QString msgProgress(int progress, int total)
{
return BuildManager::tr("Finished %1 of %n steps", nullptr, total).arg(progress);
return Tr::tr("Finished %1 of %n steps", nullptr, total).arg(progress);
}
static const QList<Target *> targetsForSelection(const Project *project,
@@ -129,8 +129,8 @@ static int queue(const QList<Project *> &projects, const QList<Id> &stepIds,
if (settings.prompToStopRunControl) {
QStringList names = Utils::transform(toStop, &RunControl::displayName);
if (QMessageBox::question(ICore::dialogParent(),
BuildManager::tr("Stop Applications"),
BuildManager::tr("Stop these applications before building?")
Tr::tr("Stop Applications"),
Tr::tr("Stop these applications before building?")
+ "\n\n" + names.join('\n'))
== QMessageBox::No) {
stopThem = false;
@@ -156,7 +156,7 @@ static int queue(const QList<Project *> &projects, const QList<Id> &stepIds,
for (const Project *pro : projects) {
if (pro && pro->needsConfiguration()) {
preambleMessage.append(
BuildManager::tr("The project %1 is not configured, skipping it.")
Tr::tr("The project %1 is not configured, skipping it.")
.arg(pro->displayName()) + QLatin1Char('\n'));
}
}
@@ -168,8 +168,7 @@ static int queue(const QList<Project *> &projects, const QList<Id> &stepIds,
if (device && !device->prepareForBuild(t)) {
preambleMessage.append(
BuildManager::tr("The build device failed to prepare for the build of %1 "
"(%2).")
Tr::tr("The build device failed to prepare for the build of %1 (%2).")
.arg(pro->displayName())
.arg(t->displayName())
+ QLatin1Char('\n'));

View File

@@ -15,7 +15,7 @@ namespace Internal {
DeviceSettingsPage::DeviceSettingsPage()
{
setId(Constants::DEVICE_SETTINGS_PAGE_ID);
setDisplayName(DeviceSettingsWidget::tr("Devices"));
setDisplayName(Tr::tr("Devices"));
setCategory(Constants::DEVICE_SETTINGS_CATEGORY);
setDisplayCategory(Tr::tr("Devices"));
setCategoryIconPath(":/projectexplorer/images/settingscategory_devices.png");

View File

@@ -214,9 +214,9 @@ ProcessResultData FileTransfer::resultData() const
QString FileTransfer::transferMethodName(FileTransferMethod method)
{
switch (method) {
case FileTransferMethod::Sftp: return FileTransfer::tr("sftp");
case FileTransferMethod::Rsync: return FileTransfer::tr("rsync");
case FileTransferMethod::GenericCopy: return FileTransfer::tr("generic file copy");
case FileTransferMethod::Sftp: return Tr::tr("sftp");
case FileTransferMethod::Rsync: return Tr::tr("rsync");
case FileTransferMethod::GenericCopy: return Tr::tr("generic file copy");
}
QTC_CHECK(false);
return {};

View File

@@ -20,6 +20,7 @@
#include <utils/qtcassert.h>
#include <utils/stringutils.h>
#include <utils/tooltip/tooltip.h>
#include <utils/utilstr.h>
#include <QDialogButtonBox>
#include <QDir>
@@ -375,7 +376,7 @@ void EnvironmentWidget::updateSummaryText()
QString text;
for (const Utils::EnvironmentItem &item : std::as_const(list)) {
if (item.name != Utils::EnvironmentModel::tr("<VARIABLE>")) {
if (item.name != ::Utils::Tr::tr("<VARIABLE>")) {
if (!d->m_baseEnvironmentText.isEmpty() || !text.isEmpty())
text.append(QLatin1String("<br>"));
switch (item.operation) {

View File

@@ -92,9 +92,9 @@ public:
{
if (pattern.pattern().isEmpty() || !pattern.isValid())
return;
m_expander.setDisplayName(JsonFieldPage::tr("Line Edit Validator Expander"));
m_expander.setDisplayName(Tr::tr("Line Edit Validator Expander"));
m_expander.setAccumulating(true);
m_expander.registerVariable("INPUT", JsonFieldPage::tr("The text edit input to fix up."),
m_expander.registerVariable("INPUT", Tr::tr("The text edit input to fix up."),
[this] { return m_currentInput; });
m_expander.registerSubProvider([expander]() -> MacroExpander * { return expander; });
setValidationFunction([this, pattern](FancyLineEdit *, QString *) {

View File

@@ -7,6 +7,7 @@
#include <utils/macroexpander.h>
#include <utils/qtcprocess.h>
#include <utils/theme/theme.h>
#include <utils/utilstr.h>
#include <QDir>
@@ -156,7 +157,7 @@ static QString invalidCommandMessage(const QString &displayName)
{
return QString("<b>%1:</b> <font color='%3'>%2</font>")
.arg(displayName,
QtcProcess::tr("Invalid command"),
::Utils::Tr::tr("Invalid command"),
creatorTheme()->color(Theme::TextColorError).name());
}

View File

@@ -1568,7 +1568,7 @@ void RunWorkerPrivate::timerEvent(QTimerEvent *ev)
killStartWatchdog();
startWatchdogCallback();
} else {
q->reportFailure(RunWorker::tr("Worker start timed out."));
q->reportFailure(Tr::tr("Worker start timed out."));
}
return;
}
@@ -1577,7 +1577,7 @@ void RunWorkerPrivate::timerEvent(QTimerEvent *ev)
killStopWatchdog();
stopWatchdogCallback();
} else {
q->reportFailure(RunWorker::tr("Worker stop timed out."));
q->reportFailure(Tr::tr("Worker stop timed out."));
}
return;
}

View File

@@ -599,7 +599,7 @@ QString SessionManagerPrivate::sessionTitle(const FilePath &filePath)
} else {
QString sessionName = d->m_sessionName;
if (sessionName.isEmpty())
sessionName = SessionManager::tr("Untitled");
sessionName = Tr::tr("Untitled");
return sessionName;
}
return QString();
@@ -935,11 +935,11 @@ void SessionManagerPrivate::askUserAboutFailedProjects()
if (!failedProjects.isEmpty()) {
QString fileList = FilePath::formatFilePaths(failedProjects, "<br>");
QMessageBox box(QMessageBox::Warning,
SessionManager::tr("Failed to restore project files"),
SessionManager::tr("Could not restore the following project files:<br><b>%1</b>").
Tr::tr("Failed to restore project files"),
Tr::tr("Could not restore the following project files:<br><b>%1</b>").
arg(fileList));
auto keepButton = new QPushButton(SessionManager::tr("Keep projects in Session"), &box);
auto removeButton = new QPushButton(SessionManager::tr("Remove projects from Session"), &box);
auto keepButton = new QPushButton(Tr::tr("Keep projects in Session"), &box);
auto removeButton = new QPushButton(Tr::tr("Remove projects from Session"), &box);
box.addButton(keepButton, QMessageBox::AcceptRole);
box.addButton(removeButton, QMessageBox::DestructiveRole);

View File

@@ -206,8 +206,7 @@ void ProjectExplorerPlugin::testXcodebuildParserParsing_data()
<< OutputParserTester::STDERR
<< QString() << QString()
<< (Tasks()
<< CompileTask(Task::Error,
XcodebuildParser::tr("Xcodebuild failed.")))
<< CompileTask(Task::Error, Tr::tr("Xcodebuild failed.")))
<< QString()
<< XcodebuildParser::UnknownXcodebuildState;
@@ -219,8 +218,7 @@ void ProjectExplorerPlugin::testXcodebuildParserParsing_data()
<< OutputParserTester::STDERR
<< QString() << QString::fromLatin1("outErr\n")
<< (Tasks()
<< CompileTask(Task::Error,
XcodebuildParser::tr("Xcodebuild failed.")))
<< CompileTask(Task::Error, Tr::tr("Xcodebuild failed.")))
<< QString()
<< XcodebuildParser::UnknownXcodebuildState;
@@ -230,8 +228,7 @@ void ProjectExplorerPlugin::testXcodebuildParserParsing_data()
<< QString() << QString()
<< (Tasks()
<< CompileTask(Task::Warning,
XcodebuildParser::tr("Replacing signature"),
"/somepath/somefile.app"))
Tr::tr("Replacing signature"), "/somepath/somefile.app"))
<< QString()
<< XcodebuildParser::InXcodebuild;

View File

@@ -238,9 +238,9 @@ public:
uiQmlOpenComboBox->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred);
uiQmlOpenComboBox->setSizeAdjustPolicy(QComboBox::QComboBox::AdjustToContents);
useQmlls = new QCheckBox(tr("Use qmlls (EXPERIMENTAL!)"));
useQmlls = new QCheckBox(Tr::tr("Use qmlls (EXPERIMENTAL!)"));
useQmlls->setChecked(s.qmllsSettigs().useQmlls);
useLatestQmlls = new QCheckBox(tr("Always use latest qmlls"));
useLatestQmlls = new QCheckBox(Tr::tr("Always use latest qmlls"));
useLatestQmlls->setChecked(s.qmllsSettigs().useLatestQmlls);
useLatestQmlls->setEnabled(s.qmllsSettigs().useQmlls);
QObject::connect(useQmlls, &QCheckBox::stateChanged, this, [this](int checked) {
@@ -276,7 +276,7 @@ public:
},
},
Group{
title(tr("Language Server")),
title(Tr::tr("Language Server")),
Column{useQmlls, useLatestQmlls},
},
st,

View File

@@ -3,6 +3,8 @@
#include "qmllsclient.h"
#include "qmljseditortr.h"
#include <languageclient/languageclientinterface.h>
#include <languageclient/languageclientmanager.h>
@@ -47,7 +49,7 @@ QmllsClient *QmllsClient::clientForQmlls(const FilePath &qmlls)
auto interface = new StdIOClientInterface;
interface->setCommandLine(CommandLine(qmlls));
auto client = new QmllsClient(interface);
client->setName(QmllsClient::tr("Qmlls (%1)").arg(qmlls.toUserOutput()));
client->setName(Tr::tr("Qmlls (%1)").arg(qmlls.toUserOutput()));
client->setActivateDocumentAutomatically(true);
LanguageFilter filter;
using namespace QmlJSTools::Constants;

View File

@@ -23,12 +23,14 @@
**
****************************************************************************/
#include <tracing/timelineformattime.h>
#include "quick3dframemodel.h"
#include "quick3dmodel.h"
#include "qmlprofilermodelmanager.h"
#include "qmlprofilerconstants.h"
#include "qmlprofilerconstants.h"
#include "qmlprofilermodelmanager.h"
#include "qmlprofilertr.h"
#include "quick3dmodel.h"
#include <tracing/timelineformattime.h>
namespace QmlProfiler {
namespace Internal {
@@ -234,19 +236,19 @@ QVariant Quick3DFrameModel::headerData(int section, Qt::Orientation orientation,
case Qt::DisplayRole:
switch (section) {
case Frame:
result = QVariant::fromValue(tr("Frame"));
result = QVariant::fromValue(Tr::tr("Frame"));
break;
case Duration:
result = QVariant::fromValue(tr("Duration"));
result = QVariant::fromValue(Tr::tr("Duration"));
break;
case Timestamp:
result = QVariant::fromValue(tr("Timestamp"));
result = QVariant::fromValue(Tr::tr("Timestamp"));
break;
case FrameDelta:
result = QVariant::fromValue(tr("Frame Delta"));
result = QVariant::fromValue(Tr::tr("Frame Delta"));
break;
case View3D:
result = QVariant::fromValue(tr("View3D"));
result = QVariant::fromValue(Tr::tr("View3D"));
break;
}
break;
@@ -441,7 +443,7 @@ QList<int> Quick3DFrameModel::frameIndices(const QString &view3DFilter) const
{
QList<int> ret;
int key = -1;
if (view3DFilter != tr("All")) {
if (view3DFilter != Tr::tr("All")) {
for (int v3d : m_frameTimes.keys()) {
if (m_modelManager->eventType(m_eventData[v3d]).data() == view3DFilter) {
key = v3d;
@@ -463,17 +465,17 @@ QStringList Quick3DFrameModel::frameNames(const QString &view3D) const
QStringList ret;
for (auto index : indices) {
const Item &item = m_data[index];
ret << QString(tr("Frame") + QLatin1Char(' ') + QString::number(item.data));
ret << QString(Tr::tr("Frame") + QLatin1Char(' ') + QString::number(item.data));
}
return ret;
}
void Quick3DFrameModel::setFilterFrame(const QString &frame)
{
if (frame == tr("None")) {
if (frame == Tr::tr("None")) {
m_filterFrame = -1;
} else {
QString title = tr("Frame");
QString title = Tr::tr("Frame");
QString number = frame.right(frame.length() - title.length());
m_filterFrame = number.toInt();
}
@@ -482,7 +484,7 @@ void Quick3DFrameModel::setFilterFrame(const QString &frame)
void Quick3DFrameModel::setFilterView3D(const QString &view3D)
{
int key = -1;
if (view3D != tr("All")) {
if (view3D != Tr::tr("All")) {
for (int v3d : m_frameTimes.keys()) {
if (m_modelManager->eventType(m_eventData[v3d]).data() == view3D) {
key = v3d;

View File

@@ -25,6 +25,8 @@
#include "quick3dframeview.h"
#include "qmlprofilertr.h"
#include <coreplugin/minisplitter.h>
#include <QHeaderView>
@@ -41,7 +43,7 @@ Quick3DFrameView::Quick3DFrameView(QmlProfilerModelManager *profilerModelManager
: QmlProfilerEventsView(parent)
{
setObjectName(QLatin1String("QmlProfiler.Quick3DFrame.Dock"));
setWindowTitle(tr("Quick3D Frame"));
setWindowTitle(Tr::tr("Quick3D Frame"));
auto model = new Quick3DFrameModel(profilerModelManager);
m_mainView.reset(new Quick3DMainView(model, false, this));
@@ -65,8 +67,8 @@ Quick3DFrameView::Quick3DFrameView(QmlProfilerModelManager *profilerModelManager
auto view3DComboModel = new QStringListModel(this);
auto frameComboBox = new QComboBox(this);
auto frameComboModel = new QStringListModel(this);
auto selectView3DLabel = new QLabel(tr("Select View3D"), this);
auto selectFrameLabel = new QLabel(tr("Compare Frame"), this);
auto selectView3DLabel = new QLabel(Tr::tr("Select View3D"), this);
auto selectFrameLabel = new QLabel(Tr::tr("Compare Frame"), this);
view3DComboBox->setModel(view3DComboModel);
frameComboBox->setModel(frameComboModel);
hFrameLayout->addWidget(selectView3DLabel);
@@ -79,19 +81,19 @@ Quick3DFrameView::Quick3DFrameView(QmlProfilerModelManager *profilerModelManager
groupLayout->addLayout(hMainLayout);
connect(model, &Quick3DFrameModel::modelReset, [model, view3DComboModel, frameComboModel](){
QStringList list;
list << tr("All");
list << Tr::tr("All");
list << model->view3DNames();
view3DComboModel->setStringList(list);
list.clear();
list << tr("None");
list << model->frameNames(tr("All"));
list << Tr::tr("None");
list << model->frameNames(Tr::tr("All"));
frameComboModel->setStringList(list);
});
connect(view3DComboBox, &QComboBox::currentTextChanged, [this, model, frameComboModel](const QString &text){
m_mainView->setFilterView3D(text);
model->setFilterView3D(text);
QStringList list;
list << tr("None");
list << Tr::tr("None");
list << model->frameNames(text);
frameComboModel->setStringList(list);
});
@@ -158,7 +160,7 @@ Quick3DMainView::Quick3DMainView(Quick3DFrameModel *model, bool compareView, QWi
void Quick3DMainView::setFilterView3D(const QString &objectName)
{
if (objectName == tr("All"))
if (objectName == Tr::tr("All"))
m_sortModel->setFilterFixedString("");
else
m_sortModel->setFilterFixedString(objectName);

View File

@@ -166,8 +166,8 @@ QVariantMap Quick3DModel::details(int index) const
if ((detailType == RenderPass || detailType == PrepareFrame) && m_data[index].data) {
quint32 width = m_data[index].data & 0xffffffff;
quint32 height = m_data[index].data >> 32;
result.insert(tr("Width"), width);
result.insert(tr("Height"), height);
result.insert(Tr::tr("Width"), width);
result.insert(Tr::tr("Height"), height);
}
if ((detailType >= MeshLoad && detailType <= TextureLoad)
|| (detailType >= MeshMemoryConsumption && detailType <= TextureMemoryConsumption)) {
@@ -176,9 +176,9 @@ QVariantMap Quick3DModel::details(int index) const
if (detailType == RenderCall) {
quint32 primitives = m_data[index].data & 0xffffffff;
quint32 instances = m_data[index].data >> 32;
result.insert(tr("Primitives"), primitives);
result.insert(Tr::tr("Primitives"), primitives);
if (instances > 1)
result.insert(tr("Instances"), instances);
result.insert(Tr::tr("Instances"), instances);
}
if (!m_data[index].eventData.isEmpty()) {
for (int i = 0; i < m_data[index].eventData.size(); i++) {

View File

@@ -12,6 +12,7 @@
#include <debugger/debuggerkitinformation.h>
#include <debugger/debuggerruncontrol.h>
#include <debugger/debuggertr.h>
#include <projectexplorer/devicesupport/deviceprocessesdialog.h>
#include <projectexplorer/devicesupport/deviceusedportsgatherer.h>
@@ -212,7 +213,7 @@ void showAttachToProcessDialog()
});
QnxAttachDebugDialog dlg(kitChooser);
dlg.addAcceptButton(DeviceProcessesDialog::tr("&Attach to Process"));
dlg.addAcceptButton(::Debugger::Tr::tr("&Attach to Process"));
dlg.showAllDevices();
if (dlg.exec() == QDialog::Rejected)
return;

View File

@@ -7,6 +7,8 @@
#include <coreplugin/icore.h>
#include <help/helptr.h>
#include <utils/fancylineedit.h>
#include <utils/layoutbuilder.h>
#include <utils/styledbar.h>
@@ -45,7 +47,7 @@ BookmarkDialog::BookmarkDialog(BookmarkManager *manager, const QString &title,
{
installEventFilter(this);
resize(450, 0);
setWindowTitle(tr("Add Bookmark"));
setWindowTitle(::Help::Tr::tr("Add Bookmark"));
proxyModel = new QSortFilterProxyModel(this);
proxyModel->setFilterKeyColumn(0);
@@ -70,14 +72,14 @@ BookmarkDialog::BookmarkDialog(BookmarkManager *manager, const QString &title,
treeViewSP.setVerticalStretch(1);
m_treeView->setSizePolicy(treeViewSP);
m_newFolderButton = new QPushButton(tr("New Folder"));
m_newFolderButton = new QPushButton(::Help::Tr::tr("New Folder"));
m_buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
using namespace Utils::Layouting;
Column {
Form {
tr("Bookmark:"), m_bookmarkEdit, br,
tr("Add in folder:"), m_bookmarkFolders, br,
::Help::Tr::tr("Bookmark:"), m_bookmarkEdit, br,
::Help::Tr::tr("Add in folder:"), m_bookmarkFolders, br,
},
Row { m_toolButton, hr },
m_treeView,
@@ -172,7 +174,7 @@ void BookmarkDialog::itemChanged(QStandardItem *item)
m_bookmarkFolders->clear();
m_bookmarkFolders->addItems(bookmarkManager->bookmarkFolders());
QString name = tr("Bookmarks");
QString name = ::Help::Tr::tr("Bookmarks");
const QModelIndex& index = m_treeView->currentIndex();
if (index.isValid())
name = index.data().toString();
@@ -188,7 +190,7 @@ void BookmarkDialog::textChanged(const QString& string)
void BookmarkDialog::selectBookmarkFolder(int index)
{
const QString folderName = m_bookmarkFolders->itemText(index);
if (folderName == tr("Bookmarks")) {
if (folderName == ::Help::Tr::tr("Bookmarks")) {
m_treeView->clearSelection();
return;
}
@@ -214,8 +216,8 @@ void BookmarkDialog::showContextMenu(const QPoint &point)
QMenu menu(this);
QAction *removeItem = menu.addAction(tr("Delete Folder"));
QAction *renameItem = menu.addAction(tr("Rename Folder"));
QAction *removeItem = menu.addAction(::Help::Tr::tr("Delete Folder"));
QAction *renameItem = menu.addAction(::Help::Tr::tr("Rename Folder"));
QAction *picked = menu.exec(m_treeView->mapToGlobal(point));
if (!picked)
@@ -227,7 +229,7 @@ void BookmarkDialog::showContextMenu(const QPoint &point)
m_bookmarkFolders->clear();
m_bookmarkFolders->addItems(bookmarkManager->bookmarkFolders());
QString name = tr("Bookmarks");
QString name = ::Help::Tr::tr("Bookmarks");
index = m_treeView->currentIndex();
if (index.isValid())
name = index.data().toString();
@@ -244,7 +246,7 @@ void BookmarkDialog::showContextMenu(const QPoint &point)
void BookmarkDialog::currentChanged(const QModelIndex &current)
{
QString text = tr("Bookmarks");
QString text = ::Help::Tr::tr("Bookmarks");
if (current.isValid())
text = current.data().toString();
m_bookmarkFolders->setCurrentIndex(m_bookmarkFolders->findText(text));
@@ -275,7 +277,7 @@ bool BookmarkDialog::eventFilter(QObject *object, QEvent *e)
m_bookmarkFolders->clear();
m_bookmarkFolders->addItems(bookmarkManager->bookmarkFolders());
QString name = tr("Bookmarks");
QString name = ::Help::Tr::tr("Bookmarks");
index = m_treeView->currentIndex();
if (index.isValid())
name = index.data().toString();
@@ -365,16 +367,16 @@ void BookmarkWidget::showContextMenu(const QPoint &point)
QMenu menu(this);
QString data = index.data(Qt::UserRole + 10).toString();
if (data == QLatin1String("Folder")) {
removeItem = menu.addAction(tr("Delete Folder"));
renameItem = menu.addAction(tr("Rename Folder"));
removeItem = menu.addAction(::Help::Tr::tr("Delete Folder"));
renameItem = menu.addAction(::Help::Tr::tr("Rename Folder"));
} else {
showItem = menu.addAction(tr("Show Bookmark"));
showItem = menu.addAction(::Help::Tr::tr("Show Bookmark"));
if (m_isOpenInNewPageActionVisible)
showItemNewTab = menu.addAction(tr("Show Bookmark as New Page"));
showItemNewTab = menu.addAction(::Help::Tr::tr("Show Bookmark as New Page"));
if (searchField->text().isEmpty()) {
menu.addSeparator();
removeItem = menu.addAction(tr("Delete Bookmark"));
renameItem = menu.addAction(tr("Rename Bookmark"));
removeItem = menu.addAction(::Help::Tr::tr("Delete Bookmark"));
renameItem = menu.addAction(::Help::Tr::tr("Rename Bookmark"));
}
}
@@ -603,7 +605,7 @@ void BookmarkManager::saveBookmarks()
QStringList BookmarkManager::bookmarkFolders() const
{
QStringList folders(tr("Bookmarks"));
QStringList folders(::Help::Tr::tr("Bookmarks"));
const QList<QStandardItem *> list = treeModel->findItems(QLatin1String("*"),
Qt::MatchWildcard | Qt::MatchRecursive,
@@ -641,8 +643,8 @@ void BookmarkManager::removeBookmarkItem(QTreeView *treeView,
if (item) {
QString data = index.data(Qt::UserRole + 10).toString();
if (data == QLatin1String("Folder") && item->rowCount() > 0) {
int value = QMessageBox::question(treeView, tr("Remove"),
tr("Deleting a folder also removes its content.<br>"
int value = QMessageBox::question(treeView, ::Help::Tr::tr("Remove"),
::Help::Tr::tr("Deleting a folder also removes its content.<br>"
"Do you want to continue?"),
QMessageBox::Yes | QMessageBox::Cancel, QMessageBox::Cancel);
@@ -755,7 +757,7 @@ void BookmarkManager::setupBookmarkModels()
QString BookmarkManager::uniqueFolderName() const
{
QString folderName = tr("New Folder");
QString folderName = ::Help::Tr::tr("New Folder");
const QList<QStandardItem *> list = treeModel->findItems(folderName,
Qt::MatchContains | Qt::MatchRecursive,
0);
@@ -764,7 +766,7 @@ QString BookmarkManager::uniqueFolderName() const
for (const QStandardItem *item : list)
names << item->text();
QString folderNameBase = tr("New Folder") + QLatin1String(" %1");
QString folderNameBase = ::Help::Tr::tr("New Folder") + QLatin1String(" %1");
for (int i = 1; i <= names.count(); ++i) {
folderName = folderNameBase.arg(i);
if (!names.contains(folderName))

View File

@@ -7,6 +7,8 @@
#include <localhelpmanager.h>
#include <openpagesmanager.h>
#include <help/helptr.h>
#include <utils/navigationtreeview.h>
#include <QFocusEvent>
@@ -106,10 +108,10 @@ void ContentWindow::showContextMenu(const QPoint &pos)
contentModel->contentItemAt(m_contentWidget->currentIndex());
QMenu menu;
QAction *curTab = menu.addAction(tr("Open Link"));
QAction *curTab = menu.addAction(::Help::Tr::tr("Open Link"));
QAction *newTab = 0;
if (m_isOpenInNewPageActionVisible)
newTab = menu.addAction(tr("Open Link as New Page"));
newTab = menu.addAction(::Help::Tr::tr("Open Link as New Page"));
QAction *action = menu.exec(m_contentWidget->mapToGlobal(pos));
if (curTab == action)

View File

@@ -3,8 +3,11 @@
#include "topicchooser.h"
#include <utils/layoutbuilder.h>
#include "helptr.h"
#include <utils/fancylineedit.h>
#include <utils/layoutbuilder.h>
#include <utils/utilstr.h>
#include <QMap>
#include <QUrl>
@@ -21,7 +24,7 @@ TopicChooser::TopicChooser(QWidget *parent, const QString &keyword,
, m_filterModel(new QSortFilterProxyModel(this))
{
resize(400, 220);
setWindowTitle(tr("Choose Topic"));
setWindowTitle(::Help::Tr::tr("Choose Topic"));
QStandardItemModel *model = new QStandardItemModel(this);
m_filterModel->setSourceModel(model);
@@ -51,7 +54,7 @@ TopicChooser::TopicChooser(QWidget *parent, const QString &keyword,
using namespace Utils::Layouting;
Column {
tr("Choose a topic for <b>%1</b>:").arg(keyword),
::Help::Tr::tr("Choose a topic for <b>%1</b>:").arg(keyword),
m_lineEdit,
m_listWidget,
buttonBox,