forked from qt-creator/qt-creator
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:
@@ -43,7 +43,7 @@ const char splashscreenFileName[] = "logo";
|
|||||||
const char splashscreenPortraitFileName[] = "logo_port";
|
const char splashscreenPortraitFileName[] = "logo_port";
|
||||||
const char splashscreenLandscapeFileName[] = "logo_land";
|
const char splashscreenLandscapeFileName[] = "logo_land";
|
||||||
const char imageSuffix[] = ".png";
|
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 lowDpiImageSize{200, 320};
|
||||||
const QSize mediumDpiImageSize{320, 480};
|
const QSize mediumDpiImageSize{320, 480};
|
||||||
const QSize highDpiImageSize{480, 800};
|
const QSize highDpiImageSize{480, 800};
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
#include <projectexplorer/buildsteplist.h>
|
#include <projectexplorer/buildsteplist.h>
|
||||||
#include <projectexplorer/project.h>
|
#include <projectexplorer/project.h>
|
||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
|
#include <projectexplorer/projectexplorertr.h>
|
||||||
#include <projectexplorer/target.h>
|
#include <projectexplorer/target.h>
|
||||||
|
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
@@ -56,12 +57,12 @@ AutotoolsBuildConfigurationFactory::AutotoolsBuildConfigurationFactory()
|
|||||||
|
|
||||||
setBuildGenerator([](const Kit *, const FilePath &projectPath, bool forSetup) {
|
setBuildGenerator([](const Kit *, const FilePath &projectPath, bool forSetup) {
|
||||||
BuildInfo info;
|
BuildInfo info;
|
||||||
info.typeName = BuildConfiguration::tr("Build");
|
info.typeName = ::ProjectExplorer::Tr::tr("Build");
|
||||||
info.buildDirectory = forSetup
|
info.buildDirectory = forSetup
|
||||||
? FilePath::fromString(projectPath.toFileInfo().absolutePath()) : projectPath;
|
? FilePath::fromString(projectPath.toFileInfo().absolutePath()) : projectPath;
|
||||||
if (forSetup) {
|
if (forSetup) {
|
||||||
//: The name of the build configuration created by default for a autotools project.
|
//: 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};
|
return QList<BuildInfo>{info};
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -417,9 +417,9 @@ ClangdClient::ClangdClient(Project *project, const Utils::FilePath &jsonDbDir, c
|
|||||||
setClientCapabilities(caps);
|
setClientCapabilities(caps);
|
||||||
setLocatorsEnabled(false);
|
setLocatorsEnabled(false);
|
||||||
setAutoRequestCodeActions(false); // clangd sends code actions inside diagnostics
|
setAutoRequestCodeActions(false); // clangd sends code actions inside diagnostics
|
||||||
progressManager()->setTitleForToken(indexingToken(),
|
progressManager()->setTitleForToken(
|
||||||
project ? tr("Indexing %1 with clangd").arg(project->displayName())
|
indexingToken(), project ? Tr::tr("Indexing %1 with clangd").arg(project->displayName())
|
||||||
: tr("Indexing session with clangd"));
|
: Tr::tr("Indexing session with clangd"));
|
||||||
progressManager()->setCancelHandlerForToken(indexingToken(), [this, project]() {
|
progressManager()->setCancelHandlerForToken(indexingToken(), [this, project]() {
|
||||||
CppEditor::ClangdProjectSettings projectSettings(project);
|
CppEditor::ClangdProjectSettings projectSettings(project);
|
||||||
projectSettings.blockIndexing();
|
projectSettings.blockIndexing();
|
||||||
|
|||||||
@@ -40,6 +40,7 @@
|
|||||||
#include <projectexplorer/project.h>
|
#include <projectexplorer/project.h>
|
||||||
#include <projectexplorer/projectexplorer.h>
|
#include <projectexplorer/projectexplorer.h>
|
||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
|
#include <projectexplorer/projectexplorertr.h>
|
||||||
#include <projectexplorer/session.h>
|
#include <projectexplorer/session.h>
|
||||||
#include <projectexplorer/target.h>
|
#include <projectexplorer/target.h>
|
||||||
#include <projectexplorer/taskhub.h>
|
#include <projectexplorer/taskhub.h>
|
||||||
@@ -1970,12 +1971,12 @@ BuildInfo CMakeBuildConfigurationFactory::createBuildInfo(BuildType buildType)
|
|||||||
switch (buildType) {
|
switch (buildType) {
|
||||||
case BuildTypeNone:
|
case BuildTypeNone:
|
||||||
info.typeName = "Build";
|
info.typeName = "Build";
|
||||||
info.displayName = BuildConfiguration::tr("Build");
|
info.displayName = ::ProjectExplorer::Tr::tr("Build");
|
||||||
info.buildType = BuildConfiguration::Unknown;
|
info.buildType = BuildConfiguration::Unknown;
|
||||||
break;
|
break;
|
||||||
case BuildTypeDebug: {
|
case BuildTypeDebug: {
|
||||||
info.typeName = "Debug";
|
info.typeName = "Debug";
|
||||||
info.displayName = BuildConfiguration::tr("Debug");
|
info.displayName = ::ProjectExplorer::Tr::tr("Debug");
|
||||||
info.buildType = BuildConfiguration::Debug;
|
info.buildType = BuildConfiguration::Debug;
|
||||||
QVariantMap extraInfo;
|
QVariantMap extraInfo;
|
||||||
// enable QML debugging by default
|
// enable QML debugging by default
|
||||||
@@ -1985,7 +1986,7 @@ BuildInfo CMakeBuildConfigurationFactory::createBuildInfo(BuildType buildType)
|
|||||||
}
|
}
|
||||||
case BuildTypeRelease:
|
case BuildTypeRelease:
|
||||||
info.typeName = "Release";
|
info.typeName = "Release";
|
||||||
info.displayName = BuildConfiguration::tr("Release");
|
info.displayName = ::ProjectExplorer::Tr::tr("Release");
|
||||||
info.buildType = BuildConfiguration::Release;
|
info.buildType = BuildConfiguration::Release;
|
||||||
break;
|
break;
|
||||||
case BuildTypeMinSizeRel:
|
case BuildTypeMinSizeRel:
|
||||||
|
|||||||
@@ -3,8 +3,10 @@
|
|||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||||
|
|
||||||
#include "cmakeformatter.h"
|
#include "cmakeformatter.h"
|
||||||
|
|
||||||
#include "cmakeformattersettings.h"
|
#include "cmakeformattersettings.h"
|
||||||
#include "cmakeprojectconstants.h"
|
#include "cmakeprojectconstants.h"
|
||||||
|
#include "cmakeprojectmanagertr.h"
|
||||||
|
|
||||||
#include <coreplugin/actionmanager/actioncontainer.h>
|
#include <coreplugin/actionmanager/actioncontainer.h>
|
||||||
#include <coreplugin/actionmanager/actionmanager.h>
|
#include <coreplugin/actionmanager/actionmanager.h>
|
||||||
@@ -57,7 +59,7 @@ bool CMakeFormatter::isApplicable(const Core::IDocument *document) const
|
|||||||
|
|
||||||
void CMakeFormatter::initialize()
|
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);
|
Core::Command *cmd = Core::ActionManager::registerAction(m_formatFile, Constants::CMAKEFORMATTER_ACTION_ID);
|
||||||
connect(m_formatFile, &QAction::triggered, this, &CMakeFormatter::formatFile);
|
connect(m_formatFile, &QAction::triggered, this, &CMakeFormatter::formatFile);
|
||||||
|
|
||||||
|
|||||||
@@ -1613,7 +1613,7 @@ void DebuggerPluginPrivate::attachToRunningApplication()
|
|||||||
kitChooser->setShowIcons(true);
|
kitChooser->setShowIcons(true);
|
||||||
|
|
||||||
auto dlg = new DeviceProcessesDialog(kitChooser, ICore::dialogParent());
|
auto dlg = new DeviceProcessesDialog(kitChooser, ICore::dialogParent());
|
||||||
dlg->addAcceptButton(DeviceProcessesDialog::tr("&Attach to Process"));
|
dlg->addAcceptButton(Tr::tr("&Attach to Process"));
|
||||||
dlg->showAllDevices();
|
dlg->showAllDevices();
|
||||||
if (dlg->exec() == QDialog::Rejected) {
|
if (dlg->exec() == QDialog::Rejected) {
|
||||||
delete dlg;
|
delete dlg;
|
||||||
@@ -2261,7 +2261,7 @@ bool wantRunTool(ToolMode toolMode, const QString &toolName)
|
|||||||
|
|
||||||
QAction *createStartAction()
|
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->setIcon(ProjectExplorer::Icons::ANALYZER_START_SMALL_TOOLBAR.icon());
|
||||||
action->setEnabled(true);
|
action->setEnabled(true);
|
||||||
return action;
|
return action;
|
||||||
@@ -2269,7 +2269,7 @@ QAction *createStartAction()
|
|||||||
|
|
||||||
QAction *createStopAction()
|
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->setIcon(Utils::Icons::STOP_SMALL_TOOLBAR.icon());
|
||||||
action->setEnabled(true);
|
action->setEnabled(true);
|
||||||
return action;
|
return action;
|
||||||
|
|||||||
@@ -113,19 +113,20 @@ GerritPushDialog::GerritPushDialog(const Utils::FilePath &workingDir, const QStr
|
|||||||
, m_remoteComboBox(new GerritRemoteChooser)
|
, m_remoteComboBox(new GerritRemoteChooser)
|
||||||
, m_targetBranchComboBox(new QComboBox)
|
, m_targetBranchComboBox(new QComboBox)
|
||||||
, m_commitView(new LogChangeWidget)
|
, 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_topicLineEdit(new QLineEdit)
|
||||||
, m_draftCheckBox(new QCheckBox(tr("&Draft/private")))
|
, m_draftCheckBox(new QCheckBox(::Git::Tr::tr("&Draft/private")))
|
||||||
, m_wipCheckBox(new QCheckBox(tr("&Work-in-progress")))
|
, m_wipCheckBox(new QCheckBox(::Git::Tr::tr("&Work-in-progress")))
|
||||||
, m_reviewersLineEdit(new QLineEdit)
|
, m_reviewersLineEdit(new QLineEdit)
|
||||||
, m_buttonBox(new QDialogButtonBox)
|
, m_buttonBox(new QDialogButtonBox)
|
||||||
, m_workingDir(workingDir)
|
, 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"
|
"Unchecked - Remove mark.\n"
|
||||||
"Partially checked - Do not change current state."));
|
"Partially checked - Do not change current state."));
|
||||||
m_commitView->setToolTip(tr("Pushes the selected commit and all dependent commits."));
|
m_commitView->setToolTip(::Git::Tr::tr(
|
||||||
m_reviewersLineEdit->setToolTip(tr("Comma-separated list of reviewers.\n"
|
"Pushes the selected commit and all dependent commits."));
|
||||||
|
m_reviewersLineEdit->setToolTip(::Git::Tr::tr("Comma-separated list of reviewers.\n"
|
||||||
"\n"
|
"\n"
|
||||||
"Reviewers can be specified by nickname or email address. Spaces not allowed.\n"
|
"Reviewers can be specified by nickname or email address. Spaces not allowed.\n"
|
||||||
"\n"
|
"\n"
|
||||||
@@ -138,14 +139,14 @@ GerritPushDialog::GerritPushDialog(const Utils::FilePath &workingDir, const QStr
|
|||||||
using namespace Utils::Layouting;
|
using namespace Utils::Layouting;
|
||||||
|
|
||||||
Grid {
|
Grid {
|
||||||
tr("Push:"), workingDir.toUserOutput(), m_localBranchComboBox, br,
|
::Git::Tr::tr("Push:"), workingDir.toUserOutput(), m_localBranchComboBox, br,
|
||||||
tr("To:"), m_remoteComboBox, m_targetBranchComboBox, br,
|
::Git::Tr::tr("To:"), m_remoteComboBox, m_targetBranchComboBox, br,
|
||||||
tr("Commits:"), br,
|
::Git::Tr::tr("Commits:"), br,
|
||||||
Span(3, m_commitView), br,
|
Span(3, m_commitView), br,
|
||||||
Span(3, m_infoLabel), br,
|
Span(3, m_infoLabel), br,
|
||||||
Span(3, Form {
|
Span(3, Form {
|
||||||
tr("&Topic:"), Row { m_topicLineEdit, m_draftCheckBox, m_wipCheckBox }, br,
|
::Git::Tr::tr("&Topic:"), Row { m_topicLineEdit, m_draftCheckBox, m_wipCheckBox }, br,
|
||||||
tr("&Reviewers:"), m_reviewersLineEdit, br
|
::Git::Tr::tr("&Reviewers:"), m_reviewersLineEdit, br
|
||||||
}), br,
|
}), br,
|
||||||
Span(3, m_buttonBox)
|
Span(3, m_buttonBox)
|
||||||
}.attachTo(this);
|
}.attachTo(this);
|
||||||
@@ -220,7 +221,8 @@ void GerritPushDialog::setChangeRange()
|
|||||||
}
|
}
|
||||||
m_infoLabel->show();
|
m_infoLabel->show();
|
||||||
const QString remote = selectedRemoteName() + '/' + remoteBranchName;
|
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();
|
const int currentRange = range.toInt();
|
||||||
QPalette palette = QApplication::palette();
|
QPalette palette = QApplication::palette();
|
||||||
if (currentRange > ReasonableDistance) {
|
if (currentRange > ReasonableDistance) {
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ using namespace Internal;
|
|||||||
|
|
||||||
static QString msgProgress(int progress, int total)
|
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,
|
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) {
|
if (settings.prompToStopRunControl) {
|
||||||
QStringList names = Utils::transform(toStop, &RunControl::displayName);
|
QStringList names = Utils::transform(toStop, &RunControl::displayName);
|
||||||
if (QMessageBox::question(ICore::dialogParent(),
|
if (QMessageBox::question(ICore::dialogParent(),
|
||||||
BuildManager::tr("Stop Applications"),
|
Tr::tr("Stop Applications"),
|
||||||
BuildManager::tr("Stop these applications before building?")
|
Tr::tr("Stop these applications before building?")
|
||||||
+ "\n\n" + names.join('\n'))
|
+ "\n\n" + names.join('\n'))
|
||||||
== QMessageBox::No) {
|
== QMessageBox::No) {
|
||||||
stopThem = false;
|
stopThem = false;
|
||||||
@@ -156,7 +156,7 @@ static int queue(const QList<Project *> &projects, const QList<Id> &stepIds,
|
|||||||
for (const Project *pro : projects) {
|
for (const Project *pro : projects) {
|
||||||
if (pro && pro->needsConfiguration()) {
|
if (pro && pro->needsConfiguration()) {
|
||||||
preambleMessage.append(
|
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'));
|
.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)) {
|
if (device && !device->prepareForBuild(t)) {
|
||||||
preambleMessage.append(
|
preambleMessage.append(
|
||||||
BuildManager::tr("The build device failed to prepare for the build of %1 "
|
Tr::tr("The build device failed to prepare for the build of %1 (%2).")
|
||||||
"(%2).")
|
|
||||||
.arg(pro->displayName())
|
.arg(pro->displayName())
|
||||||
.arg(t->displayName())
|
.arg(t->displayName())
|
||||||
+ QLatin1Char('\n'));
|
+ QLatin1Char('\n'));
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ namespace Internal {
|
|||||||
DeviceSettingsPage::DeviceSettingsPage()
|
DeviceSettingsPage::DeviceSettingsPage()
|
||||||
{
|
{
|
||||||
setId(Constants::DEVICE_SETTINGS_PAGE_ID);
|
setId(Constants::DEVICE_SETTINGS_PAGE_ID);
|
||||||
setDisplayName(DeviceSettingsWidget::tr("Devices"));
|
setDisplayName(Tr::tr("Devices"));
|
||||||
setCategory(Constants::DEVICE_SETTINGS_CATEGORY);
|
setCategory(Constants::DEVICE_SETTINGS_CATEGORY);
|
||||||
setDisplayCategory(Tr::tr("Devices"));
|
setDisplayCategory(Tr::tr("Devices"));
|
||||||
setCategoryIconPath(":/projectexplorer/images/settingscategory_devices.png");
|
setCategoryIconPath(":/projectexplorer/images/settingscategory_devices.png");
|
||||||
|
|||||||
@@ -214,9 +214,9 @@ ProcessResultData FileTransfer::resultData() const
|
|||||||
QString FileTransfer::transferMethodName(FileTransferMethod method)
|
QString FileTransfer::transferMethodName(FileTransferMethod method)
|
||||||
{
|
{
|
||||||
switch (method) {
|
switch (method) {
|
||||||
case FileTransferMethod::Sftp: return FileTransfer::tr("sftp");
|
case FileTransferMethod::Sftp: return Tr::tr("sftp");
|
||||||
case FileTransferMethod::Rsync: return FileTransfer::tr("rsync");
|
case FileTransferMethod::Rsync: return Tr::tr("rsync");
|
||||||
case FileTransferMethod::GenericCopy: return FileTransfer::tr("generic file copy");
|
case FileTransferMethod::GenericCopy: return Tr::tr("generic file copy");
|
||||||
}
|
}
|
||||||
QTC_CHECK(false);
|
QTC_CHECK(false);
|
||||||
return {};
|
return {};
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
#include <utils/stringutils.h>
|
#include <utils/stringutils.h>
|
||||||
#include <utils/tooltip/tooltip.h>
|
#include <utils/tooltip/tooltip.h>
|
||||||
|
#include <utils/utilstr.h>
|
||||||
|
|
||||||
#include <QDialogButtonBox>
|
#include <QDialogButtonBox>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
@@ -375,7 +376,7 @@ void EnvironmentWidget::updateSummaryText()
|
|||||||
|
|
||||||
QString text;
|
QString text;
|
||||||
for (const Utils::EnvironmentItem &item : std::as_const(list)) {
|
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())
|
if (!d->m_baseEnvironmentText.isEmpty() || !text.isEmpty())
|
||||||
text.append(QLatin1String("<br>"));
|
text.append(QLatin1String("<br>"));
|
||||||
switch (item.operation) {
|
switch (item.operation) {
|
||||||
|
|||||||
@@ -92,9 +92,9 @@ public:
|
|||||||
{
|
{
|
||||||
if (pattern.pattern().isEmpty() || !pattern.isValid())
|
if (pattern.pattern().isEmpty() || !pattern.isValid())
|
||||||
return;
|
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.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; });
|
[this] { return m_currentInput; });
|
||||||
m_expander.registerSubProvider([expander]() -> MacroExpander * { return expander; });
|
m_expander.registerSubProvider([expander]() -> MacroExpander * { return expander; });
|
||||||
setValidationFunction([this, pattern](FancyLineEdit *, QString *) {
|
setValidationFunction([this, pattern](FancyLineEdit *, QString *) {
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
#include <utils/macroexpander.h>
|
#include <utils/macroexpander.h>
|
||||||
#include <utils/qtcprocess.h>
|
#include <utils/qtcprocess.h>
|
||||||
#include <utils/theme/theme.h>
|
#include <utils/theme/theme.h>
|
||||||
|
#include <utils/utilstr.h>
|
||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
|
|
||||||
@@ -156,7 +157,7 @@ static QString invalidCommandMessage(const QString &displayName)
|
|||||||
{
|
{
|
||||||
return QString("<b>%1:</b> <font color='%3'>%2</font>")
|
return QString("<b>%1:</b> <font color='%3'>%2</font>")
|
||||||
.arg(displayName,
|
.arg(displayName,
|
||||||
QtcProcess::tr("Invalid command"),
|
::Utils::Tr::tr("Invalid command"),
|
||||||
creatorTheme()->color(Theme::TextColorError).name());
|
creatorTheme()->color(Theme::TextColorError).name());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1568,7 +1568,7 @@ void RunWorkerPrivate::timerEvent(QTimerEvent *ev)
|
|||||||
killStartWatchdog();
|
killStartWatchdog();
|
||||||
startWatchdogCallback();
|
startWatchdogCallback();
|
||||||
} else {
|
} else {
|
||||||
q->reportFailure(RunWorker::tr("Worker start timed out."));
|
q->reportFailure(Tr::tr("Worker start timed out."));
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1577,7 +1577,7 @@ void RunWorkerPrivate::timerEvent(QTimerEvent *ev)
|
|||||||
killStopWatchdog();
|
killStopWatchdog();
|
||||||
stopWatchdogCallback();
|
stopWatchdogCallback();
|
||||||
} else {
|
} else {
|
||||||
q->reportFailure(RunWorker::tr("Worker stop timed out."));
|
q->reportFailure(Tr::tr("Worker stop timed out."));
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -599,7 +599,7 @@ QString SessionManagerPrivate::sessionTitle(const FilePath &filePath)
|
|||||||
} else {
|
} else {
|
||||||
QString sessionName = d->m_sessionName;
|
QString sessionName = d->m_sessionName;
|
||||||
if (sessionName.isEmpty())
|
if (sessionName.isEmpty())
|
||||||
sessionName = SessionManager::tr("Untitled");
|
sessionName = Tr::tr("Untitled");
|
||||||
return sessionName;
|
return sessionName;
|
||||||
}
|
}
|
||||||
return QString();
|
return QString();
|
||||||
@@ -935,11 +935,11 @@ void SessionManagerPrivate::askUserAboutFailedProjects()
|
|||||||
if (!failedProjects.isEmpty()) {
|
if (!failedProjects.isEmpty()) {
|
||||||
QString fileList = FilePath::formatFilePaths(failedProjects, "<br>");
|
QString fileList = FilePath::formatFilePaths(failedProjects, "<br>");
|
||||||
QMessageBox box(QMessageBox::Warning,
|
QMessageBox box(QMessageBox::Warning,
|
||||||
SessionManager::tr("Failed to restore project files"),
|
Tr::tr("Failed to restore project files"),
|
||||||
SessionManager::tr("Could not restore the following project files:<br><b>%1</b>").
|
Tr::tr("Could not restore the following project files:<br><b>%1</b>").
|
||||||
arg(fileList));
|
arg(fileList));
|
||||||
auto keepButton = new QPushButton(SessionManager::tr("Keep projects in Session"), &box);
|
auto keepButton = new QPushButton(Tr::tr("Keep projects in Session"), &box);
|
||||||
auto removeButton = new QPushButton(SessionManager::tr("Remove projects from Session"), &box);
|
auto removeButton = new QPushButton(Tr::tr("Remove projects from Session"), &box);
|
||||||
box.addButton(keepButton, QMessageBox::AcceptRole);
|
box.addButton(keepButton, QMessageBox::AcceptRole);
|
||||||
box.addButton(removeButton, QMessageBox::DestructiveRole);
|
box.addButton(removeButton, QMessageBox::DestructiveRole);
|
||||||
|
|
||||||
|
|||||||
@@ -206,8 +206,7 @@ void ProjectExplorerPlugin::testXcodebuildParserParsing_data()
|
|||||||
<< OutputParserTester::STDERR
|
<< OutputParserTester::STDERR
|
||||||
<< QString() << QString()
|
<< QString() << QString()
|
||||||
<< (Tasks()
|
<< (Tasks()
|
||||||
<< CompileTask(Task::Error,
|
<< CompileTask(Task::Error, Tr::tr("Xcodebuild failed.")))
|
||||||
XcodebuildParser::tr("Xcodebuild failed.")))
|
|
||||||
<< QString()
|
<< QString()
|
||||||
<< XcodebuildParser::UnknownXcodebuildState;
|
<< XcodebuildParser::UnknownXcodebuildState;
|
||||||
|
|
||||||
@@ -219,8 +218,7 @@ void ProjectExplorerPlugin::testXcodebuildParserParsing_data()
|
|||||||
<< OutputParserTester::STDERR
|
<< OutputParserTester::STDERR
|
||||||
<< QString() << QString::fromLatin1("outErr\n")
|
<< QString() << QString::fromLatin1("outErr\n")
|
||||||
<< (Tasks()
|
<< (Tasks()
|
||||||
<< CompileTask(Task::Error,
|
<< CompileTask(Task::Error, Tr::tr("Xcodebuild failed.")))
|
||||||
XcodebuildParser::tr("Xcodebuild failed.")))
|
|
||||||
<< QString()
|
<< QString()
|
||||||
<< XcodebuildParser::UnknownXcodebuildState;
|
<< XcodebuildParser::UnknownXcodebuildState;
|
||||||
|
|
||||||
@@ -230,8 +228,7 @@ void ProjectExplorerPlugin::testXcodebuildParserParsing_data()
|
|||||||
<< QString() << QString()
|
<< QString() << QString()
|
||||||
<< (Tasks()
|
<< (Tasks()
|
||||||
<< CompileTask(Task::Warning,
|
<< CompileTask(Task::Warning,
|
||||||
XcodebuildParser::tr("Replacing signature"),
|
Tr::tr("Replacing signature"), "/somepath/somefile.app"))
|
||||||
"/somepath/somefile.app"))
|
|
||||||
<< QString()
|
<< QString()
|
||||||
<< XcodebuildParser::InXcodebuild;
|
<< XcodebuildParser::InXcodebuild;
|
||||||
|
|
||||||
|
|||||||
@@ -238,9 +238,9 @@ public:
|
|||||||
uiQmlOpenComboBox->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred);
|
uiQmlOpenComboBox->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred);
|
||||||
uiQmlOpenComboBox->setSizeAdjustPolicy(QComboBox::QComboBox::AdjustToContents);
|
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);
|
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->setChecked(s.qmllsSettigs().useLatestQmlls);
|
||||||
useLatestQmlls->setEnabled(s.qmllsSettigs().useQmlls);
|
useLatestQmlls->setEnabled(s.qmllsSettigs().useQmlls);
|
||||||
QObject::connect(useQmlls, &QCheckBox::stateChanged, this, [this](int checked) {
|
QObject::connect(useQmlls, &QCheckBox::stateChanged, this, [this](int checked) {
|
||||||
@@ -276,7 +276,7 @@ public:
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
Group{
|
Group{
|
||||||
title(tr("Language Server")),
|
title(Tr::tr("Language Server")),
|
||||||
Column{useQmlls, useLatestQmlls},
|
Column{useQmlls, useLatestQmlls},
|
||||||
},
|
},
|
||||||
st,
|
st,
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
|
|
||||||
#include "qmllsclient.h"
|
#include "qmllsclient.h"
|
||||||
|
|
||||||
|
#include "qmljseditortr.h"
|
||||||
|
|
||||||
#include <languageclient/languageclientinterface.h>
|
#include <languageclient/languageclientinterface.h>
|
||||||
#include <languageclient/languageclientmanager.h>
|
#include <languageclient/languageclientmanager.h>
|
||||||
|
|
||||||
@@ -47,7 +49,7 @@ QmllsClient *QmllsClient::clientForQmlls(const FilePath &qmlls)
|
|||||||
auto interface = new StdIOClientInterface;
|
auto interface = new StdIOClientInterface;
|
||||||
interface->setCommandLine(CommandLine(qmlls));
|
interface->setCommandLine(CommandLine(qmlls));
|
||||||
auto client = new QmllsClient(interface);
|
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);
|
client->setActivateDocumentAutomatically(true);
|
||||||
LanguageFilter filter;
|
LanguageFilter filter;
|
||||||
using namespace QmlJSTools::Constants;
|
using namespace QmlJSTools::Constants;
|
||||||
|
|||||||
@@ -23,12 +23,14 @@
|
|||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <tracing/timelineformattime.h>
|
|
||||||
#include "quick3dframemodel.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 QmlProfiler {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
@@ -234,19 +236,19 @@ QVariant Quick3DFrameModel::headerData(int section, Qt::Orientation orientation,
|
|||||||
case Qt::DisplayRole:
|
case Qt::DisplayRole:
|
||||||
switch (section) {
|
switch (section) {
|
||||||
case Frame:
|
case Frame:
|
||||||
result = QVariant::fromValue(tr("Frame"));
|
result = QVariant::fromValue(Tr::tr("Frame"));
|
||||||
break;
|
break;
|
||||||
case Duration:
|
case Duration:
|
||||||
result = QVariant::fromValue(tr("Duration"));
|
result = QVariant::fromValue(Tr::tr("Duration"));
|
||||||
break;
|
break;
|
||||||
case Timestamp:
|
case Timestamp:
|
||||||
result = QVariant::fromValue(tr("Timestamp"));
|
result = QVariant::fromValue(Tr::tr("Timestamp"));
|
||||||
break;
|
break;
|
||||||
case FrameDelta:
|
case FrameDelta:
|
||||||
result = QVariant::fromValue(tr("Frame Delta"));
|
result = QVariant::fromValue(Tr::tr("Frame Delta"));
|
||||||
break;
|
break;
|
||||||
case View3D:
|
case View3D:
|
||||||
result = QVariant::fromValue(tr("View3D"));
|
result = QVariant::fromValue(Tr::tr("View3D"));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -441,7 +443,7 @@ QList<int> Quick3DFrameModel::frameIndices(const QString &view3DFilter) const
|
|||||||
{
|
{
|
||||||
QList<int> ret;
|
QList<int> ret;
|
||||||
int key = -1;
|
int key = -1;
|
||||||
if (view3DFilter != tr("All")) {
|
if (view3DFilter != Tr::tr("All")) {
|
||||||
for (int v3d : m_frameTimes.keys()) {
|
for (int v3d : m_frameTimes.keys()) {
|
||||||
if (m_modelManager->eventType(m_eventData[v3d]).data() == view3DFilter) {
|
if (m_modelManager->eventType(m_eventData[v3d]).data() == view3DFilter) {
|
||||||
key = v3d;
|
key = v3d;
|
||||||
@@ -463,17 +465,17 @@ QStringList Quick3DFrameModel::frameNames(const QString &view3D) const
|
|||||||
QStringList ret;
|
QStringList ret;
|
||||||
for (auto index : indices) {
|
for (auto index : indices) {
|
||||||
const Item &item = m_data[index];
|
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;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Quick3DFrameModel::setFilterFrame(const QString &frame)
|
void Quick3DFrameModel::setFilterFrame(const QString &frame)
|
||||||
{
|
{
|
||||||
if (frame == tr("None")) {
|
if (frame == Tr::tr("None")) {
|
||||||
m_filterFrame = -1;
|
m_filterFrame = -1;
|
||||||
} else {
|
} else {
|
||||||
QString title = tr("Frame");
|
QString title = Tr::tr("Frame");
|
||||||
QString number = frame.right(frame.length() - title.length());
|
QString number = frame.right(frame.length() - title.length());
|
||||||
m_filterFrame = number.toInt();
|
m_filterFrame = number.toInt();
|
||||||
}
|
}
|
||||||
@@ -482,7 +484,7 @@ void Quick3DFrameModel::setFilterFrame(const QString &frame)
|
|||||||
void Quick3DFrameModel::setFilterView3D(const QString &view3D)
|
void Quick3DFrameModel::setFilterView3D(const QString &view3D)
|
||||||
{
|
{
|
||||||
int key = -1;
|
int key = -1;
|
||||||
if (view3D != tr("All")) {
|
if (view3D != Tr::tr("All")) {
|
||||||
for (int v3d : m_frameTimes.keys()) {
|
for (int v3d : m_frameTimes.keys()) {
|
||||||
if (m_modelManager->eventType(m_eventData[v3d]).data() == view3D) {
|
if (m_modelManager->eventType(m_eventData[v3d]).data() == view3D) {
|
||||||
key = v3d;
|
key = v3d;
|
||||||
|
|||||||
@@ -25,6 +25,8 @@
|
|||||||
|
|
||||||
#include "quick3dframeview.h"
|
#include "quick3dframeview.h"
|
||||||
|
|
||||||
|
#include "qmlprofilertr.h"
|
||||||
|
|
||||||
#include <coreplugin/minisplitter.h>
|
#include <coreplugin/minisplitter.h>
|
||||||
|
|
||||||
#include <QHeaderView>
|
#include <QHeaderView>
|
||||||
@@ -41,7 +43,7 @@ Quick3DFrameView::Quick3DFrameView(QmlProfilerModelManager *profilerModelManager
|
|||||||
: QmlProfilerEventsView(parent)
|
: QmlProfilerEventsView(parent)
|
||||||
{
|
{
|
||||||
setObjectName(QLatin1String("QmlProfiler.Quick3DFrame.Dock"));
|
setObjectName(QLatin1String("QmlProfiler.Quick3DFrame.Dock"));
|
||||||
setWindowTitle(tr("Quick3D Frame"));
|
setWindowTitle(Tr::tr("Quick3D Frame"));
|
||||||
|
|
||||||
auto model = new Quick3DFrameModel(profilerModelManager);
|
auto model = new Quick3DFrameModel(profilerModelManager);
|
||||||
m_mainView.reset(new Quick3DMainView(model, false, this));
|
m_mainView.reset(new Quick3DMainView(model, false, this));
|
||||||
@@ -65,8 +67,8 @@ Quick3DFrameView::Quick3DFrameView(QmlProfilerModelManager *profilerModelManager
|
|||||||
auto view3DComboModel = new QStringListModel(this);
|
auto view3DComboModel = new QStringListModel(this);
|
||||||
auto frameComboBox = new QComboBox(this);
|
auto frameComboBox = new QComboBox(this);
|
||||||
auto frameComboModel = new QStringListModel(this);
|
auto frameComboModel = new QStringListModel(this);
|
||||||
auto selectView3DLabel = new QLabel(tr("Select View3D"), this);
|
auto selectView3DLabel = new QLabel(Tr::tr("Select View3D"), this);
|
||||||
auto selectFrameLabel = new QLabel(tr("Compare Frame"), this);
|
auto selectFrameLabel = new QLabel(Tr::tr("Compare Frame"), this);
|
||||||
view3DComboBox->setModel(view3DComboModel);
|
view3DComboBox->setModel(view3DComboModel);
|
||||||
frameComboBox->setModel(frameComboModel);
|
frameComboBox->setModel(frameComboModel);
|
||||||
hFrameLayout->addWidget(selectView3DLabel);
|
hFrameLayout->addWidget(selectView3DLabel);
|
||||||
@@ -79,19 +81,19 @@ Quick3DFrameView::Quick3DFrameView(QmlProfilerModelManager *profilerModelManager
|
|||||||
groupLayout->addLayout(hMainLayout);
|
groupLayout->addLayout(hMainLayout);
|
||||||
connect(model, &Quick3DFrameModel::modelReset, [model, view3DComboModel, frameComboModel](){
|
connect(model, &Quick3DFrameModel::modelReset, [model, view3DComboModel, frameComboModel](){
|
||||||
QStringList list;
|
QStringList list;
|
||||||
list << tr("All");
|
list << Tr::tr("All");
|
||||||
list << model->view3DNames();
|
list << model->view3DNames();
|
||||||
view3DComboModel->setStringList(list);
|
view3DComboModel->setStringList(list);
|
||||||
list.clear();
|
list.clear();
|
||||||
list << tr("None");
|
list << Tr::tr("None");
|
||||||
list << model->frameNames(tr("All"));
|
list << model->frameNames(Tr::tr("All"));
|
||||||
frameComboModel->setStringList(list);
|
frameComboModel->setStringList(list);
|
||||||
});
|
});
|
||||||
connect(view3DComboBox, &QComboBox::currentTextChanged, [this, model, frameComboModel](const QString &text){
|
connect(view3DComboBox, &QComboBox::currentTextChanged, [this, model, frameComboModel](const QString &text){
|
||||||
m_mainView->setFilterView3D(text);
|
m_mainView->setFilterView3D(text);
|
||||||
model->setFilterView3D(text);
|
model->setFilterView3D(text);
|
||||||
QStringList list;
|
QStringList list;
|
||||||
list << tr("None");
|
list << Tr::tr("None");
|
||||||
list << model->frameNames(text);
|
list << model->frameNames(text);
|
||||||
frameComboModel->setStringList(list);
|
frameComboModel->setStringList(list);
|
||||||
});
|
});
|
||||||
@@ -158,7 +160,7 @@ Quick3DMainView::Quick3DMainView(Quick3DFrameModel *model, bool compareView, QWi
|
|||||||
|
|
||||||
void Quick3DMainView::setFilterView3D(const QString &objectName)
|
void Quick3DMainView::setFilterView3D(const QString &objectName)
|
||||||
{
|
{
|
||||||
if (objectName == tr("All"))
|
if (objectName == Tr::tr("All"))
|
||||||
m_sortModel->setFilterFixedString("");
|
m_sortModel->setFilterFixedString("");
|
||||||
else
|
else
|
||||||
m_sortModel->setFilterFixedString(objectName);
|
m_sortModel->setFilterFixedString(objectName);
|
||||||
|
|||||||
@@ -166,8 +166,8 @@ QVariantMap Quick3DModel::details(int index) const
|
|||||||
if ((detailType == RenderPass || detailType == PrepareFrame) && m_data[index].data) {
|
if ((detailType == RenderPass || detailType == PrepareFrame) && m_data[index].data) {
|
||||||
quint32 width = m_data[index].data & 0xffffffff;
|
quint32 width = m_data[index].data & 0xffffffff;
|
||||||
quint32 height = m_data[index].data >> 32;
|
quint32 height = m_data[index].data >> 32;
|
||||||
result.insert(tr("Width"), width);
|
result.insert(Tr::tr("Width"), width);
|
||||||
result.insert(tr("Height"), height);
|
result.insert(Tr::tr("Height"), height);
|
||||||
}
|
}
|
||||||
if ((detailType >= MeshLoad && detailType <= TextureLoad)
|
if ((detailType >= MeshLoad && detailType <= TextureLoad)
|
||||||
|| (detailType >= MeshMemoryConsumption && detailType <= TextureMemoryConsumption)) {
|
|| (detailType >= MeshMemoryConsumption && detailType <= TextureMemoryConsumption)) {
|
||||||
@@ -176,9 +176,9 @@ QVariantMap Quick3DModel::details(int index) const
|
|||||||
if (detailType == RenderCall) {
|
if (detailType == RenderCall) {
|
||||||
quint32 primitives = m_data[index].data & 0xffffffff;
|
quint32 primitives = m_data[index].data & 0xffffffff;
|
||||||
quint32 instances = m_data[index].data >> 32;
|
quint32 instances = m_data[index].data >> 32;
|
||||||
result.insert(tr("Primitives"), primitives);
|
result.insert(Tr::tr("Primitives"), primitives);
|
||||||
if (instances > 1)
|
if (instances > 1)
|
||||||
result.insert(tr("Instances"), instances);
|
result.insert(Tr::tr("Instances"), instances);
|
||||||
}
|
}
|
||||||
if (!m_data[index].eventData.isEmpty()) {
|
if (!m_data[index].eventData.isEmpty()) {
|
||||||
for (int i = 0; i < m_data[index].eventData.size(); i++) {
|
for (int i = 0; i < m_data[index].eventData.size(); i++) {
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
|
|
||||||
#include <debugger/debuggerkitinformation.h>
|
#include <debugger/debuggerkitinformation.h>
|
||||||
#include <debugger/debuggerruncontrol.h>
|
#include <debugger/debuggerruncontrol.h>
|
||||||
|
#include <debugger/debuggertr.h>
|
||||||
|
|
||||||
#include <projectexplorer/devicesupport/deviceprocessesdialog.h>
|
#include <projectexplorer/devicesupport/deviceprocessesdialog.h>
|
||||||
#include <projectexplorer/devicesupport/deviceusedportsgatherer.h>
|
#include <projectexplorer/devicesupport/deviceusedportsgatherer.h>
|
||||||
@@ -212,7 +213,7 @@ void showAttachToProcessDialog()
|
|||||||
});
|
});
|
||||||
|
|
||||||
QnxAttachDebugDialog dlg(kitChooser);
|
QnxAttachDebugDialog dlg(kitChooser);
|
||||||
dlg.addAcceptButton(DeviceProcessesDialog::tr("&Attach to Process"));
|
dlg.addAcceptButton(::Debugger::Tr::tr("&Attach to Process"));
|
||||||
dlg.showAllDevices();
|
dlg.showAllDevices();
|
||||||
if (dlg.exec() == QDialog::Rejected)
|
if (dlg.exec() == QDialog::Rejected)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -7,6 +7,8 @@
|
|||||||
|
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
|
|
||||||
|
#include <help/helptr.h>
|
||||||
|
|
||||||
#include <utils/fancylineedit.h>
|
#include <utils/fancylineedit.h>
|
||||||
#include <utils/layoutbuilder.h>
|
#include <utils/layoutbuilder.h>
|
||||||
#include <utils/styledbar.h>
|
#include <utils/styledbar.h>
|
||||||
@@ -45,7 +47,7 @@ BookmarkDialog::BookmarkDialog(BookmarkManager *manager, const QString &title,
|
|||||||
{
|
{
|
||||||
installEventFilter(this);
|
installEventFilter(this);
|
||||||
resize(450, 0);
|
resize(450, 0);
|
||||||
setWindowTitle(tr("Add Bookmark"));
|
setWindowTitle(::Help::Tr::tr("Add Bookmark"));
|
||||||
|
|
||||||
proxyModel = new QSortFilterProxyModel(this);
|
proxyModel = new QSortFilterProxyModel(this);
|
||||||
proxyModel->setFilterKeyColumn(0);
|
proxyModel->setFilterKeyColumn(0);
|
||||||
@@ -70,14 +72,14 @@ BookmarkDialog::BookmarkDialog(BookmarkManager *manager, const QString &title,
|
|||||||
treeViewSP.setVerticalStretch(1);
|
treeViewSP.setVerticalStretch(1);
|
||||||
m_treeView->setSizePolicy(treeViewSP);
|
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);
|
m_buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
|
||||||
|
|
||||||
using namespace Utils::Layouting;
|
using namespace Utils::Layouting;
|
||||||
Column {
|
Column {
|
||||||
Form {
|
Form {
|
||||||
tr("Bookmark:"), m_bookmarkEdit, br,
|
::Help::Tr::tr("Bookmark:"), m_bookmarkEdit, br,
|
||||||
tr("Add in folder:"), m_bookmarkFolders, br,
|
::Help::Tr::tr("Add in folder:"), m_bookmarkFolders, br,
|
||||||
},
|
},
|
||||||
Row { m_toolButton, hr },
|
Row { m_toolButton, hr },
|
||||||
m_treeView,
|
m_treeView,
|
||||||
@@ -172,7 +174,7 @@ void BookmarkDialog::itemChanged(QStandardItem *item)
|
|||||||
m_bookmarkFolders->clear();
|
m_bookmarkFolders->clear();
|
||||||
m_bookmarkFolders->addItems(bookmarkManager->bookmarkFolders());
|
m_bookmarkFolders->addItems(bookmarkManager->bookmarkFolders());
|
||||||
|
|
||||||
QString name = tr("Bookmarks");
|
QString name = ::Help::Tr::tr("Bookmarks");
|
||||||
const QModelIndex& index = m_treeView->currentIndex();
|
const QModelIndex& index = m_treeView->currentIndex();
|
||||||
if (index.isValid())
|
if (index.isValid())
|
||||||
name = index.data().toString();
|
name = index.data().toString();
|
||||||
@@ -188,7 +190,7 @@ void BookmarkDialog::textChanged(const QString& string)
|
|||||||
void BookmarkDialog::selectBookmarkFolder(int index)
|
void BookmarkDialog::selectBookmarkFolder(int index)
|
||||||
{
|
{
|
||||||
const QString folderName = m_bookmarkFolders->itemText(index);
|
const QString folderName = m_bookmarkFolders->itemText(index);
|
||||||
if (folderName == tr("Bookmarks")) {
|
if (folderName == ::Help::Tr::tr("Bookmarks")) {
|
||||||
m_treeView->clearSelection();
|
m_treeView->clearSelection();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -214,8 +216,8 @@ void BookmarkDialog::showContextMenu(const QPoint &point)
|
|||||||
|
|
||||||
QMenu menu(this);
|
QMenu menu(this);
|
||||||
|
|
||||||
QAction *removeItem = menu.addAction(tr("Delete Folder"));
|
QAction *removeItem = menu.addAction(::Help::Tr::tr("Delete Folder"));
|
||||||
QAction *renameItem = menu.addAction(tr("Rename Folder"));
|
QAction *renameItem = menu.addAction(::Help::Tr::tr("Rename Folder"));
|
||||||
|
|
||||||
QAction *picked = menu.exec(m_treeView->mapToGlobal(point));
|
QAction *picked = menu.exec(m_treeView->mapToGlobal(point));
|
||||||
if (!picked)
|
if (!picked)
|
||||||
@@ -227,7 +229,7 @@ void BookmarkDialog::showContextMenu(const QPoint &point)
|
|||||||
m_bookmarkFolders->clear();
|
m_bookmarkFolders->clear();
|
||||||
m_bookmarkFolders->addItems(bookmarkManager->bookmarkFolders());
|
m_bookmarkFolders->addItems(bookmarkManager->bookmarkFolders());
|
||||||
|
|
||||||
QString name = tr("Bookmarks");
|
QString name = ::Help::Tr::tr("Bookmarks");
|
||||||
index = m_treeView->currentIndex();
|
index = m_treeView->currentIndex();
|
||||||
if (index.isValid())
|
if (index.isValid())
|
||||||
name = index.data().toString();
|
name = index.data().toString();
|
||||||
@@ -244,7 +246,7 @@ void BookmarkDialog::showContextMenu(const QPoint &point)
|
|||||||
|
|
||||||
void BookmarkDialog::currentChanged(const QModelIndex ¤t)
|
void BookmarkDialog::currentChanged(const QModelIndex ¤t)
|
||||||
{
|
{
|
||||||
QString text = tr("Bookmarks");
|
QString text = ::Help::Tr::tr("Bookmarks");
|
||||||
if (current.isValid())
|
if (current.isValid())
|
||||||
text = current.data().toString();
|
text = current.data().toString();
|
||||||
m_bookmarkFolders->setCurrentIndex(m_bookmarkFolders->findText(text));
|
m_bookmarkFolders->setCurrentIndex(m_bookmarkFolders->findText(text));
|
||||||
@@ -275,7 +277,7 @@ bool BookmarkDialog::eventFilter(QObject *object, QEvent *e)
|
|||||||
m_bookmarkFolders->clear();
|
m_bookmarkFolders->clear();
|
||||||
m_bookmarkFolders->addItems(bookmarkManager->bookmarkFolders());
|
m_bookmarkFolders->addItems(bookmarkManager->bookmarkFolders());
|
||||||
|
|
||||||
QString name = tr("Bookmarks");
|
QString name = ::Help::Tr::tr("Bookmarks");
|
||||||
index = m_treeView->currentIndex();
|
index = m_treeView->currentIndex();
|
||||||
if (index.isValid())
|
if (index.isValid())
|
||||||
name = index.data().toString();
|
name = index.data().toString();
|
||||||
@@ -365,16 +367,16 @@ void BookmarkWidget::showContextMenu(const QPoint &point)
|
|||||||
QMenu menu(this);
|
QMenu menu(this);
|
||||||
QString data = index.data(Qt::UserRole + 10).toString();
|
QString data = index.data(Qt::UserRole + 10).toString();
|
||||||
if (data == QLatin1String("Folder")) {
|
if (data == QLatin1String("Folder")) {
|
||||||
removeItem = menu.addAction(tr("Delete Folder"));
|
removeItem = menu.addAction(::Help::Tr::tr("Delete Folder"));
|
||||||
renameItem = menu.addAction(tr("Rename Folder"));
|
renameItem = menu.addAction(::Help::Tr::tr("Rename Folder"));
|
||||||
} else {
|
} else {
|
||||||
showItem = menu.addAction(tr("Show Bookmark"));
|
showItem = menu.addAction(::Help::Tr::tr("Show Bookmark"));
|
||||||
if (m_isOpenInNewPageActionVisible)
|
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()) {
|
if (searchField->text().isEmpty()) {
|
||||||
menu.addSeparator();
|
menu.addSeparator();
|
||||||
removeItem = menu.addAction(tr("Delete Bookmark"));
|
removeItem = menu.addAction(::Help::Tr::tr("Delete Bookmark"));
|
||||||
renameItem = menu.addAction(tr("Rename Bookmark"));
|
renameItem = menu.addAction(::Help::Tr::tr("Rename Bookmark"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -603,7 +605,7 @@ void BookmarkManager::saveBookmarks()
|
|||||||
|
|
||||||
QStringList BookmarkManager::bookmarkFolders() const
|
QStringList BookmarkManager::bookmarkFolders() const
|
||||||
{
|
{
|
||||||
QStringList folders(tr("Bookmarks"));
|
QStringList folders(::Help::Tr::tr("Bookmarks"));
|
||||||
|
|
||||||
const QList<QStandardItem *> list = treeModel->findItems(QLatin1String("*"),
|
const QList<QStandardItem *> list = treeModel->findItems(QLatin1String("*"),
|
||||||
Qt::MatchWildcard | Qt::MatchRecursive,
|
Qt::MatchWildcard | Qt::MatchRecursive,
|
||||||
@@ -641,8 +643,8 @@ void BookmarkManager::removeBookmarkItem(QTreeView *treeView,
|
|||||||
if (item) {
|
if (item) {
|
||||||
QString data = index.data(Qt::UserRole + 10).toString();
|
QString data = index.data(Qt::UserRole + 10).toString();
|
||||||
if (data == QLatin1String("Folder") && item->rowCount() > 0) {
|
if (data == QLatin1String("Folder") && item->rowCount() > 0) {
|
||||||
int value = QMessageBox::question(treeView, tr("Remove"),
|
int value = QMessageBox::question(treeView, ::Help::Tr::tr("Remove"),
|
||||||
tr("Deleting a folder also removes its content.<br>"
|
::Help::Tr::tr("Deleting a folder also removes its content.<br>"
|
||||||
"Do you want to continue?"),
|
"Do you want to continue?"),
|
||||||
QMessageBox::Yes | QMessageBox::Cancel, QMessageBox::Cancel);
|
QMessageBox::Yes | QMessageBox::Cancel, QMessageBox::Cancel);
|
||||||
|
|
||||||
@@ -755,7 +757,7 @@ void BookmarkManager::setupBookmarkModels()
|
|||||||
|
|
||||||
QString BookmarkManager::uniqueFolderName() const
|
QString BookmarkManager::uniqueFolderName() const
|
||||||
{
|
{
|
||||||
QString folderName = tr("New Folder");
|
QString folderName = ::Help::Tr::tr("New Folder");
|
||||||
const QList<QStandardItem *> list = treeModel->findItems(folderName,
|
const QList<QStandardItem *> list = treeModel->findItems(folderName,
|
||||||
Qt::MatchContains | Qt::MatchRecursive,
|
Qt::MatchContains | Qt::MatchRecursive,
|
||||||
0);
|
0);
|
||||||
@@ -764,7 +766,7 @@ QString BookmarkManager::uniqueFolderName() const
|
|||||||
for (const QStandardItem *item : list)
|
for (const QStandardItem *item : list)
|
||||||
names << item->text();
|
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) {
|
for (int i = 1; i <= names.count(); ++i) {
|
||||||
folderName = folderNameBase.arg(i);
|
folderName = folderNameBase.arg(i);
|
||||||
if (!names.contains(folderName))
|
if (!names.contains(folderName))
|
||||||
|
|||||||
@@ -7,6 +7,8 @@
|
|||||||
#include <localhelpmanager.h>
|
#include <localhelpmanager.h>
|
||||||
#include <openpagesmanager.h>
|
#include <openpagesmanager.h>
|
||||||
|
|
||||||
|
#include <help/helptr.h>
|
||||||
|
|
||||||
#include <utils/navigationtreeview.h>
|
#include <utils/navigationtreeview.h>
|
||||||
|
|
||||||
#include <QFocusEvent>
|
#include <QFocusEvent>
|
||||||
@@ -106,10 +108,10 @@ void ContentWindow::showContextMenu(const QPoint &pos)
|
|||||||
contentModel->contentItemAt(m_contentWidget->currentIndex());
|
contentModel->contentItemAt(m_contentWidget->currentIndex());
|
||||||
|
|
||||||
QMenu menu;
|
QMenu menu;
|
||||||
QAction *curTab = menu.addAction(tr("Open Link"));
|
QAction *curTab = menu.addAction(::Help::Tr::tr("Open Link"));
|
||||||
QAction *newTab = 0;
|
QAction *newTab = 0;
|
||||||
if (m_isOpenInNewPageActionVisible)
|
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));
|
QAction *action = menu.exec(m_contentWidget->mapToGlobal(pos));
|
||||||
if (curTab == action)
|
if (curTab == action)
|
||||||
|
|||||||
@@ -3,8 +3,11 @@
|
|||||||
|
|
||||||
#include "topicchooser.h"
|
#include "topicchooser.h"
|
||||||
|
|
||||||
#include <utils/layoutbuilder.h>
|
#include "helptr.h"
|
||||||
|
|
||||||
#include <utils/fancylineedit.h>
|
#include <utils/fancylineedit.h>
|
||||||
|
#include <utils/layoutbuilder.h>
|
||||||
|
#include <utils/utilstr.h>
|
||||||
|
|
||||||
#include <QMap>
|
#include <QMap>
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
@@ -21,7 +24,7 @@ TopicChooser::TopicChooser(QWidget *parent, const QString &keyword,
|
|||||||
, m_filterModel(new QSortFilterProxyModel(this))
|
, m_filterModel(new QSortFilterProxyModel(this))
|
||||||
{
|
{
|
||||||
resize(400, 220);
|
resize(400, 220);
|
||||||
setWindowTitle(tr("Choose Topic"));
|
setWindowTitle(::Help::Tr::tr("Choose Topic"));
|
||||||
|
|
||||||
QStandardItemModel *model = new QStandardItemModel(this);
|
QStandardItemModel *model = new QStandardItemModel(this);
|
||||||
m_filterModel->setSourceModel(model);
|
m_filterModel->setSourceModel(model);
|
||||||
@@ -51,7 +54,7 @@ TopicChooser::TopicChooser(QWidget *parent, const QString &keyword,
|
|||||||
|
|
||||||
using namespace Utils::Layouting;
|
using namespace Utils::Layouting;
|
||||||
Column {
|
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_lineEdit,
|
||||||
m_listWidget,
|
m_listWidget,
|
||||||
buttonBox,
|
buttonBox,
|
||||||
|
|||||||
Reference in New Issue
Block a user