summaryrefslogtreecommitdiff
path: root/src/plugins/debugger
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2022-07-05 15:37:08 +0200
committerhjk <hjk@qt.io>2022-07-08 12:32:38 +0000
commit9894c6eaf079fd1e768271c3b6a0af8cc11de735 (patch)
treea9c7404ffaabad97cf303a54ff0ca5d256f9fe18 /src/plugins/debugger
parentbb3549a7210ce599ea353af52807144e455dc206 (diff)
downloadqt-creator-9894c6eaf079fd1e768271c3b6a0af8cc11de735.tar.gz
Debugger: Convert to Tr::tr
Change-Id: I5d2475c790851c68f9997ac6af72b5eaca58482d Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'src/plugins/debugger')
-rw-r--r--src/plugins/debugger/analyzer/analyzerrunconfigwidget.cpp12
-rw-r--r--src/plugins/debugger/analyzer/analyzerrunconfigwidget.h4
-rw-r--r--src/plugins/debugger/analyzer/detailederrorview.cpp5
-rw-r--r--src/plugins/debugger/analyzer/detailederrorview.h2
-rw-r--r--src/plugins/debugger/analyzer/diagnosticlocation.h2
-rw-r--r--src/plugins/debugger/analyzer/startremotedialog.cpp16
-rw-r--r--src/plugins/debugger/analyzer/startremotedialog.h4
-rw-r--r--src/plugins/debugger/breakhandler.cpp322
-rw-r--r--src/plugins/debugger/breakhandler.h18
-rw-r--r--src/plugins/debugger/breakpoint.cpp4
-rw-r--r--src/plugins/debugger/cdb/cdbengine.cpp27
-rw-r--r--src/plugins/debugger/cdb/cdbengine.h6
-rw-r--r--src/plugins/debugger/cdb/cdboptionspage.cpp45
-rw-r--r--src/plugins/debugger/commonoptionspage.cpp21
-rw-r--r--src/plugins/debugger/commonoptionspage.h6
-rw-r--r--src/plugins/debugger/console/console.cpp34
-rw-r--r--src/plugins/debugger/console/console.h10
-rw-r--r--src/plugins/debugger/console/consoleedit.cpp14
-rw-r--r--src/plugins/debugger/console/consoleedit.h6
-rw-r--r--src/plugins/debugger/console/consoleitem.cpp6
-rw-r--r--src/plugins/debugger/console/consoleitem.h9
-rw-r--r--src/plugins/debugger/console/consoleitemdelegate.cpp13
-rw-r--r--src/plugins/debugger/console/consoleitemdelegate.h8
-rw-r--r--src/plugins/debugger/console/consoleitemmodel.cpp12
-rw-r--r--src/plugins/debugger/console/consoleitemmodel.h6
-rw-r--r--src/plugins/debugger/console/consoleproxymodel.cpp7
-rw-r--r--src/plugins/debugger/console/consoleproxymodel.h6
-rw-r--r--src/plugins/debugger/console/consoleview.cpp8
-rw-r--r--src/plugins/debugger/console/consoleview.h8
-rw-r--r--src/plugins/debugger/debuggeractions.cpp264
-rw-r--r--src/plugins/debugger/debuggeractions.h10
-rw-r--r--src/plugins/debugger/debuggercore.h6
-rw-r--r--src/plugins/debugger/debuggerdialogs.cpp106
-rw-r--r--src/plugins/debugger/debuggerdialogs.h18
-rw-r--r--src/plugins/debugger/debuggerengine.cpp216
-rw-r--r--src/plugins/debugger/debuggericons.cpp7
-rw-r--r--src/plugins/debugger/debuggericons.h6
-rw-r--r--src/plugins/debugger/debuggeritem.cpp30
-rw-r--r--src/plugins/debugger/debuggeritemmanager.cpp66
-rw-r--r--src/plugins/debugger/debuggeritemmanager.h9
-rw-r--r--src/plugins/debugger/debuggerkitinformation.cpp45
-rw-r--r--src/plugins/debugger/debuggerkitinformation.h4
-rw-r--r--src/plugins/debugger/debuggermainwindow.cpp16
-rw-r--r--src/plugins/debugger/debuggerplugin.cpp241
-rw-r--r--src/plugins/debugger/debuggerplugin.h6
-rw-r--r--src/plugins/debugger/debuggerprotocol.cpp6
-rw-r--r--src/plugins/debugger/debuggerprotocol.h8
-rw-r--r--src/plugins/debugger/debuggerrunconfigurationaspect.cpp16
-rw-r--r--src/plugins/debugger/debuggerrunconfigurationaspect.h3
-rw-r--r--src/plugins/debugger/debuggerruncontrol.cpp56
-rw-r--r--src/plugins/debugger/debuggerruncontrol.h6
-rw-r--r--src/plugins/debugger/debuggersourcepathmappingwidget.cpp39
-rw-r--r--src/plugins/debugger/debuggersourcepathmappingwidget.h7
-rw-r--r--src/plugins/debugger/debuggertooltipmanager.cpp25
-rw-r--r--src/plugins/debugger/debuggertooltipmanager.h12
-rw-r--r--src/plugins/debugger/disassembleragent.cpp7
-rw-r--r--src/plugins/debugger/disassembleragent.h6
-rw-r--r--src/plugins/debugger/disassemblerlines.cpp7
-rw-r--r--src/plugins/debugger/disassemblerlines.h6
-rw-r--r--src/plugins/debugger/enginemanager.cpp35
-rw-r--r--src/plugins/debugger/enginemanager.h6
-rw-r--r--src/plugins/debugger/gdb/gdbengine.cpp227
-rw-r--r--src/plugins/debugger/gdb/gdbengine.h8
-rw-r--r--src/plugins/debugger/gdb/gdboptionspage.cpp25
-rw-r--r--src/plugins/debugger/imageviewer.cpp14
-rw-r--r--src/plugins/debugger/imageviewer.h6
-rw-r--r--src/plugins/debugger/lldb/lldbengine.cpp44
-rw-r--r--src/plugins/debugger/lldb/lldbengine.h6
-rw-r--r--src/plugins/debugger/loadcoredialog.cpp41
-rw-r--r--src/plugins/debugger/loadcoredialog.h8
-rw-r--r--src/plugins/debugger/localsandexpressionswindow.cpp6
-rw-r--r--src/plugins/debugger/localsandexpressionswindow.h6
-rw-r--r--src/plugins/debugger/logwindow.cpp31
-rw-r--r--src/plugins/debugger/logwindow.h10
-rw-r--r--src/plugins/debugger/memoryagent.cpp15
-rw-r--r--src/plugins/debugger/memoryagent.h8
-rw-r--r--src/plugins/debugger/moduleshandler.cpp81
-rw-r--r--src/plugins/debugger/moduleshandler.h6
-rw-r--r--src/plugins/debugger/outputcollector.cpp14
-rw-r--r--src/plugins/debugger/outputcollector.h12
-rw-r--r--src/plugins/debugger/pdb/pdbengine.cpp37
-rw-r--r--src/plugins/debugger/pdb/pdbengine.h9
-rw-r--r--src/plugins/debugger/peripheralregisterhandler.cpp44
-rw-r--r--src/plugins/debugger/peripheralregisterhandler.h7
-rw-r--r--src/plugins/debugger/procinterrupt.h6
-rw-r--r--src/plugins/debugger/qml/interactiveinterpreter.cpp6
-rw-r--r--src/plugins/debugger/qml/interactiveinterpreter.h6
-rw-r--r--src/plugins/debugger/qml/qmlengine.cpp33
-rw-r--r--src/plugins/debugger/qml/qmlengine.h8
-rw-r--r--src/plugins/debugger/qml/qmlengineutils.cpp11
-rw-r--r--src/plugins/debugger/qml/qmlengineutils.h6
-rw-r--r--src/plugins/debugger/qml/qmlinspectoragent.cpp13
-rw-r--r--src/plugins/debugger/qml/qmlinspectoragent.h8
-rw-r--r--src/plugins/debugger/registerhandler.cpp52
-rw-r--r--src/plugins/debugger/registerhandler.h6
-rw-r--r--src/plugins/debugger/shared/cdbsymbolpathlisteditor.cpp43
-rw-r--r--src/plugins/debugger/shared/cdbsymbolpathlisteditor.h7
-rw-r--r--src/plugins/debugger/shared/symbolpathsdialog.cpp16
-rw-r--r--src/plugins/debugger/shared/symbolpathsdialog.h2
-rw-r--r--src/plugins/debugger/simplifytype.cpp6
-rw-r--r--src/plugins/debugger/simplifytype.h6
-rw-r--r--src/plugins/debugger/sourceagent.cpp6
-rw-r--r--src/plugins/debugger/sourceagent.h10
-rw-r--r--src/plugins/debugger/sourcefileshandler.cpp18
-rw-r--r--src/plugins/debugger/sourcefileshandler.h8
-rw-r--r--src/plugins/debugger/sourceutils.cpp6
-rw-r--r--src/plugins/debugger/sourceutils.h6
-rw-r--r--src/plugins/debugger/stackframe.cpp41
-rw-r--r--src/plugins/debugger/stackframe.h13
-rw-r--r--src/plugins/debugger/stackhandler.cpp47
-rw-r--r--src/plugins/debugger/stackhandler.h6
-rw-r--r--src/plugins/debugger/stackwindow.cpp8
-rw-r--r--src/plugins/debugger/stackwindow.h8
-rw-r--r--src/plugins/debugger/terminal.cpp22
-rw-r--r--src/plugins/debugger/threadshandler.cpp35
-rw-r--r--src/plugins/debugger/threadshandler.h10
-rw-r--r--src/plugins/debugger/unstartedappwatcherdialog.cpp35
-rw-r--r--src/plugins/debugger/unstartedappwatcherdialog.h6
-rw-r--r--src/plugins/debugger/uvsc/uvscclient.cpp16
-rw-r--r--src/plugins/debugger/uvsc/uvscclient.h6
-rw-r--r--src/plugins/debugger/uvsc/uvscengine.cpp89
-rw-r--r--src/plugins/debugger/uvsc/uvscengine.h11
-rw-r--r--src/plugins/debugger/watchdata.cpp6
-rw-r--r--src/plugins/debugger/watchdata.h6
-rw-r--r--src/plugins/debugger/watchdelegatewidgets.cpp6
-rw-r--r--src/plugins/debugger/watchdelegatewidgets.h7
-rw-r--r--src/plugins/debugger/watchhandler.cpp15
127 files changed, 1473 insertions, 1810 deletions
diff --git a/src/plugins/debugger/analyzer/analyzerrunconfigwidget.cpp b/src/plugins/debugger/analyzer/analyzerrunconfigwidget.cpp
index 0c3479a61c..c21f86d4fc 100644
--- a/src/plugins/debugger/analyzer/analyzerrunconfigwidget.cpp
+++ b/src/plugins/debugger/analyzer/analyzerrunconfigwidget.cpp
@@ -26,6 +26,8 @@
#include "analyzerrunconfigwidget.h"
+#include "debuggertr.h"
+
#include <utils/detailswidget.h>
#include <utils/layoutbuilder.h>
@@ -42,10 +44,10 @@ AnalyzerRunConfigWidget::AnalyzerRunConfigWidget(ProjectExplorer::GlobalOrProjec
using namespace Layouting;
auto settingsCombo = new QComboBox;
- settingsCombo->addItem(tr("Global"));
- settingsCombo->addItem(tr("Custom"));
+ settingsCombo->addItem(Tr::tr("Global"));
+ settingsCombo->addItem(Tr::tr("Custom"));
- auto restoreButton = new QPushButton(tr("Restore Global"));
+ auto restoreButton = new QPushButton(Tr::tr("Restore Global"));
auto innerPane = new QWidget;
auto configWidget = aspect->projectSettings()->createConfigWidget();
@@ -72,8 +74,8 @@ AnalyzerRunConfigWidget::AnalyzerRunConfigWidget(ProjectExplorer::GlobalOrProjec
configWidget->setEnabled(isCustom);
restoreButton->setEnabled(isCustom);
details->setSummaryText(isCustom
- ? tr("Use Customized Settings")
- : tr("Use Global Settings"));
+ ? Tr::tr("Use Customized Settings")
+ : Tr::tr("Use Global Settings"));
};
chooseSettings(aspect->isUsingGlobalSettings() ? 0 : 1);
diff --git a/src/plugins/debugger/analyzer/analyzerrunconfigwidget.h b/src/plugins/debugger/analyzer/analyzerrunconfigwidget.h
index 3924dfc61b..0d199f0e1a 100644
--- a/src/plugins/debugger/analyzer/analyzerrunconfigwidget.h
+++ b/src/plugins/debugger/analyzer/analyzerrunconfigwidget.h
@@ -30,14 +30,10 @@
#include <projectexplorer/runconfiguration.h>
-#include <QCoreApplication>
-
namespace Debugger {
class DEBUGGER_EXPORT AnalyzerRunConfigWidget : public QWidget
{
- Q_DECLARE_TR_FUNCTIONS(ProjectExplorer::Internal::EditorSettingsPropertiesPage);
-
public:
AnalyzerRunConfigWidget(ProjectExplorer::GlobalOrProjectAspect *aspect);
};
diff --git a/src/plugins/debugger/analyzer/detailederrorview.cpp b/src/plugins/debugger/analyzer/detailederrorview.cpp
index b1ac155afb..ee7e72e0f4 100644
--- a/src/plugins/debugger/analyzer/detailederrorview.cpp
+++ b/src/plugins/debugger/analyzer/detailederrorview.cpp
@@ -25,6 +25,7 @@
#include "detailederrorview.h"
+#include "debuggertr.h"
#include "diagnosticlocation.h"
#include <coreplugin/editormanager/editormanager.h>
@@ -50,7 +51,7 @@ DetailedErrorView::DetailedErrorView(QWidget *parent) :
{
header()->setSectionResizeMode(QHeaderView::ResizeToContents);
- m_copyAction->setText(tr("Copy"));
+ m_copyAction->setText(Tr::tr("Copy"));
m_copyAction->setIcon(Utils::Icons::COPY.icon());
m_copyAction->setShortcut(QKeySequence::Copy);
m_copyAction->setShortcutContext(Qt::WidgetWithChildrenShortcut);
@@ -169,4 +170,4 @@ void DetailedErrorView::setCurrentRow(int row)
selectIndex(model()->index(row, 0));
}
-} // namespace Debugger
+} // Debugger
diff --git a/src/plugins/debugger/analyzer/detailederrorview.h b/src/plugins/debugger/analyzer/detailederrorview.h
index 5ee08770fe..5a36004b89 100644
--- a/src/plugins/debugger/analyzer/detailederrorview.h
+++ b/src/plugins/debugger/analyzer/detailederrorview.h
@@ -36,8 +36,6 @@ class DiagnosticLocation;
class DEBUGGER_EXPORT DetailedErrorView : public QTreeView
{
- Q_OBJECT
-
public:
DetailedErrorView(QWidget *parent = nullptr);
~DetailedErrorView() override;
diff --git a/src/plugins/debugger/analyzer/diagnosticlocation.h b/src/plugins/debugger/analyzer/diagnosticlocation.h
index fe52fe9248..739a6d522b 100644
--- a/src/plugins/debugger/analyzer/diagnosticlocation.h
+++ b/src/plugins/debugger/analyzer/diagnosticlocation.h
@@ -27,7 +27,7 @@
#include <debugger/debugger_global.h>
-#include <utils/fileutils.h>
+#include <utils/filepath.h>
#include <QDebug>
#include <QMetaType>
diff --git a/src/plugins/debugger/analyzer/startremotedialog.cpp b/src/plugins/debugger/analyzer/startremotedialog.cpp
index 9f96ab89a2..3d40bc53fa 100644
--- a/src/plugins/debugger/analyzer/startremotedialog.cpp
+++ b/src/plugins/debugger/analyzer/startremotedialog.cpp
@@ -25,6 +25,8 @@
#include "startremotedialog.h"
+#include "debuggertr.h"
+
#include <coreplugin/icore.h>
#include <projectexplorer/devicesupport/idevice.h>
@@ -60,7 +62,7 @@ StartRemoteDialog::StartRemoteDialog(QWidget *parent)
: QDialog(parent)
, d(new Internal::StartRemoteDialogPrivate)
{
- setWindowTitle(tr("Start Remote Analysis"));
+ setWindowTitle(Tr::tr("Start Remote Analysis"));
d->kitChooser = new KitChooser(this);
d->kitChooser->setKitPredicate([](const Kit *kit) {
@@ -77,10 +79,10 @@ StartRemoteDialog::StartRemoteDialog(QWidget *parent)
auto formLayout = new QFormLayout;
formLayout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
- formLayout->addRow(tr("Kit:"), d->kitChooser);
- formLayout->addRow(tr("Executable:"), d->executable);
- formLayout->addRow(tr("Arguments:"), d->arguments);
- formLayout->addRow(tr("Working directory:"), d->workingDirectory);
+ formLayout->addRow(Tr::tr("Kit:"), d->kitChooser);
+ formLayout->addRow(Tr::tr("Executable:"), d->executable);
+ formLayout->addRow(Tr::tr("Arguments:"), d->arguments);
+ formLayout->addRow(Tr::tr("Working directory:"), d->workingDirectory);
auto verticalLayout = new QVBoxLayout(this);
verticalLayout->addLayout(formLayout);
@@ -89,7 +91,7 @@ StartRemoteDialog::StartRemoteDialog(QWidget *parent)
QSettings *settings = Core::ICore::settings();
settings->beginGroup("AnalyzerStartRemoteDialog");
d->kitChooser->populate();
- d->kitChooser->setCurrentKitId(Utils::Id::fromSetting(settings->value("profile")));
+ d->kitChooser->setCurrentKitId(Id::fromSetting(settings->value("profile")));
d->executable->setText(settings->value("executable").toString());
d->workingDirectory->setText(settings->value("workingDirectory").toString());
d->arguments->setText(settings->value("arguments").toString());
@@ -141,4 +143,4 @@ FilePath StartRemoteDialog::workingDirectory() const
return FilePath::fromString(d->workingDirectory->text());
}
-} // namespace Debugger
+} // Debugger
diff --git a/src/plugins/debugger/analyzer/startremotedialog.h b/src/plugins/debugger/analyzer/startremotedialog.h
index 72d7478fb7..5e5723e653 100644
--- a/src/plugins/debugger/analyzer/startremotedialog.h
+++ b/src/plugins/debugger/analyzer/startremotedialog.h
@@ -40,8 +40,6 @@ namespace Internal { class StartRemoteDialogPrivate; }
class DEBUGGER_EXPORT StartRemoteDialog : public QDialog
{
- Q_OBJECT
-
public:
explicit StartRemoteDialog(QWidget *parent = nullptr);
~StartRemoteDialog() override;
@@ -56,4 +54,4 @@ private:
Internal::StartRemoteDialogPrivate *d;
};
-} // namespace Debugger
+} // Debugger
diff --git a/src/plugins/debugger/breakhandler.cpp b/src/plugins/debugger/breakhandler.cpp
index a075c324bb..1b95ae1eb9 100644
--- a/src/plugins/debugger/breakhandler.cpp
+++ b/src/plugins/debugger/breakhandler.cpp
@@ -30,6 +30,7 @@
#include "debuggerengine.h"
#include "debuggericons.h"
#include "debuggerinternalconstants.h"
+#include "debuggertr.h"
#include "disassembleragent.h"
#include "enginemanager.h"
#include "simplifytype.h"
@@ -92,7 +93,7 @@ public:
: TextMark(fileName, lineNumber, Constants::TEXT_MARK_CATEGORY_BREAKPOINT), m_bp(bp)
{
setColor(Theme::Debugger_Breakpoint_TextMarkColor);
- setDefaultToolTip(QApplication::translate("BreakHandler", "Breakpoint"));
+ setDefaultToolTip(Tr::tr("Breakpoint"));
setPriority(TextEditor::TextMark::NormalPriority);
setIconProvider([bp] { return bp->icon(); });
setToolTipProvider([bp] { return bp->toolTip(); });
@@ -149,7 +150,7 @@ public:
GlobalBreakpointMarker(GlobalBreakpoint gbp, const FilePath &fileName, int lineNumber)
: TextMark(fileName, lineNumber, Constants::TEXT_MARK_CATEGORY_BREAKPOINT), m_gbp(gbp)
{
- setDefaultToolTip(QApplication::translate("BreakHandler", "Breakpoint"));
+ setDefaultToolTip(Tr::tr("Breakpoint"));
setPriority(TextEditor::TextMark::NormalPriority);
setIconProvider([this] { return m_gbp->icon(); });
setToolTipProvider([this] { return m_gbp->toolTip(); });
@@ -206,44 +207,44 @@ static QString stateToString(BreakpointState state)
{
switch (state) {
case BreakpointNew:
- return BreakHandler::tr("New");
+ return Tr::tr("New");
case BreakpointInsertionRequested:
- return BreakHandler::tr("Insertion requested");
+ return Tr::tr("Insertion requested");
case BreakpointInsertionProceeding:
- return BreakHandler::tr("Insertion proceeding");
+ return Tr::tr("Insertion proceeding");
case BreakpointUpdateRequested:
- return BreakHandler::tr("Change requested");
+ return Tr::tr("Change requested");
case BreakpointUpdateProceeding:
- return BreakHandler::tr("Change proceeding");
+ return Tr::tr("Change proceeding");
case BreakpointInserted:
- return BreakHandler::tr("Breakpoint inserted");
+ return Tr::tr("Breakpoint inserted");
case BreakpointRemoveRequested:
- return BreakHandler::tr("Removal requested");
+ return Tr::tr("Removal requested");
case BreakpointRemoveProceeding:
- return BreakHandler::tr("Removal proceeding");
+ return Tr::tr("Removal proceeding");
case BreakpointDead:
- return BreakHandler::tr("Dead");
+ return Tr::tr("Dead");
default:
break;
}
//: Invalid breakpoint state.
- return BreakHandler::tr("<invalid state>");
+ return Tr::tr("<invalid state>");
}
static QString msgBreakpointAtSpecialFunc(const QString &func)
{
- return BreakHandler::tr("Breakpoint at \"%1\"").arg(func);
+ return Tr::tr("Breakpoint at \"%1\"").arg(func);
}
static QString typeToString(BreakpointType type)
{
switch (type) {
case BreakpointByFileAndLine:
- return BreakHandler::tr("Breakpoint by File and Line");
+ return Tr::tr("Breakpoint by File and Line");
case BreakpointByFunction:
- return BreakHandler::tr("Breakpoint by Function");
+ return Tr::tr("Breakpoint by Function");
case BreakpointByAddress:
- return BreakHandler::tr("Breakpoint by Address");
+ return Tr::tr("Breakpoint by Address");
case BreakpointAtThrow:
return msgBreakpointAtSpecialFunc("throw");
case BreakpointAtCatch:
@@ -257,20 +258,20 @@ static QString typeToString(BreakpointType type)
case BreakpointAtSysCall:
return msgBreakpointAtSpecialFunc("syscall");
case BreakpointAtMain:
- return BreakHandler::tr("Breakpoint at Function \"main()\"");
+ return Tr::tr("Breakpoint at Function \"main()\"");
case WatchpointAtAddress:
- return BreakHandler::tr("Watchpoint at Address");
+ return Tr::tr("Watchpoint at Address");
case WatchpointAtExpression:
- return BreakHandler::tr("Watchpoint at Expression");
+ return Tr::tr("Watchpoint at Expression");
case BreakpointOnQmlSignalEmit:
- return BreakHandler::tr("Breakpoint on QML Signal Emit");
+ return Tr::tr("Breakpoint on QML Signal Emit");
case BreakpointAtJavaScriptThrow:
- return BreakHandler::tr("Breakpoint at JavaScript throw");
+ return Tr::tr("Breakpoint at JavaScript throw");
case UnknownBreakpointType:
case LastBreakpointType:
break;
}
- return BreakHandler::tr("Unknown Breakpoint Type");
+ return Tr::tr("Unknown Breakpoint Type");
}
class LeftElideDelegate : public QStyledItemDelegate
@@ -308,8 +309,6 @@ public:
class BreakpointDialog : public QDialog
{
- Q_DECLARE_TR_FUNCTIONS(Debugger::Internal::BreakHandler)
-
public:
explicit BreakpointDialog(unsigned int enabledParts, QWidget *parent = nullptr);
bool showDialog(BreakpointParameters *data, BreakpointParts *parts);
@@ -373,130 +372,130 @@ BreakpointDialog::BreakpointDialog(unsigned int enabledParts, QWidget *parent)
: QDialog(parent), m_enabledParts(enabledParts), m_previousType(UnknownBreakpointType),
m_firstTypeChange(true)
{
- setWindowTitle(tr("Edit Breakpoint Properties"));
+ setWindowTitle(Tr::tr("Edit Breakpoint Properties"));
- auto groupBoxBasic = new QGroupBox(tr("Basic"), this);
+ auto groupBoxBasic = new QGroupBox(Tr::tr("Basic"), this);
// Match BreakpointType (omitting unknown type).
const QStringList types = {
- tr("File Name and Line Number"),
- tr("Function Name"),
- tr("Break on Memory Address"),
- tr("Break When C++ Exception Is Thrown"),
- tr("Break When C++ Exception Is Caught"),
- tr("Break When Function \"main\" Starts"),
- tr("Break When a New Process Is Forked"),
- tr("Break When a New Process Is Executed"),
- tr("Break When a System Call Is Executed"),
- tr("Break on Data Access at Fixed Address"),
- tr("Break on Data Access at Address Given by Expression"),
- tr("Break on QML Signal Emit"),
- tr("Break When JavaScript Exception Is Thrown")
+ Tr::tr("File Name and Line Number"),
+ Tr::tr("Function Name"),
+ Tr::tr("Break on Memory Address"),
+ Tr::tr("Break When C++ Exception Is Thrown"),
+ Tr::tr("Break When C++ Exception Is Caught"),
+ Tr::tr("Break When Function \"main\" Starts"),
+ Tr::tr("Break When a New Process Is Forked"),
+ Tr::tr("Break When a New Process Is Executed"),
+ Tr::tr("Break When a System Call Is Executed"),
+ Tr::tr("Break on Data Access at Fixed Address"),
+ Tr::tr("Break on Data Access at Address Given by Expression"),
+ Tr::tr("Break on QML Signal Emit"),
+ Tr::tr("Break When JavaScript Exception Is Thrown")
};
// We don't list UnknownBreakpointType, so 1 less:
QTC_CHECK(types.size() + 1 == LastBreakpointType);
m_comboBoxType = new QComboBox(groupBoxBasic);
m_comboBoxType->setMaxVisibleItems(20);
m_comboBoxType->addItems(types);
- m_labelType = new QLabel(tr("Breakpoint &type:"), groupBoxBasic);
+ m_labelType = new QLabel(Tr::tr("Breakpoint &type:"), groupBoxBasic);
m_labelType->setBuddy(m_comboBoxType);
m_pathChooserFileName = new PathChooser(groupBoxBasic);
m_pathChooserFileName->setHistoryCompleter("Debugger.Breakpoint.File.History");
m_pathChooserFileName->setExpectedKind(PathChooser::File);
- m_labelFileName = new QLabel(tr("&File name:"), groupBoxBasic);
+ m_labelFileName = new QLabel(Tr::tr("&File name:"), groupBoxBasic);
m_labelFileName->setBuddy(m_pathChooserFileName);
m_lineEditLineNumber = new QLineEdit(groupBoxBasic);
- m_labelLineNumber = new QLabel(tr("&Line number:"), groupBoxBasic);
+ m_labelLineNumber = new QLabel(Tr::tr("&Line number:"), groupBoxBasic);
m_labelLineNumber->setBuddy(m_lineEditLineNumber);
m_checkBoxEnabled = new QCheckBox(groupBoxBasic);
- m_labelEnabled = new QLabel(tr("&Enabled:"), groupBoxBasic);
+ m_labelEnabled = new QLabel(Tr::tr("&Enabled:"), groupBoxBasic);
m_labelEnabled->setBuddy(m_checkBoxEnabled);
m_lineEditAddress = new QLineEdit(groupBoxBasic);
- m_labelAddress = new QLabel(tr("&Address:"), groupBoxBasic);
+ m_labelAddress = new QLabel(Tr::tr("&Address:"), groupBoxBasic);
m_labelAddress->setBuddy(m_lineEditAddress);
m_lineEditExpression = new QLineEdit(groupBoxBasic);
- m_labelExpression = new QLabel(tr("&Expression:"), groupBoxBasic);
+ m_labelExpression = new QLabel(Tr::tr("&Expression:"), groupBoxBasic);
m_labelExpression->setBuddy(m_lineEditExpression);
m_lineEditFunction = new QLineEdit(groupBoxBasic);
- m_labelFunction = new QLabel(tr("Fun&ction:"), groupBoxBasic);
+ m_labelFunction = new QLabel(Tr::tr("Fun&ction:"), groupBoxBasic);
m_labelFunction->setBuddy(m_lineEditFunction);
- auto groupBoxAdvanced = new QGroupBox(tr("Advanced"), this);
+ auto groupBoxAdvanced = new QGroupBox(Tr::tr("Advanced"), this);
m_checkBoxTracepoint = new QCheckBox(groupBoxAdvanced);
- m_labelTracepoint = new QLabel(tr("T&racepoint only:"), groupBoxAdvanced);
+ m_labelTracepoint = new QLabel(Tr::tr("T&racepoint only:"), groupBoxAdvanced);
m_labelTracepoint->setBuddy(m_checkBoxTracepoint);
m_checkBoxOneShot = new QCheckBox(groupBoxAdvanced);
- m_labelOneShot = new QLabel(tr("&One shot only:"), groupBoxAdvanced);
+ m_labelOneShot = new QLabel(Tr::tr("&One shot only:"), groupBoxAdvanced);
m_labelOneShot->setBuddy(m_checkBoxOneShot);
const QString pathToolTip =
- tr("<p>Determines how the path is specified "
- "when setting breakpoints:</p><ul>"
- "<li><i>Use Engine Default</i>: Preferred setting of the "
- "debugger engine.</li>"
- "<li><i>Use Full Path</i>: Pass full path, avoiding ambiguities "
- "should files of the same name exist in several modules. "
- "This is the engine default for CDB and LLDB.</li>"
- "<li><i>Use File Name</i>: Pass the file name only. This is "
- "useful when using a source tree whose location does "
- "not match the one used when building the modules. "
- "It is the engine default for GDB as using full paths can "
- "be slow with this engine.</li></ul>");
+ Tr::tr("<p>Determines how the path is specified "
+ "when setting breakpoints:</p><ul>"
+ "<li><i>Use Engine Default</i>: Preferred setting of the "
+ "debugger engine.</li>"
+ "<li><i>Use Full Path</i>: Pass full path, avoiding ambiguities "
+ "should files of the same name exist in several modules. "
+ "This is the engine default for CDB and LLDB.</li>"
+ "<li><i>Use File Name</i>: Pass the file name only. This is "
+ "useful when using a source tree whose location does "
+ "not match the one used when building the modules. "
+ "It is the engine default for GDB as using full paths can "
+ "be slow with this engine.</li></ul>");
m_comboBoxPathUsage = new QComboBox(groupBoxAdvanced);
- m_comboBoxPathUsage->addItem(tr("Use Engine Default"));
- m_comboBoxPathUsage->addItem(tr("Use Full Path"));
- m_comboBoxPathUsage->addItem(tr("Use File Name"));
+ m_comboBoxPathUsage->addItem(Tr::tr("Use Engine Default"));
+ m_comboBoxPathUsage->addItem(Tr::tr("Use Full Path"));
+ m_comboBoxPathUsage->addItem(Tr::tr("Use File Name"));
m_comboBoxPathUsage->setToolTip(pathToolTip);
- m_labelUseFullPath = new QLabel(tr("Pat&h:"), groupBoxAdvanced);
+ m_labelUseFullPath = new QLabel(Tr::tr("Pat&h:"), groupBoxAdvanced);
m_labelUseFullPath->setBuddy(m_comboBoxPathUsage);
m_labelUseFullPath->setToolTip(pathToolTip);
const QString moduleToolTip =
- "<p>" + tr("Specifying the module (base name of the library or executable) "
+ "<p>" + Tr::tr("Specifying the module (base name of the library or executable) "
"for function or file type breakpoints can significantly speed up "
"debugger startup times (CDB, LLDB).") + "</p>";
m_lineEditModule = new QLineEdit(groupBoxAdvanced);
m_lineEditModule->setToolTip(moduleToolTip);
- m_labelModule = new QLabel(tr("&Module:"), groupBoxAdvanced);
+ m_labelModule = new QLabel(Tr::tr("&Module:"), groupBoxAdvanced);
m_labelModule->setBuddy(m_lineEditModule);
m_labelModule->setToolTip(moduleToolTip);
const QString commandsToolTip =
- "<p>" + tr("Debugger commands to be executed when the breakpoint is hit. "
+ "<p>" + Tr::tr("Debugger commands to be executed when the breakpoint is hit. "
"This feature is only available for GDB.") + "</p>";
m_textEditCommands = new SmallTextEdit(groupBoxAdvanced);
m_textEditCommands->setToolTip(commandsToolTip);
- m_labelCommands = new QLabel(tr("&Commands:"), groupBoxAdvanced);
+ m_labelCommands = new QLabel(Tr::tr("&Commands:"), groupBoxAdvanced);
m_labelCommands->setBuddy(m_textEditCommands);
m_labelCommands->setToolTip(commandsToolTip);
m_lineEditMessage = new QLineEdit(groupBoxAdvanced);
- m_labelMessage = new QLabel(tr("&Message:"), groupBoxAdvanced);
+ m_labelMessage = new QLabel(Tr::tr("&Message:"), groupBoxAdvanced);
m_labelMessage->setBuddy(m_lineEditMessage);
m_lineEditCondition = new QLineEdit(groupBoxAdvanced);
- m_labelCondition = new QLabel(tr("C&ondition:"), groupBoxAdvanced);
+ m_labelCondition = new QLabel(Tr::tr("C&ondition:"), groupBoxAdvanced);
m_labelCondition->setBuddy(m_lineEditCondition);
m_spinBoxIgnoreCount = new QSpinBox(groupBoxAdvanced);
m_spinBoxIgnoreCount->setMinimum(0);
m_spinBoxIgnoreCount->setMaximum(2147483647);
- m_labelIgnoreCount = new QLabel(tr("&Ignore count:"), groupBoxAdvanced);
+ m_labelIgnoreCount = new QLabel(Tr::tr("&Ignore count:"), groupBoxAdvanced);
m_labelIgnoreCount->setBuddy(m_spinBoxIgnoreCount);
m_lineEditThreadSpec = new QLineEdit(groupBoxAdvanced);
- m_labelThreadSpec = new QLabel(tr("&Thread specification:"), groupBoxAdvanced);
+ m_labelThreadSpec = new QLabel(Tr::tr("&Thread specification:"), groupBoxAdvanced);
m_labelThreadSpec->setBuddy(m_lineEditThreadSpec);
- m_checkBoxPropagate = new QCheckBox(tr("Propagate Change to Preset Breakpoint"), this);
+ m_checkBoxPropagate = new QCheckBox(Tr::tr("Propagate Change to Preset Breakpoint"), this);
m_checkBoxPropagate->setCheckable(true);
m_checkBoxPropagate->setChecked(true);
m_checkBoxPropagate->setVisible(false); // FIXME: Make it work.
@@ -847,8 +846,6 @@ bool BreakpointDialog::showDialog(BreakpointParameters *data,
// Dialog allowing changing properties of multiple breakpoints at a time.
class MultiBreakPointsDialog : public QDialog
{
- Q_DECLARE_TR_FUNCTIONS(Debugger::Internal::BreakHandler)
-
public:
MultiBreakPointsDialog(unsigned int enabledParts, QWidget *parent);
@@ -872,7 +869,7 @@ private:
MultiBreakPointsDialog::MultiBreakPointsDialog(unsigned int enabledParts, QWidget *parent) :
QDialog(parent)
{
- setWindowTitle(tr("Edit Breakpoint Properties"));
+ setWindowTitle(Tr::tr("Edit Breakpoint Properties"));
m_lineEditCondition = new QLineEdit(this);
m_spinBoxIgnoreCount = new QSpinBox(this);
@@ -885,9 +882,9 @@ MultiBreakPointsDialog::MultiBreakPointsDialog(unsigned int enabledParts, QWidge
auto formLayout = new QFormLayout;
if (enabledParts & ConditionPart)
- formLayout->addRow(tr("&Condition:"), m_lineEditCondition);
- formLayout->addRow(tr("&Ignore count:"), m_spinBoxIgnoreCount);
- formLayout->addRow(tr("&Thread specification:"), m_lineEditThreadSpec);
+ formLayout->addRow(Tr::tr("&Condition:"), m_lineEditCondition);
+ formLayout->addRow(Tr::tr("&Ignore count:"), m_spinBoxIgnoreCount);
+ formLayout->addRow(Tr::tr("&Thread specification:"), m_lineEditThreadSpec);
auto verticalLayout = new QVBoxLayout(this);
verticalLayout->addLayout(formLayout);
@@ -903,8 +900,8 @@ BreakHandler::BreakHandler(DebuggerEngine *engine)
#if USE_BREAK_MODEL_TEST
new ModelTest(this, 0);
#endif
- setHeader({tr("Number"), tr("Function"), tr("File"), tr("Line"), tr("Address"),
- tr("Condition"), tr("Ignore"), tr("Threads")});
+ setHeader({Tr::tr("Number"), Tr::tr("Function"), Tr::tr("File"), Tr::tr("Line"),
+ Tr::tr("Address"), Tr::tr("Condition"), Tr::tr("Ignore"), Tr::tr("Threads")});
}
bool BreakpointParameters::isLocatedAt(const FilePath &file, int line, const FilePath &markerFile) const
@@ -1011,7 +1008,7 @@ SubBreakpoints BreakHandler::findSubBreakpointsByIndex(const QList<QModelIndex>
QString BreakHandler::displayFromThreadSpec(int spec)
{
- return spec == -1 ? BreakHandler::tr("(all)") : QString::number(spec);
+ return spec == -1 ? Tr::tr("(all)") : QString::number(spec);
}
int BreakHandler::threadSpecFromDisplay(const QString &str)
@@ -1064,10 +1061,10 @@ QVariant BreakpointItem::data(int column, int role) const
return typeToString(m_parameters.type);
if (m_parameters.type == WatchpointAtAddress)
- return BreakHandler::tr("Data at 0x%1").arg(m_parameters.address, 0, 16);
+ return Tr::tr("Data at 0x%1").arg(m_parameters.address, 0, 16);
if (m_parameters.type == WatchpointAtExpression)
- return BreakHandler::tr("Data at %1").arg(m_parameters.expression);
+ return Tr::tr("Data at %1").arg(m_parameters.expression);
return empty;
}
@@ -1097,7 +1094,7 @@ QVariant BreakpointItem::data(int column, int role) const
if (role == Qt::DisplayRole)
return m_parameters.condition;
if (role == Qt::ToolTipRole)
- return BreakHandler::tr("Breakpoint will only be hit if this condition is met.");
+ return Tr::tr("Breakpoint will only be hit if this condition is met.");
if (role == Qt::UserRole + 1)
return m_parameters.condition;
break;
@@ -1107,7 +1104,7 @@ QVariant BreakpointItem::data(int column, int role) const
return ignoreCount ? QVariant(ignoreCount) : QVariant(QString());
}
if (role == Qt::ToolTipRole)
- return BreakHandler::tr("Breakpoint will only be hit after being ignored so many times.");
+ return Tr::tr("Breakpoint will only be hit after being ignored so many times.");
if (role == Qt::UserRole + 1)
return m_parameters.ignoreCount;
break;
@@ -1115,7 +1112,7 @@ QVariant BreakpointItem::data(int column, int role) const
if (role == Qt::DisplayRole)
return BreakHandler::displayFromThreadSpec(m_parameters.threadSpec);
if (role == Qt::ToolTipRole)
- return BreakHandler::tr("Breakpoint will only be hit in the specified thread(s).");
+ return Tr::tr("Breakpoint will only be hit in the specified thread(s).");
if (role == Qt::UserRole + 1)
return BreakHandler::displayFromThreadSpec(m_parameters.threadSpec);
break;
@@ -1616,9 +1613,9 @@ bool BreakHandler::contextMenuEvent(const ItemViewEvent &ev)
auto menu = new QMenu;
- addAction(this, menu, tr("Add Breakpoint..."), true, &BreakpointManager::executeAddBreakpointDialog);
+ addAction(this, menu, Tr::tr("Add Breakpoint..."), true, &BreakpointManager::executeAddBreakpointDialog);
- addAction(this, menu, tr("Delete Selected Breakpoints"),
+ addAction(this, menu, Tr::tr("Delete Selected Breakpoints"),
!selectedBreakpoints.isEmpty(),
[selectedBreakpoints] {
for (Breakpoint bp : selectedBreakpoints) {
@@ -1630,7 +1627,7 @@ bool BreakHandler::contextMenuEvent(const ItemViewEvent &ev)
}
});
- addAction(this, menu, tr("Edit Selected Breakpoints..."),
+ addAction(this, menu, Tr::tr("Edit Selected Breakpoints..."),
!selectedBreakpoints.isEmpty(),
[this, selectedBreakpoints, ev] { editBreakpoints(selectedBreakpoints, ev.view()); });
@@ -1638,8 +1635,8 @@ bool BreakHandler::contextMenuEvent(const ItemViewEvent &ev)
// FIXME BP: m_engine->threadsHandler()->currentThreadId();
// int threadId = 0;
// addAction(menu,
- // threadId == -1 ? tr("Associate Breakpoint with All Threads")
- // : tr("Associate Breakpoint with Thread %1").arg(threadId),
+ // threadId == -1 ? Tr::tr("Associate Breakpoint with All Threads")
+ // : Tr::tr("Associate Breakpoint with Thread %1").arg(threadId),
// !selectedItems.isEmpty(),
// [this, selectedItems, threadId] {
// for (Breakpoint bp : selectedItems)
@@ -1648,8 +1645,8 @@ bool BreakHandler::contextMenuEvent(const ItemViewEvent &ev)
addAction(this, menu,
selectedBreakpoints.size() > 1
- ? breakpointsEnabled ? tr("Disable Selected Breakpoints") : tr("Enable Selected Breakpoints")
- : breakpointsEnabled ? tr("Disable Breakpoint") : tr("Enable Breakpoint"),
+ ? breakpointsEnabled ? Tr::tr("Disable Selected Breakpoints") : Tr::tr("Enable Selected Breakpoints")
+ : breakpointsEnabled ? Tr::tr("Disable Breakpoint") : Tr::tr("Enable Breakpoint"),
!selectedBreakpoints.isEmpty(),
[this, selectedBreakpoints, breakpointsEnabled] {
for (Breakpoint bp : selectedBreakpoints) {
@@ -1662,8 +1659,8 @@ bool BreakHandler::contextMenuEvent(const ItemViewEvent &ev)
addAction(this, menu,
selectedLocations.size() > 1
- ? locationsEnabled ? tr("Disable Selected Locations") : tr("Enable Selected Locations")
- : locationsEnabled ? tr("Disable Location") : tr("Enable Location"),
+ ? locationsEnabled ? Tr::tr("Disable Selected Locations") : Tr::tr("Enable Selected Locations")
+ : locationsEnabled ? Tr::tr("Disable Location") : Tr::tr("Enable Location"),
!selectedLocations.isEmpty() && handlesIndividualLocations,
[this, selectedLocations, locationsEnabled] {
for (SubBreakpointItem * const sbp : selectedLocations)
@@ -1673,7 +1670,7 @@ bool BreakHandler::contextMenuEvent(const ItemViewEvent &ev)
menu->addSeparator();
- addAction(this, menu, tr("Delete All Breakpoints"),
+ addAction(this, menu, Tr::tr("Delete All Breakpoints"),
rowCount() > 0,
&BreakpointManager::executeDeleteAllBreakpointsDialog);
@@ -1688,8 +1685,8 @@ bool BreakHandler::contextMenuEvent(const ItemViewEvent &ev)
breakpointsInFile.append(findBreakpointByIndex(index));
}
}
- addAction(this, menu, tr("Delete Breakpoints of \"%1\"").arg(file),
- tr("Delete Breakpoints of File"),
+ addAction(this, menu, Tr::tr("Delete Breakpoints of \"%1\"").arg(file),
+ Tr::tr("Delete Breakpoints of File"),
breakpointsInFile.size() > 1,
[breakpointsInFile] {
for (Breakpoint bp : breakpointsInFile)
@@ -1933,78 +1930,78 @@ QString BreakpointItem::toolTip() const
const BreakpointParameters &requested = requestedParameters();
QString rc;
QTextStream str(&rc);
- str << "<html><body><b>" << tr("Breakpoint") << "</b>"
+ str << "<html><body><b>" << Tr::tr("Breakpoint") << "</b>"
<< "<table>"
- << "<tr><td>" << tr("Internal ID:")
+ << "<tr><td>" << Tr::tr("Internal ID:")
<< "</td><td>" << m_responseId << "</td></tr>"
- << "<tr><td>" << tr("State:")
- << "</td><td>" << (requestedParameters().enabled ? tr("Enabled") : tr("Disabled"));
+ << "<tr><td>" << Tr::tr("State:")
+ << "</td><td>" << (requestedParameters().enabled ? Tr::tr("Enabled") : Tr::tr("Disabled"));
if (m_parameters.pending)
- str << ", " << tr("pending");
+ str << ", " << Tr::tr("pending");
str << ", " << stateToString(m_state) << "</td></tr>";
- str << "<tr><td>" << tr("Breakpoint Type:")
+ str << "<tr><td>" << Tr::tr("Breakpoint Type:")
<< "</td><td>" << typeToString(requested.type) << "</td></tr>"
- << "<tr><td>" << tr("Marker File:")
+ << "<tr><td>" << Tr::tr("Marker File:")
<< "</td><td>" << markerFileName().toUserOutput() << "</td></tr>"
- << "<tr><td>" << tr("Marker Line:")
+ << "<tr><td>" << Tr::tr("Marker Line:")
<< "</td><td>" << markerLineNumber() << "</td></tr>"
- << "<tr><td>" << tr("Hit Count:")
+ << "<tr><td>" << Tr::tr("Hit Count:")
<< "</td><td>" << m_parameters.hitCount << "</td></tr>"
<< "</table><br><table>"
- << "<tr><th>" << tr("Property")
- << "</th><th>" << tr("Requested")
- << "</th><th>" << tr("Obtained") << "</th></tr>";
+ << "<tr><th>" << Tr::tr("Property")
+ << "</th><th>" << Tr::tr("Requested")
+ << "</th><th>" << Tr::tr("Obtained") << "</th></tr>";
if (!m_displayName.isEmpty()) {
- str << "<tr><td>" << tr("Display Name:")
+ str << "<tr><td>" << Tr::tr("Display Name:")
<< "</td><td>&mdash;</td><td>" << m_displayName << "</td></tr>";
}
if (m_parameters.type == BreakpointByFunction) {
- str << "<tr><td>" << tr("Function Name:")
+ str << "<tr><td>" << Tr::tr("Function Name:")
<< "</td><td>" << requested.functionName
<< "</td><td>" << m_parameters.functionName
<< "</td></tr>";
}
if (m_parameters.type == BreakpointByFileAndLine) {
- str << "<tr><td>" << tr("File Name:")
+ str << "<tr><td>" << Tr::tr("File Name:")
<< "</td><td>" << requested.fileName.toUserOutput()
<< "</td><td>" << m_parameters.fileName.toUserOutput()
<< "</td></tr>"
- << "<tr><td>" << tr("Line Number:")
+ << "<tr><td>" << Tr::tr("Line Number:")
<< "</td><td>" << requested.lineNumber
<< "</td><td>" << m_parameters.lineNumber << "</td></tr>";
}
if (requested.type == BreakpointByFunction || m_parameters.type == BreakpointByFileAndLine) {
- str << "<tr><td>" << tr("Module:")
+ str << "<tr><td>" << Tr::tr("Module:")
<< "</td><td>" << requested.module
<< "</td><td>" << m_parameters.module
<< "</td></tr>";
}
- str << "<tr><td>" << tr("Breakpoint Address:")
+ str << "<tr><td>" << Tr::tr("Breakpoint Address:")
<< "</td><td>";
formatAddress(str, requested.address);
str << "</td><td>";
formatAddress(str, m_parameters.address);
str << "</td></tr>";
if (!requested.command.isEmpty() || !m_parameters.command.isEmpty()) {
- str << "<tr><td>" << tr("Command:")
+ str << "<tr><td>" << Tr::tr("Command:")
<< "</td><td>" << requested.command
<< "</td><td>" << m_parameters.command
<< "</td></tr>";
}
if (!requested.message.isEmpty() || !m_parameters.message.isEmpty()) {
- str << "<tr><td>" << tr("Message:")
+ str << "<tr><td>" << Tr::tr("Message:")
<< "</td><td>" << requested.message
<< "</td><td>" << m_parameters.message
<< "</td></tr>";
}
if (!requested.condition.isEmpty() || !m_parameters.condition.isEmpty()) {
- str << "<tr><td>" << tr("Condition:")
+ str << "<tr><td>" << Tr::tr("Condition:")
<< "</td><td>" << requested.condition
<< "</td><td>" << m_parameters.condition
<< "</td></tr>";
}
if (requested.ignoreCount || m_parameters.ignoreCount) {
- str << "<tr><td>" << tr("Ignore Count:") << "</td><td>";
+ str << "<tr><td>" << Tr::tr("Ignore Count:") << "</td><td>";
if (requested.ignoreCount)
str << m_parameters.ignoreCount;
str << "</td><td>";
@@ -2013,7 +2010,7 @@ QString BreakpointItem::toolTip() const
str << "</td></tr>";
}
if (requested.threadSpec >= 0 || m_parameters.threadSpec >= 0) {
- str << "<tr><td>" << tr("Thread Specification:")
+ str << "<tr><td>" << Tr::tr("Thread Specification:")
<< "</td><td>";
if (requested.threadSpec >= 0)
str << requested.threadSpec;
@@ -2069,33 +2066,33 @@ void BreakHandler::releaseAllBreakpoints()
QString BreakpointItem::msgWatchpointByExpressionTriggered(const QString &expr) const
{
- return tr("Internal data breakpoint %1 at %2 triggered.")
+ return Tr::tr("Internal data breakpoint %1 at %2 triggered.")
.arg(responseId()).arg(expr);
}
QString BreakpointItem::msgWatchpointByExpressionTriggered(const QString &expr,
const QString &threadId) const
{
- return tr("Internal data breakpoint %1 at %2 in thread %3 triggered.")
+ return Tr::tr("Internal data breakpoint %1 at %2 in thread %3 triggered.")
.arg(responseId()).arg(expr).arg(threadId);
}
QString BreakpointItem::msgWatchpointByAddressTriggered(quint64 address) const
{
- return tr("Internal data breakpoint %1 at 0x%2 triggered.")
+ return Tr::tr("Internal data breakpoint %1 at 0x%2 triggered.")
.arg(responseId()).arg(address, 0, 16);
}
QString BreakpointItem::msgWatchpointByAddressTriggered(quint64 address,
const QString &threadId) const
{
- return tr("Internal data breakpoint %1 at 0x%2 in thread %3 triggered.")
+ return Tr::tr("Internal data breakpoint %1 at 0x%2 in thread %3 triggered.")
.arg(responseId()).arg(address, 0, 16).arg(threadId);
}
QString BreakpointItem::msgBreakpointTriggered(const QString &threadId) const
{
- return tr("Stopped at breakpoint %1 in thread %2.")
+ return Tr::tr("Stopped at breakpoint %1 in thread %2.")
.arg(responseId()).arg(threadId);
}
@@ -2171,9 +2168,9 @@ QVariant GlobalBreakpointItem::data(int column, int role) const
|| m_params.type == BreakpointAtSysCall)
return typeToString(m_params.type);
if (m_params.type == WatchpointAtAddress)
- return BreakHandler::tr("Data at 0x%1").arg(m_params.address, 0, 16);
+ return Tr::tr("Data at 0x%1").arg(m_params.address, 0, 16);
if (m_params.type == WatchpointAtExpression)
- return BreakHandler::tr("Data at %1").arg(m_params.expression);
+ return Tr::tr("Data at %1").arg(m_params.expression);
return empty;
}
break;
@@ -2202,7 +2199,7 @@ QVariant GlobalBreakpointItem::data(int column, int role) const
if (role == Qt::DisplayRole)
return m_params.condition;
if (role == Qt::ToolTipRole)
- return BreakHandler::tr("Breakpoint will only be hit if this condition is met.");
+ return Tr::tr("Breakpoint will only be hit if this condition is met.");
if (role == Qt::UserRole + 1)
return m_params.condition;
break;
@@ -2212,7 +2209,7 @@ QVariant GlobalBreakpointItem::data(int column, int role) const
return ignoreCount ? QVariant(ignoreCount) : QVariant(QString());
}
if (role == Qt::ToolTipRole)
- return BreakHandler::tr("Breakpoint will only be hit after being ignored so many times.");
+ return Tr::tr("Breakpoint will only be hit after being ignored so many times.");
if (role == Qt::UserRole + 1)
return m_params.ignoreCount;
break;
@@ -2220,7 +2217,7 @@ QVariant GlobalBreakpointItem::data(int column, int role) const
if (role == Qt::DisplayRole)
return BreakHandler::displayFromThreadSpec(m_params.threadSpec);
if (role == Qt::ToolTipRole)
- return BreakHandler::tr("Breakpoint will only be hit in the specified thread(s).");
+ return Tr::tr("Breakpoint will only be hit in the specified thread(s).");
if (role == Qt::UserRole + 1)
return BreakHandler::displayFromThreadSpec(m_params.threadSpec);
break;
@@ -2377,43 +2374,42 @@ QString GlobalBreakpointItem::toolTip() const
{
QString rc;
QTextStream str(&rc);
- str << "<html><body><b>" << BreakpointItem::tr("Unclaimed Breakpoint") << "</b>"
+ str << "<html><body><b>" << Tr::tr("Unclaimed Breakpoint") << "</b>"
<< "<table>"
- //<< "<tr><td>" << tr("ID:") << "</td><td>" << m_id << "</td></tr>"
- << "<tr><td>" << BreakpointItem::tr("State:")
- << "</td><td>" << (m_params.enabled ? BreakpointItem::tr("Enabled") : BreakpointItem::tr("Disabled"))
- << "<tr><td>" << BreakpointItem::tr("Breakpoint Type:")
- << "</td><td>" << typeToString(m_params.type) << "</td></tr>";
+ //<< "<tr><td>" << Tr::tr("ID:") << "</td><td>" << m_id << "</td></tr>"
+ << "<tr><td>" << Tr::tr("State:") << "</td><td>"
+ << (m_params.enabled ? Tr::tr("Enabled") : Tr::tr("Disabled")) << "<tr><td>"
+ << Tr::tr("Breakpoint Type:") << "</td><td>" << typeToString(m_params.type) << "</td></tr>";
if (m_params.type == BreakpointByFunction) {
- str << "<tr><td>" << BreakpointItem::tr("Function Name:")
+ str << "<tr><td>" << Tr::tr("Function Name:")
<< "</td><td>" << m_params.functionName
<< "</td></tr>";
}
if (m_params.type == BreakpointByFileAndLine) {
- str << "<tr><td>" << BreakpointItem::tr("File Name:")
+ str << "<tr><td>" << Tr::tr("File Name:")
<< "</td><td>" << m_params.fileName.toUserOutput()
<< "</td></tr>"
- << "<tr><td>" << BreakpointItem::tr("Line Number:")
+ << "<tr><td>" << Tr::tr("Line Number:")
<< "</td><td>" << m_params.lineNumber;
}
if (m_params.type == BreakpointByFunction || m_params.type == BreakpointByFileAndLine) {
- str << "<tr><td>" << BreakpointItem::tr("Module:")
+ str << "<tr><td>" << Tr::tr("Module:")
<< "</td><td>" << m_params.module
<< "</td></tr>";
}
- str << "<tr><td>" << BreakpointItem::tr("Breakpoint Address:") << "</td><td>";
+ str << "<tr><td>" << Tr::tr("Breakpoint Address:") << "</td><td>";
formatAddress(str, m_params.address);
str << "</td></tr>";
if (!m_params.command.isEmpty())
- str << "<tr><td>" << BreakpointItem::tr("Command:") << "</td><td>" << m_params.command << "</td></tr>";
+ str << "<tr><td>" << Tr::tr("Command:") << "</td><td>" << m_params.command << "</td></tr>";
if (!m_params.message.isEmpty())
- str << "<tr><td>" << BreakpointItem::tr("Message:") << "</td><td>" << m_params.message << "</td></tr>";
+ str << "<tr><td>" << Tr::tr("Message:") << "</td><td>" << m_params.message << "</td></tr>";
if (!m_params.condition.isEmpty())
- str << "<tr><td>" << BreakpointItem::tr("Condition:") << "</td><td>" << m_params.condition << "</td></tr>";
+ str << "<tr><td>" << Tr::tr("Condition:") << "</td><td>" << m_params.condition << "</td></tr>";
if (m_params.ignoreCount)
- str << "<tr><td>" << BreakpointItem::tr("Ignore Count:") << "</td><td>" << m_params.ignoreCount << "</td></tr>";
+ str << "<tr><td>" << Tr::tr("Ignore Count:") << "</td><td>" << m_params.ignoreCount << "</td></tr>";
if (m_params.threadSpec >= 0)
- str << "<tr><td>" << BreakpointItem::tr("Thread Specification:") << "</td><td>" << m_params.threadSpec << "</td></tr>";
+ str << "<tr><td>" << Tr::tr("Thread Specification:") << "</td><td>" << m_params.threadSpec << "</td></tr>";
str << "</table></body></html><hr>";
return rc;
@@ -2426,8 +2422,8 @@ QString GlobalBreakpointItem::toolTip() const
BreakpointManager::BreakpointManager()
{
theBreakpointManager = this;
- setHeader({tr("Debuggee"), tr("Function"), tr("File"), tr("Line"), tr("Address"),
- tr("Condition"), tr("Ignore"), tr("Threads")});
+ setHeader({Tr::tr("Debuggee"), Tr::tr("Function"), Tr::tr("File"), Tr::tr("Line"), Tr::tr("Address"),
+ Tr::tr("Condition"), Tr::tr("Ignore"), Tr::tr("Threads")});
connect(SessionManager::instance(), &SessionManager::sessionLoaded,
this, &BreakpointManager::loadSessionData);
connect(SessionManager::instance(), &SessionManager::aboutToSaveSession,
@@ -2567,7 +2563,7 @@ void BreakpointManager::executeAddBreakpointDialog()
BreakpointParameters data(BreakpointByFileAndLine);
BreakpointParts parts = NoParts;
BreakpointDialog dialog(~0, ICore::dialogParent());
- dialog.setWindowTitle(tr("Add Breakpoint"));
+ dialog.setWindowTitle(Tr::tr("Add Breakpoint"));
if (dialog.showDialog(&data, &parts))
BreakpointManager::createBreakpoint(data);
}
@@ -2642,23 +2638,23 @@ bool BreakpointManager::contextMenuEvent(const ItemViewEvent &ev)
auto menu = new QMenu;
- addAction(this, menu, tr("Add Breakpoint..."), true, &BreakpointManager::executeAddBreakpointDialog);
+ addAction(this, menu, Tr::tr("Add Breakpoint..."), true, &BreakpointManager::executeAddBreakpointDialog);
- addAction(this, menu, tr("Delete Selected Breakpoints"),
+ addAction(this, menu, Tr::tr("Delete Selected Breakpoints"),
!selectedBreakpoints.isEmpty(),
[selectedBreakpoints] {
for (GlobalBreakpoint gbp : selectedBreakpoints)
gbp->deleteBreakpoint();
});
- addAction(this, menu, tr("Edit Selected Breakpoints..."),
+ addAction(this, menu, Tr::tr("Edit Selected Breakpoints..."),
!selectedBreakpoints.isEmpty(),
[this, selectedBreakpoints, ev] { editBreakpoints(selectedBreakpoints, ev.view()); });
addAction(this, menu,
selectedBreakpoints.size() > 1
- ? breakpointsEnabled ? tr("Disable Selected Breakpoints") : tr("Enable Selected Breakpoints")
- : breakpointsEnabled ? tr("Disable Breakpoint") : tr("Enable Breakpoint"),
+ ? breakpointsEnabled ? Tr::tr("Disable Selected Breakpoints") : Tr::tr("Enable Selected Breakpoints")
+ : breakpointsEnabled ? Tr::tr("Disable Breakpoint") : Tr::tr("Enable Breakpoint"),
!selectedBreakpoints.isEmpty(),
[selectedBreakpoints, breakpointsEnabled] {
for (GlobalBreakpoint gbp : selectedBreakpoints)
@@ -2668,7 +2664,7 @@ bool BreakpointManager::contextMenuEvent(const ItemViewEvent &ev)
menu->addSeparator();
- addAction(this, menu, tr("Delete All Breakpoints"),
+ addAction(this, menu, Tr::tr("Delete All Breakpoints"),
rowCount() > 0,
&BreakpointManager::executeDeleteAllBreakpointsDialog);
@@ -2684,8 +2680,8 @@ bool BreakpointManager::contextMenuEvent(const ItemViewEvent &ev)
});
}
}
- addAction(this, menu, tr("Delete Breakpoints of \"%1\"").arg(file.toUserOutput()),
- tr("Delete Breakpoints of File"),
+ addAction(this, menu, Tr::tr("Delete Breakpoints of \"%1\"").arg(file.toUserOutput()),
+ Tr::tr("Delete Breakpoints of File"),
breakpointsInFile.size() > 1,
[breakpointsInFile] {
for (GlobalBreakpoint gbp : breakpointsInFile)
@@ -2714,9 +2710,9 @@ void BreakpointManager::executeDeleteAllBreakpointsDialog()
{
QDialogButtonBox::StandardButton pressed =
CheckableMessageBox::doNotAskAgainQuestion(ICore::dialogParent(),
- tr("Remove All Breakpoints"),
- tr("Are you sure you want to remove all breakpoints "
- "from all files in the current session?"),
+ Tr::tr("Remove All Breakpoints"),
+ Tr::tr("Are you sure you want to remove all breakpoints "
+ "from all files in the current session?"),
ICore::settings(),
"RemoveAllBreakpoints");
if (pressed != QDialogButtonBox::Yes)
diff --git a/src/plugins/debugger/breakhandler.h b/src/plugins/debugger/breakhandler.h
index 3354b382dd..e3949264b5 100644
--- a/src/plugins/debugger/breakhandler.h
+++ b/src/plugins/debugger/breakhandler.h
@@ -28,16 +28,14 @@
#include "breakpoint.h"
#include "debuggerprotocol.h"
-#include <utils/fileutils.h>
+#include <utils/filepath.h>
#include <utils/treemodel.h>
-#include <QCoreApplication>
#include <QPointer>
namespace Utils { class ItemViewEvent; }
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
class BreakHandler;
class BreakpointItem;
@@ -64,8 +62,6 @@ using SubBreakpoint = QPointer<SubBreakpointItem>;
class GlobalBreakpointItem : public QObject, public Utils::TreeItem
{
- Q_DECLARE_TR_FUNCTIONS(Debugger::Internal::BreakHandler)
-
public:
explicit GlobalBreakpointItem();
~GlobalBreakpointItem() override;
@@ -115,8 +111,6 @@ using GlobalBreakpoints = QList<GlobalBreakpoint>;
class BreakpointItem final : public QObject, public Utils::TypedTreeItem<SubBreakpointItem>
{
- Q_DECLARE_TR_FUNCTIONS(Debugger::Internal::BreakHandler)
-
public:
explicit BreakpointItem(const GlobalBreakpoint &gbp);
~BreakpointItem() final;
@@ -229,8 +223,6 @@ inline auto qHash(const Debugger::Internal::GlobalBreakpoint &b) { return qHash(
class BreakHandler : public BreakHandlerModel
{
- Q_OBJECT
-
public:
explicit BreakHandler(DebuggerEngine *engine);
@@ -291,8 +283,6 @@ private:
class BreakpointManager : public BreakpointManagerModel
{
- Q_OBJECT
-
public:
BreakpointManager();
@@ -328,6 +318,4 @@ private:
void editBreakpoints(const GlobalBreakpoints &gbps, QWidget *parent);
};
-} // namespace Internal
-} // namespace Debugger
-
+} // Debugger::Internal
diff --git a/src/plugins/debugger/breakpoint.cpp b/src/plugins/debugger/breakpoint.cpp
index 9d0e850c62..dae9f70d69 100644
--- a/src/plugins/debugger/breakpoint.cpp
+++ b/src/plugins/debugger/breakpoint.cpp
@@ -25,11 +25,11 @@
#include "breakpoint.h"
-#include "debuggeractions.h"
-#include "debuggercore.h"
#include "debuggerprotocol.h"
#include <projectexplorer/abi.h>
+
+#include <utils/fileutils.h>
#include <utils/qtcassert.h>
#include <utils/stringutils.h>
diff --git a/src/plugins/debugger/cdb/cdbengine.cpp b/src/plugins/debugger/cdb/cdbengine.cpp
index 5ce9bd2ab9..a5025c1af4 100644
--- a/src/plugins/debugger/cdb/cdbengine.cpp
+++ b/src/plugins/debugger/cdb/cdbengine.cpp
@@ -39,6 +39,7 @@
#include <debugger/debuggerprotocol.h>
#include <debugger/debuggerruncontrol.h>
#include <debugger/debuggertooltipmanager.h>
+#include <debugger/debuggertr.h>
#include <debugger/disassembleragent.h>
#include <debugger/disassemblerlines.h>
#include <debugger/enginemanager.h>
@@ -303,7 +304,7 @@ void CdbEngine::createFullBacktrace()
void CdbEngine::handleSetupFailure(const QString &errorMessage)
{
showMessage(errorMessage, LogError);
- Core::AsynchronousMessageBox::critical(tr("Failed to Start the Debugger"), errorMessage);
+ Core::AsynchronousMessageBox::critical(Tr::tr("Failed to Start the Debugger"), errorMessage);
notifyEngineSetupFailed();
}
@@ -337,7 +338,7 @@ void CdbEngine::setupEngine()
// The extension is passed as relative name with the path variable set
//(does not work with absolute path names)
if (sp.debugger.command.isEmpty()) {
- handleSetupFailure(tr("There is no CDB executable specified."));
+ handleSetupFailure(Tr::tr("There is no CDB executable specified."));
return;
}
@@ -353,7 +354,7 @@ void CdbEngine::setupEngine()
m_wow64State = noWow64Stack;
const QFileInfo extensionFi(CdbEngine::extensionLibraryName(cdbIs64Bit, cdbIsArm));
if (!extensionFi.isFile()) {
- handleSetupFailure(tr("Internal error: The extension %1 cannot be found.\n"
+ handleSetupFailure(Tr::tr("Internal error: The extension %1 cannot be found.\n"
"If you have updated %2 via Maintenance Tool, you may "
"need to rerun the Tool and select \"Add or remove components\" "
"and then select the "
@@ -1638,14 +1639,14 @@ enum StopActionFlags
static inline QString msgTracePointTriggered(const Breakpoint &, const QString &displayName,
const QString &threadId)
{
- return CdbEngine::tr("Trace point %1 in thread %2 triggered.")
+ return Tr::tr("Trace point %1 in thread %2 triggered.")
.arg(displayName).arg(threadId);
}
static inline QString msgCheckingConditionalBreakPoint(const Breakpoint &bp, const QString &displayName,
const QString &threadId)
{
- return CdbEngine::tr("Conditional breakpoint %1 in thread %2 triggered, examining expression \"%3\".")
+ return Tr::tr("Conditional breakpoint %1 in thread %2 triggered, examining expression \"%3\".")
.arg(displayName).arg(threadId, bp->condition());
}
@@ -1662,7 +1663,7 @@ unsigned CdbEngine::examineStopReason(const GdbMi &stopReason,
qDebug("%s", qPrintable(stopReason.toString(true, 4)));
const QString reason = stopReason["reason"].data();
if (reason.isEmpty()) {
- *message = tr("Malformed stop response received.");
+ *message = Tr::tr("Malformed stop response received.");
rc |= StopReportParseError|StopNotifyStop;
return rc;
}
@@ -1806,7 +1807,7 @@ void CdbEngine::processStop(const GdbMi &stopReason, bool conditionalBreakPointT
m_sourceStepInto = false;
// Start sequence to get all relevant data.
if (stopFlags & StopInArtificialThread) {
- showMessage(tr("Switching to main thread..."), LogMisc);
+ showMessage(Tr::tr("Switching to main thread..."), LogMisc);
runCommand({"~0 s", NoFlags});
forcedThread = true;
// Re-fetch stack again.
@@ -2169,7 +2170,7 @@ void CdbEngine::handleExtensionMessage(char t, int token, const QString &what, c
const Task::TaskType type =
isFatalWinException(exception.exceptionCode) ? Task::Error : Task::Warning;
const FilePath fileName = FilePath::fromUserInput(exception.file);
- const QString taskEntry = tr("Debugger encountered an exception: %1").arg(
+ const QString taskEntry = Tr::tr("Debugger encountered an exception: %1").arg(
exception.toString(false).trimmed());
TaskHub::addTask(Task(type, taskEntry,
fileName, exception.lineNumber,
@@ -2251,7 +2252,7 @@ void CdbEngine::checkQtSdkPdbFiles(const QString &module)
return;
const QString message
- = tr("The installed %1 is missing debug information files.\n"
+ = Tr::tr("The installed %1 is missing debug information files.\n"
"Locals and Expression might not be able to display all Qt Types in a "
"human readable format.\n\n"
"Please install the \"Qt Debug Information Files\" Package from the "
@@ -2261,7 +2262,7 @@ void CdbEngine::checkQtSdkPdbFiles(const QString &module)
CheckableMessageBox::doNotShowAgainInformation(
Core::ICore::dialogParent(),
- tr("Missing Qt Debug Information"),
+ Tr::tr("Missing Qt Debug Information"),
message,
Core::ICore::settings(),
"CdbQtSdkPdbHint");
@@ -2384,7 +2385,7 @@ void CdbEngine::parseOutputLine(QString line)
const QRegularExpressionMatch match = moduleRegExp.match(line);
if (match.hasMatch()) {
const QString module = match.captured(3).trimmed();
- showStatusMessage(tr("Module loaded: %1").arg(module), 3000);
+ showStatusMessage(Tr::tr("Module loaded: %1").arg(module), 3000);
checkQtSdkPdbFiles(module);
}
} else {
@@ -2818,9 +2819,9 @@ void CdbEngine::handleExpression(const DebuggerResponse &response, const Breakpo
showMessage(response.data["msg"].data(), LogError);
// Is this a conditional breakpoint?
const QString message = value ?
- tr("Value %1 obtained from evaluating the condition of breakpoint %2, stopping.").
+ Tr::tr("Value %1 obtained from evaluating the condition of breakpoint %2, stopping.").
arg(value).arg(bp->displayName()) :
- tr("Value 0 obtained from evaluating the condition of breakpoint %1, continuing.").
+ Tr::tr("Value 0 obtained from evaluating the condition of breakpoint %1, continuing.").
arg(bp->displayName());
showMessage(message, LogMisc);
// Stop if evaluation is true, else continue
diff --git a/src/plugins/debugger/cdb/cdbengine.h b/src/plugins/debugger/cdb/cdbengine.h
index c26cd901b8..c46627d848 100644
--- a/src/plugins/debugger/cdb/cdbengine.h
+++ b/src/plugins/debugger/cdb/cdbengine.h
@@ -36,8 +36,7 @@
#include <QElapsedTimer>
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
class CdbEngine : public CppDebuggerEngine
{
@@ -231,5 +230,4 @@ private:
mutable CPlusPlus::Snapshot m_codeModelSnapshot;
};
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/cdb/cdboptionspage.cpp b/src/plugins/debugger/cdb/cdboptionspage.cpp
index f62454fc79..333a5d74d1 100644
--- a/src/plugins/debugger/cdb/cdboptionspage.cpp
+++ b/src/plugins/debugger/cdb/cdboptionspage.cpp
@@ -25,12 +25,11 @@
#include "cdboptionspage.h"
-#include "cdbengine.h"
-
#include <debugger/commonoptionspage.h>
#include <debugger/debuggeractions.h>
#include <debugger/debuggercore.h>
#include <debugger/debuggerinternalconstants.h>
+#include <debugger/debuggertr.h>
#include <debugger/shared/cdbsymbolpathlisteditor.h>
#include <coreplugin/icore.h>
@@ -56,18 +55,12 @@ struct EventsDescription {
// Parameters of the "sxe" command
const EventsDescription eventDescriptions[] =
{
- {"eh", false, QT_TRANSLATE_NOOP("Debugger::Internal::CdbBreakEventWidget",
- "C++ exception")},
- {"ct", false, QT_TRANSLATE_NOOP("Debugger::Internal::CdbBreakEventWidget",
- "Thread creation")},
- {"et", false, QT_TRANSLATE_NOOP("Debugger::Internal::CdbBreakEventWidget",
- "Thread exit")},
- {"ld", true, QT_TRANSLATE_NOOP("Debugger::Internal::CdbBreakEventWidget",
- "Load module:")},
- {"ud", true, QT_TRANSLATE_NOOP("Debugger::Internal::CdbBreakEventWidget",
- "Unload module:")},
- {"out", true, QT_TRANSLATE_NOOP("Debugger::Internal::CdbBreakEventWidget",
- "Output:")}
+ {"eh", false, QT_TRANSLATE_NOOP("Debugger", "C++ exception")},
+ {"ct", false, QT_TRANSLATE_NOOP("Debugger", "Thread creation")},
+ {"et", false, QT_TRANSLATE_NOOP("Debugger", "Thread exit")},
+ {"ld", true, QT_TRANSLATE_NOOP("Debugger", "Load module:")},
+ {"ud", true, QT_TRANSLATE_NOOP("Debugger", "Unload module:")},
+ {"out", true, QT_TRANSLATE_NOOP("Debugger", "Output:")}
};
static inline int indexOfEvent(const QString &abbrev)
@@ -86,8 +79,6 @@ static inline int indexOfEvent(const QString &abbrev)
// events with parameters (like 'out:Needle').
class CdbBreakEventWidget : public QWidget
{
- Q_DECLARE_TR_FUNCTIONS(Debugger::Internal::CdbBreakEventWidget)
-
public:
explicit CdbBreakEventWidget(QWidget *parent = nullptr);
@@ -113,7 +104,7 @@ CdbBreakEventWidget::CdbBreakEventWidget(QWidget *parent) : QWidget(parent)
mainLayout->addLayout(leftLayout);
const size_t eventCount = sizeof(eventDescriptions) / sizeof(EventsDescription);
for (size_t e = 0; e < eventCount; e++) {
- auto cb = new QCheckBox(tr(eventDescriptions[e].description));
+ auto cb = new QCheckBox(Tr::tr(eventDescriptions[e].description));
QLineEdit *le = nullptr;
if (eventDescriptions[e].hasParameter) {
if (!parameterLayout) {
@@ -185,8 +176,6 @@ QStringList CdbBreakEventWidget::breakEvents() const
class CdbOptionsPageWidget : public Core::IOptionsPageWidget
{
- Q_DECLARE_TR_FUNCTIONS(Debugger::Internal::CdbOptionsPageWidget)
-
public:
CdbOptionsPageWidget();
@@ -209,14 +198,14 @@ CdbOptionsPageWidget::CdbOptionsPageWidget()
Column {
Row {
Group {
- Title(tr("Startup")),
+ Title(Tr::tr("Startup")),
s.cdbAdditionalArguments,
s.useCdbConsole,
Stretch()
},
Group {
- Title(tr("Various")),
+ Title(Tr::tr("Various")),
s.ignoreFirstChanceAccessViolation,
s.cdbBreakOnCrtDbgReport,
s.cdbBreakPointCorrection,
@@ -225,12 +214,12 @@ CdbOptionsPageWidget::CdbOptionsPageWidget()
},
Group {
- Title(tr("Break On")),
+ Title(Tr::tr("Break On")),
m_breakEventWidget
},
Group {
- Title(tr("Add Exceptions to Issues View")),
+ Title(Tr::tr("Add Exceptions to Issues View")),
s.firstChanceExceptionTaskEntry,
s.secondChanceExceptionTaskEntry
},
@@ -255,7 +244,7 @@ void CdbOptionsPageWidget::finish()
CdbOptionsPage::CdbOptionsPage()
{
setId("F.Debugger.Cda");
- setDisplayName(CdbOptionsPageWidget::tr("CDB"));
+ setDisplayName(Tr::tr("CDB"));
setCategory(Debugger::Constants::DEBUGGER_SETTINGS_CATEGORY);
setWidgetCreator([] { return new CdbOptionsPageWidget; });
}
@@ -265,8 +254,6 @@ CdbOptionsPage::CdbOptionsPage()
class CdbPathsPageWidget : public Core::IOptionsPageWidget
{
- Q_DECLARE_TR_FUNCTIONS(Debugger::Internal::CdbPathsPageWidget)
-
public:
CdbPathsPageWidget();
@@ -288,8 +275,8 @@ CdbPathsPageWidget::CdbPathsPageWidget()
finish();
Column {
- Group { Title(tr("Symbol Paths")), m_symbolPaths },
- Group { Title(tr("Source Paths")), m_sourcePaths },
+ Group { Title(Tr::tr("Symbol Paths")), m_symbolPaths },
+ Group { Title(Tr::tr("Source Paths")), m_sourcePaths },
Stretch()
}.attachTo(this);
}
@@ -310,7 +297,7 @@ void CdbPathsPageWidget::finish()
CdbPathsPage::CdbPathsPage()
{
setId("F.Debugger.Cdb");
- setDisplayName(CdbPathsPageWidget::tr("CDB Paths"));
+ setDisplayName(Tr::tr("CDB Paths"));
setCategory(Debugger::Constants::DEBUGGER_SETTINGS_CATEGORY);
setWidgetCreator([] { return new CdbPathsPageWidget; });
}
diff --git a/src/plugins/debugger/commonoptionspage.cpp b/src/plugins/debugger/commonoptionspage.cpp
index d4a3ecd2d6..e467bc6380 100644
--- a/src/plugins/debugger/commonoptionspage.cpp
+++ b/src/plugins/debugger/commonoptionspage.cpp
@@ -27,6 +27,7 @@
#include "debuggeractions.h"
#include "debuggerinternalconstants.h"
+#include "debuggertr.h"
#include <coreplugin/icore.h>
@@ -47,8 +48,6 @@ namespace Internal {
class CommonOptionsPageWidget : public Core::IOptionsPageWidget
{
- Q_DECLARE_TR_FUNCTIONS(Debugger::Internal::CommonOptionsPageWidget)
-
public:
explicit CommonOptionsPageWidget()
{
@@ -107,23 +106,23 @@ void CommonOptionsPageWidget::apply()
CommonOptionsPage::CommonOptionsPage()
{
setId(DEBUGGER_COMMON_SETTINGS_ID);
- setDisplayName(QCoreApplication::translate("Debugger", "General"));
+ setDisplayName(Tr::tr("General"));
setCategory(DEBUGGER_SETTINGS_CATEGORY);
- setDisplayCategory(QCoreApplication::translate("Debugger", "Debugger"));
+ setDisplayCategory(Tr::tr("Debugger"));
setCategoryIconPath(":/debugger/images/settingscategory_debugger.png");
setWidgetCreator([] { return new CommonOptionsPageWidget; });
}
QString CommonOptionsPage::msgSetBreakpointAtFunction(const char *function)
{
- return CommonOptionsPageWidget::tr("Stop when %1() is called").arg(QLatin1String(function));
+ return Tr::tr("Stop when %1() is called").arg(QLatin1String(function));
}
QString CommonOptionsPage::msgSetBreakpointAtFunctionToolTip(const char *function,
const QString &hint)
{
QString result = "<html><head/><body>";
- result += CommonOptionsPageWidget::tr("Always adds a breakpoint on the <i>%1()</i> function.")
+ result += Tr::tr("Always adds a breakpoint on the <i>%1()</i> function.")
.arg(QLatin1String(function));
if (!hint.isEmpty()) {
result += "<br>";
@@ -142,8 +141,6 @@ QString CommonOptionsPage::msgSetBreakpointAtFunctionToolTip(const char *functio
class LocalsAndExpressionsOptionsPageWidget : public IOptionsPageWidget
{
- Q_DECLARE_TR_FUNCTIONS(Debugger::Internal::LocalsAndExpressionsOptionsPage)
-
public:
LocalsAndExpressionsOptionsPageWidget()
{
@@ -154,7 +151,7 @@ public:
label->setTextFormat(Qt::AutoText);
label->setWordWrap(true);
label->setText("<html><head/><body>\n<p>"
- + tr("The debugging helpers are used to produce a nice "
+ + Tr::tr("The debugging helpers are used to produce a nice "
"display of objects of certain types like QString or "
"std::map in the &quot;Locals&quot; and &quot;Expressions&quot; views.")
+ "</p></body></html>");
@@ -163,13 +160,13 @@ public:
label,
s.useCodeModel,
s.showThreadNames,
- Group { Title(tr("Extra Debugging Helper")), s.extraDumperFile }
+ Group { Title(Tr::tr("Extra Debugging Helper")), s.extraDumperFile }
};
Group useHelper {
Row {
left,
- Group { Title(tr("Debugging Helper Customization")), s.extraDumperCommands }
+ Group { Title(Tr::tr("Debugging Helper Customization")), s.extraDumperCommands }
}
};
@@ -203,7 +200,7 @@ LocalsAndExpressionsOptionsPage::LocalsAndExpressionsOptionsPage()
{
setId("Z.Debugger.LocalsAndExpressions");
//: '&&' will appear as one (one is marking keyboard shortcut)
- setDisplayName(QCoreApplication::translate("Debugger", "Locals && Expressions"));
+ setDisplayName(Tr::tr("Locals && Expressions"));
setCategory(DEBUGGER_SETTINGS_CATEGORY);
setWidgetCreator([] { return new LocalsAndExpressionsOptionsPageWidget; });
}
diff --git a/src/plugins/debugger/commonoptionspage.h b/src/plugins/debugger/commonoptionspage.h
index 9491bb3d7d..ed298c98e5 100644
--- a/src/plugins/debugger/commonoptionspage.h
+++ b/src/plugins/debugger/commonoptionspage.h
@@ -27,8 +27,7 @@
#include <coreplugin/dialogs/ioptionspage.h>
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
class CommonOptionsPage final : public Core::IOptionsPage
{
@@ -46,5 +45,4 @@ public:
LocalsAndExpressionsOptionsPage();
};
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/console/console.cpp b/src/plugins/debugger/console/console.cpp
index d6a911d972..92380cc196 100644
--- a/src/plugins/debugger/console/console.cpp
+++ b/src/plugins/debugger/console/console.cpp
@@ -24,14 +24,18 @@
****************************************************************************/
#include "console.h"
+
#include "consoleview.h"
#include "consoleproxymodel.h"
#include "consoleitemdelegate.h"
+#include "../debuggertr.h"
#include <coreplugin/coreconstants.h>
#include <coreplugin/findplaceholder.h>
#include <coreplugin/icore.h>
+
#include <utils/utilsicons.h>
+
#include <aggregation/aggregate.h>
#include <coreplugin/find/itemviewfind.h>
@@ -46,8 +50,7 @@ const char SHOW_LOG[] = "showLog";
const char SHOW_WARNING[] = "showWarning";
const char SHOW_ERROR[] = "showError";
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
/////////////////////////////////////////////////////////////////////
//
@@ -103,8 +106,8 @@ Console::Console()
m_showDebug.setDefaultValue(true);
m_showDebug.setSettingsKey(CONSOLE, SHOW_LOG);
- m_showDebug.setLabelText(tr("Show debug, log, and info messages."));
- m_showDebug.setToolTip(tr("Show debug, log, and info messages."));
+ m_showDebug.setLabelText(Tr::tr("Show debug, log, and info messages."));
+ m_showDebug.setToolTip(Tr::tr("Show debug, log, and info messages."));
m_showDebug.setValue(true);
m_showDebug.action()->setIcon(Utils::Icons::INFO_TOOLBAR.icon());
connect(&m_showDebug, &Utils::BoolAspect::valueChanged,
@@ -115,8 +118,8 @@ Console::Console()
m_showWarning.setDefaultValue(true);
m_showWarning.setSettingsKey(CONSOLE, SHOW_WARNING);
- m_showWarning.setLabelText(tr("Show warning messages."));
- m_showWarning.setToolTip(tr("Show warning messages."));
+ m_showWarning.setLabelText(Tr::tr("Show warning messages."));
+ m_showWarning.setToolTip(Tr::tr("Show warning messages."));
m_showWarning.setValue(true);
m_showWarning.action()->setIcon(Utils::Icons::WARNING_TOOLBAR.icon());
connect(m_showWarning.action(), &QAction::toggled,
@@ -127,8 +130,8 @@ Console::Console()
m_showError.setDefaultValue(true);
m_showError.setSettingsKey(CONSOLE, SHOW_ERROR);
- m_showError.setLabelText(tr("Show error messages."));
- m_showError.setToolTip(tr("Show error messages."));
+ m_showError.setLabelText(Tr::tr("Show error messages."));
+ m_showError.setToolTip(Tr::tr("Show error messages."));
m_showError.setValue(true);
m_showError.action()->setIcon(Utils::Icons::CRITICAL_TOOLBAR.icon());
connect(m_showError.action(), &QAction::toggled,
@@ -162,6 +165,11 @@ QList<QWidget *> Console::toolBarWidgets() const
m_spacer, m_statusLabel};
}
+QString Console::displayName() const
+{
+ return Tr::tr("QML Debugger Console");
+}
+
int Console::priorityInStatusBar() const
{
return 20;
@@ -269,14 +277,12 @@ void Console::evaluate(const QString &expression)
m_consoleItemModel->shiftEditableRow();
m_scriptEvaluator(expression);
} else {
- auto item = new ConsoleItem(ConsoleItem::ErrorType,
- QCoreApplication::translate(
- "Debugger::Internal::Console",
- "Can only evaluate during a debug session."));
+ auto item = new ConsoleItem(
+ ConsoleItem::ErrorType,
+ QCoreApplication::translate("Debugger", "Can only evaluate during a debug session."));
m_consoleItemModel->shiftEditableRow();
printItem(item);
}
}
-} // Internal
-} // Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/console/console.h b/src/plugins/debugger/console/console.h
index eee5185195..1e561102b0 100644
--- a/src/plugins/debugger/console/console.h
+++ b/src/plugins/debugger/console/console.h
@@ -41,8 +41,7 @@ QT_END_NAMESPACE
namespace Utils { class BoolAspect; }
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
using ScriptEvaluator = std::function<void (QString)>;
@@ -51,15 +50,13 @@ class ConsoleView;
class Console final : public Core::IOutputPane
{
- Q_OBJECT
-
public:
Console();
~Console() override;
QWidget *outputWidget(QWidget *) override;
QList<QWidget *> toolBarWidgets() const override;
- QString displayName() const override { return tr("QML Debugger Console"); }
+ QString displayName() const override;
int priorityInStatusBar() const override;
void clearContents() override;
bool canFocus() const override;
@@ -101,5 +98,4 @@ private:
Console *debuggerConsole();
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/console/consoleedit.cpp b/src/plugins/debugger/console/consoleedit.cpp
index 2a3e46bfb4..bc3103ef73 100644
--- a/src/plugins/debugger/console/consoleedit.cpp
+++ b/src/plugins/debugger/console/consoleedit.cpp
@@ -24,22 +24,15 @@
****************************************************************************/
#include "consoleedit.h"
-#include "consoleitemmodel.h"
#include "console.h"
+
#include <utils/qtcassert.h>
#include <QUrl>
#include <QMenu>
#include <QKeyEvent>
-namespace Debugger {
-namespace Internal {
-
-///////////////////////////////////////////////////////////////////////
-//
-// ConsoleEdit
-//
-///////////////////////////////////////////////////////////////////////
+namespace Debugger::Internal {
ConsoleEdit::ConsoleEdit(const QModelIndex &index, QWidget *parent) :
QTextEdit(parent),
@@ -154,5 +147,4 @@ void ConsoleEdit::replaceCurrentScript(const QString &script)
setTextCursor(cursor);
}
-} // Internal
-} // Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/console/consoleedit.h b/src/plugins/debugger/console/consoleedit.h
index 44ef4bd112..39143b405b 100644
--- a/src/plugins/debugger/console/consoleedit.h
+++ b/src/plugins/debugger/console/consoleedit.h
@@ -29,8 +29,7 @@
#include <QString>
#include <QTextEdit>
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
class ConsoleEdit : public QTextEdit
{
@@ -57,5 +56,4 @@ private:
QString m_cachedScript;
};
-} // Debugger
-} // Internal
+} // Debugger::Internal
diff --git a/src/plugins/debugger/console/consoleitem.cpp b/src/plugins/debugger/console/consoleitem.cpp
index d22e14d6b4..8dfb8f669f 100644
--- a/src/plugins/debugger/console/consoleitem.cpp
+++ b/src/plugins/debugger/console/consoleitem.cpp
@@ -25,8 +25,7 @@
#include "consoleitem.h"
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
static QString addZeroWidthSpace(QString text)
{
@@ -157,5 +156,4 @@ QString ConsoleItem::expression() const
return text().remove(QChar(0x200b)); // ZERO WIDTH SPACE
}
-} // Internal
-} // Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/console/consoleitem.h b/src/plugins/debugger/console/consoleitem.h
index 5e6b5a4d77..508b481c27 100644
--- a/src/plugins/debugger/console/consoleitem.h
+++ b/src/plugins/debugger/console/consoleitem.h
@@ -27,11 +27,7 @@
#include <utils/treemodel.h>
-#include <QString>
-#include <functional>
-
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
class ConsoleItem : public Utils::TreeItem
{
@@ -80,5 +76,4 @@ private:
std::function<void(ConsoleItem *)> m_doFetch;
};
-} // Internal
-} // Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/console/consoleitemdelegate.cpp b/src/plugins/debugger/console/consoleitemdelegate.cpp
index ef3cd9435d..fd9dd99b16 100644
--- a/src/plugins/debugger/console/consoleitemdelegate.cpp
+++ b/src/plugins/debugger/console/consoleitemdelegate.cpp
@@ -24,6 +24,7 @@
****************************************************************************/
#include "consoleitemdelegate.h"
+
#include "consoleedit.h"
#include <coreplugin/coreconstants.h>
@@ -39,14 +40,7 @@
const int ELLIPSIS_GRADIENT_WIDTH = 16;
-namespace Debugger {
-namespace Internal {
-
-///////////////////////////////////////////////////////////////////////
-//
-// ConsoleItemDelegate
-//
-///////////////////////////////////////////////////////////////////////
+namespace Debugger::Internal {
ConsoleItemDelegate::ConsoleItemDelegate(ConsoleItemModel *model, QObject *parent) :
QStyledItemDelegate(parent),
@@ -328,5 +322,4 @@ qreal ConsoleItemDelegate::layoutText(QTextLayout &tl, int width,
return height;
}
-} // Internal
-} // Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/console/consoleitemdelegate.h b/src/plugins/debugger/console/consoleitemdelegate.h
index 480c588bc2..c4d7cf4e91 100644
--- a/src/plugins/debugger/console/consoleitemdelegate.h
+++ b/src/plugins/debugger/console/consoleitemdelegate.h
@@ -26,18 +26,15 @@
#pragma once
#include "consoleitemmodel.h"
-#include "console.h"
#include <QStyledItemDelegate>
QT_FORWARD_DECLARE_CLASS(QTextLayout)
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
class ConsoleItemDelegate : public QStyledItemDelegate
{
- Q_OBJECT
public:
ConsoleItemDelegate(ConsoleItemModel *model, QObject *parent);
@@ -164,5 +161,4 @@ public:
static const int ITEM_SPACING = 4;
};
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/console/consoleitemmodel.cpp b/src/plugins/debugger/console/consoleitemmodel.cpp
index aa31132956..c43417eeb1 100644
--- a/src/plugins/debugger/console/consoleitemmodel.cpp
+++ b/src/plugins/debugger/console/consoleitemmodel.cpp
@@ -28,14 +28,7 @@
#include <QFontMetrics>
#include <QFont>
-namespace Debugger {
-namespace Internal {
-
-///////////////////////////////////////////////////////////////////////
-//
-// ConsoleItemModel
-//
-///////////////////////////////////////////////////////////////////////
+namespace Debugger::Internal {
ConsoleItemModel::ConsoleItemModel(QObject *parent) :
Utils::TreeModel<>(new ConsoleItem, parent)
@@ -103,5 +96,4 @@ int ConsoleItemModel::sizeOfLineNumber(const QFont &font)
return fm.horizontalAdvance("88888");
}
-} // Internal
-} // Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/console/consoleitemmodel.h b/src/plugins/debugger/console/consoleitemmodel.h
index 921b5d1cc9..7bd6b00aad 100644
--- a/src/plugins/debugger/console/consoleitemmodel.h
+++ b/src/plugins/debugger/console/consoleitemmodel.h
@@ -34,8 +34,7 @@ QT_BEGIN_NAMESPACE
class QFont;
QT_END_NAMESPACE
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
class ConsoleItemModel : public Utils::TreeModel<>
{
@@ -64,5 +63,4 @@ private:
bool m_canFetchMore = false;
};
-} // Internal
-} // Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/console/consoleproxymodel.cpp b/src/plugins/debugger/console/consoleproxymodel.cpp
index 37a395adc6..8f52fb3fe5 100644
--- a/src/plugins/debugger/console/consoleproxymodel.cpp
+++ b/src/plugins/debugger/console/consoleproxymodel.cpp
@@ -24,10 +24,8 @@
****************************************************************************/
#include "consoleproxymodel.h"
-#include "consoleitemmodel.h"
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
ConsoleProxyModel::ConsoleProxyModel(QObject *parent) :
QSortFilterProxyModel(parent),
@@ -81,5 +79,4 @@ void ConsoleProxyModel::onRowsInserted(const QModelIndex &index, int start, int
} while (--rowIndex >= start);
}
-} // Internal
-} // Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/console/consoleproxymodel.h b/src/plugins/debugger/console/consoleproxymodel.h
index c97c4f10cf..abb96c79af 100644
--- a/src/plugins/debugger/console/consoleproxymodel.h
+++ b/src/plugins/debugger/console/consoleproxymodel.h
@@ -30,8 +30,7 @@
#include <QSortFilterProxyModel>
#include <QItemSelectionModel>
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
class ConsoleProxyModel : public QSortFilterProxyModel
{
@@ -59,5 +58,4 @@ private:
QFlags<ConsoleItem::ItemType> m_filter;
};
-} // Internal
-} // Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/console/consoleview.cpp b/src/plugins/debugger/console/consoleview.cpp
index 72ff8cedef..2053f42402 100644
--- a/src/plugins/debugger/console/consoleview.cpp
+++ b/src/plugins/debugger/console/consoleview.cpp
@@ -24,8 +24,10 @@
****************************************************************************/
#include "consoleview.h"
+
#include "consoleitemdelegate.h"
#include "consoleitemmodel.h"
+#include "../debuggertr.h"
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/manhattanstyle.h>
@@ -145,14 +147,14 @@ void ConsoleView::contextMenuEvent(QContextMenuEvent *event)
QModelIndex itemIndex = indexAt(event->pos());
QMenu menu;
- auto copy = new QAction(tr("&Copy"), this);
+ auto copy = new QAction(Tr::tr("&Copy"), this);
copy->setEnabled(itemIndex.isValid());
menu.addAction(copy);
- auto show = new QAction(tr("&Show in Editor"), this);
+ auto show = new QAction(Tr::tr("&Show in Editor"), this);
show->setEnabled(canShowItemInTextEditor(itemIndex));
menu.addAction(show);
menu.addSeparator();
- auto clear = new QAction(tr("C&lear"), this);
+ auto clear = new QAction(Tr::tr("C&lear"), this);
menu.addAction(clear);
QAction *a = menu.exec(event->globalPos());
diff --git a/src/plugins/debugger/console/consoleview.h b/src/plugins/debugger/console/consoleview.h
index 9e3f2013bb..42d8872eff 100644
--- a/src/plugins/debugger/console/consoleview.h
+++ b/src/plugins/debugger/console/consoleview.h
@@ -28,15 +28,12 @@
#include <utils/fileinprojectfinder.h>
#include <utils/itemviews.h>
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
class ConsoleItemModel;
class ConsoleView : public Utils::TreeView
{
- Q_OBJECT
-
public:
ConsoleView(ConsoleItemModel *model, QWidget *parent);
@@ -60,5 +57,4 @@ private:
Utils::FileInProjectFinder m_finder;
};
-} // Internal
-} // Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/debuggeractions.cpp b/src/plugins/debugger/debuggeractions.cpp
index 31b325c2bc..c6c016f8f6 100644
--- a/src/plugins/debugger/debuggeractions.cpp
+++ b/src/plugins/debugger/debuggeractions.cpp
@@ -28,6 +28,7 @@
#include "commonoptionspage.h"
#include "debuggericons.h"
#include "debuggerinternalconstants.h"
+#include "debuggertr.h"
#ifdef Q_OS_WIN
#include "registerpostmortemaction.h"
@@ -45,12 +46,11 @@
using namespace Utils;
+namespace Debugger::Internal {
+
const char debugModeSettingsGroupC[] = "DebugMode";
const char cdbSettingsGroupC[] = "CDB2";
-namespace Debugger {
-namespace Internal {
-
//////////////////////////////////////////////////////////////////////////
//
// DebuggerSettings
@@ -72,79 +72,79 @@ DebuggerSettings::DebuggerSettings()
const QString debugModeGroup(debugModeSettingsGroupC);
const QString cdbSettingsGroup(cdbSettingsGroupC);
- settingsDialog.setLabelText(tr("Configure Debugger..."));
+ settingsDialog.setLabelText(Tr::tr("Configure Debugger..."));
/*
groupBoxPluginDebugging = new QGroupBox(q);
- groupBoxPluginDebugging->setTitle(GdbOptionsPage::tr(
+ groupBoxPluginDebugging->setTitle(Tr::tr(
"Behavior of Breakpoint Setting in Plugins"));
radioButtonAllPluginBreakpoints = new QRadioButton(groupBoxPluginDebugging);
- radioButtonAllPluginBreakpoints->setText(GdbOptionsPage::tr(
+ radioButtonAllPluginBreakpoints->setText(Tr::tr(
"Always try to set breakpoints in plugins automatically"));
- radioButtonAllPluginBreakpoints->setToolTip(GdbOptionsPage::tr(
+ radioButtonAllPluginBreakpoints->setToolTip(Tr::tr(
"This is the slowest but safest option."));
radioButtonSelectedPluginBreakpoints = new QRadioButton(groupBoxPluginDebugging);
- radioButtonSelectedPluginBreakpoints->setText(GdbOptionsPage::tr(
+ radioButtonSelectedPluginBreakpoints->setText(Tr::tr(
"Try to set breakpoints in selected plugins"));
radioButtonNoPluginBreakpoints = new QRadioButton(groupBoxPluginDebugging);
- radioButtonNoPluginBreakpoints->setText(GdbOptionsPage::tr(
+ radioButtonNoPluginBreakpoints->setText(Tr::tr(
"Never set breakpoints in plugins automatically"));
lineEditSelectedPluginBreakpointsPattern = new QLineEdit(groupBoxPluginDebugging);
labelSelectedPluginBreakpoints = new QLabel(groupBoxPluginDebugging);
- labelSelectedPluginBreakpoints->setText(GdbOptionsPage::tr(
+ labelSelectedPluginBreakpoints->setText(Tr::tr(
"Matching regular expression: "));
*/
//
// View
//
- alwaysAdjustColumnWidths.setLabelText(tr("Always Adjust View Column Widths to Contents"));
+ alwaysAdjustColumnWidths.setLabelText(Tr::tr("Always Adjust View Column Widths to Contents"));
alwaysAdjustColumnWidths.setSettingsKey(debugModeGroup, "AlwaysAdjustColumnWidths");
alwaysAdjustColumnWidths.setDefaultValue(true);
// Needed by QML Inspector
- //useAlternatingRowColors.setLabelText(tr("Use Alternating Row Colors"));
+ //useAlternatingRowColors.setLabelText(Tr::tr("Use Alternating Row Colors"));
useAlternatingRowColors.setSettingsKey(debugModeGroup, "UseAlternatingRowColours");
- useAlternatingRowColors.setLabelText(tr("Use alternating row colors in debug views"));
+ useAlternatingRowColors.setLabelText(Tr::tr("Use alternating row colors in debug views"));
stationaryEditorWhileStepping.setSettingsKey(debugModeGroup, "StationaryEditorWhileStepping");
- stationaryEditorWhileStepping.setLabelText(tr("Keep editor stationary when stepping"));
- stationaryEditorWhileStepping.setToolTip(tr("Scrolls the editor only when it is necessary "
+ stationaryEditorWhileStepping.setLabelText(Tr::tr("Keep editor stationary when stepping"));
+ stationaryEditorWhileStepping.setToolTip(Tr::tr("Scrolls the editor only when it is necessary "
"to keep the current line in view, "
"instead of keeping the next statement centered at "
"all times."));
forceLoggingToConsole.setSettingsKey(debugModeGroup, "ForceLoggingToConsole");
- forceLoggingToConsole.setLabelText(tr("Force logging to console"));
- forceLoggingToConsole.setToolTip(tr("Sets QT_LOGGING_TO_CONSOLE=1 in the environment "
+ forceLoggingToConsole.setLabelText(Tr::tr("Force logging to console"));
+ forceLoggingToConsole.setToolTip(Tr::tr("Sets QT_LOGGING_TO_CONSOLE=1 in the environment "
"of the debugged program, preventing storing debug output "
"in system logs."));
fontSizeFollowsEditor.setSettingsKey(debugModeGroup, "FontSizeFollowsEditor");
- fontSizeFollowsEditor.setToolTip(tr("Changes the font size in the debugger views when"
+ fontSizeFollowsEditor.setToolTip(Tr::tr("Changes the font size in the debugger views when"
"the font size in the main editor changes."));
- fontSizeFollowsEditor.setLabelText(tr("Debugger font size follows main editor"));
+ fontSizeFollowsEditor.setLabelText(Tr::tr("Debugger font size follows main editor"));
useMessageBoxForSignals.setSettingsKey(debugModeGroup, "UseMessageBoxForSignals");
useMessageBoxForSignals.setDefaultValue(true);
- useMessageBoxForSignals.setLabelText(/*GdbOptionsPage::*/tr(
+ useMessageBoxForSignals.setLabelText(Tr::tr(
"Show a message box when receiving a signal"));
- useMessageBoxForSignals.setToolTip(/*GdbOptionsPage::*/tr(
+ useMessageBoxForSignals.setToolTip(Tr::tr(
"Displays a message box as soon as your application\n"
"receives a signal like SIGSEGV during debugging."));
- logTimeStamps.setLabelText(tr("Log Time Stamps"));
+ logTimeStamps.setLabelText(Tr::tr("Log Time Stamps"));
logTimeStamps.setSettingsKey(debugModeGroup, "LogTimeStamps");
- autoDerefPointers.setLabelText(tr("Dereference Pointers Automatically"));
+ autoDerefPointers.setLabelText(Tr::tr("Dereference Pointers Automatically"));
autoDerefPointers.setDefaultValue(true);
autoDerefPointers.setSettingsKey(debugModeGroup, "AutoDerefPointers");
- autoDerefPointers.setToolTip(tr("<p>This switches the Locals and Expressions views to "
+ autoDerefPointers.setToolTip(Tr::tr("<p>This switches the Locals and Expressions views to "
"automatically dereference pointers. This saves a level in the "
"tree view, but also loses data for the now-missing intermediate "
"level."));
@@ -155,7 +155,7 @@ DebuggerSettings::DebuggerSettings()
cdbAdditionalArguments.setSettingsKey(cdbSettingsGroup, "AdditionalArguments");
cdbAdditionalArguments.setDisplayStyle(StringAspect::LineEditDisplay);
- cdbAdditionalArguments.setLabelText(tr("Additional arguments:"));
+ cdbAdditionalArguments.setLabelText(Tr::tr("Additional arguments:"));
cdbSymbolPaths.setSettingsKey(cdbSettingsGroup, "SymbolPaths");
cdbSourcePaths.setSettingsKey(cdbSettingsGroup, "SourcePaths");
@@ -166,68 +166,68 @@ DebuggerSettings::DebuggerSettings()
CommonOptionsPage::msgSetBreakpointAtFunction(Constants::CRT_DEBUG_REPORT));
cdbBreakOnCrtDbgReport.setToolTip(
CommonOptionsPage::msgSetBreakpointAtFunctionToolTip(Constants::CRT_DEBUG_REPORT,
- tr("Catches runtime error messages caused by assert(), for example.")));
+ Tr::tr("Catches runtime error messages caused by assert(), for example.")));
useCdbConsole.setSettingsKey(cdbSettingsGroup, "CDB_Console");
- useCdbConsole.setToolTip("<html><head/><body><p>" + tr(
+ useCdbConsole.setToolTip("<html><head/><body><p>" + Tr::tr(
"Uses CDB's native console for console applications. "
"This overrides the setting in Environment > System. "
"The native console does not prompt on application exit. "
"It is suitable for diagnosing cases in which the application does not "
"start up properly in the configured console and the subsequent attach fails.")
+ "</p></body></html>");
- useCdbConsole.setLabelText(tr("Use CDB &console"));
+ useCdbConsole.setLabelText(Tr::tr("Use CDB &console"));
cdbBreakPointCorrection.setSettingsKey(cdbSettingsGroup, "BreakpointCorrection");
cdbBreakPointCorrection.setDefaultValue(true);
- cdbBreakPointCorrection.setToolTip("<html><head/><body><p>" + tr(
+ cdbBreakPointCorrection.setToolTip("<html><head/><body><p>" + Tr::tr(
"Attempts to correct the location of a breakpoint based on file and line number should"
"it be in a comment or in a line for which no code is generated. "
"The correction is based on the code model.") + "</p></body></html>");
- cdbBreakPointCorrection.setLabelText(tr("Correct breakpoint location"));
+ cdbBreakPointCorrection.setLabelText(Tr::tr("Correct breakpoint location"));
cdbUsePythonDumper.setSettingsKey(cdbSettingsGroup, "UsePythonDumper");
cdbUsePythonDumper.setDefaultValue(true);
- cdbUsePythonDumper.setLabelText(tr("Use Python dumper"));
+ cdbUsePythonDumper.setLabelText(Tr::tr("Use Python dumper"));
firstChanceExceptionTaskEntry.setSettingsKey(cdbSettingsGroup, "FirstChanceExceptionTaskEntry");
firstChanceExceptionTaskEntry.setDefaultValue(true);
- firstChanceExceptionTaskEntry.setLabelText(tr("First chance exceptions"));
+ firstChanceExceptionTaskEntry.setLabelText(Tr::tr("First chance exceptions"));
secondChanceExceptionTaskEntry.setSettingsKey(cdbSettingsGroup, "SecondChanceExceptionTaskEntry");
secondChanceExceptionTaskEntry.setDefaultValue(true);
- secondChanceExceptionTaskEntry.setLabelText(tr("Second chance exceptions"));
+ secondChanceExceptionTaskEntry.setLabelText(Tr::tr("Second chance exceptions"));
ignoreFirstChanceAccessViolation.setSettingsKey(cdbSettingsGroup, "IgnoreFirstChanceAccessViolation");
- ignoreFirstChanceAccessViolation.setLabelText(tr("Ignore first chance access violations"));
+ ignoreFirstChanceAccessViolation.setLabelText(Tr::tr("Ignore first chance access violations"));
//
// Locals & Watchers
//
showStdNamespace.setSettingsKey(debugModeGroup, "ShowStandardNamespace");
showStdNamespace.setDefaultValue(true);
- showStdNamespace.setDisplayName(tr("Show \"std::\" Namespace in Types"));
- showStdNamespace.setLabelText(tr("Show \"std::\" namespace in types"));
- showStdNamespace.setToolTip(tr("<p>Shows \"std::\" prefix for types from the standard library."));
+ showStdNamespace.setDisplayName(Tr::tr("Show \"std::\" Namespace in Types"));
+ showStdNamespace.setLabelText(Tr::tr("Show \"std::\" namespace in types"));
+ showStdNamespace.setToolTip(Tr::tr("<p>Shows \"std::\" prefix for types from the standard library."));
showQtNamespace.setSettingsKey(debugModeGroup, "ShowQtNamespace");
showQtNamespace.setDefaultValue(true);
- showQtNamespace.setDisplayName(tr("Show Qt's Namespace in Types"));
- showQtNamespace.setLabelText(tr("Show Qt's namespace in types"));
- showQtNamespace.setToolTip(tr("<p>Shows Qt namespace prefix for Qt types. This is only "
+ showQtNamespace.setDisplayName(Tr::tr("Show Qt's Namespace in Types"));
+ showQtNamespace.setLabelText(Tr::tr("Show Qt's namespace in types"));
+ showQtNamespace.setToolTip(Tr::tr("<p>Shows Qt namespace prefix for Qt types. This is only "
"relevant if Qt was configured with \"-qtnamespace\"."));
showQObjectNames.setSettingsKey(debugModeGroup, "ShowQObjectNames2");
showQObjectNames.setDefaultValue(true);
- showQObjectNames.setDisplayName(tr("Show QObject names if available"));
- showQObjectNames.setLabelText(tr("Show QObject names if available"));
- showQObjectNames.setToolTip(tr("<p>Displays the objectName property of QObject based items. "
+ showQObjectNames.setDisplayName(Tr::tr("Show QObject names if available"));
+ showQObjectNames.setLabelText(Tr::tr("Show QObject names if available"));
+ showQObjectNames.setToolTip(Tr::tr("<p>Displays the objectName property of QObject based items. "
"Note that this can negatively impact debugger performance "
"even if no QObjects are present."));
sortStructMembers.setSettingsKey(debugModeGroup, "SortStructMembers");
- sortStructMembers.setDisplayName(tr("Sort Members of Classes and Structs Alphabetically"));
- sortStructMembers.setLabelText(tr("Sort members of classes and structs alphabetically"));
+ sortStructMembers.setDisplayName(Tr::tr("Sort Members of Classes and Structs Alphabetically"));
+ sortStructMembers.setLabelText(Tr::tr("Sort members of classes and structs alphabetically"));
sortStructMembers.setDefaultValue(true);
//
@@ -235,27 +235,27 @@ DebuggerSettings::DebuggerSettings()
//
useDebuggingHelpers.setSettingsKey(debugModeGroup, "UseDebuggingHelper");
useDebuggingHelpers.setDefaultValue(true);
- useDebuggingHelpers.setLabelText(tr("Use Debugging Helpers"));
+ useDebuggingHelpers.setLabelText(Tr::tr("Use Debugging Helpers"));
useCodeModel.setSettingsKey(debugModeGroup, "UseCodeModel");
useCodeModel.setDefaultValue(true);
- useCodeModel.setLabelText(tr("Use code model"));
- useCodeModel.setToolTip(tr("<p>Selecting this causes the C++ Code Model being asked "
+ useCodeModel.setLabelText(Tr::tr("Use code model"));
+ useCodeModel.setToolTip(Tr::tr("<p>Selecting this causes the C++ Code Model being asked "
"for variable scope information. This might result in slightly faster "
"debugger operation but may fail for optimized code."));
showThreadNames.setSettingsKey(debugModeGroup, "ShowThreadNames");
- showThreadNames.setLabelText(tr("Display thread names"));
- showThreadNames.setToolTip(tr("<p>Displays names of QThread based threads."));
+ showThreadNames.setLabelText(Tr::tr("Display thread names"));
+ showThreadNames.setToolTip(Tr::tr("<p>Displays names of QThread based threads."));
//
// Breakpoints
//
- synchronizeBreakpoints.setLabelText(tr("Synchronize Breakpoints"));
+ synchronizeBreakpoints.setLabelText(Tr::tr("Synchronize Breakpoints"));
- adjustBreakpointLocations.setDisplayName(tr("Adjust Breakpoint Locations"));
- adjustBreakpointLocations.setToolTip(tr("<p>Not all source code lines generate "
+ adjustBreakpointLocations.setDisplayName(Tr::tr("Adjust Breakpoint Locations"));
+ adjustBreakpointLocations.setToolTip(Tr::tr("<p>Not all source code lines generate "
"executable code. Putting a breakpoint on such a line acts as "
"if the breakpoint was set on the next line that generated code. "
"Selecting 'Adjust Breakpoint Locations' shifts the red "
@@ -263,9 +263,9 @@ DebuggerSettings::DebuggerSettings()
"breakpoint."));
adjustBreakpointLocations.setDefaultValue(true);
adjustBreakpointLocations.setSettingsKey(debugModeGroup, "AdjustBreakpointLocations");
- adjustBreakpointLocations.setLabelText(/*GdbOptionsPage::*/tr(
+ adjustBreakpointLocations.setLabelText(Tr::tr(
"Adjust breakpoint locations"));
- adjustBreakpointLocations.setToolTip(/*GdbOptionsPage::*/tr(
+ adjustBreakpointLocations.setToolTip(Tr::tr(
"GDB allows setting breakpoints on source lines for which no code \n"
"was generated. In such situations the breakpoint is shifted to the\n"
"next source code line for which code was actually generated.\n"
@@ -273,24 +273,24 @@ DebuggerSettings::DebuggerSettings()
"markers in the source code editor."));
- breakOnThrow.setLabelText(tr("Break on \"throw\""));
+ breakOnThrow.setLabelText(Tr::tr("Break on \"throw\""));
breakOnThrow.setSettingsKey(debugModeGroup, "BreakOnThrow");
- breakOnCatch.setLabelText(tr("Break on \"catch\""));
+ breakOnCatch.setLabelText(Tr::tr("Break on \"catch\""));
breakOnCatch.setSettingsKey(debugModeGroup, "BreakOnCatch");
- breakOnWarning.setLabelText(tr("Break on \"qWarning\""));
+ breakOnWarning.setLabelText(Tr::tr("Break on \"qWarning\""));
breakOnWarning.setSettingsKey(debugModeGroup, "BreakOnWarning");
// FIXME: Move to common settings page.
breakOnWarning.setLabelText(CommonOptionsPage::msgSetBreakpointAtFunction("qWarning"));
breakOnWarning.setToolTip(CommonOptionsPage::msgSetBreakpointAtFunctionToolTip("qWarning"));
- breakOnFatal.setLabelText(tr("Break on \"qFatal\""));
+ breakOnFatal.setLabelText(Tr::tr("Break on \"qFatal\""));
breakOnFatal.setSettingsKey(debugModeGroup, "BreakOnFatal");
breakOnFatal.setLabelText(CommonOptionsPage::msgSetBreakpointAtFunction("qFatal"));
breakOnFatal.setToolTip(CommonOptionsPage::msgSetBreakpointAtFunctionToolTip("qFatal"));
- breakOnAbort.setLabelText(tr("Break on \"abort\""));
+ breakOnAbort.setLabelText(Tr::tr("Break on \"abort\""));
breakOnAbort.setSettingsKey(debugModeGroup, "BreakOnAbort");
breakOnAbort.setLabelText(CommonOptionsPage::msgSetBreakpointAtFunction("abort"));
breakOnAbort.setToolTip(CommonOptionsPage::msgSetBreakpointAtFunctionToolTip("abort"));
@@ -301,46 +301,46 @@ DebuggerSettings::DebuggerSettings()
loadGdbInit.setSettingsKey(debugModeGroup, "LoadGdbInit");
loadGdbInit.setDefaultValue(true);
- loadGdbInit.setLabelText(/*GdbOptionsPage::*/tr("Load .gdbinit file on startup"));
- loadGdbInit.setToolTip(/*GdbOptionsPage::*/tr(
+ loadGdbInit.setLabelText(Tr::tr("Load .gdbinit file on startup"));
+ loadGdbInit.setToolTip(Tr::tr(
"Allows or inhibits reading the user's default\n"
".gdbinit file on debugger startup."));
loadGdbDumpers.setSettingsKey(debugModeGroup, "LoadGdbDumpers2");
- loadGdbDumpers.setLabelText(/*GdbOptionsPage::*/tr("Load system GDB pretty printers"));
- loadGdbDumpers.setToolTip(/*GdbOptionsPage::*/tr(
+ loadGdbDumpers.setLabelText(Tr::tr("Load system GDB pretty printers"));
+ loadGdbDumpers.setToolTip(Tr::tr(
"Uses the default GDB pretty printers installed in your "
"system or linked to the libraries your application uses."));
autoEnrichParameters.setSettingsKey(debugModeGroup, "AutoEnrichParameters");
autoEnrichParameters.setDefaultValue(true);
- autoEnrichParameters.setLabelText(/*GdbOptionsPage::*/tr(
+ autoEnrichParameters.setLabelText(Tr::tr(
"Use common locations for debug information"));
- autoEnrichParameters.setToolTip(/*GdbOptionsPage::*/tr(
+ autoEnrichParameters.setToolTip(Tr::tr(
"<html><head/><body>Adds common paths to locations "
"of debug information such as <i>/usr/src/debug</i> "
"when starting GDB.</body></html>"));
useDynamicType.setSettingsKey(debugModeGroup, "UseDynamicType");
useDynamicType.setDefaultValue(true);
- useDynamicType.setDisplayName(tr("Use Dynamic Object Type for Display"));
- useDynamicType.setLabelText(/*GdbOptionsPage::*/tr(
+ useDynamicType.setDisplayName(Tr::tr("Use Dynamic Object Type for Display"));
+ useDynamicType.setLabelText(Tr::tr(
"Use dynamic object type for display"));
- useDynamicType.setToolTip(/*GdbOptionsPage::*/tr(
+ useDynamicType.setToolTip(Tr::tr(
"Specifies whether the dynamic or the static type of objects will be "
"displayed. Choosing the dynamic type might be slower."));
targetAsync.setSettingsKey(debugModeGroup, "TargetAsync");
- targetAsync.setLabelText(/*GdbOptionsPage::*/tr(
+ targetAsync.setLabelText(Tr::tr(
"Use asynchronous mode to control the inferior"));
warnOnReleaseBuilds.setSettingsKey(debugModeGroup, "WarnOnReleaseBuilds");
warnOnReleaseBuilds.setDefaultValue(true);
- warnOnReleaseBuilds.setLabelText(tr("Warn when debugging \"Release\" builds"));
- warnOnReleaseBuilds.setToolTip(tr("Shows a warning when starting the debugger "
+ warnOnReleaseBuilds.setLabelText(Tr::tr("Warn when debugging \"Release\" builds"));
+ warnOnReleaseBuilds.setToolTip(Tr::tr("Shows a warning when starting the debugger "
"on a binary with insufficient debug information."));
- QString howToUsePython = /*GdbOptionsPage::*/tr(
+ QString howToUsePython = Tr::tr(
"<p>To execute simple Python commands, prefix them with \"python\".</p>"
"<p>To execute sequences of Python commands spanning multiple lines "
"prepend the block with \"python\" on a separate line, and append "
@@ -351,7 +351,7 @@ DebuggerSettings::DebuggerSettings()
gdbStartupCommands.setSettingsKey(debugModeGroup, "GdbStartupCommands");
gdbStartupCommands.setDisplayStyle(StringAspect::TextEditDisplay);
gdbStartupCommands.setUseGlobalMacroExpander();
- gdbStartupCommands.setToolTip("<html><head/><body><p>" + /*GdbOptionsPage::*/tr(
+ gdbStartupCommands.setToolTip("<html><head/><body><p>" + Tr::tr(
"GDB commands entered here will be executed after "
"GDB has been started, but before the debugged program is started or "
"attached, and before the debugging helpers are initialized.") + "</p>"
@@ -360,7 +360,7 @@ DebuggerSettings::DebuggerSettings()
gdbPostAttachCommands.setSettingsKey(debugModeGroup, "GdbPostAttachCommands");
gdbPostAttachCommands.setDisplayStyle(StringAspect::TextEditDisplay);
gdbPostAttachCommands.setUseGlobalMacroExpander();
- gdbPostAttachCommands.setToolTip("<html><head/><body><p>" + /*GdbOptionsPage::*/tr(
+ gdbPostAttachCommands.setToolTip("<html><head/><body><p>" + Tr::tr(
"GDB commands entered here will be executed after "
"GDB has successfully attached to remote targets.</p>"
"<p>You can add commands to further set up the target here, "
@@ -371,102 +371,100 @@ DebuggerSettings::DebuggerSettings()
extraDumperCommands.setDisplayStyle(StringAspect::TextEditDisplay);
extraDumperCommands.setUseGlobalMacroExpander();
extraDumperCommands.setToolTip("<html><head/><body><p>"
- + tr("Python commands entered here will be executed after built-in "
+ + Tr::tr("Python commands entered here will be executed after built-in "
"debugging helpers have been loaded and fully initialized. You can "
"load additional debugging helpers or modify existing ones here.")
+ "</p></body></html>");
extraDumperFile.setSettingsKey(debugModeGroup, "ExtraDumperFile");
extraDumperFile.setDisplayStyle(StringAspect::PathChooserDisplay);
- extraDumperFile.setDisplayName(tr("Extra Debugging Helpers"));
+ extraDumperFile.setDisplayName(Tr::tr("Extra Debugging Helpers"));
// Label text is intentional empty in the GUI.
- extraDumperFile.setToolTip(tr("Path to a Python file containing additional data dumpers."));
+ extraDumperFile.setToolTip(Tr::tr("Path to a Python file containing additional data dumpers."));
- const QString t = tr("Stopping and stepping in the debugger "
+ const QString t = Tr::tr("Stopping and stepping in the debugger "
"will automatically open views associated with the current location.") + '\n';
closeSourceBuffersOnExit.setSettingsKey(debugModeGroup, "CloseBuffersOnExit");
- closeSourceBuffersOnExit.setLabelText(tr("Close temporary source views on debugger exit"));
- closeSourceBuffersOnExit.setToolTip(t + tr("Closes automatically opened source views when the debugger exits."));
+ closeSourceBuffersOnExit.setLabelText(Tr::tr("Close temporary source views on debugger exit"));
+ closeSourceBuffersOnExit.setToolTip(t + Tr::tr("Closes automatically opened source views when the debugger exits."));
closeMemoryBuffersOnExit.setSettingsKey(debugModeGroup, "CloseMemoryBuffersOnExit");
closeMemoryBuffersOnExit.setDefaultValue(true);
- closeMemoryBuffersOnExit.setLabelText(tr("Close temporary memory views on debugger exit"));
- closeMemoryBuffersOnExit.setToolTip(t + tr("Closes automatically opened memory views when the debugger exits."));
+ closeMemoryBuffersOnExit.setLabelText(Tr::tr("Close temporary memory views on debugger exit"));
+ closeMemoryBuffersOnExit.setToolTip(t + Tr::tr("Closes automatically opened memory views when the debugger exits."));
switchModeOnExit.setSettingsKey(debugModeGroup, "SwitchModeOnExit");
- switchModeOnExit.setLabelText(tr("Switch to previous mode on debugger exit"));
+ switchModeOnExit.setLabelText(Tr::tr("Switch to previous mode on debugger exit"));
breakpointsFullPathByDefault.setSettingsKey(debugModeGroup, "BreakpointsFullPath");
- breakpointsFullPathByDefault.setToolTip(tr("Enables a full file path in breakpoints by default also for GDB."));
- breakpointsFullPathByDefault.setLabelText(tr("Set breakpoints using a full absolute path"));
+ breakpointsFullPathByDefault.setToolTip(Tr::tr("Enables a full file path in breakpoints by default also for GDB."));
+ breakpointsFullPathByDefault.setLabelText(Tr::tr("Set breakpoints using a full absolute path"));
raiseOnInterrupt.setSettingsKey(debugModeGroup, "RaiseOnInterrupt");
raiseOnInterrupt.setDefaultValue(true);
- raiseOnInterrupt.setLabelText(tr("Bring %1 to foreground when application interrupts")
+ raiseOnInterrupt.setLabelText(Tr::tr("Bring %1 to foreground when application interrupts")
.arg(Core::Constants::IDE_DISPLAY_NAME));
autoQuit.setSettingsKey(debugModeGroup, "AutoQuit");
- autoQuit.setLabelText(tr("Automatically Quit Debugger"));
+ autoQuit.setLabelText(Tr::tr("Automatically Quit Debugger"));
multiInferior.setSettingsKey(debugModeGroup, "MultiInferior");
- multiInferior.setLabelText(/*GdbOptionsPage::*/tr("Debug all child processes"));
- multiInferior.setToolTip(/*GdbOptionsPage::*/tr(
+ multiInferior.setLabelText(Tr::tr("Debug all child processes"));
+ multiInferior.setToolTip(Tr::tr(
"<html><head/><body>Keeps debugging all children after a fork."
"</body></html>"));
intelFlavor.setSettingsKey(debugModeGroup, "IntelFlavor");
- intelFlavor.setLabelText(/*GdbOptionsPage::*/tr("Use Intel style disassembly"));
- intelFlavor.setToolTip(/*GdbOptionsPage::*/tr(
- "GDB shows by default AT&&T style disassembly."));
+ intelFlavor.setLabelText(Tr::tr("Use Intel style disassembly"));
+ intelFlavor.setToolTip(Tr::tr("GDB shows by default AT&&T style disassembly."));
useAnnotationsInMainEditor.setSettingsKey(debugModeGroup, "UseAnnotations");
- useAnnotationsInMainEditor.setLabelText(tr("Use annotations in main editor when debugging"));
- useAnnotationsInMainEditor.setToolTip(tr("<p>Shows simple variable values "
+ useAnnotationsInMainEditor.setLabelText(Tr::tr("Use annotations in main editor when debugging"));
+ useAnnotationsInMainEditor.setToolTip(Tr::tr("<p>Shows simple variable values "
"as annotations in the main editor during debugging."));
useAnnotationsInMainEditor.setDefaultValue(true);
usePseudoTracepoints.setSettingsKey(debugModeGroup, "UsePseudoTracepoints");
- usePseudoTracepoints.setLabelText(/*GdbOptionsPage::*/tr("Use pseudo message tracepoints"));
- usePseudoTracepoints.setToolTip(
- /*GdbOptionsPage::*/ tr("Uses Python to extend the ordinary GDB breakpoint class."));
+ usePseudoTracepoints.setLabelText(Tr::tr("Use pseudo message tracepoints"));
+ usePseudoTracepoints.setToolTip(Tr::tr("Uses Python to extend the ordinary GDB breakpoint class."));
usePseudoTracepoints.setDefaultValue(true);
useIndexCache.setSettingsKey(debugModeGroup, "UseIndexCache");
- useIndexCache.setLabelText(tr("Use automatic symbol cache"));
- useIndexCache.setToolTip(tr("It is possible for GDB to automatically save a copy of "
+ useIndexCache.setLabelText(Tr::tr("Use automatic symbol cache"));
+ useIndexCache.setToolTip(Tr::tr("It is possible for GDB to automatically save a copy of "
"its symbol index in a cache on disk and retrieve it from there when loading the same "
"binary in the future."));
useIndexCache.setDefaultValue(true);
useToolTipsInMainEditor.setSettingsKey(debugModeGroup, "UseToolTips");
- useToolTipsInMainEditor.setLabelText(tr("Use tooltips in main editor when debugging"));
- useToolTipsInMainEditor.setToolTip(tr("<p>Enables tooltips for variable "
+ useToolTipsInMainEditor.setLabelText(Tr::tr("Use tooltips in main editor when debugging"));
+ useToolTipsInMainEditor.setToolTip(Tr::tr("<p>Enables tooltips for variable "
"values during debugging. Since this can slow down debugging and "
"does not provide reliable information as it does not use scope "
"information, it is switched off by default."));
useToolTipsInMainEditor.setDefaultValue(true);
useToolTipsInLocalsView.setSettingsKey(debugModeGroup, "UseToolTipsInLocalsView");
- useToolTipsInLocalsView.setLabelText(tr("Use Tooltips in Locals View when Debugging"));
- useToolTipsInLocalsView.setToolTip(tr("<p>Enables tooltips in the locals "
+ useToolTipsInLocalsView.setLabelText(Tr::tr("Use Tooltips in Locals View when Debugging"));
+ useToolTipsInLocalsView.setToolTip(Tr::tr("<p>Enables tooltips in the locals "
"view during debugging."));
useToolTipsInBreakpointsView.setSettingsKey(debugModeGroup, "UseToolTipsInBreakpointsView");
- useToolTipsInBreakpointsView.setLabelText(tr("Use Tooltips in Breakpoints View when Debugging"));
- useToolTipsInBreakpointsView.setToolTip(tr("<p>Enables tooltips in the breakpoints "
+ useToolTipsInBreakpointsView.setLabelText(Tr::tr("Use Tooltips in Breakpoints View when Debugging"));
+ useToolTipsInBreakpointsView.setToolTip(Tr::tr("<p>Enables tooltips in the breakpoints "
"view during debugging."));
useToolTipsInStackView.setSettingsKey(debugModeGroup, "UseToolTipsInStackView");
- useToolTipsInStackView.setLabelText(tr("Use Tooltips in Stack View when Debugging"));
- useToolTipsInStackView.setToolTip(tr("<p>Enables tooltips in the stack "
+ useToolTipsInStackView.setLabelText(Tr::tr("Use Tooltips in Stack View when Debugging"));
+ useToolTipsInStackView.setToolTip(Tr::tr("<p>Enables tooltips in the stack "
"view during debugging."));
useToolTipsInStackView.setDefaultValue(true);
skipKnownFrames.setSettingsKey(debugModeGroup, "SkipKnownFrames");
- skipKnownFrames.setDisplayName(tr("Skip Known Frames"));
- skipKnownFrames.setLabelText(/*GdbOptionsPage::*/tr("Skip known frames when stepping"));
- skipKnownFrames.setToolTip(/*GdbOptionsPage::*/tr(
+ skipKnownFrames.setDisplayName(Tr::tr("Skip Known Frames"));
+ skipKnownFrames.setLabelText(Tr::tr("Skip known frames when stepping"));
+ skipKnownFrames.setToolTip(Tr::tr(
"<html><head/><body><p>"
"Allows <i>Step Into</i> to compress several steps into one step\n"
"for less noisy debugging. For example, the atomic reference\n"
@@ -475,9 +473,9 @@ DebuggerSettings::DebuggerSettings()
enableReverseDebugging.setSettingsKey(debugModeGroup, "EnableReverseDebugging");
enableReverseDebugging.setIcon(Icons::REVERSE_MODE.icon());
- enableReverseDebugging.setDisplayName(tr("Enable Reverse Debugging"));
- enableReverseDebugging.setLabelText(/*GdbOptionsPage::*/tr("Enable reverse debugging"));
- enableReverseDebugging.setToolTip(/*GdbOptionsPage::*/tr(
+ enableReverseDebugging.setDisplayName(Tr::tr("Enable Reverse Debugging"));
+ enableReverseDebugging.setLabelText(Tr::tr("Enable reverse debugging"));
+ enableReverseDebugging.setToolTip(Tr::tr(
"<html><head/><body><p>Enables stepping backwards.</p><p>"
"<b>Note:</b> This feature is very slow and unstable on the GDB side. "
"It exhibits unpredictable behavior when going backwards over system "
@@ -488,10 +486,10 @@ DebuggerSettings::DebuggerSettings()
registerForPostMortem = new RegisterPostMortemAction;
registerForPostMortem->setSettingsKey(debugModeGroup, "RegisterForPostMortem");
registerForPostMortem->setToolTip(
- tr("Registers %1 for debugging crashed applications.")
+ Tr::tr("Registers %1 for debugging crashed applications.")
.arg(Core::Constants::IDE_DISPLAY_NAME));
registerForPostMortem->setLabelText(
- tr("Use %1 for post-mortem debugging")
+ Tr::tr("Use %1 for post-mortem debugging")
.arg(Core::Constants::IDE_DISPLAY_NAME));
#else
// Some dummy.
@@ -511,40 +509,40 @@ DebuggerSettings::DebuggerSettings()
maximalStackDepth.setSettingsKey(debugModeGroup, "MaximalStackDepth");
maximalStackDepth.setDefaultValue(20);
- maximalStackDepth.setSpecialValueText(tr("<unlimited>"));
+ maximalStackDepth.setSpecialValueText(Tr::tr("<unlimited>"));
maximalStackDepth.setRange(0, 1000);
maximalStackDepth.setSingleStep(5);
- maximalStackDepth.setLabelText(tr("Maximum stack depth:"));
+ maximalStackDepth.setLabelText(Tr::tr("Maximum stack depth:"));
displayStringLimit.setSettingsKey(debugModeGroup, "DisplayStringLimit");
displayStringLimit.setDefaultValue(300);
- displayStringLimit.setSpecialValueText(tr("<unlimited>"));
+ displayStringLimit.setSpecialValueText(Tr::tr("<unlimited>"));
displayStringLimit.setRange(20, 10000);
displayStringLimit.setSingleStep(10);
- displayStringLimit.setLabelText(tr("Display string length:"));
- displayStringLimit.setToolTip(tr("<p>The maximum length of string entries in the "
+ displayStringLimit.setLabelText(Tr::tr("Display string length:"));
+ displayStringLimit.setToolTip(Tr::tr("<p>The maximum length of string entries in the "
"Locals and Expressions views. Longer than that are cut off "
"and displayed with an ellipsis attached."));
maximalStringLength.setSettingsKey(debugModeGroup, "MaximalStringLength");
maximalStringLength.setDefaultValue(10000);
- maximalStringLength.setSpecialValueText(tr("<unlimited>"));
+ maximalStringLength.setSpecialValueText(Tr::tr("<unlimited>"));
maximalStringLength.setRange(20, 10000000);
maximalStringLength.setSingleStep(20);
- maximalStringLength.setLabelText(tr("Maximum string length:"));
- maximalStringLength.setToolTip(tr("<p>The maximum length for strings in separated windows. "
+ maximalStringLength.setLabelText(Tr::tr("Maximum string length:"));
+ maximalStringLength.setToolTip(Tr::tr("<p>The maximum length for strings in separated windows. "
"Longer strings are cut off and displayed with an ellipsis attached."));
- expandStack.setLabelText(tr("Reload Full Stack"));
+ expandStack.setLabelText(Tr::tr("Reload Full Stack"));
- createFullBacktrace.setLabelText(tr("Create Full Backtrace"));
+ createFullBacktrace.setLabelText(Tr::tr("Create Full Backtrace"));
gdbWatchdogTimeout.setSettingsKey(debugModeGroup, "WatchdogTimeout");
gdbWatchdogTimeout.setDefaultValue(20);
- gdbWatchdogTimeout.setSuffix(/*GdbOptionsPage::*/tr("sec"));
+ gdbWatchdogTimeout.setSuffix(Tr::tr("sec"));
gdbWatchdogTimeout.setRange(20, 1000000);
- gdbWatchdogTimeout.setLabelText(/*GdbOptionsPage::*/tr("GDB timeout:"));
- gdbWatchdogTimeout.setToolTip(/*GdbOptionsPage::*/tr(
+ gdbWatchdogTimeout.setLabelText(Tr::tr("GDB timeout:"));
+ gdbWatchdogTimeout.setToolTip(Tr::tr(
"The number of seconds before a non-responsive GDB process is terminated.\n"
"The default value of 20 seconds should be sufficient for most\n"
"applications, but there are situations when loading big libraries or\n"
@@ -556,8 +554,9 @@ DebuggerSettings::DebuggerSettings()
//
showQmlObjectTree.setSettingsKey(debugModeGroup, "ShowQmlObjectTree");
showQmlObjectTree.setDefaultValue(true);
- showQmlObjectTree.setToolTip(tr("Shows QML object tree in Locals and Expressions when connected and not stepping."));
- showQmlObjectTree.setLabelText(tr("Show QML object tree"));
+ showQmlObjectTree.setToolTip(Tr::tr("Shows QML object tree in Locals and Expressions "
+ "when connected and not stepping."));
+ showQmlObjectTree.setLabelText(Tr::tr("Show QML object tree"));
const QString qmlInspectorGroup = "QML.Inspector";
showAppOnTop.setSettingsKey(qmlInspectorGroup, "QmlInspector.ShowAppOnTop");
@@ -697,6 +696,5 @@ QString DebuggerSettings::dump()
return "Debugger settings:\n" + settings.join('\n');
}
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/debuggeractions.h b/src/plugins/debugger/debuggeractions.h
index 46036b0c9d..50976bd318 100644
--- a/src/plugins/debugger/debuggeractions.h
+++ b/src/plugins/debugger/debuggeractions.h
@@ -32,8 +32,7 @@
#include <utils/aspects.h>
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
class SourcePathMapAspectPrivate;
@@ -75,8 +74,6 @@ class GeneralSettings
class DebuggerSettings
{
- Q_DECLARE_TR_FUNCTIONS(Debugger::Internal::DebuggerSettings)
-
public:
explicit DebuggerSettings();
~DebuggerSettings();
@@ -203,9 +200,6 @@ private:
DebuggerSettings *debuggerSettings();
-///////////////////////////////////////////////////////////
-
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Internal
Q_DECLARE_METATYPE(Debugger::Internal::SourcePathMap)
diff --git a/src/plugins/debugger/debuggercore.h b/src/plugins/debugger/debuggercore.h
index e4123d3cdd..9927111626 100644
--- a/src/plugins/debugger/debuggercore.h
+++ b/src/plugins/debugger/debuggercore.h
@@ -40,8 +40,7 @@ QT_END_NAMESPACE
namespace Utils { class BaseTreeView; }
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
enum TestCases
{
@@ -66,5 +65,4 @@ QStringList qtBuildPaths();
QWidget *addSearch(Utils::BaseTreeView *treeView);
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/debuggerdialogs.cpp b/src/plugins/debugger/debuggerdialogs.cpp
index f65ddd9190..a5dbec79dd 100644
--- a/src/plugins/debugger/debuggerdialogs.cpp
+++ b/src/plugins/debugger/debuggerdialogs.cpp
@@ -26,14 +26,16 @@
#include "debuggerdialogs.h"
#include "cdb/cdbengine.h"
-#include "debuggerkitinformation.h"
#include "debuggerruncontrol.h"
+#include "debuggertr.h"
#include <app/app_version.h>
#include <coreplugin/icore.h>
#include <projectexplorer/devicesupport/sshparameters.h>
+#include <projectexplorer/kitinformation.h>
+#include <projectexplorer/kitmanager.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/toolchain.h>
@@ -61,8 +63,7 @@ using namespace Core;
using namespace ProjectExplorer;
using namespace Utils;
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
///////////////////////////////////////////////////////////////////////
//
@@ -96,13 +97,11 @@ public:
QDialogButtonBox *buttonBox;
};
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Internal
Q_DECLARE_METATYPE(Debugger::Internal::StartApplicationParameters)
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
///////////////////////////////////////////////////////////////////////
//
@@ -212,31 +211,31 @@ void StartApplicationParameters::fromSettings(const QSettings *settings)
StartApplicationDialog::StartApplicationDialog(QWidget *parent)
: QDialog(parent), d(new StartApplicationDialogPrivate)
{
- setWindowTitle(tr("Start Debugger"));
+ setWindowTitle(Tr::tr("Start Debugger"));
d->kitChooser = new KitChooser(this);
d->kitChooser->setShowIcons(true);
d->kitChooser->populate();
- d->serverPortLabel = new QLabel(tr("Server port:"), this);
+ d->serverPortLabel = new QLabel(Tr::tr("Server port:"), this);
d->serverPortSpinBox = new QSpinBox(this);
d->serverPortSpinBox->setRange(1, 65535);
d->channelOverrideHintLabel =
- new QLabel(tr("Normally, the running server is identified by the IP of the "
+ new QLabel(Tr::tr("Normally, the running server is identified by the IP of the "
"device in the kit and the server port selected above.\n"
"You can choose another communication channel here, such as "
"a serial line or custom ip:port."));
- d->channelOverrideLabel = new QLabel(tr("Override server channel:"), this);
+ d->channelOverrideLabel = new QLabel(Tr::tr("Override server channel:"), this);
d->channelOverrideEdit = new QLineEdit(this);
//: "For example, /dev/ttyS0, COM1, 127.0.0.1:1234"
d->channelOverrideEdit->setPlaceholderText(
- tr("For example, %1").arg("/dev/ttyS0, COM1, 127.0.0.1:1234"));
+ Tr::tr("For example, %1").arg("/dev/ttyS0, COM1, 127.0.0.1:1234"));
d->localExecutablePathChooser = new PathChooser(this);
d->localExecutablePathChooser->setExpectedKind(PathChooser::File);
- d->localExecutablePathChooser->setPromptDialogTitle(tr("Select Executable"));
+ d->localExecutablePathChooser->setPromptDialogTitle(Tr::tr("Select Executable"));
d->localExecutablePathChooser->setHistoryCompleter("LocalExecutable");
d->arguments = new FancyLineEdit(this);
@@ -244,7 +243,7 @@ StartApplicationDialog::StartApplicationDialog(QWidget *parent)
d->workingDirectory = new PathChooser(this);
d->workingDirectory->setExpectedKind(PathChooser::ExistingDirectory);
- d->workingDirectory->setPromptDialogTitle(tr("Select Working Directory"));
+ d->workingDirectory->setPromptDialogTitle(Tr::tr("Select Working Directory"));
d->workingDirectory->setHistoryCompleter("WorkingDirectory");
d->runInTerminalCheckBox = new QCheckBox(this);
@@ -257,32 +256,32 @@ StartApplicationDialog::StartApplicationDialog(QWidget *parent)
d->sysRootPathChooser = new PathChooser(this);
d->sysRootPathChooser->setExpectedKind(PathChooser::Directory);
d->sysRootPathChooser->setHistoryCompleter("Debugger.SysRoot.History");
- d->sysRootPathChooser->setPromptDialogTitle(tr("Select SysRoot Directory"));
- d->sysRootPathChooser->setToolTip(tr(
+ d->sysRootPathChooser->setPromptDialogTitle(Tr::tr("Select SysRoot Directory"));
+ d->sysRootPathChooser->setToolTip(Tr::tr(
"This option can be used to override the kit's SysRoot setting."));
- d->sysRootLabel = new QLabel(tr("Override S&ysRoot:"), this);
+ d->sysRootLabel = new QLabel(Tr::tr("Override S&ysRoot:"), this);
d->sysRootLabel->setBuddy(d->sysRootPathChooser);
d->sysRootLabel->setToolTip(d->sysRootPathChooser->toolTip());
d->serverInitCommandsTextEdit = new QPlainTextEdit(this);
- d->serverInitCommandsTextEdit->setToolTip(tr(
+ d->serverInitCommandsTextEdit->setToolTip(Tr::tr(
"This option can be used to send the target init commands."));
- d->serverInitCommandsLabel = new QLabel(tr("&Init commands:"), this);
+ d->serverInitCommandsLabel = new QLabel(Tr::tr("&Init commands:"), this);
d->serverInitCommandsLabel->setBuddy(d->serverInitCommandsTextEdit);
d->serverInitCommandsLabel->setToolTip(d->serverInitCommandsTextEdit->toolTip());
d->serverResetCommandsTextEdit = new QPlainTextEdit(this);
- d->serverResetCommandsTextEdit->setToolTip(tr(
+ d->serverResetCommandsTextEdit->setToolTip(Tr::tr(
"This option can be used to send the target reset commands."));
- d->serverResetCommandsLabel = new QLabel(tr("&Reset commands:"), this);
+ d->serverResetCommandsLabel = new QLabel(Tr::tr("&Reset commands:"), this);
d->serverResetCommandsLabel->setBuddy(d->serverResetCommandsTextEdit);
d->serverResetCommandsLabel->setToolTip(d->serverResetCommandsTextEdit->toolTip());
d->debuginfoPathChooser = new PathChooser(this);
- d->debuginfoPathChooser->setPromptDialogTitle(tr("Select Location of Debugging Information"));
- d->debuginfoPathChooser->setToolTip(tr(
+ d->debuginfoPathChooser->setPromptDialogTitle(Tr::tr("Select Location of Debugging Information"));
+ d->debuginfoPathChooser->setToolTip(Tr::tr(
"Base path for external debug information and debug sources. "
"If empty, $SYSROOT/usr/lib/debug will be chosen."));
d->debuginfoPathChooser->setHistoryCompleter("Debugger.DebugLocation.History");
@@ -303,22 +302,22 @@ StartApplicationDialog::StartApplicationDialog(QWidget *parent)
auto formLayout = new QFormLayout();
formLayout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow);
- formLayout->addRow(tr("&Kit:"), d->kitChooser);
+ formLayout->addRow(Tr::tr("&Kit:"), d->kitChooser);
formLayout->addRow(d->serverPortLabel, d->serverPortSpinBox);
- formLayout->addRow(tr("Local &executable:"), d->localExecutablePathChooser);
- formLayout->addRow(tr("Command line &arguments:"), d->arguments);
- formLayout->addRow(tr("&Working directory:"), d->workingDirectory);
- formLayout->addRow(tr("Run in &terminal:"), d->runInTerminalCheckBox);
- formLayout->addRow(tr("Break at \"&main\":"), d->breakAtMainCheckBox);
- formLayout->addRow(tr("Use target extended-remote to connect:"), d->useTargetExtendedRemoteCheckBox);
+ formLayout->addRow(Tr::tr("Local &executable:"), d->localExecutablePathChooser);
+ formLayout->addRow(Tr::tr("Command line &arguments:"), d->arguments);
+ formLayout->addRow(Tr::tr("&Working directory:"), d->workingDirectory);
+ formLayout->addRow(Tr::tr("Run in &terminal:"), d->runInTerminalCheckBox);
+ formLayout->addRow(Tr::tr("Break at \"&main\":"), d->breakAtMainCheckBox);
+ formLayout->addRow(Tr::tr("Use target extended-remote to connect:"), d->useTargetExtendedRemoteCheckBox);
formLayout->addRow(d->sysRootLabel, d->sysRootPathChooser);
formLayout->addRow(d->serverInitCommandsLabel, d->serverInitCommandsTextEdit);
formLayout->addRow(d->serverResetCommandsLabel, d->serverResetCommandsTextEdit);
- formLayout->addRow(tr("Debug &information:"), d->debuginfoPathChooser);
+ formLayout->addRow(Tr::tr("Debug &information:"), d->debuginfoPathChooser);
formLayout->addRow(d->channelOverrideHintLabel);
formLayout->addRow(d->channelOverrideLabel, d->channelOverrideEdit);
formLayout->addRow(line2);
- formLayout->addRow(tr("&Recent:"), d->historyComboBox);
+ formLayout->addRow(Tr::tr("&Recent:"), d->historyComboBox);
auto verticalLayout = new QVBoxLayout(this);
verticalLayout->addLayout(formLayout);
@@ -463,7 +462,7 @@ void StartApplicationDialog::run(bool attachRemote)
debugger->setStartMode(AttachToRemoteServer);
debugger->setCloseMode(KillAtClose);
debugger->setUseContinueInsteadOfRun(true);
- debugger->setRunControlName(tr("Attach to %1").arg(debugger->remoteChannel()));
+ debugger->setRunControlName(Tr::tr("Attach to %1").arg(debugger->remoteChannel()));
}
debugger->startRunControl();
}
@@ -532,7 +531,7 @@ AttachToQmlPortDialog::AttachToQmlPortDialog(QWidget *parent)
: QDialog(parent),
d(new AttachToQmlPortDialogPrivate)
{
- setWindowTitle(tr("Start Debugger"));
+ setWindowTitle(Tr::tr("Start Debugger"));
d->kitChooser = new KitChooser(this);
d->kitChooser->setShowIcons(true);
@@ -547,8 +546,8 @@ AttachToQmlPortDialog::AttachToQmlPortDialog(QWidget *parent)
buttonBox->button(QDialogButtonBox::Ok)->setDefault(true);
auto formLayout = new QFormLayout();
- formLayout->addRow(tr("Kit:"), d->kitChooser);
- formLayout->addRow(tr("&Port:"), d->portSpinBox);
+ formLayout->addRow(Tr::tr("Kit:"), d->kitChooser);
+ formLayout->addRow(Tr::tr("&Port:"), d->portSpinBox);
auto verticalLayout = new QVBoxLayout(this);
verticalLayout->addLayout(formLayout);
@@ -598,7 +597,7 @@ static QString cdbRemoteHelp()
const QString ext32 = QDir::toNativeSeparators(CdbEngine::extensionLibraryName(false));
const QString ext64 = QDir::toNativeSeparators(CdbEngine::extensionLibraryName(true));
- return StartRemoteCdbDialog::tr(
+ return Tr::tr(
"<html><body><p>The remote CDB needs to load the matching %1 CDB extension "
"(<code>%2</code> or <code>%3</code>, respectively).</p><p>Copy it onto the remote machine and set the "
"environment variable <code>%4</code> to point to its folder.</p><p>"
@@ -614,7 +613,7 @@ static QString cdbRemoteHelp()
StartRemoteCdbDialog::StartRemoteCdbDialog(QWidget *parent) :
QDialog(parent), m_lineEdit(new QLineEdit)
{
- setWindowTitle(tr("Start a CDB Remote Session"));
+ setWindowTitle(Tr::tr("Start a CDB Remote Session"));
auto groupBox = new QGroupBox;
@@ -622,7 +621,7 @@ StartRemoteCdbDialog::StartRemoteCdbDialog(QWidget *parent) :
helpLabel->setWordWrap(true);
helpLabel->setTextInteractionFlags(Qt::TextBrowserInteraction);
- auto label = new QLabel(tr("&Connection:"));
+ auto label = new QLabel(Tr::tr("&Connection:"));
label->setBuddy(m_lineEdit);
m_lineEdit->setMinimumWidth(400);
@@ -686,10 +685,10 @@ AddressDialog::AddressDialog(QWidget *parent) :
m_lineEdit(new QLineEdit),
m_box(new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel))
{
- setWindowTitle(tr("Select Start Address"));
+ setWindowTitle(Tr::tr("Select Start Address"));
auto hLayout = new QHBoxLayout;
- hLayout->addWidget(new QLabel(tr("Enter an address:") + ' '));
+ hLayout->addWidget(new QLabel(Tr::tr("Enter an address:") + ' '));
hLayout->addWidget(m_lineEdit);
auto vLayout = new QVBoxLayout;
@@ -764,7 +763,7 @@ public:
StartRemoteEngineDialog::StartRemoteEngineDialog(QWidget *parent)
: QDialog(parent), d(new StartRemoteEngineDialogPrivate)
{
- setWindowTitle(tr("Start Remote Engine"));
+ setWindowTitle(Tr::tr("Start Remote Engine"));
d->host = new FancyLineEdit(this);
d->host->setHistoryCompleter("HostName");
@@ -785,11 +784,11 @@ StartRemoteEngineDialog::StartRemoteEngineDialog(QWidget *parent)
d->buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok);
auto formLayout = new QFormLayout();
- formLayout->addRow(tr("&Host:"), d->host);
- formLayout->addRow(tr("&Username:"), d->username);
- formLayout->addRow(tr("&Password:"), d->password);
- formLayout->addRow(tr("&Engine path:"), d->enginePath);
- formLayout->addRow(tr("&Inferior path:"), d->inferiorPath);
+ formLayout->addRow(Tr::tr("&Host:"), d->host);
+ formLayout->addRow(Tr::tr("&Username:"), d->username);
+ formLayout->addRow(Tr::tr("&Password:"), d->password);
+ formLayout->addRow(Tr::tr("&Engine path:"), d->enginePath);
+ formLayout->addRow(Tr::tr("&Inferior path:"), d->inferiorPath);
auto verticalLayout = new QVBoxLayout(this);
verticalLayout->addLayout(formLayout);
@@ -859,7 +858,7 @@ public:
m_layout->addWidget(new QLabel(type), row, column++);
for (int i = -1; i != typeFormats.size(); ++i) {
auto choice = new QRadioButton(this);
- choice->setText(i == -1 ? TypeFormatsDialog::tr("Reset")
+ choice->setText(i == -1 ? Tr::tr("Reset")
: WatchHandler::nameForFormat(typeFormats.at(i)));
m_layout->addWidget(choice, row, column++);
if (i == current)
@@ -916,10 +915,10 @@ private:
TypeFormatsDialog::TypeFormatsDialog(QWidget *parent)
: QDialog(parent), m_ui(new TypeFormatsDialogUi(this))
{
- setWindowTitle(tr("Type Formats"));
- m_ui->addPage(tr("Qt Types"));
- m_ui->addPage(tr("Standard Types"));
- m_ui->addPage(tr("Misc Types"));
+ setWindowTitle(Tr::tr("Type Formats"));
+ m_ui->addPage(Tr::tr("Qt Types"));
+ m_ui->addPage(Tr::tr("Standard Types"));
+ m_ui->addPage(Tr::tr("Misc Types"));
connect(m_ui->buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
connect(m_ui->buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
@@ -943,5 +942,4 @@ void TypeFormatsDialog::addTypeFormats(const QString &type0,
m_ui->pages[pos]->addTypeFormats(type, typeFormats, current);
}
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/debuggerdialogs.h b/src/plugins/debugger/debuggerdialogs.h
index 51e2c6df44..aca22533ca 100644
--- a/src/plugins/debugger/debuggerdialogs.h
+++ b/src/plugins/debugger/debuggerdialogs.h
@@ -38,8 +38,7 @@ class QLineEdit;
class QDialogButtonBox;
QT_END_NAMESPACE
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
class AttachToQmlPortDialogPrivate;
class DebuggerRunParameters;
@@ -49,8 +48,6 @@ class StartRemoteEngineDialogPrivate;
class StartApplicationDialog : public QDialog
{
- Q_OBJECT
-
public:
explicit StartApplicationDialog(QWidget *parent);
~StartApplicationDialog() override;
@@ -72,8 +69,6 @@ private:
class AttachToQmlPortDialog : public QDialog
{
- Q_OBJECT
-
public:
explicit AttachToQmlPortDialog(QWidget *parent);
~AttachToQmlPortDialog() override;
@@ -90,8 +85,6 @@ private:
class StartRemoteCdbDialog : public QDialog
{
- Q_OBJECT
-
public:
explicit StartRemoteCdbDialog(QWidget *parent);
~StartRemoteCdbDialog() override;
@@ -109,8 +102,6 @@ private:
class AddressDialog : public QDialog
{
- Q_OBJECT
-
public:
explicit AddressDialog(QWidget *parent = nullptr);
@@ -132,8 +123,6 @@ private:
class StartRemoteEngineDialog : public QDialog
{
- Q_OBJECT
-
public:
explicit StartRemoteEngineDialog(QWidget *parent);
~StartRemoteEngineDialog() override;
@@ -151,8 +140,6 @@ class TypeFormatsDialogUi;
class TypeFormatsDialog : public QDialog
{
- Q_OBJECT
-
public:
explicit TypeFormatsDialog(QWidget *parent);
~TypeFormatsDialog() override;
@@ -164,5 +151,4 @@ private:
TypeFormatsDialogUi *m_ui;
};
-} // namespace Debugger
-} // namespace Internal
+} // Debugger::Internal
diff --git a/src/plugins/debugger/debuggerengine.cpp b/src/plugins/debugger/debuggerengine.cpp
index ffff03082e..e985d4a08f 100644
--- a/src/plugins/debugger/debuggerengine.cpp
+++ b/src/plugins/debugger/debuggerengine.cpp
@@ -32,6 +32,7 @@
#include "debuggericons.h"
#include "debuggerruncontrol.h"
#include "debuggertooltipmanager.h"
+#include "debuggertr.h"
#include "breakhandler.h"
#include "disassembleragent.h"
@@ -228,8 +229,8 @@ public:
} else {
delete agent;
AsynchronousMessageBox::warning(
- DebuggerEngine::tr("No Memory Viewer Available"),
- DebuggerEngine::tr("The memory contents cannot be shown as no viewer plugin "
+ Tr::tr("No Memory Viewer Available"),
+ Tr::tr("The memory contents cannot be shown as no viewer plugin "
"for binary data has been loaded."));
}
}
@@ -281,7 +282,7 @@ public:
m_disassemblerAgent(engine),
m_toolTipManager(engine)
{
- m_debuggerName = DebuggerEngine::tr("Debugger");
+ m_debuggerName = Tr::tr("Debugger");
m_logWindow = new LogWindow(m_engine); // Needed before start()
m_logWindow->setObjectName("Debugger.Dock.Output");
@@ -366,8 +367,8 @@ public:
{
// update tooltips that are visible on the button in the mode selector
const QString displayName = m_engine->displayName();
- m_continueAction.setToolTip(tr("Continue %1").arg(displayName));
- m_interruptAction.setToolTip(tr("Interrupt %1").arg(displayName));
+ m_continueAction.setToolTip(Tr::tr("Continue %1").arg(displayName));
+ m_interruptAction.setToolTip(Tr::tr("Interrupt %1").arg(displayName));
}
void setupViews();
@@ -425,7 +426,7 @@ public:
m_stackHandler.removeAll();
m_threadsHandler.removeAll();
m_watchHandler.cleanup();
- m_engine->showMessage(tr("Debugger finished."), StatusBar);
+ m_engine->showMessage(Tr::tr("Debugger finished."), StatusBar);
m_engine->setState(DebuggerFinished); // Also destroys views.
if (debuggerSettings()->switchModeOnExit.value())
EngineManager::deactivateDebugMode();
@@ -526,32 +527,29 @@ public:
bool m_isDying = false;
QAction m_detachAction;
- OptionalAction m_continueAction{tr("Continue")};
- QAction m_exitAction{tr("Stop Debugger")}; // On application output button if "Stop" is possible
- OptionalAction m_interruptAction{tr("Interrupt")}; // On the fat debug button if "Pause" is possible
- QAction m_abortAction{tr("Abort Debugging")};
- QAction m_stepIntoAction{tr("Step Into")};
- QAction m_stepOutAction{tr("Step Out")};
- QAction m_runToLineAction{tr("Run to Line")}; // In the debug menu
- QAction m_runToSelectedFunctionAction{tr("Run to Selected Function")};
- QAction m_jumpToLineAction{tr("Jump to Line")};
- QAction m_frameUpAction{QCoreApplication::translate("Debugger::Internal::DebuggerPluginPrivate",
- "Move to Calling Frame")};
- QAction m_frameDownAction{QCoreApplication::translate("Debugger::Internal::DebuggerPluginPrivate",
- "Move to Called Frame")};
- QAction m_openMemoryEditorAction{QCoreApplication::translate("Debugger::Internal::DebuggerPluginPrivate",
- "Memory...")};
+ OptionalAction m_continueAction{Tr::tr("Continue")};
+ QAction m_exitAction{Tr::tr("Stop Debugger")}; // On application output button if "Stop" is possible
+ OptionalAction m_interruptAction{Tr::tr("Interrupt")}; // On the fat debug button if "Pause" is possible
+ QAction m_abortAction{Tr::tr("Abort Debugging")};
+ QAction m_stepIntoAction{Tr::tr("Step Into")};
+ QAction m_stepOutAction{Tr::tr("Step Out")};
+ QAction m_runToLineAction{Tr::tr("Run to Line")}; // In the debug menu
+ QAction m_runToSelectedFunctionAction{Tr::tr("Run to Selected Function")};
+ QAction m_jumpToLineAction{Tr::tr("Jump to Line")};
+ QAction m_frameUpAction{Tr::tr("Move to Calling Frame")};
+ QAction m_frameDownAction{Tr::tr("Move to Called Frame")};
+ QAction m_openMemoryEditorAction{Tr::tr("Memory...")};
// In the Debug menu.
- QAction m_returnFromFunctionAction{tr("Immediately Return From Inner Function")};
- QAction m_stepOverAction{tr("Step Over")};
- QAction m_watchAction{tr("Add Expression Evaluator")};
- QAction m_setOrRemoveBreakpointAction{tr("Set or Remove Breakpoint")};
- QAction m_enableOrDisableBreakpointAction{tr("Enable or Disable Breakpoint")};
- QAction m_resetAction{tr("Restart Debugging")};
- OptionalAction m_operateByInstructionAction{tr("Operate by Instruction")};
- QAction m_recordForReverseOperationAction{tr("Record Information to Allow Reversal of Direction")};
- OptionalAction m_operateInReverseDirectionAction{tr("Reverse Direction")};
- OptionalAction m_snapshotAction{tr("Take Snapshot of Process State")};
+ QAction m_returnFromFunctionAction{Tr::tr("Immediately Return From Inner Function")};
+ QAction m_stepOverAction{Tr::tr("Step Over")};
+ QAction m_watchAction{Tr::tr("Add Expression Evaluator")};
+ QAction m_setOrRemoveBreakpointAction{Tr::tr("Set or Remove Breakpoint")};
+ QAction m_enableOrDisableBreakpointAction{Tr::tr("Enable or Disable Breakpoint")};
+ QAction m_resetAction{Tr::tr("Restart Debugging")};
+ OptionalAction m_operateByInstructionAction{Tr::tr("Operate by Instruction")};
+ QAction m_recordForReverseOperationAction{Tr::tr("Record Information to Allow Reversal of Direction")};
+ OptionalAction m_operateInReverseDirectionAction{Tr::tr("Reverse Direction")};
+ OptionalAction m_snapshotAction{Tr::tr("Take Snapshot of Process State")};
QPointer<TerminalRunner> m_terminalRunner;
DebuggerToolTipManager m_toolTipManager;
@@ -575,7 +573,7 @@ void DebuggerEnginePrivate::setupViews()
m_progress.setProgressRange(0, 1000);
FutureProgress *fp = ProgressManager::addTask(m_progress.future(),
- tr("Launching Debugger"), "Debugger.Launcher");
+ Tr::tr("Launching Debugger"), "Debugger.Launcher");
connect(fp, &FutureProgress::canceled, m_engine, &DebuggerEngine::quitDebugger);
fp->setKeepOnFinish(FutureProgress::HideOnFinish);
m_progress.reportStarted();
@@ -589,7 +587,7 @@ void DebuggerEnginePrivate::setupViews()
m_operateByInstructionAction.setIcon(Debugger::Icons::SINGLE_INSTRUCTION_MODE.icon());
m_operateByInstructionAction.setCheckable(true);
m_operateByInstructionAction.setChecked(false);
- m_operateByInstructionAction.setToolTip("<p>" + tr("Switches the debugger to instruction-wise "
+ m_operateByInstructionAction.setToolTip("<p>" + Tr::tr("Switches the debugger to instruction-wise "
"operation mode. In this mode, stepping operates on single "
"instructions and the source location view also shows the "
"disassembled instructions."));
@@ -641,7 +639,7 @@ void DebuggerEnginePrivate::setupViews()
Qt::QueuedConnection);
m_modulesWindow = addSearch(m_modulesView);
m_modulesWindow->setObjectName("Debugger.Dock.Modules." + engineId);
- m_modulesWindow->setWindowTitle(tr("&Modules"));
+ m_modulesWindow->setWindowTitle(Tr::tr("&Modules"));
m_registerView = new BaseTreeView;
m_registerView->setModel(m_registerHandler.model());
@@ -653,7 +651,7 @@ void DebuggerEnginePrivate::setupViews()
Qt::QueuedConnection);
m_registerWindow = addSearch(m_registerView);
m_registerWindow->setObjectName("Debugger.Dock.Register." + engineId);
- m_registerWindow->setWindowTitle(tr("Reg&isters"));
+ m_registerWindow->setWindowTitle(Tr::tr("Reg&isters"));
m_peripheralRegisterView = new BaseTreeView;
m_peripheralRegisterView->setModel(m_peripheralRegisterHandler.model());
@@ -665,7 +663,7 @@ void DebuggerEnginePrivate::setupViews()
Qt::QueuedConnection);
m_peripheralRegisterWindow = addSearch(m_peripheralRegisterView);
m_peripheralRegisterWindow->setObjectName("Debugger.Dock.PeripheralRegister." + engineId);
- m_peripheralRegisterWindow->setWindowTitle(tr("Peripheral Reg&isters"));
+ m_peripheralRegisterWindow->setWindowTitle(Tr::tr("Peripheral Reg&isters"));
m_stackView = new StackTreeView;
m_stackView->setModel(m_stackHandler.model());
@@ -674,7 +672,7 @@ void DebuggerEnginePrivate::setupViews()
m_stackView->enableColumnHiding();
m_stackWindow = addSearch(m_stackView);
m_stackWindow->setObjectName("Debugger.Dock.Stack." + engineId);
- m_stackWindow->setWindowTitle(tr("&Stack"));
+ m_stackWindow->setWindowTitle(Tr::tr("&Stack"));
m_sourceFilesView = new BaseTreeView;
m_sourceFilesView->setModel(m_sourceFilesHandler.model());
@@ -686,7 +684,7 @@ void DebuggerEnginePrivate::setupViews()
Qt::QueuedConnection);
m_sourceFilesWindow = addSearch(m_sourceFilesView);
m_sourceFilesWindow->setObjectName("Debugger.Dock.SourceFiles." + engineId);
- m_sourceFilesWindow->setWindowTitle(tr("Source Files"));
+ m_sourceFilesWindow->setWindowTitle(Tr::tr("Source Files"));
m_threadsView = new BaseTreeView;
m_threadsView->setModel(m_threadsHandler.model());
@@ -697,13 +695,13 @@ void DebuggerEnginePrivate::setupViews()
m_threadsView->enableColumnHiding();
m_threadsWindow = addSearch(m_threadsView);
m_threadsWindow->setObjectName("Debugger.Dock.Threads." + engineId);
- m_threadsWindow->setWindowTitle(tr("&Threads"));
+ m_threadsWindow->setWindowTitle(Tr::tr("&Threads"));
m_returnView = new WatchTreeView{ReturnType};
m_returnView->setModel(m_watchHandler.model());
m_returnWindow = addSearch(m_returnView);
m_returnWindow->setObjectName("CppDebugReturn");
- m_returnWindow->setWindowTitle(tr("Locals"));
+ m_returnWindow->setWindowTitle(Tr::tr("Locals"));
m_returnWindow->setVisible(false);
m_localsView = new WatchTreeView{LocalsType};
@@ -711,21 +709,21 @@ void DebuggerEnginePrivate::setupViews()
m_localsView->setSettings(settings, "Debugger.LocalsView");
m_localsWindow = addSearch(m_localsView);
m_localsWindow->setObjectName("Debugger.Dock.Locals." + engineId);
- m_localsWindow->setWindowTitle(tr("Locals"));
+ m_localsWindow->setWindowTitle(Tr::tr("Locals"));
m_inspectorView = new WatchTreeView{InspectType};
m_inspectorView->setModel(m_watchHandler.model());
m_inspectorView->setSettings(settings, "Debugger.LocalsView"); // sic! same as locals view.
m_inspectorWindow = addSearch(m_inspectorView);
m_inspectorWindow->setObjectName("Debugger.Dock.Inspector." + engineId);
- m_inspectorWindow->setWindowTitle(tr("Locals"));
+ m_inspectorWindow->setWindowTitle(Tr::tr("Locals"));
m_watchersView = new WatchTreeView{WatchersType};
m_watchersView->setModel(m_watchHandler.model());
m_watchersView->setSettings(settings, "Debugger.WatchersView");
m_watchersWindow = addSearch(m_watchersView);
m_watchersWindow->setObjectName("Debugger.Dock.Watchers." + engineId);
- m_watchersWindow->setWindowTitle(tr("&Expressions"));
+ m_watchersWindow->setWindowTitle(Tr::tr("&Expressions"));
m_localsAndInspectorWindow = new LocalsAndInspectorWindow(
m_localsWindow, m_inspectorWindow, m_returnWindow);
@@ -747,7 +745,7 @@ void DebuggerEnginePrivate::setupViews()
m_breakView->enableColumnHiding();
m_breakWindow = addSearch(m_breakView);
m_breakWindow->setObjectName("Debugger.Dock.Break." + engineId);
- m_breakWindow->setWindowTitle(tr("&Breakpoints"));
+ m_breakWindow->setWindowTitle(Tr::tr("&Breakpoints"));
m_perspective->useSubPerspectiveSwitcher(EngineManager::engineChooser());
@@ -775,11 +773,11 @@ void DebuggerEnginePrivate::setupViews()
connect(&m_interruptAction, &QAction::triggered,
m_engine, &DebuggerEngine::handleExecInterrupt);
- m_abortAction.setToolTip(tr("Aborts debugging and resets the debugger to the initial state."));
+ m_abortAction.setToolTip(Tr::tr("Aborts debugging and resets the debugger to the initial state."));
connect(&m_abortAction, &QAction::triggered,
m_engine, &DebuggerEngine::abortDebugger);
- m_resetAction.setToolTip(tr("Restarts the debugging session."));
+ m_resetAction.setToolTip(Tr::tr("Restarts the debugging session."));
m_resetAction.setIcon(Icons::RESTART_TOOLBAR.icon());
connect(&m_resetAction, &QAction::triggered,
m_engine, &DebuggerEngine::handleReset);
@@ -825,7 +823,7 @@ void DebuggerEnginePrivate::setupViews()
m_perspective->addToolbarSeparator();
- m_threadLabel = new QLabel(tr("Threads:"));
+ m_threadLabel = new QLabel(Tr::tr("Threads:"));
m_perspective->addToolBarWidget(m_threadLabel);
m_perspective->addToolBarWidget(m_threadsHandler.threadSwitcher());
@@ -1120,7 +1118,7 @@ void DebuggerEngine::gotoLocation(const Location &loc)
if (loc.needsMarker()) {
d->m_locationMark.reset(new LocationMark(this, loc.fileName(), line));
- d->m_locationMark->setToolTip(tr("Current debugger location of %1").arg(displayName()));
+ d->m_locationMark->setToolTip(Tr::tr("Current debugger location of %1").arg(displayName()));
}
d->m_breakHandler.setLocation(loc);
@@ -1249,7 +1247,7 @@ void DebuggerEngine::notifyEngineSetupFailed()
QTC_ASSERT(state() == EngineSetupRequested, qDebug() << this << state());
setState(EngineSetupFailed);
if (d->m_isPrimaryEngine) {
- showMessage(tr("Debugging has failed."), NormalMessageFormat);
+ showMessage(Tr::tr("Debugging has failed."), NormalMessageFormat);
d->m_progress.setProgressValue(900);
d->m_progress.reportCanceled();
d->m_progress.reportFinished();
@@ -1276,7 +1274,7 @@ void DebuggerEngine::notifyEngineRunOkAndInferiorUnrunnable()
d->m_progress.setProgressValue(1000);
d->m_progress.reportFinished();
QTC_ASSERT(state() == EngineRunRequested, qDebug() << this << state());
- showStatusMessage(tr("Loading finished."));
+ showStatusMessage(Tr::tr("Loading finished."));
setState(InferiorUnrunnable);
}
@@ -1287,7 +1285,7 @@ void DebuggerEngine::notifyEngineRunFailed()
d->m_progress.setProgressValue(900);
d->m_progress.reportCanceled();
d->m_progress.reportFinished();
- showStatusMessage(tr("Run failed."));
+ showStatusMessage(Tr::tr("Run failed."));
setState(EngineRunFailed);
d->doShutdownEngine();
}
@@ -1298,7 +1296,7 @@ void DebuggerEngine::notifyEngineRunAndInferiorRunOk()
d->m_progress.setProgressValue(1000);
d->m_progress.reportFinished();
QTC_ASSERT(state() == EngineRunRequested, qDebug() << this << state());
- showStatusMessage(tr("Running."));
+ showStatusMessage(Tr::tr("Running."));
setState(InferiorRunOk);
}
@@ -1308,7 +1306,7 @@ void DebuggerEngine::notifyEngineRunAndInferiorStopOk()
d->m_progress.setProgressValue(1000);
d->m_progress.reportFinished();
QTC_ASSERT(state() == EngineRunRequested, qDebug() << this << state());
- showStatusMessage(tr("Stopped."));
+ showStatusMessage(Tr::tr("Stopped."));
setState(InferiorStopOk);
}
@@ -1316,7 +1314,7 @@ void DebuggerEngine::notifyInferiorRunRequested()
{
showMessage("NOTE: INFERIOR RUN REQUESTED");
QTC_ASSERT(state() == InferiorStopOk, qDebug() << this << state());
- showStatusMessage(tr("Run requested..."));
+ showStatusMessage(Tr::tr("Run requested..."));
setState(InferiorRunRequested);
}
@@ -1327,7 +1325,7 @@ void DebuggerEngine::notifyInferiorRunOk()
return;
}
showMessage("NOTE: INFERIOR RUN OK");
- showStatusMessage(tr("Running."));
+ showStatusMessage(Tr::tr("Running."));
// Transition from StopRequested can happen in remotegdbadapter.
QTC_ASSERT(state() == InferiorRunRequested
|| state() == InferiorStopOk
@@ -1364,7 +1362,7 @@ void DebuggerEngine::notifyInferiorStopOk()
return;
}
QTC_ASSERT(state() == InferiorStopRequested, qDebug() << this << state());
- showMessage(tr("Stopped."), StatusBar);
+ showMessage(Tr::tr("Stopped."), StatusBar);
setState(InferiorStopOk);
}
@@ -1374,7 +1372,7 @@ void DebuggerEngine::notifyInferiorSpontaneousStop()
QTC_ASSERT(state() == InferiorRunOk, qDebug() << this << state());
if (QTC_GUARD(d->m_perspective))
d->m_perspective->select();
- showMessage(tr("Stopped."), StatusBar);
+ showMessage(Tr::tr("Stopped."), StatusBar);
setState(InferiorStopOk);
if (debuggerSettings()->raiseOnInterrupt.value())
ICore::raiseWindow(DebuggerMainWindow::instance());
@@ -1398,9 +1396,9 @@ void DebuggerEnginePrivate::setInitialActionStates()
m_recordForReverseOperationAction.setIcon(Icons::RECORD_OFF.icon());
m_recordForReverseOperationAction.setToolTip(QString("<html><head/><body><p>%1</p><p>"
"<b>%2</b>%3</p></body></html>").arg(
- tr("Record information to enable stepping backwards."),
- tr("Note: "),
- tr("This feature is very slow and unstable on the GDB side. "
+ Tr::tr("Record information to enable stepping backwards."),
+ Tr::tr("Note: "),
+ Tr::tr("This feature is very slow and unstable on the GDB side. "
"It exhibits unpredictable behavior when going backwards over system "
"calls and is very likely to destroy your debugging session.")));
@@ -1451,7 +1449,7 @@ void DebuggerEnginePrivate::updateState()
const DebuggerState state = m_state;
const bool companionPreventsAction = m_engine->companionPreventsActions();
- // Fixme: hint tr("Debugger is Busy");
+ // Fixme: hint Tr::tr("Debugger is Busy");
// Exactly one of m_interuptAction and m_continueAction should be
// visible, possibly disabled.
if (state == DebuggerNotReady) {
@@ -1602,7 +1600,7 @@ void DebuggerEnginePrivate::updateReverseActions()
m_operateInReverseDirectionAction.setVisible(canReverse);
m_operateInReverseDirectionAction.setEnabled(canReverse && stopped && doesRecord);
m_operateInReverseDirectionAction.setIcon(Icons::DIRECTION_BACKWARD.icon());
- m_operateInReverseDirectionAction.setText(DebuggerEngine::tr("Operate in Reverse Direction"));
+ m_operateInReverseDirectionAction.setText(Tr::tr("Operate in Reverse Direction"));
}
void DebuggerEnginePrivate::cleanupViews()
@@ -1819,9 +1817,9 @@ void DebuggerEngine::notifyDebuggerProcessFinished(const ProcessResultData &resu
// Initiate shutdown sequence
notifyInferiorIll();
const QString msg = result.m_exitStatus == QProcess::CrashExit ?
- tr("The %1 process terminated.") :
- tr("The %2 process terminated unexpectedly (exit code %1).").arg(result.m_exitCode);
- AsynchronousMessageBox::critical(tr("Unexpected %1 Exit").arg(backendName),
+ Tr::tr("The %1 process terminated.") :
+ Tr::tr("The %2 process terminated unexpectedly (exit code %1).").arg(result.m_exitCode);
+ AsynchronousMessageBox::critical(Tr::tr("Unexpected %1 Exit").arg(backendName),
msg.arg(backendName));
break;
}
@@ -1963,7 +1961,7 @@ void DebuggerEngine::notifyInferiorPid(const ProcessHandle &pid)
return;
d->m_inferiorPid = pid;
if (pid.isValid()) {
- showMessage(tr("Taking notice of pid %1").arg(pid.pid()));
+ showMessage(Tr::tr("Taking notice of pid %1").arg(pid.pid()));
DebuggerStartMode sm = runParameters().startMode;
if (sm == StartInternal || sm == StartExternal || sm == AttachToLocalProcess)
d->m_inferiorPid.activate();
@@ -1982,14 +1980,14 @@ bool DebuggerEngine::isReverseDebugging() const
void DebuggerEngine::handleBeginOfRecordingReached()
{
- showStatusMessage(tr("Reverse-execution history exhausted. Going forward again."));
+ showStatusMessage(Tr::tr("Reverse-execution history exhausted. Going forward again."));
d->m_operateInReverseDirectionAction.setChecked(false);
d->updateReverseActions();
}
void DebuggerEngine::handleRecordingFailed()
{
- showStatusMessage(tr("Reverse-execution recording failed."));
+ showStatusMessage(Tr::tr("Reverse-execution recording failed."));
d->m_operateInReverseDirectionAction.setChecked(false);
d->m_recordForReverseOperationAction.setChecked(false);
d->updateReverseActions();
@@ -2009,7 +2007,7 @@ void DebuggerEngine::quitDebugger()
break;
case InferiorRunOk:
setState(InferiorStopRequested);
- showMessage(tr("Attempting to interrupt."), StatusBar);
+ showMessage(Tr::tr("Attempting to interrupt."), StatusBar);
interruptInferior();
break;
case EngineSetupRequested:
@@ -2037,7 +2035,7 @@ void DebuggerEngine::requestInterruptInferior()
QTC_ASSERT(state() == InferiorRunOk, qDebug() << this << state());
setState(InferiorStopRequested);
showMessage("CALL: INTERRUPT INFERIOR");
- showMessage(tr("Attempting to interrupt."), StatusBar);
+ showMessage(Tr::tr("Attempting to interrupt."), StatusBar);
interruptInferior();
}
@@ -2074,7 +2072,7 @@ void DebuggerEngine::watchPoint(const QPoint &pnt)
cmd.callback = [this](const DebuggerResponse &response) {
qulonglong addr = response.data["selected"].toAddress();
if (addr == 0)
- showMessage(tr("Could not find a widget."), StatusBar);
+ showMessage(Tr::tr("Could not find a widget."), StatusBar);
// Add the watcher entry nevertheless, as that's the place where
// the user expects visual feedback.
watchHandler()->watchExpression(response.data["expr"].data(), QString(), true);
@@ -2188,7 +2186,7 @@ void DebuggerEngine::updateAll()
QString DebuggerEngine::displayName() const
{
//: e.g. LLDB for "myproject", shows up i
- return tr("%1 for \"%2\"").arg(d->m_debuggerName, runParameters().displayName);
+ return Tr::tr("%1 for \"%2\"").arg(d->m_debuggerName, runParameters().displayName);
}
void DebuggerEngine::insertBreakpoint(const Breakpoint &bp)
@@ -2244,7 +2242,7 @@ void DebuggerEngine::handleReverseDirection(bool reverse)
void DebuggerEngine::executeDebuggerCommand(const QString &)
{
- showMessage(tr("This debugger cannot handle user input."), StatusBar);
+ showMessage(Tr::tr("This debugger cannot handle user input."), StatusBar);
}
bool DebuggerEngine::isDying() const
@@ -2254,24 +2252,24 @@ bool DebuggerEngine::isDying() const
QString DebuggerEngine::msgStopped(const QString &reason)
{
- return reason.isEmpty() ? tr("Stopped.") : tr("Stopped: \"%1\".").arg(reason);
+ return reason.isEmpty() ? Tr::tr("Stopped.") : Tr::tr("Stopped: \"%1\".").arg(reason);
}
QString DebuggerEngine::msgStoppedBySignal(const QString &meaning,
const QString &name)
{
- return tr("Stopped: %1 (Signal %2).").arg(meaning, name);
+ return Tr::tr("Stopped: %1 (Signal %2).").arg(meaning, name);
}
QString DebuggerEngine::msgStoppedByException(const QString &description,
const QString &threadId)
{
- return tr("Stopped in thread %1 by: %2.").arg(threadId, description);
+ return Tr::tr("Stopped in thread %1 by: %2.").arg(threadId, description);
}
QString DebuggerEngine::msgInterrupted()
{
- return tr("Interrupted.");
+ return Tr::tr("Interrupted.");
}
bool DebuggerEngine::showStoppedBySignalMessageBox(QString meaning, QString name)
@@ -2280,25 +2278,25 @@ bool DebuggerEngine::showStoppedBySignalMessageBox(QString meaning, QString name
return false;
if (name.isEmpty())
- name = ' ' + tr("<Unknown>", "name") + ' ';
+ name = ' ' + Tr::tr("<Unknown>", "name") + ' ';
if (meaning.isEmpty())
- meaning = ' ' + tr("<Unknown>", "meaning") + ' ';
- const QString msg = tr("<p>The inferior stopped because it received a "
+ meaning = ' ' + Tr::tr("<Unknown>", "meaning") + ' ';
+ const QString msg = Tr::tr("<p>The inferior stopped because it received a "
"signal from the operating system.<p>"
"<table><tr><td>Signal name : </td><td>%1</td></tr>"
"<tr><td>Signal meaning : </td><td>%2</td></tr></table>")
.arg(name, meaning);
- d->m_alertBox = AsynchronousMessageBox::information(tr("Signal Received"), msg);
+ d->m_alertBox = AsynchronousMessageBox::information(Tr::tr("Signal Received"), msg);
return true;
}
void DebuggerEngine::showStoppedByExceptionMessageBox(const QString &description)
{
const QString msg =
- tr("<p>The inferior stopped because it triggered an exception.<p>%1").
+ Tr::tr("<p>The inferior stopped because it triggered an exception.<p>%1").
arg(description);
- AsynchronousMessageBox::information(tr("Exception Triggered"), msg);
+ AsynchronousMessageBox::information(Tr::tr("Exception Triggered"), msg);
}
void DebuggerEngine::openMemoryView(const MemoryViewSetupData &data)
@@ -2365,7 +2363,7 @@ void DebuggerEngine::updateLocalsView(const GdbMi &all)
static int count = 0;
showMessage(QString("<Rebuild Watchmodel %1 @ %2 >")
.arg(++count).arg(LogWindow::logTimeStamp()), LogMiscInput);
- showMessage(tr("Finished retrieving data."), 400, StatusBar);
+ showMessage(Tr::tr("Finished retrieving data."), 400, StatusBar);
d->m_toolTipManager.updateToolTips();
@@ -2518,9 +2516,9 @@ void DebuggerEngine::handleExecRunToSelectedFunction()
}
if (functionName.isEmpty()) {
- showMessage(tr("No function selected."), StatusBar);
+ showMessage(Tr::tr("No function selected."), StatusBar);
} else {
- showMessage(tr("Running to function \"%1\".").arg(functionName), StatusBar);
+ showMessage(Tr::tr("Running to function \"%1\".").arg(functionName), StatusBar);
resetLocation();
executeRunToFunction(functionName);
}
@@ -2547,8 +2545,8 @@ void DebuggerEngine::handleAddToWatchWindow()
exp = exp.trimmed();
if (exp.isEmpty()) {
// Happens e.g. when trying to evaluate 'char' or 'return'.
- AsynchronousMessageBox::warning(tr("Warning"),
- tr("Select a valid expression to evaluate."));
+ AsynchronousMessageBox::warning(Tr::tr("Warning"),
+ Tr::tr("Select a valid expression to evaluate."));
return;
}
watchHandler()->watchVariable(exp);
@@ -2682,13 +2680,13 @@ void DebuggerEngine::showModuleSymbols(const QString &moduleName, const Symbols
w->setSortingEnabled(true);
w->setObjectName("Symbols." + moduleName);
QStringList header;
- header.append(tr("Symbol"));
- header.append(tr("Address"));
- header.append(tr("Code"));
- header.append(tr("Section"));
- header.append(tr("Name"));
+ header.append(Tr::tr("Symbol"));
+ header.append(Tr::tr("Address"));
+ header.append(Tr::tr("Code"));
+ header.append(Tr::tr("Section"));
+ header.append(Tr::tr("Name"));
w->setHeaderLabels(header);
- w->setWindowTitle(tr("Symbols in \"%1\"").arg(moduleName));
+ w->setWindowTitle(Tr::tr("Symbols in \"%1\"").arg(moduleName));
for (const Symbol &s : symbols) {
auto it = new QTreeWidgetItem;
it->setData(0, Qt::DisplayRole, s.name);
@@ -2711,13 +2709,13 @@ void DebuggerEngine::showModuleSections(const QString &moduleName, const Section
w->setSortingEnabled(true);
w->setObjectName("Sections." + moduleName);
QStringList header;
- header.append(tr("Name"));
- header.append(tr("From"));
- header.append(tr("To"));
- header.append(tr("Address"));
- header.append(tr("Flags"));
+ header.append(Tr::tr("Name"));
+ header.append(Tr::tr("From"));
+ header.append(Tr::tr("To"));
+ header.append(Tr::tr("Address"));
+ header.append(Tr::tr("Flags"));
w->setHeaderLabels(header);
- w->setWindowTitle(tr("Sections in \"%1\"").arg(moduleName));
+ w->setWindowTitle(Tr::tr("Sections in \"%1\"").arg(moduleName));
for (const Section &s : sections) {
auto it = new QTreeWidgetItem;
it->setData(0, Qt::DisplayRole, s.name);
@@ -2760,7 +2758,7 @@ void CppDebuggerEngine::validateRunParameters(DebuggerRunParameters &rp)
}
if (!preferredDebugger.isEmpty()) {
warnOnInappropriateDebugger = true;
- detailedWarning = DebuggerEngine::tr(
+ detailedWarning = Tr::tr(
"The inferior is in the Portable Executable format.\n"
"Selecting %1 as debugger would improve the debugging "
"experience for this binary format.")
@@ -2791,7 +2789,7 @@ void CppDebuggerEngine::validateRunParameters(DebuggerRunParameters &rp)
if (CheckableMessageBox::shouldAskAgain(coreSettings, warnOnInappropriateDebuggerKey)) {
if (rp.cppEngineType == CdbEngineType) {
warnOnInappropriateDebugger = true;
- detailedWarning = DebuggerEngine::tr(
+ detailedWarning = Tr::tr(
"The inferior is in the ELF format.\n"
"Selecting GDB or LLDB as debugger would improve the debugging "
"experience for this binary format.");
@@ -2885,9 +2883,9 @@ void CppDebuggerEngine::validateRunParameters(DebuggerRunParameters &rp)
return;
for (const QByteArray &name : qAsConst(interesting)) {
- const QString found = seen.contains(name) ? DebuggerEngine::tr("Found.")
- : DebuggerEngine::tr("Not found.");
- detailedWarning.append('\n' + DebuggerEngine::tr("Section %1: %2").arg(QString::fromUtf8(name)).arg(found));
+ const QString found = seen.contains(name) ? Tr::tr("Found.")
+ : Tr::tr("Not found.");
+ detailedWarning.append('\n' + Tr::tr("Section %1: %2").arg(QString::fromUtf8(name)).arg(found));
}
break;
}
@@ -2897,8 +2895,8 @@ void CppDebuggerEngine::validateRunParameters(DebuggerRunParameters &rp)
if (warnOnInappropriateDebugger) {
CheckableMessageBox::doNotShowAgainInformation(
Core::ICore::dialogParent(),
- DebuggerEngine::tr("Warning"),
- DebuggerEngine::tr(
+ Tr::tr("Warning"),
+ Tr::tr(
"The selected debugger may be inappropriate for the inferior.\n"
"Examining symbols and setting breakpoints by file name and line number "
"may fail.\n")
@@ -2906,8 +2904,8 @@ void CppDebuggerEngine::validateRunParameters(DebuggerRunParameters &rp)
Core::ICore::settings(),
warnOnInappropriateDebuggerKey);
} else if (warnOnRelease) {
- AsynchronousMessageBox::information(DebuggerEngine::tr("Warning"),
- DebuggerEngine::tr("This does not seem to be a \"Debug\" build.\n"
+ AsynchronousMessageBox::information(Tr::tr("Warning"),
+ Tr::tr("This does not seem to be a \"Debug\" build.\n"
"Setting breakpoints by file name and line number may fail.")
+ '\n' + detailedWarning);
}
diff --git a/src/plugins/debugger/debuggericons.cpp b/src/plugins/debugger/debuggericons.cpp
index 88dfd085a0..e155577554 100644
--- a/src/plugins/debugger/debuggericons.cpp
+++ b/src/plugins/debugger/debuggericons.cpp
@@ -27,8 +27,7 @@
using namespace Utils;
-namespace Debugger {
-namespace Icons {
+namespace Debugger::Icons {
const Icon BREAKPOINT({
{":/utils/images/filledcircle.png", Theme::IconsErrorColor}}, Icon::Tint);
@@ -158,5 +157,5 @@ const Icon MACOS_TOUCHBAR_DEBUG_STEP_INTO(
":/debugger/images/macos_touchbar_debug_step_into.png");
const Icon MACOS_TOUCHBAR_DEBUG_STEP_OUT(
":/debugger/images/macos_touchbar_debug_step_out.png");
-} // namespace Icons
-} // namespace Debugger
+
+} // Debugger::Icons
diff --git a/src/plugins/debugger/debuggericons.h b/src/plugins/debugger/debuggericons.h
index 4eacbc0020..1dc8352428 100644
--- a/src/plugins/debugger/debuggericons.h
+++ b/src/plugins/debugger/debuggericons.h
@@ -29,8 +29,7 @@
#include <utils/icon.h>
-namespace Debugger {
-namespace Icons {
+namespace Debugger::Icons {
// Used in QmlProfiler.
DEBUGGER_EXPORT extern const Utils::Icon RECORD_ON;
@@ -90,5 +89,4 @@ extern const Utils::Icon MACOS_TOUCHBAR_DEBUG_STEP_OVER;
extern const Utils::Icon MACOS_TOUCHBAR_DEBUG_STEP_INTO;
extern const Utils::Icon MACOS_TOUCHBAR_DEBUG_STEP_OUT;
-} // namespace Icons
-} // namespace Debugger
+} // namespace Debugger::Icons
diff --git a/src/plugins/debugger/debuggeritem.cpp b/src/plugins/debugger/debuggeritem.cpp
index a665950646..896bc65ff2 100644
--- a/src/plugins/debugger/debuggeritem.cpp
+++ b/src/plugins/debugger/debuggeritem.cpp
@@ -24,14 +24,14 @@
****************************************************************************/
#include "debuggeritem.h"
-#include "debuggeritemmanager.h"
-#include "debuggerkitinformation.h"
+
#include "debuggerprotocol.h"
+#include "debuggertr.h"
#include <projectexplorer/abi.h>
#include <utils/algorithm.h>
-#include <utils/fileutils.h>
+#include <utils/filepath.h>
#include <utils/hostosinfo.h>
#include <utils/macroexpander.h>
#include <utils/qtcassert.h>
@@ -40,14 +40,8 @@
#include <utils/utilsicons.h>
#include <utils/winutils.h>
-#include <QFileInfo>
#include <QUuid>
-#ifdef WITH_TESTS
-# include <QTest>
-# include "debuggerplugin.h"
-#endif
-
using namespace Debugger::Internal;
using namespace ProjectExplorer;
using namespace Utils;
@@ -307,7 +301,7 @@ QString DebuggerItem::engineTypeName() const
{
switch (m_engineType) {
case NoEngineType:
- return DebuggerItemManager::tr("Not recognized");
+ return Tr::tr("Not recognized");
case GdbEngineType:
return QLatin1String("GDB");
case CdbEngineType:
@@ -348,7 +342,7 @@ QIcon DebuggerItem::decoration() const
QString DebuggerItem::validityMessage() const
{
if (m_engineType == NoEngineType)
- return DebuggerItemManager::tr("Could not determine debugger type");
+ return Tr::tr("Could not determine debugger type");
return QString();
}
@@ -384,14 +378,12 @@ QString DebuggerItem::displayName() const
return m_unexpandedDisplayName;
MacroExpander expander;
- expander.registerVariable("Debugger:Type", DebuggerKitAspect::tr("Type of Debugger Backend"),
+ expander.registerVariable("Debugger:Type", Tr::tr("Type of Debugger Backend"),
[this] { return engineTypeName(); });
- expander.registerVariable("Debugger:Version", DebuggerKitAspect::tr("Debugger"),
- [this] { return !m_version.isEmpty() ? m_version :
- DebuggerKitAspect::tr("Unknown debugger version"); });
- expander.registerVariable("Debugger:Abi", DebuggerKitAspect::tr("Debugger"),
- [this] { return !m_abis.isEmpty() ? abiNames().join(' ') :
- DebuggerKitAspect::tr("Unknown debugger ABI"); });
+ expander.registerVariable("Debugger:Version", Tr::tr("Debugger"),
+ [this] { return !m_version.isEmpty() ? m_version : Tr::tr("Unknown debugger version"); });
+ expander.registerVariable("Debugger:Abi", Tr::tr("Debugger"),
+ [this] { return !m_abis.isEmpty() ? abiNames().join(' ') : Tr::tr("Unknown debugger ABI"); });
return expander.expand(m_unexpandedDisplayName);
}
@@ -494,4 +486,4 @@ bool DebuggerItem::isValid() const
return !m_id.isNull();
}
-} // namespace Debugger;
+} // namespace Debugger
diff --git a/src/plugins/debugger/debuggeritemmanager.cpp b/src/plugins/debugger/debuggeritemmanager.cpp
index a446ec50c8..8e12a8b30e 100644
--- a/src/plugins/debugger/debuggeritemmanager.cpp
+++ b/src/plugins/debugger/debuggeritemmanager.cpp
@@ -24,8 +24,9 @@
****************************************************************************/
#include "debuggeritemmanager.h"
+
#include "debuggeritem.h"
-#include "debuggerkitinformation.h"
+#include "debuggertr.h"
#include <coreplugin/dialogs/ioptionspage.h>
#include <coreplugin/icore.h>
@@ -48,7 +49,6 @@
#include <utils/treemodel.h>
#include <utils/winutils.h>
-#include <QCoreApplication>
#include <QDebug>
#include <QDir>
#include <QFileInfo>
@@ -80,7 +80,6 @@ class DebuggerItemModel;
class DebuggerItemManagerPrivate
{
- Q_DECLARE_TR_FUNCTIONS(Debugger::DebuggerItemManager)
public:
DebuggerItemManagerPrivate();
~DebuggerItemManagerPrivate();
@@ -111,8 +110,6 @@ static DebuggerItemManagerPrivate *d = nullptr;
class DebuggerItemConfigWidget : public QWidget
{
- Q_DECLARE_TR_FUNCTIONS(Debugger::DebuggerItemManager)
-
public:
explicit DebuggerItemConfigWidget();
void load(const DebuggerItem *item);
@@ -190,8 +187,6 @@ public:
class DebuggerItemModel : public TreeModel<TreeItem, StaticTreeItem, DebuggerTreeItem>
{
- Q_DECLARE_TR_FUNCTIONS(Debugger::DebuggerOptionsPage)
-
public:
DebuggerItemModel();
@@ -225,7 +220,7 @@ const DebuggerItem *findDebugger(const Predicate &pred)
DebuggerItemModel::DebuggerItemModel()
{
- setHeader({tr("Name"), tr("Path"), tr("Type")});
+ setHeader({Tr::tr("Name"), Tr::tr("Path"), Tr::tr("Type")});
rootItem()->appendChild(
new StaticTreeItem({ProjectExplorer::Constants::msgAutoDetected()},
{ProjectExplorer::Constants::msgAutoDetectedToolTip()}));
@@ -334,7 +329,7 @@ DebuggerItemConfigWidget::DebuggerItemConfigWidget()
m_cdbLabel->setOpenExternalLinks(true);
m_versionLabel = new QLineEdit(this);
- m_versionLabel->setPlaceholderText(tr("Unknown"));
+ m_versionLabel->setPlaceholderText(Tr::tr("Unknown"));
m_versionLabel->setEnabled(false);
m_abis = new QLineEdit(this);
@@ -342,13 +337,13 @@ DebuggerItemConfigWidget::DebuggerItemConfigWidget()
auto formLayout = new QFormLayout(this);
formLayout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow);
- formLayout->addRow(new QLabel(tr("Name:")), m_displayNameLineEdit);
+ formLayout->addRow(new QLabel(Tr::tr("Name:")), m_displayNameLineEdit);
formLayout->addRow(m_cdbLabel);
- formLayout->addRow(new QLabel(tr("Path:")), m_binaryChooser);
- formLayout->addRow(new QLabel(tr("Type:")), m_typeLineEdit);
- formLayout->addRow(new QLabel(tr("ABIs:")), m_abis);
- formLayout->addRow(new QLabel(tr("Version:")), m_versionLabel);
- formLayout->addRow(new QLabel(tr("Working directory:")), m_workingDirectoryChooser);
+ formLayout->addRow(new QLabel(Tr::tr("Path:")), m_binaryChooser);
+ formLayout->addRow(new QLabel(Tr::tr("Type:")), m_typeLineEdit);
+ formLayout->addRow(new QLabel(Tr::tr("ABIs:")), m_abis);
+ formLayout->addRow(new QLabel(Tr::tr("Version:")), m_versionLabel);
+ formLayout->addRow(new QLabel(Tr::tr("Working directory:")), m_workingDirectoryChooser);
connect(m_binaryChooser, &PathChooser::filePathChanged,
this, &DebuggerItemConfigWidget::binaryPathHasChanged);
@@ -413,10 +408,10 @@ void DebuggerItemConfigWidget::load(const DebuggerItem *item)
QString versionCommand;
if (item->engineType() == CdbEngineType) {
const bool is64bit = is64BitWindowsSystem();
- const QString versionString = is64bit ? tr("64-bit version") : tr("32-bit version");
+ const QString versionString = is64bit ? Tr::tr("64-bit version") : Tr::tr("32-bit version");
//: Label text for path configuration. %2 is "x-bit version".
text = "<html><body><p>"
- + tr("Specify the path to the "
+ + Tr::tr("Specify the path to the "
"<a href=\"%1\">Windows Console Debugger executable</a>"
" (%2) here.").arg(QLatin1String(debuggingToolsWikiLinkC), versionString)
+ "</p></body></html>";
@@ -460,13 +455,12 @@ void DebuggerItemConfigWidget::binaryPathHasChanged()
class DebuggerConfigWidget : public IOptionsPageWidget
{
- Q_DECLARE_TR_FUNCTIONS(Debugger::DebuggerOptionsPage)
public:
DebuggerConfigWidget()
{
- m_addButton = new QPushButton(tr("Add"), this);
+ m_addButton = new QPushButton(Tr::tr("Add"), this);
- m_cloneButton = new QPushButton(tr("Clone"), this);
+ m_cloneButton = new QPushButton(Tr::tr("Clone"), this);
m_cloneButton->setEnabled(false);
m_delButton = new QPushButton(this);
@@ -555,7 +549,7 @@ void DebuggerConfigWidget::cloneDebugger()
DebuggerItem newItem;
newItem.createId();
newItem.setCommand(item->command());
- newItem.setUnexpandedDisplayName(d->uniqueDisplayName(tr("Clone of %1").arg(item->displayName())));
+ newItem.setUnexpandedDisplayName(d->uniqueDisplayName(Tr::tr("Clone of %1").arg(item->displayName())));
newItem.reinitializeFromFile();
newItem.setAutoDetected(false);
d->m_model->addDebugger(newItem, true);
@@ -567,7 +561,7 @@ void DebuggerConfigWidget::addDebugger()
DebuggerItem item;
item.createId();
item.setEngineType(NoEngineType);
- item.setUnexpandedDisplayName(d->uniqueDisplayName(tr("New Debugger")));
+ item.setUnexpandedDisplayName(d->uniqueDisplayName(Tr::tr("New Debugger")));
item.setAutoDetected(false);
d->m_model->addDebugger(item, true);
m_debuggerView->setCurrentIndex(d->m_model->lastIndex());
@@ -597,7 +591,7 @@ void DebuggerConfigWidget::updateButtons()
m_container->setVisible(item != nullptr);
m_cloneButton->setEnabled(item && item->isValid() && item->canClone());
m_delButton->setEnabled(item && !item->isAutoDetected());
- m_delButton->setText(item && titem->m_removed ? tr("Restore") : tr("Remove"));
+ m_delButton->setText(item && titem->m_removed ? Tr::tr("Restore") : Tr::tr("Remove"));
}
// --------------------------------------------------------------------------
@@ -606,12 +600,10 @@ void DebuggerConfigWidget::updateButtons()
class DebuggerOptionsPage : public Core::IOptionsPage
{
- Q_DECLARE_TR_FUNCTIONS(Debugger::DebuggerOptionsPage)
-
public:
DebuggerOptionsPage() {
setId(ProjectExplorer::Constants::DEBUGGER_SETTINGS_PAGE_ID);
- setDisplayName(tr("Debuggers"));
+ setDisplayName(Tr::tr("Debuggers"));
setCategory(ProjectExplorer::Constants::KITS_SETTINGS_CATEGORY);
setWidgetCreator([] { return new DebuggerConfigWidget; });
}
@@ -688,7 +680,7 @@ void DebuggerItemManagerPrivate::autoDetectCdbDebuggers()
item.setAbis(Abi::abisOfBinary(cdb));
item.setCommand(cdb);
item.setEngineType(CdbEngineType);
- item.setUnexpandedDisplayName(uniqueDisplayName(tr("Auto-detected CDB at %1").arg(cdb.toUserOutput())));
+ item.setUnexpandedDisplayName(uniqueDisplayName(Tr::tr("Auto-detected CDB at %1").arg(cdb.toUserOutput())));
item.reinitializeFromFile(); // collect version number
m_model->addDebugger(item);
}
@@ -736,7 +728,7 @@ void DebuggerItemManagerPrivate::autoDetectGdbOrLldbDebuggers(const FilePaths &s
// DebuggerItem result;
// result.setAutoDetected(true);
-// result.setDisplayName(tr("Auto-detected for Tool Chain %1").arg(tc->displayName()));
+// result.setDisplayName(Tr::tr("Auto-detected for Tool Chain %1").arg(tc->displayName()));
/*
// Check suggestions from the SDK.
Environment env = Environment::systemEnvironment();
@@ -785,7 +777,7 @@ void DebuggerItemManagerPrivate::autoDetectGdbOrLldbDebuggers(const FilePaths &s
for (const FilePath &path : paths)
path.iterateDirectory(addSuspect, {filters, QDir::Files | QDir::Executable});
- QStringList logMessages{tr("Searching debuggers...")};
+ QStringList logMessages{Tr::tr("Searching debuggers...")};
for (const FilePath &command : qAsConst(suspects)) {
const auto commandMatches = [command](const DebuggerTreeItem *titem) {
return titem->m_item.command() == command;
@@ -804,10 +796,10 @@ void DebuggerItemManagerPrivate::autoDetectGdbOrLldbDebuggers(const FilePaths &s
if (item.engineType() == NoEngineType)
continue;
//: %1: Debugger engine type (GDB, LLDB, CDB...), %2: Path
- const QString name = detectionSource.isEmpty() ? tr("System %1 at %2") : tr("Detected %1 at %2");
+ const QString name = detectionSource.isEmpty() ? Tr::tr("System %1 at %2") : Tr::tr("Detected %1 at %2");
item.setUnexpandedDisplayName(name.arg(item.engineTypeName()).arg(command.toUserOutput()));
m_model->addDebugger(item);
- logMessages.append(tr("Found: \"%1\"").arg(command.toUserOutput()));
+ logMessages.append(Tr::tr("Found: \"%1\"").arg(command.toUserOutput()));
}
if (logMessage)
*logMessage = logMessages.join('\n');
@@ -848,7 +840,7 @@ void DebuggerItemManagerPrivate::autoDetectUvscDebuggers()
item.setVersion(uVisionVersion);
item.setEngineType(UvscEngineType);
item.setUnexpandedDisplayName(
- uniqueDisplayName(tr("Auto-detected uVision at %1")
+ uniqueDisplayName(Tr::tr("Auto-detected uVision at %1")
.arg(uVision.toUserOutput())));
m_model->addDebugger(item);
}
@@ -996,8 +988,8 @@ void DebuggerItemManagerPrivate::saveDebuggers()
DebuggerItemManager::DebuggerItemManager()
{
new DebuggerItemManagerPrivate;
- connect(ICore::instance(), &ICore::saveSettingsRequested,
- this, [] { d->saveDebuggers(); });
+ QObject::connect(ICore::instance(), &ICore::saveSettingsRequested,
+ [] { d->saveDebuggers(); });
}
DebuggerItemManager::~DebuggerItemManager()
@@ -1056,7 +1048,7 @@ void DebuggerItemManager::autoDetectDebuggersForDevice(const FilePaths &searchPa
void DebuggerItemManager::removeDetectedDebuggers(const QString &detectionSource,
QString *logMessage)
{
- QStringList logMessages{tr("Removing debugger entries...")};
+ QStringList logMessages{Tr::tr("Removing debugger entries...")};
QList<DebuggerTreeItem *> toBeRemoved;
d->m_model->forItemsAtLevel<2>([detectionSource, &toBeRemoved](DebuggerTreeItem *titem) {
@@ -1070,7 +1062,7 @@ void DebuggerItemManager::removeDetectedDebuggers(const QString &detectionSource
toBeRemoved.append(titem);
});
for (DebuggerTreeItem *current : toBeRemoved) {
- logMessages.append(tr("Removed \"%1\"").arg(current->m_item.displayName()));
+ logMessages.append(Tr::tr("Removed \"%1\"").arg(current->m_item.displayName()));
d->m_model->destroyItem(current);
}
@@ -1081,7 +1073,7 @@ void DebuggerItemManager::removeDetectedDebuggers(const QString &detectionSource
void DebuggerItemManager::listDetectedDebuggers(const QString &detectionSource, QString *logMessage)
{
QTC_ASSERT(logMessage, return);
- QStringList logMessages{tr("Debuggers:")};
+ QStringList logMessages{Tr::tr("Debuggers:")};
d->m_model->forItemsAtLevel<2>([detectionSource, &logMessages](DebuggerTreeItem *titem) {
if (titem->m_item.detectionSource() == detectionSource)
logMessages.append(titem->m_item.displayName());
diff --git a/src/plugins/debugger/debuggeritemmanager.h b/src/plugins/debugger/debuggeritemmanager.h
index 300269d5dc..f347296376 100644
--- a/src/plugins/debugger/debuggeritemmanager.h
+++ b/src/plugins/debugger/debuggeritemmanager.h
@@ -31,21 +31,18 @@
#include <utils/filepath.h>
#include <QList>
-#include <QObject>
-#include <QString>
-#include <QCoreApplication>
namespace Debugger {
class DebuggerItem;
-class DEBUGGER_EXPORT DebuggerItemManager : public QObject
+class DEBUGGER_EXPORT DebuggerItemManager
{
- Q_DECLARE_TR_FUNCTIONS(Debugger::DebuggerItemManager)
+ Q_DISABLE_COPY_MOVE(DebuggerItemManager)
public:
DebuggerItemManager();
- ~DebuggerItemManager() override;
+ ~DebuggerItemManager();
static const QList<DebuggerItem> debuggers();
diff --git a/src/plugins/debugger/debuggerkitinformation.cpp b/src/plugins/debugger/debuggerkitinformation.cpp
index 868cf947a0..7315e015db 100644
--- a/src/plugins/debugger/debuggerkitinformation.cpp
+++ b/src/plugins/debugger/debuggerkitinformation.cpp
@@ -27,6 +27,7 @@
#include "debuggeritemmanager.h"
#include "debuggeritem.h"
+#include "debuggertr.h"
#include <projectexplorer/devicesupport/idevice.h>
#include <projectexplorer/projectexplorerconstants.h>
@@ -34,7 +35,7 @@
#include <projectexplorer/toolchain.h>
#include <utils/environment.h>
-#include <utils/fileutils.h>
+#include <utils/filepath.h>
#include <utils/layoutbuilder.h>
#include <utils/macroexpander.h>
#include <utils/qtcassert.h>
@@ -57,8 +58,6 @@ namespace Internal {
class DebuggerKitAspectWidget final : public KitAspectWidget
{
- Q_DECLARE_TR_FUNCTIONS(Debugger::DebuggerKitAspect)
-
public:
DebuggerKitAspectWidget(Kit *workingCopy, const KitAspect *ki)
: KitAspectWidget(workingCopy, ki)
@@ -99,7 +98,7 @@ private:
{
m_ignoreChanges = true;
m_comboBox->clear();
- m_comboBox->addItem(tr("None"), QString());
+ m_comboBox->addItem(Tr::tr("None"), QString());
for (const DebuggerItem &item : DebuggerItemManager::debuggers())
m_comboBox->addItem(item.displayName(), item.id());
@@ -142,8 +141,8 @@ DebuggerKitAspect::DebuggerKitAspect()
{
setObjectName("DebuggerKitAspect");
setId(DebuggerKitAspect::id());
- setDisplayName(tr("Debugger"));
- setDescription(tr("The debugger to use for this kit."));
+ setDisplayName(Tr::tr("Debugger"));
+ setDescription(Tr::tr("The debugger to use for this kit."));
setPriority(28000);
}
@@ -378,23 +377,23 @@ Tasks DebuggerKitAspect::validateDebugger(const Kit *k)
path = item->command().toUserOutput();
if (errors & NoDebugger)
- result << BuildSystemTask(Task::Warning, tr("No debugger set up."));
+ result << BuildSystemTask(Task::Warning, Tr::tr("No debugger set up."));
if (errors & DebuggerNotFound)
- result << BuildSystemTask(Task::Error, tr("Debugger \"%1\" not found.").arg(path));
+ result << BuildSystemTask(Task::Error, Tr::tr("Debugger \"%1\" not found.").arg(path));
if (errors & DebuggerNotExecutable)
- result << BuildSystemTask(Task::Error, tr("Debugger \"%1\" not executable.").arg(path));
+ result << BuildSystemTask(Task::Error, Tr::tr("Debugger \"%1\" not executable.").arg(path));
if (errors & DebuggerNeedsAbsolutePath) {
const QString message =
- tr("The debugger location must be given as an "
+ Tr::tr("The debugger location must be given as an "
"absolute path (%1).").arg(path);
result << BuildSystemTask(Task::Error, message);
}
if (errors & DebuggerDoesNotMatch) {
- const QString message = tr("The ABI of the selected debugger does not "
+ const QString message = Tr::tr("The ABI of the selected debugger does not "
"match the toolchain ABI.");
result << BuildSystemTask(Task::Warning, message);
}
@@ -409,37 +408,37 @@ KitAspectWidget *DebuggerKitAspect::createConfigWidget(Kit *k) const
void DebuggerKitAspect::addToMacroExpander(Kit *kit, MacroExpander *expander) const
{
QTC_ASSERT(kit, return);
- expander->registerVariable("Debugger:Name", tr("Name of Debugger"),
+ expander->registerVariable("Debugger:Name", Tr::tr("Name of Debugger"),
[kit]() -> QString {
const DebuggerItem *item = debugger(kit);
- return item ? item->displayName() : tr("Unknown debugger");
+ return item ? item->displayName() : Tr::tr("Unknown debugger");
});
- expander->registerVariable("Debugger:Type", tr("Type of Debugger Backend"),
+ expander->registerVariable("Debugger:Type", Tr::tr("Type of Debugger Backend"),
[kit]() -> QString {
const DebuggerItem *item = debugger(kit);
- return item ? item->engineTypeName() : tr("Unknown debugger type");
+ return item ? item->engineTypeName() : Tr::tr("Unknown debugger type");
});
- expander->registerVariable("Debugger:Version", tr("Debugger"),
+ expander->registerVariable("Debugger:Version", Tr::tr("Debugger"),
[kit]() -> QString {
const DebuggerItem *item = debugger(kit);
return item && !item->version().isEmpty()
- ? item->version() : tr("Unknown debugger version");
+ ? item->version() : Tr::tr("Unknown debugger version");
});
- expander->registerVariable("Debugger:Abi", tr("Debugger"),
+ expander->registerVariable("Debugger:Abi", Tr::tr("Debugger"),
[kit]() -> QString {
const DebuggerItem *item = debugger(kit);
return item && !item->abis().isEmpty()
? item->abiNames().join(' ')
- : tr("Unknown debugger ABI");
+ : Tr::tr("Unknown debugger ABI");
});
}
KitAspect::ItemList DebuggerKitAspect::toUserOutput(const Kit *k) const
{
- return {{tr("Debugger"), displayString(k)}};
+ return {{Tr::tr("Debugger"), displayString(k)}};
}
DebuggerEngineType DebuggerKitAspect::engineType(const Kit *k)
@@ -453,10 +452,10 @@ QString DebuggerKitAspect::displayString(const Kit *k)
{
const DebuggerItem *item = debugger(k);
if (!item)
- return tr("No Debugger");
+ return Tr::tr("No Debugger");
QString binary = item->command().toUserOutput();
- QString name = tr("%1 Engine").arg(item->engineTypeName());
- return binary.isEmpty() ? tr("%1 <None>").arg(name) : tr("%1 using \"%2\"").arg(name, binary);
+ QString name = Tr::tr("%1 Engine").arg(item->engineTypeName());
+ return binary.isEmpty() ? Tr::tr("%1 <None>").arg(name) : Tr::tr("%1 using \"%2\"").arg(name, binary);
}
void DebuggerKitAspect::setDebugger(Kit *k, const QVariant &id)
diff --git a/src/plugins/debugger/debuggerkitinformation.h b/src/plugins/debugger/debuggerkitinformation.h
index 66cb98cb83..61b49e8776 100644
--- a/src/plugins/debugger/debuggerkitinformation.h
+++ b/src/plugins/debugger/debuggerkitinformation.h
@@ -36,8 +36,6 @@ class DebuggerItem;
class DEBUGGER_EXPORT DebuggerKitAspect : public ProjectExplorer::KitAspect
{
- Q_OBJECT
-
public:
DebuggerKitAspect();
@@ -76,4 +74,4 @@ public:
static QString displayString(const ProjectExplorer::Kit *k);
};
-} // namespace Debugger
+} // Debugger
diff --git a/src/plugins/debugger/debuggermainwindow.cpp b/src/plugins/debugger/debuggermainwindow.cpp
index d38613898f..267321527e 100644
--- a/src/plugins/debugger/debuggermainwindow.cpp
+++ b/src/plugins/debugger/debuggermainwindow.cpp
@@ -25,7 +25,7 @@
#include "debuggermainwindow.h"
#include "debuggerconstants.h"
-#include "debuggerinternalconstants.h"
+#include "debuggertr.h"
#include "enginemanager.h"
#include <coreplugin/actionmanager/actioncontainer.h>
@@ -216,11 +216,11 @@ DebuggerMainWindowPrivate::DebuggerMainWindowPrivate(DebuggerMainWindow *parent)
});
auto viewButton = new QToolButton;
- viewButton->setText(DebuggerMainWindow::tr("&Views"));
+ viewButton->setText(Tr::tr("&Views"));
auto closeButton = new QToolButton();
closeButton->setIcon(Utils::Icons::CLOSE_SPLIT_BOTTOM.icon());
- closeButton->setToolTip(DebuggerMainWindow::tr("Leave Debug Mode"));
+ closeButton->setToolTip(Tr::tr("Leave Debug Mode"));
auto toolbar = new Utils::StyledBar;
toolbar->setProperty("topBorder", true);
@@ -258,7 +258,7 @@ DebuggerMainWindowPrivate::DebuggerMainWindowPrivate(DebuggerMainWindow *parent)
scrolledToolbar->setFixedHeight(StyleHelper::navigationWidgetHeight());
scrolledToolbar->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
- auto dock = new QDockWidget(DebuggerMainWindow::tr("Toolbar"), q);
+ auto dock = new QDockWidget(Tr::tr("Toolbar"), q);
dock->setObjectName("Toolbar");
dock->setFeatures(QDockWidget::NoDockWidgetFeatures);
dock->setAllowedAreas(Qt::BottomDockWidgetArea);
@@ -585,7 +585,7 @@ void DebuggerMainWindowPrivate::setCentralWidget(QWidget *widget)
q->showCentralWidgetAction()->setText(widget->windowTitle());
} else {
m_centralWidgetStack->addWidget(m_editorPlaceHolder);
- q->showCentralWidgetAction()->setText(DebuggerMainWindow::tr("Editor"));
+ q->showCentralWidgetAction()->setText(Tr::tr("Editor"));
}
}
@@ -755,7 +755,7 @@ void PerspectivePrivate::populatePerspective()
theMainWindow->showCentralWidgetAction()->setText(m_centralWidget->windowTitle());
} else {
theMainWindow->d->m_centralWidgetStack->addWidget(theMainWindow->d->m_editorPlaceHolder);
- theMainWindow->showCentralWidgetAction()->setText(DebuggerMainWindow::tr("Editor"));
+ theMainWindow->showCentralWidgetAction()->setText(Tr::tr("Editor"));
}
ICore::addAdditionalContext(context());
@@ -875,11 +875,11 @@ void Perspective::registerNextPrevShortcuts(QAction *next, QAction *prev)
static const char nextId[] = "Analyzer.nextitem";
static const char prevId[] = "Analyzer.previtem";
- next->setText(DebuggerMainWindow::tr("Next Item"));
+ next->setText(Tr::tr("Next Item"));
Command * const nextCmd = ActionManager::registerAction(next, nextId,
Context(Id::fromString(id())));
nextCmd->augmentActionWithShortcutToolTip(next);
- prev->setText(DebuggerMainWindow::tr("Previous Item"));
+ prev->setText(Tr::tr("Previous Item"));
Command * const prevCmd = ActionManager::registerAction(prev, prevId,
Context(Id::fromString(id())));
prevCmd->augmentActionWithShortcutToolTip(prev);
diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp
index 5de92dd483..366ee1a559 100644
--- a/src/plugins/debugger/debuggerplugin.cpp
+++ b/src/plugins/debugger/debuggerplugin.cpp
@@ -37,6 +37,7 @@
#include "debuggerrunconfigurationaspect.h"
#include "debuggerruncontrol.h"
#include "debuggerkitinformation.h"
+#include "debuggertr.h"
#include "memoryagent.h"
#include "breakhandler.h"
#include "disassemblerlines.h"
@@ -488,7 +489,7 @@ public:
{
setObjectName("DebugMode");
setContext(Context(C_DEBUGMODE, CC::C_NAVIGATION_PANE));
- setDisplayName(DebuggerPlugin::tr("Debug"));
+ setDisplayName(Tr::tr("Debug"));
setIcon(Utils::Icon::modeIcon(Icons::MODE_DEBUGGER_CLASSIC,
Icons::MODE_DEBUGGER_FLAT, Icons::MODE_DEBUGGER_FLAT_ACTIVE));
setPriority(85);
@@ -628,19 +629,18 @@ public:
if (isMessageOnly) {
if (data.type == LocationByAddress) {
//: Message tracepoint: Address hit.
- message = tr("0x%1 hit").arg(data.address, 0, 16);
+ message = Tr::tr("0x%1 hit").arg(data.address, 0, 16);
} else {
//: Message tracepoint: %1 file, %2 line %3 function hit.
- message = tr("%1:%2 %3() hit").arg(data.fileName.fileName()).
+ message = Tr::tr("%1:%2 %3() hit").arg(data.fileName.fileName()).
arg(data.lineNumber).
arg(cppFunctionAt(data.fileName.toString(), data.lineNumber));
}
QInputDialog dialog; // Create wide input dialog.
- dialog.setWindowFlags(dialog.windowFlags()
- & ~(Qt::MSWindowsFixedSizeDialogHint));
+ dialog.setWindowFlags(dialog.windowFlags() & ~(Qt::MSWindowsFixedSizeDialogHint));
dialog.resize(600, dialog.height());
- dialog.setWindowTitle(tr("Add Message Tracepoint"));
- dialog.setLabelText (tr("Message:"));
+ dialog.setWindowTitle(Tr::tr("Add Message Tracepoint"));
+ dialog.setLabelText(Tr::tr("Message:"));
dialog.setTextValue(message);
if (dialog.exec() != QDialog::Accepted || dialog.textValue().isEmpty())
return;
@@ -694,22 +694,22 @@ public:
ProxyAction m_hiddenStopAction;
QAction m_undisturbableAction;
OptionalAction m_startAction;
- QAction m_debugWithoutDeployAction{tr("Start Debugging Without Deployment")};
- QAction m_startAndDebugApplicationAction{tr("Start and Debug External Application...")};
- QAction m_attachToRunningApplication{tr("Attach to Running Application...")};
- QAction m_attachToUnstartedApplication{tr("Attach to Unstarted Application...")};
- QAction m_attachToQmlPortAction{tr("Attach to QML Port...")};
- QAction m_attachToRemoteServerAction{tr("Attach to Running Debug Server...")};
- QAction m_startRemoteCdbAction{tr("Attach to Remote CDB Session...")};
- QAction m_attachToCoreAction{tr("Load Core File...")};
+ QAction m_debugWithoutDeployAction{Tr::tr("Start Debugging Without Deployment")};
+ QAction m_startAndDebugApplicationAction{Tr::tr("Start and Debug External Application...")};
+ QAction m_attachToRunningApplication{Tr::tr("Attach to Running Application...")};
+ QAction m_attachToUnstartedApplication{Tr::tr("Attach to Unstarted Application...")};
+ QAction m_attachToQmlPortAction{Tr::tr("Attach to QML Port...")};
+ QAction m_attachToRemoteServerAction{Tr::tr("Attach to Running Debug Server...")};
+ QAction m_startRemoteCdbAction{Tr::tr("Attach to Remote CDB Session...")};
+ QAction m_attachToCoreAction{Tr::tr("Load Core File...")};
// In the Debug menu.
- QAction m_startAndBreakOnMain{tr("Start and Break on Main")};
- QAction m_watchAction{tr("Add Expression Evaluator")};
+ QAction m_startAndBreakOnMain{Tr::tr("Start and Break on Main")};
+ QAction m_watchAction{Tr::tr("Add Expression Evaluator")};
Command *m_watchCommand = nullptr;
- QAction m_setOrRemoveBreakpointAction{tr("Set or Remove Breakpoint")};
- QAction m_enableOrDisableBreakpointAction{tr("Enable or Disable Breakpoint")};
- QAction m_reloadDebuggingHelpersAction{tr("Reload Debugging Helpers")};
+ QAction m_setOrRemoveBreakpointAction{Tr::tr("Set or Remove Breakpoint")};
+ QAction m_enableOrDisableBreakpointAction{Tr::tr("Enable or Disable Breakpoint")};
+ QAction m_reloadDebuggingHelpersAction{Tr::tr("Reload Debugging Helpers")};
BreakpointManager m_breakpointManager;
QString m_lastPermanentStatusMessage;
@@ -727,7 +727,7 @@ public:
QList<IOptionsPage *> m_optionPages;
IContext m_debugModeContext;
- Perspective m_perspective{Constants::PRESET_PERSPECTIVE_ID, tr("Debugger")};
+ Perspective m_perspective{Constants::PRESET_PERSPECTIVE_ID, Tr::tr("Debugger")};
DebuggerKitAspect debuggerKitAspect;
CommonOptionsPage commonOptionsPage;
@@ -763,7 +763,7 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(const QStringList &arguments)
// Task integration.
//: Category under which Analyzer tasks are listed in Issues view
- TaskHub::addCategory(ANALYZERTASK_ID, tr("Debugger"));
+ TaskHub::addCategory(ANALYZERTASK_ID, Tr::tr("Debugger"));
const Context debuggerNotRunning(C_DEBUGGER_NOTRUNNING);
ICore::addAdditionalContext(debuggerNotRunning);
@@ -775,7 +775,7 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(const QStringList &arguments)
// Menus
m_menu = ActionManager::createMenu(M_DEBUG_ANALYZER);
- m_menu->menu()->setTitle(tr("&Analyze"));
+ m_menu->menu()->setTitle(Tr::tr("&Analyze"));
m_menu->menu()->setEnabled(true);
m_menu->appendGroup(G_ANALYZER_CONTROL);
@@ -800,13 +800,13 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(const QStringList &arguments)
QAction *act;
// Populate Windows->Views menu with standard actions.
- act = new QAction(tr("Memory..."), this);
+ act = new QAction(Tr::tr("Memory..."), this);
act->setVisible(false);
act->setEnabled(false);
Command *cmd = ActionManager::registerAction(act, Constants::OPEN_MEMORY_EDITOR);
- TaskHub::addCategory(TASK_CATEGORY_DEBUGGER_DEBUGINFO, tr("Debug Information"));
- TaskHub::addCategory(TASK_CATEGORY_DEBUGGER_RUNTIME, tr("Debugger Runtime"));
+ TaskHub::addCategory(TASK_CATEGORY_DEBUGGER_DEBUGINFO, Tr::tr("Debug Information"));
+ TaskHub::addCategory(TASK_CATEGORY_DEBUGGER_RUNTIME, Tr::tr("Debugger Runtime"));
m_debuggerSettings.readSettings();
@@ -843,14 +843,14 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(const QStringList &arguments)
breakpointManagerView->enableColumnHiding();
auto breakpointManagerWindow = addSearch(breakpointManagerView);
- breakpointManagerWindow->setWindowTitle(tr("Breakpoint Preset"));
+ breakpointManagerWindow->setWindowTitle(Tr::tr("Breakpoint Preset"));
breakpointManagerWindow->setObjectName("Debugger.Docks.BreakpointManager");
addLabel(breakpointManagerWindow, breakpointManagerWindow->windowTitle());
addFontSizeAdaptation(breakpointManagerWindow);
// Snapshot
auto engineManagerView = new BaseTreeView;
- engineManagerView->setWindowTitle(tr("Running Debuggers"));
+ engineManagerView->setWindowTitle(Tr::tr("Running Debuggers"));
engineManagerView->setSettings(ICore::settings(), "Debugger.SnapshotView");
engineManagerView->setIconSize(QSize(10, 10));
engineManagerView->setModel(EngineManager::model());
@@ -858,7 +858,7 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(const QStringList &arguments)
engineManagerView->enableColumnHiding();
auto engineManagerWindow = addSearch(engineManagerView);
- engineManagerWindow->setWindowTitle(tr("Debugger Perspectives"));
+ engineManagerWindow->setWindowTitle(Tr::tr("Debugger Perspectives"));
engineManagerWindow->setObjectName("Debugger.Docks.Snapshots");
addLabel(engineManagerWindow, engineManagerWindow->windowTitle());
addFontSizeAdaptation(engineManagerWindow);
@@ -908,17 +908,17 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(const QStringList &arguments)
// MENU_GROUP_START_REMOTE
// MENU_GROUP_START_QML
- const QKeySequence startShortcut(useMacShortcuts ? tr("Ctrl+Y") : tr("F5"));
+ const QKeySequence startShortcut(useMacShortcuts ? Tr::tr("Ctrl+Y") : Tr::tr("F5"));
cmd = ActionManager::registerAction(&m_visibleStartAction, "Debugger.Debug");
- cmd->setDescription(tr("Start Debugging or Continue"));
+ cmd->setDescription(Tr::tr("Start Debugging or Continue"));
cmd->setAttribute(Command::CA_UpdateText);
cmd->setAttribute(Command::CA_UpdateIcon);
//mstart->addAction(cmd, CC::G_DEFAULT_ONE);
cmd = ActionManager::registerAction(&m_startAction, DEBUGGER_START);
- cmd->setDescription(tr("Start Debugging"));
+ cmd->setDescription(Tr::tr("Start Debugging"));
cmd->setAttribute(Command::CA_UpdateText);
cmd->setDefaultKeySequence(startShortcut);
mstart->addAction(cmd, CC::G_DEFAULT_ONE);
@@ -943,12 +943,12 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(const QStringList &arguments)
cmd = ActionManager::registerAction(&m_attachToRunningApplication,
"Debugger.AttachToRemoteProcess");
- cmd->setDescription(tr("Attach to Running Application"));
+ cmd->setDescription(Tr::tr("Attach to Running Application"));
mstart->addAction(cmd, MENU_GROUP_GENERAL);
cmd = ActionManager::registerAction(&m_attachToUnstartedApplication,
"Debugger.AttachToUnstartedProcess");
- cmd->setDescription(tr("Attach to Unstarted Application"));
+ cmd->setDescription(Tr::tr("Attach to Unstarted Application"));
mstart->addAction(cmd, MENU_GROUP_GENERAL);
cmd = ActionManager::registerAction(&m_startAndDebugApplicationAction,
@@ -979,22 +979,22 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(const QStringList &arguments)
cmd->setAttribute(Command::CA_Hide);
mstart->addAction(cmd, MENU_GROUP_START_QML);
- act = new QAction(tr("Detach Debugger"), this);
+ act = new QAction(Tr::tr("Detach Debugger"), this);
act->setEnabled(false);
cmd = ActionManager::registerAction(act, Constants::DETACH);
debugMenu->addAction(cmd, CC::G_DEFAULT_ONE);
- act = new QAction(interruptIcon(false), tr("Interrupt"), this);
+ act = new QAction(interruptIcon(false), Tr::tr("Interrupt"), this);
act->setEnabled(false);
cmd = ActionManager::registerAction(act, Constants::INTERRUPT);
- cmd->setDescription(tr("Interrupt Debugger"));
+ cmd->setDescription(Tr::tr("Interrupt Debugger"));
cmd->setAttribute(Command::CA_UpdateText);
cmd->setDefaultKeySequence(startShortcut);
cmd->setTouchBarIcon(Icons::MACOS_TOUCHBAR_DEBUG_INTERRUPT.icon());
touchBar->addAction(cmd);
debugMenu->addAction(cmd, CC::G_DEFAULT_ONE);
- act = new QAction(continueIcon(false), tr("Continue"), this);
+ act = new QAction(continueIcon(false), Tr::tr("Continue"), this);
act->setEnabled(false);
cmd = ActionManager::registerAction(act, Constants::CONTINUE);
cmd->setAttribute(Command::CA_UpdateText);
@@ -1005,7 +1005,7 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(const QStringList &arguments)
const QIcon sidebarStopIcon = Icon::sideBarIcon(Icons::STOP, Icons::STOP_FLAT);
const QIcon stopIcon = Icon::combinedIcon({Icons::DEBUG_EXIT_SMALL.icon(), sidebarStopIcon});
- act = new QAction(stopIcon, tr("Stop Debugger"), this);
+ act = new QAction(stopIcon, Tr::tr("Stop Debugger"), this);
act->setEnabled(false);
cmd = ActionManager::registerAction(act, Constants::STOP);
cmd->setTouchBarIcon(Icons::MACOS_TOUCHBAR_DEBUG_EXIT.icon());
@@ -1016,19 +1016,19 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(const QStringList &arguments)
m_hiddenStopAction.setAttribute(ProxyAction::UpdateIcon);
cmd = ActionManager::registerAction(&m_hiddenStopAction, "Debugger.HiddenStop");
- cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Shift+Ctrl+Y") : tr("Shift+F5")));
+ cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? Tr::tr("Shift+Ctrl+Y") : Tr::tr("Shift+F5")));
- act = new QAction(tr("Abort Debugging"), this);
+ act = new QAction(Tr::tr("Abort Debugging"), this);
act->setEnabled(false);
cmd = ActionManager::registerAction(act, Constants::ABORT);
- cmd->setDescription(tr("Reset Debugger"));
+ cmd->setDescription(Tr::tr("Reset Debugger"));
debugMenu->addAction(cmd, CC::G_DEFAULT_ONE);
- act = new QAction(Icons::RESTART_TOOLBAR.icon(), tr("Restart Debugging"), this);
+ act = new QAction(Icons::RESTART_TOOLBAR.icon(), Tr::tr("Restart Debugging"), this);
act->setEnabled(false);
- act->setToolTip(tr("Restart the debugging session."));
+ act->setToolTip(Tr::tr("Restart the debugging session."));
cmd = ActionManager::registerAction(act, Constants::RESET);
- cmd->setDescription(tr("Restart Debugging"));
+ cmd->setDescription(Tr::tr("Restart Debugging"));
debugMenu->addAction(cmd, CC::G_DEFAULT_ONE);
debugMenu->addSeparator();
@@ -1036,7 +1036,7 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(const QStringList &arguments)
cmd = ActionManager::registerAction(&m_startAndBreakOnMain,
"Debugger.StartAndBreakOnMain",
debuggerNotRunning);
- cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Ctrl+Shift+O") : tr("F10")));
+ cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? Tr::tr("Ctrl+Shift+O") : Tr::tr("F10")));
cmd->setAttribute(Command::CA_Hide);
debugMenu->addAction(cmd);
connect(&m_startAndBreakOnMain, &QAction::triggered, this, [] {
@@ -1044,53 +1044,53 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(const QStringList &arguments)
ProjectExplorerPlugin::runStartupProject(ProjectExplorer::Constants::DEBUG_RUN_MODE, false);
});
- act = new QAction(Icons::STEP_OVER.icon(), tr("Step Over"), this);
+ act = new QAction(Icons::STEP_OVER.icon(), Tr::tr("Step Over"), this);
act->setEnabled(false);
cmd = ActionManager::registerAction(act, Constants::NEXT);
- cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Ctrl+Shift+O") : tr("F10")));
+ cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? Tr::tr("Ctrl+Shift+O") : Tr::tr("F10")));
cmd->setTouchBarIcon(Icons::MACOS_TOUCHBAR_DEBUG_STEP_OVER.icon());
touchBar->addAction(cmd);
debugMenu->addAction(cmd);
- act = new QAction(Icons::STEP_INTO.icon(), tr("Step Into"), this);
+ act = new QAction(Icons::STEP_INTO.icon(), Tr::tr("Step Into"), this);
act->setEnabled(false);
cmd = ActionManager::registerAction(act, Constants::STEP);
- cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Ctrl+Shift+I") : tr("F11")));
+ cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? Tr::tr("Ctrl+Shift+I") : Tr::tr("F11")));
cmd->setTouchBarIcon(Icons::MACOS_TOUCHBAR_DEBUG_STEP_INTO.icon());
touchBar->addAction(cmd);
debugMenu->addAction(cmd);
- act = new QAction(Icons::STEP_OUT.icon(), tr("Step Out"), this);
+ act = new QAction(Icons::STEP_OUT.icon(), Tr::tr("Step Out"), this);
act->setEnabled(false);
cmd = ActionManager::registerAction(act, Constants::STEPOUT);
- cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Ctrl+Shift+T") : tr("Shift+F11")));
+ cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? Tr::tr("Ctrl+Shift+T") : Tr::tr("Shift+F11")));
cmd->setTouchBarIcon(Icons::MACOS_TOUCHBAR_DEBUG_STEP_OUT.icon());
touchBar->addAction(cmd);
debugMenu->addAction(cmd);
- act = new QAction(tr("Run to Line"), this);
+ act = new QAction(Tr::tr("Run to Line"), this);
act->setEnabled(false);
act->setVisible(false);
cmd = ActionManager::registerAction(act, Constants::RUNTOLINE);
- cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Shift+F8") : tr("Ctrl+F10")));
+ cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? Tr::tr("Shift+F8") : Tr::tr("Ctrl+F10")));
debugMenu->addAction(cmd);
- act = new QAction(tr("Run to Selected Function"), this);
+ act = new QAction(Tr::tr("Run to Selected Function"), this);
act->setEnabled(false);
act->setEnabled(false);
cmd = ActionManager::registerAction(act, Constants::RUNTOSELECTEDFUNCTION);
- cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+F6")));
+ cmd->setDefaultKeySequence(QKeySequence(Tr::tr("Ctrl+F6")));
// Don't add to menu by default as keeping its enabled state
// and text up-to-date is a lot of hassle.
// debugMenu->addAction(cmd);
- act = new QAction(tr("Jump to Line"), this);
+ act = new QAction(Tr::tr("Jump to Line"), this);
act->setEnabled(false);
act->setVisible(false);
cmd = ActionManager::registerAction(act, Constants::JUMPTOLINE);
debugMenu->addAction(cmd);
- act = new QAction(tr("Immediately Return From Inner Function"), this);
+ act = new QAction(Tr::tr("Immediately Return From Inner Function"), this);
act->setEnabled(false);
act->setVisible(false);
cmd = ActionManager::registerAction(act, Constants::RETURNFROMFUNCTION);
@@ -1099,22 +1099,19 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(const QStringList &arguments)
debugMenu->addSeparator();
act = new QAction(this);
- act->setText(QCoreApplication::translate("Debugger::Internal::DebuggerPluginPrivate",
- "Move to Calling Frame"));
+ act->setText(QCoreApplication::translate("Debugger", "Move to Calling Frame"));
act->setEnabled(false);
act->setVisible(false);
ActionManager::registerAction(act, Constants::FRAME_UP);
act = new QAction(this);
- act->setText(QCoreApplication::translate("Debugger::Internal::DebuggerPluginPrivate",
- "Move to Called Frame"));
+ act->setText(QCoreApplication::translate("Debugger", "Move to Called Frame"));
act->setEnabled(false);
act->setVisible(false);
ActionManager::registerAction(act, Constants::FRAME_DOWN);
act = new QAction(this);
- act->setText(QCoreApplication::translate("Debugger::Internal::DebuggerEnginePrivate",
- "Operate by Instruction"));
+ act->setText(QCoreApplication::translate("Debugger", "Operate by Instruction"));
act->setEnabled(false);
act->setVisible(false);
act->setCheckable(true);
@@ -1123,28 +1120,28 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(const QStringList &arguments)
debugMenu->addAction(cmd);
cmd = ActionManager::registerAction(&m_setOrRemoveBreakpointAction, "Debugger.ToggleBreak");
- cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("F8") : tr("F9")));
+ cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? Tr::tr("F8") : Tr::tr("F9")));
debugMenu->addAction(cmd);
connect(&m_setOrRemoveBreakpointAction, &QAction::triggered,
this, &DebuggerPluginPrivate::setOrRemoveBreakpoint);
cmd = ActionManager::registerAction(&m_enableOrDisableBreakpointAction,
"Debugger.EnableOrDisableBreakpoint");
- cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Ctrl+F8") : tr("Ctrl+F9")));
+ cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? Tr::tr("Ctrl+F8") : Tr::tr("Ctrl+F9")));
debugMenu->addAction(cmd);
connect(&m_enableOrDisableBreakpointAction, &QAction::triggered,
this, &DebuggerPluginPrivate::enableOrDisableBreakpoint);
debugMenu->addSeparator();
- auto qmlShowAppOnTopDummyAction = new QAction(tr("Show Application on Top"), this);
+ auto qmlShowAppOnTopDummyAction = new QAction(Tr::tr("Show Application on Top"), this);
qmlShowAppOnTopDummyAction->setCheckable(true);
qmlShowAppOnTopDummyAction->setIcon(Icons::APP_ON_TOP.icon());
qmlShowAppOnTopDummyAction->setEnabled(false);
cmd = ActionManager::registerAction(qmlShowAppOnTopDummyAction, Constants::QML_SHOW_APP_ON_TOP);
debugMenu->addAction(cmd);
- auto qmlSelectDummyAction = new QAction(tr("Select"), this);
+ auto qmlSelectDummyAction = new QAction(Tr::tr("Select"), this);
qmlSelectDummyAction->setCheckable(true);
qmlSelectDummyAction->setIcon(Icons::SELECT.icon());
qmlSelectDummyAction->setEnabled(false);
@@ -1242,7 +1239,7 @@ DebuggerPluginPrivate::~DebuggerPluginPrivate()
static QString msgParameterMissing(const QString &a)
{
- return DebuggerPlugin::tr("Option \"%1\" is missing the parameter.").arg(a);
+ return Tr::tr("Option \"%1\" is missing the parameter.").arg(a);
}
static Kit *guessKitFromAbis(const Abis &abis)
@@ -1305,7 +1302,7 @@ bool DebuggerPluginPrivate::parseArgument(QStringList::const_iterator &it,
} else if (executable.isEmpty()) {
executable = FilePath::fromString(key);
} else {
- *errorMessage = DebuggerPlugin::tr("Only one executable allowed.");
+ *errorMessage = Tr::tr("Only one executable allowed.");
return false;
}
} else if (key == "kit") {
@@ -1338,23 +1335,23 @@ bool DebuggerPluginPrivate::parseArgument(QStringList::const_iterator &it,
debugger->setStartMode(AttachToLocalProcess);
debugger->setCloseMode(DetachAtClose);
debugger->setAttachPid(pid);
- debugger->setRunControlName(tr("Process %1").arg(pid));
- debugger->setStartMessage(tr("Attaching to local process %1.").arg(pid));
+ debugger->setRunControlName(Tr::tr("Process %1").arg(pid));
+ debugger->setStartMessage(Tr::tr("Attaching to local process %1.").arg(pid));
} else if (startMode == AttachToRemoteServer) {
debugger->setStartMode(AttachToRemoteServer);
debugger->setRemoteChannel(remoteChannel);
- debugger->setRunControlName(tr("Remote: \"%1\"").arg(remoteChannel));
- debugger->setStartMessage(tr("Attaching to remote server %1.").arg(remoteChannel));
+ debugger->setRunControlName(Tr::tr("Remote: \"%1\"").arg(remoteChannel));
+ debugger->setStartMessage(Tr::tr("Attaching to remote server %1.").arg(remoteChannel));
} else if (startMode == AttachToCore) {
debugger->setStartMode(AttachToCore);
debugger->setCloseMode(DetachAtClose);
debugger->setCoreFilePath(coreFile);
- debugger->setRunControlName(tr("Core file \"%1\"").arg(coreFile.toUserOutput()));
- debugger->setStartMessage(tr("Attaching to core file %1.").arg(coreFile.toUserOutput()));
+ debugger->setRunControlName(Tr::tr("Core file \"%1\"").arg(coreFile.toUserOutput()));
+ debugger->setStartMessage(Tr::tr("Attaching to core file %1.").arg(coreFile.toUserOutput()));
} else {
debugger->setStartMode(StartExternal);
- debugger->setRunControlName(tr("Executable file \"%1\"").arg(executable.toUserOutput()));
- debugger->setStartMessage(tr("Debugging file %1.").arg(executable.toUserOutput()));
+ debugger->setRunControlName(Tr::tr("Executable file \"%1\"").arg(executable.toUserOutput()));
+ debugger->setStartMessage(Tr::tr("Debugging file %1.").arg(executable.toUserOutput()));
}
debugger->setUseTerminal(useTerminal);
@@ -1379,10 +1376,10 @@ bool DebuggerPluginPrivate::parseArgument(QStringList::const_iterator &it,
debugger->setStartMode(AttachToCrashedProcess);
debugger->setCrashParameter(it->section(':', 0, 0));
debugger->setAttachPid(pid);
- debugger->setRunControlName(tr("Crashed process %1").arg(pid));
- debugger->setStartMessage(tr("Attaching to crashed process %1").arg(pid));
+ debugger->setRunControlName(Tr::tr("Crashed process %1").arg(pid));
+ debugger->setStartMessage(Tr::tr("Attaching to crashed process %1").arg(pid));
if (pid < 1) {
- *errorMessage = DebuggerPlugin::tr("The parameter \"%1\" of option \"%2\" "
+ *errorMessage = Tr::tr("The parameter \"%1\" of option \"%2\" "
"does not match the pattern <handle>:<pid>.").arg(*it, option);
return false;
}
@@ -1390,7 +1387,7 @@ bool DebuggerPluginPrivate::parseArgument(QStringList::const_iterator &it,
return true;
}
- *errorMessage = DebuggerPlugin::tr("Invalid debugger option: %1").arg(option);
+ *errorMessage = Tr::tr("Invalid debugger option: %1").arg(option);
return false;
}
@@ -1408,7 +1405,7 @@ void DebuggerPluginPrivate::parseCommandLineArguments()
{
QString errorMessage;
if (!parseArguments(m_arguments, &errorMessage)) {
- errorMessage = tr("Error evaluating command line arguments: %1")
+ errorMessage = Tr::tr("Error evaluating command line arguments: %1")
.arg(errorMessage);
qWarning("%s\n", qPrintable(errorMessage));
MessageManager::writeDisrupting(errorMessage);
@@ -1448,10 +1445,10 @@ void DebuggerPluginPrivate::updatePresetState()
// Restrict width, otherwise Creator gets too wide, see QTCREATORBUG-21885
const QString startToolTip =
- canRun ? tr("Start debugging of startup project") : whyNot;
+ canRun ? Tr::tr("Start debugging of startup project") : whyNot;
m_startAction.setToolTip(startToolTip);
- m_startAction.setText(tr("Start Debugging of Startup Project"));
+ m_startAction.setText(Tr::tr("Start Debugging of Startup Project"));
if (!currentEngine) {
// No engine running -- or -- we have a running engine but it does not
@@ -1578,7 +1575,7 @@ void DebuggerPluginPrivate::attachCore()
auto runControl = new RunControl(ProjectExplorer::Constants::DEBUG_RUN_MODE);
runControl->setKit(dlg.kit());
- runControl->setDisplayName(tr("Core file \"%1\"")
+ runControl->setDisplayName(Tr::tr("Core file \"%1\"")
.arg(dlg.useLocalCoreFile() ? dlg.localCoreFile().toUserOutput()
: dlg.remoteCoreFile().toUserOutput()));
auto debugger = new DebuggerRunTool(runControl);
@@ -1599,7 +1596,7 @@ void DebuggerPluginPrivate::reloadDebuggingHelpers()
engine->reloadDebuggingHelpers();
else
DebuggerMainWindow::showStatusMessage(
- tr("Reload debugging helpers skipped as no engine is running."), 5000);
+ Tr::tr("Reload debugging helpers skipped as no engine is running."), 5000);
}
void DebuggerPluginPrivate::startRemoteCdbSession()
@@ -1677,7 +1674,7 @@ void DebuggerPluginPrivate::attachToRunningApplication()
auto runControl = new RunControl(ProjectExplorer::Constants::DEBUG_RUN_MODE);
runControl->setKit(kit);
//: %1: PID
- runControl->setDisplayName(tr("Process %1").arg(processInfo.processId));
+ runControl->setDisplayName(Tr::tr("Process %1").arg(processInfo.processId));
auto debugger = new RemoteAttachRunner(runControl, ProcessHandle(processInfo.processId));
debugger->startRunControl();
}
@@ -1709,7 +1706,7 @@ RunControl *DebuggerPluginPrivate::attachToRunningProcess(Kit *kit,
IDevice::ConstPtr device = DeviceKitAspect::device(kit);
QTC_ASSERT(device, return nullptr);
if (processInfo.processId == 0) {
- AsynchronousMessageBox::warning(tr("Warning"), tr("Cannot attach to process with PID 0"));
+ AsynchronousMessageBox::warning(Tr::tr("Warning"), Tr::tr("Cannot attach to process with PID 0"));
return nullptr;
}
@@ -1717,23 +1714,23 @@ RunControl *DebuggerPluginPrivate::attachToRunningProcess(Kit *kit,
const bool isWindows = (tcAbi.os() == Abi::WindowsOS);
if (isWindows && isWinProcessBeingDebugged(processInfo.processId)) {
AsynchronousMessageBox::warning(
- tr("Process Already Under Debugger Control"),
- tr("The process %1 is already under the control of a debugger.\n"
+ Tr::tr("Process Already Under Debugger Control"),
+ Tr::tr("The process %1 is already under the control of a debugger.\n"
"%2 cannot attach to it.").arg(processInfo.processId)
.arg(Core::Constants::IDE_DISPLAY_NAME));
return nullptr;
}
if (device->type() != PE::DESKTOP_DEVICE_TYPE) {
- AsynchronousMessageBox::warning(tr("Not a Desktop Device Type"),
- tr("It is only possible to attach to a locally running process."));
+ AsynchronousMessageBox::warning(Tr::tr("Not a Desktop Device Type"),
+ Tr::tr("It is only possible to attach to a locally running process."));
return nullptr;
}
auto runControl = new RunControl(ProjectExplorer::Constants::DEBUG_RUN_MODE);
runControl->setKit(kit);
//: %1: PID
- runControl->setDisplayName(tr("Process %1").arg(processInfo.processId));
+ runControl->setDisplayName(Tr::tr("Process %1").arg(processInfo.processId));
auto debugger = new DebuggerRunTool(runControl);
debugger->setAttachPid(ProcessHandle(processInfo.processId));
debugger->setInferiorExecutable(device->filePath(processInfo.executable));
@@ -1751,7 +1748,7 @@ void DebuggerPlugin::attachExternalApplication(RunControl *rc)
ProcessHandle pid = rc->applicationProcessHandle();
auto runControl = new RunControl(ProjectExplorer::Constants::DEBUG_RUN_MODE);
runControl->setTarget(rc->target());
- runControl->setDisplayName(tr("Process %1").arg(pid.pid()));
+ runControl->setDisplayName(Tr::tr("Process %1").arg(pid.pid()));
auto debugger = new DebuggerRunTool(runControl);
debugger->setInferiorExecutable(rc->targetFilePath());
debugger->setAttachPid(pid);
@@ -1877,20 +1874,20 @@ void DebuggerPluginPrivate::requestContextMenu(TextEditorWidget *widget,
if (gbp) {
// Remove existing breakpoint.
- auto act = menu->addAction(tr("Remove Breakpoint"));
+ auto act = menu->addAction(Tr::tr("Remove Breakpoint"));
connect(act, &QAction::triggered, [gbp] { gbp->deleteBreakpoint(); });
// Enable/disable existing breakpoint.
if (gbp->isEnabled()) {
- act = menu->addAction(tr("Disable Breakpoint"));
+ act = menu->addAction(Tr::tr("Disable Breakpoint"));
connect(act, &QAction::triggered, [gbp] { gbp->setEnabled(false); });
} else {
- act = menu->addAction(tr("Enable Breakpoint"));
+ act = menu->addAction(Tr::tr("Enable Breakpoint"));
connect(act, &QAction::triggered, [gbp] { gbp->setEnabled(true); });
}
// Edit existing breakpoint.
- act = menu->addAction(tr("Edit Breakpoint..."));
+ act = menu->addAction(Tr::tr("Edit Breakpoint..."));
connect(act, &QAction::triggered, [gbp] {
BreakpointManager::editBreakpoint(gbp, ICore::dialogParent());
});
@@ -1898,8 +1895,8 @@ void DebuggerPluginPrivate::requestContextMenu(TextEditorWidget *widget,
} else {
// Handle non-existing breakpoint.
const QString text = args.address
- ? tr("Set Breakpoint at 0x%1").arg(args.address, 0, 16)
- : tr("Set Breakpoint at Line %1").arg(lineNumber);
+ ? Tr::tr("Set Breakpoint at 0x%1").arg(args.address, 0, 16)
+ : Tr::tr("Set Breakpoint at Line %1").arg(lineNumber);
auto act = menu->addAction(text);
act->setEnabled(args.isValid());
connect(act, &QAction::triggered, [this, args] {
@@ -1908,8 +1905,8 @@ void DebuggerPluginPrivate::requestContextMenu(TextEditorWidget *widget,
// Message trace point
const QString tracePointText = args.address
- ? tr("Set Message Tracepoint at 0x%1...").arg(args.address, 0, 16)
- : tr("Set Message Tracepoint at Line %1...").arg(lineNumber);
+ ? Tr::tr("Set Message Tracepoint at 0x%1...").arg(args.address, 0, 16)
+ : Tr::tr("Set Message Tracepoint at Line %1...").arg(lineNumber);
act = menu->addAction(tracePointText);
act->setEnabled(args.isValid());
connect(act, &QAction::triggered, [this, args] {
@@ -1923,8 +1920,8 @@ void DebuggerPluginPrivate::requestContextMenu(TextEditorWidget *widget,
menu->addSeparator();
if (engine->hasCapability(RunToLineCapability)) {
auto act = menu->addAction(args.address
- ? DebuggerEngine::tr("Run to Address 0x%1").arg(args.address, 0, 16)
- : DebuggerEngine::tr("Run to Line %1").arg(args.lineNumber));
+ ? Tr::tr("Run to Address 0x%1").arg(args.address, 0, 16)
+ : Tr::tr("Run to Line %1").arg(args.lineNumber));
connect(act, &QAction::triggered, this, [args, engine] {
QTC_ASSERT(engine, return);
engine->executeRunToLine(args);
@@ -1932,8 +1929,8 @@ void DebuggerPluginPrivate::requestContextMenu(TextEditorWidget *widget,
}
if (engine->hasCapability(JumpToLineCapability)) {
auto act = menu->addAction(args.address
- ? DebuggerEngine::tr("Jump to Address 0x%1").arg(args.address, 0, 16)
- : DebuggerEngine::tr("Jump to Line %1").arg(args.lineNumber));
+ ? Tr::tr("Jump to Address 0x%1").arg(args.address, 0, 16)
+ : Tr::tr("Jump to Line %1").arg(args.lineNumber));
connect(act, &QAction::triggered, this, [args, engine] {
QTC_ASSERT(engine, return);
engine->executeJumpToLine(args);
@@ -1945,7 +1942,7 @@ void DebuggerPluginPrivate::requestContextMenu(TextEditorWidget *widget,
frame.function = cppFunctionAt(args.fileName.toString(), lineNumber, 1);
frame.line = 42; // trick gdb into mixed mode.
if (!frame.function.isEmpty()) {
- const QString text = tr("Disassemble Function \"%1\"")
+ const QString text = Tr::tr("Disassemble Function \"%1\"")
.arg(frame.function);
auto act = new QAction(text, menu);
connect(act, &QAction::triggered, this, [frame, engine] {
@@ -2021,7 +2018,7 @@ void DebuggerPluginPrivate::dumpLog()
LogWindow *logWindow = engine->logWindow();
QTC_ASSERT(logWindow, return);
- const FilePath filePath = FileUtils::getSaveFilePath(nullptr, tr("Save Debugger Log"),
+ const FilePath filePath = FileUtils::getSaveFilePath(nullptr, Tr::tr("Save Debugger Log"),
TemporaryDirectory::masterDirectoryFilePath());
if (filePath.isEmpty())
return;
@@ -2231,7 +2228,7 @@ void showCannotStartDialog(const QString &text)
errorDialog->setAttribute(Qt::WA_DeleteOnClose);
errorDialog->setIcon(QMessageBox::Warning);
errorDialog->setWindowTitle(text);
- errorDialog->setText(DebuggerPlugin::tr("Cannot start %1 without a project. Please open the project "
+ errorDialog->setText(Tr::tr("Cannot start %1 without a project. Please open the project "
"and try again.").arg(text));
errorDialog->setStandardButtons(QMessageBox::Ok);
errorDialog->setDefaultButton(QMessageBox::Ok);
@@ -2247,13 +2244,13 @@ bool wantRunTool(ToolMode toolMode, const QString &toolName)
QString currentMode;
switch (buildType) {
case BuildConfiguration::Debug:
- currentMode = DebuggerPlugin::tr("Debug");
+ currentMode = Tr::tr("Debug");
break;
case BuildConfiguration::Profile:
- currentMode = DebuggerPlugin::tr("Profile");
+ currentMode = Tr::tr("Profile");
break;
case BuildConfiguration::Release:
- currentMode = DebuggerPlugin::tr("Release");
+ currentMode = Tr::tr("Release");
break;
default:
QTC_CHECK(false);
@@ -2262,25 +2259,25 @@ bool wantRunTool(ToolMode toolMode, const QString &toolName)
QString toolModeString;
switch (toolMode) {
case DebugMode:
- toolModeString = DebuggerPlugin::tr("in Debug mode");
+ toolModeString = Tr::tr("in Debug mode");
break;
case ProfileMode:
- toolModeString = DebuggerPlugin::tr("in Profile mode");
+ toolModeString = Tr::tr("in Profile mode");
break;
case ReleaseMode:
- toolModeString = DebuggerPlugin::tr("in Release mode");
+ toolModeString = Tr::tr("in Release mode");
break;
case SymbolsMode:
- toolModeString = DebuggerPlugin::tr("with debug symbols (Debug or Profile mode)");
+ toolModeString = Tr::tr("with debug symbols (Debug or Profile mode)");
break;
case OptimizedMode:
- toolModeString = DebuggerPlugin::tr("on optimized code (Profile or Release mode)");
+ toolModeString = Tr::tr("on optimized code (Profile or Release mode)");
break;
default:
QTC_CHECK(false);
}
- const QString title = DebuggerPlugin::tr("Run %1 in %2 Mode?").arg(toolName).arg(currentMode);
- const QString message = DebuggerPlugin::tr("<html><head/><body><p>You are trying "
+ const QString title = Tr::tr("Run %1 in %2 Mode?").arg(toolName).arg(currentMode);
+ const QString message = Tr::tr("<html><head/><body><p>You are trying "
"to run the tool \"%1\" on an application in %2 mode. "
"The tool is designed to be used %3.</p><p>"
"Run-time characteristics differ significantly between "
@@ -2545,7 +2542,7 @@ QVector<QObject *> DebuggerPlugin::createTestObjects() const
#endif // if WITH_TESTS
-} // namespace Internal
-} // namespace Debugger
+} // Internal
+} // Debugger
#include "debuggerplugin.moc"
diff --git a/src/plugins/debugger/debuggerplugin.h b/src/plugins/debugger/debuggerplugin.h
index 11f5d7607b..af93dbdff4 100644
--- a/src/plugins/debugger/debuggerplugin.h
+++ b/src/plugins/debugger/debuggerplugin.h
@@ -32,8 +32,7 @@
namespace ProjectExplorer { class RunControl; }
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
class DebuggerPlugin : public ExtensionSystem::IPlugin
{
@@ -69,7 +68,6 @@ private:
QVector<QObject *> createTestObjects() const override;
};
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Internal
Q_DECLARE_METATYPE(QString *)
diff --git a/src/plugins/debugger/debuggerprotocol.cpp b/src/plugins/debugger/debuggerprotocol.cpp
index 922a5c1e7f..b0558ffcb5 100644
--- a/src/plugins/debugger/debuggerprotocol.cpp
+++ b/src/plugins/debugger/debuggerprotocol.cpp
@@ -44,8 +44,7 @@
#define QTC_ASSERT(cond, action) if (cond) {} else { QTC_ASSERT_STRING(#cond); action; } do {} while (0)
#define QTC_CHECK(cond) if (cond) {} else { QTC_ASSERT_STRING(#cond); } do {} while (0)
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
static uchar fromhex(uchar c)
{
@@ -983,5 +982,4 @@ QString toHex(const QString &str)
return QString::fromUtf8(str.toUtf8().toHex());
}
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/debuggerprotocol.h b/src/plugins/debugger/debuggerprotocol.h
index 1e743633f0..c683b67e91 100644
--- a/src/plugins/debugger/debuggerprotocol.h
+++ b/src/plugins/debugger/debuggerprotocol.h
@@ -32,12 +32,11 @@
#include <QJsonObject>
#include <QVector>
-#include <utils/fileutils.h>
+#include <utils/filepath.h>
namespace Utils { class ProcessHandle; }
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
class DebuggerResponse;
@@ -349,7 +348,6 @@ public:
quint64 address = 0;
};
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Internal
Q_DECLARE_OPERATORS_FOR_FLAGS(Debugger::Internal::DebuggerCommand::CommandFlags)
diff --git a/src/plugins/debugger/debuggerrunconfigurationaspect.cpp b/src/plugins/debugger/debuggerrunconfigurationaspect.cpp
index 4a339db3d7..66bf54dffd 100644
--- a/src/plugins/debugger/debuggerrunconfigurationaspect.cpp
+++ b/src/plugins/debugger/debuggerrunconfigurationaspect.cpp
@@ -25,11 +25,12 @@
#include "debuggerrunconfigurationaspect.h"
-#include "debuggerconstants.h"
+#include "debuggertr.h"
#include <coreplugin/helpmanager.h>
#include <coreplugin/icontext.h>
#include <coreplugin/icore.h>
+
#include <projectexplorer/buildconfiguration.h>
#include <projectexplorer/buildstep.h>
#include <projectexplorer/buildsteplist.h>
@@ -38,6 +39,7 @@
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/runconfiguration.h>
#include <projectexplorer/target.h>
+
#include <qtsupport/qtbuildaspects.h>
#include <utils/layoutbuilder.h>
@@ -168,7 +170,7 @@ DebuggerRunConfigurationAspect::DebuggerRunConfigurationAspect(Target *target)
: m_target(target)
{
setId("DebuggerAspect");
- setDisplayName(tr("Debugger settings"));
+ setDisplayName(Tr::tr("Debugger settings"));
setConfigWidgetCreator([this] {
Layouting::Form builder;
@@ -188,15 +190,15 @@ DebuggerRunConfigurationAspect::DebuggerRunConfigurationAspect(Target *target)
addDataExtractor(this, &DebuggerRunConfigurationAspect::overrideStartup, &Data::overrideStartup);
m_cppAspect = new DebuggerLanguageAspect;
- m_cppAspect->setLabel(tr("Enable C++"));
+ m_cppAspect->setLabel(Tr::tr("Enable C++"));
m_cppAspect->setSettingsKey("RunConfiguration.UseCppDebugger");
m_cppAspect->setAutoSettingsKey("RunConfiguration.UseCppDebuggerAuto");
m_qmlAspect = new DebuggerLanguageAspect;
- m_qmlAspect->setLabel(tr("Enable QML"));
+ m_qmlAspect->setLabel(Tr::tr("Enable QML"));
m_qmlAspect->setSettingsKey("RunConfiguration.UseQmlDebugger");
m_qmlAspect->setAutoSettingsKey("RunConfiguration.UseQmlDebuggerAuto");
- m_qmlAspect->setInfoLabelText(tr("<a href=\""
+ m_qmlAspect->setInfoLabelText(Tr::tr("<a href=\""
"qthelp://org.qt-project.qtcreator/doc/creator-debugging-qml.html"
"\">What are the prerequisites?</a>"));
@@ -212,13 +214,13 @@ DebuggerRunConfigurationAspect::DebuggerRunConfigurationAspect(Target *target)
m_multiProcessAspect = new BoolAspect;
m_multiProcessAspect->setSettingsKey("RunConfiguration.UseMultiProcess");
- m_multiProcessAspect->setLabel(tr("Enable Debugging of Subprocesses"),
+ m_multiProcessAspect->setLabel(Tr::tr("Enable Debugging of Subprocesses"),
BoolAspect::LabelPlacement::AtCheckBox);
m_overrideStartupAspect = new StringAspect;
m_overrideStartupAspect->setSettingsKey("RunConfiguration.OverrideDebuggerStartup");
m_overrideStartupAspect->setDisplayStyle(StringAspect::TextEditDisplay);
- m_overrideStartupAspect->setLabelText(tr("Additional startup commands:"));
+ m_overrideStartupAspect->setLabelText(Tr::tr("Additional startup commands:"));
}
DebuggerRunConfigurationAspect::~DebuggerRunConfigurationAspect()
diff --git a/src/plugins/debugger/debuggerrunconfigurationaspect.h b/src/plugins/debugger/debuggerrunconfigurationaspect.h
index 4f390d65f6..d1b0d86e24 100644
--- a/src/plugins/debugger/debuggerrunconfigurationaspect.h
+++ b/src/plugins/debugger/debuggerrunconfigurationaspect.h
@@ -26,7 +26,6 @@
#pragma once
#include "debugger_global.h"
-#include "debuggerconstants.h"
#include <projectexplorer/runconfiguration.h>
#include <projectexplorer/runconfigurationaspects.h>
@@ -38,8 +37,6 @@ namespace Internal { class DebuggerLanguageAspect; }
class DEBUGGER_EXPORT DebuggerRunConfigurationAspect
: public ProjectExplorer::GlobalOrProjectAspect
{
- Q_OBJECT
-
public:
DebuggerRunConfigurationAspect(ProjectExplorer::Target *target);
~DebuggerRunConfigurationAspect();
diff --git a/src/plugins/debugger/debuggerruncontrol.cpp b/src/plugins/debugger/debuggerruncontrol.cpp
index 5b88a067fe..137ec06749 100644
--- a/src/plugins/debugger/debuggerruncontrol.cpp
+++ b/src/plugins/debugger/debuggerruncontrol.cpp
@@ -23,22 +23,20 @@
**
****************************************************************************/
-#include "debuggermainwindow.h"
#include "debuggerruncontrol.h"
+
+#include "debuggermainwindow.h"
+#include "debuggertr.h"
#include "terminal.h"
-#include "analyzer/analyzermanager.h"
#include "console/console.h"
#include "debuggeractions.h"
-#include "debuggercore.h"
#include "debuggerengine.h"
#include "debuggerinternalconstants.h"
#include "debuggerkitinformation.h"
-#include "debuggerplugin.h"
#include "debuggerrunconfigurationaspect.h"
#include "breakhandler.h"
#include "enginemanager.h"
-#include "shared/peutils.h"
#include <projectexplorer/buildconfiguration.h>
#include <projectexplorer/devicesupport/deviceprocessesdialog.h>
@@ -95,12 +93,12 @@ DebuggerEngine *createUvscEngine();
static QString noEngineMessage()
{
- return DebuggerPlugin::tr("Unable to create a debugging engine.");
+ return Tr::tr("Unable to create a debugging engine.");
}
static QString noDebuggerInKitMessage()
{
- return DebuggerPlugin::tr("The kit does not have a debugger set.");
+ return Tr::tr("The kit does not have a debugger set.");
}
class CoreUnpacker final : public RunWorker
@@ -138,7 +136,7 @@ private:
reportFailure("Error unpacking " + m_coreFilePath.toUserOutput());
});
- const QString msg = DebuggerRunTool::tr("Unpacking core file to %1");
+ const QString msg = Tr::tr("Unpacking core file to %1");
appendMessage(msg.arg(m_tempCoreFilePath.toUserOutput()), LogMessageFormat);
if (m_coreFilePath.endsWith(".lzo")) {
@@ -244,7 +242,7 @@ void DebuggerRunTool::setSysRoot(const Utils::FilePath &sysRoot)
void DebuggerRunTool::setSymbolFile(const FilePath &symbolFile)
{
if (symbolFile.isEmpty())
- reportFailure(tr("Cannot debug: Local executable is not set."));
+ reportFailure(Tr::tr("Cannot debug: Local executable is not set."));
m_runParameters.symbolFile = symbolFile;
}
@@ -469,7 +467,7 @@ void DebuggerRunTool::start()
if (m_runParameters.startMode == StartInternal
&& m_runParameters.inferior.command.isEmpty()
&& m_runParameters.interpreter.isEmpty()) {
- reportFailure(tr("No executable specified."));
+ reportFailure(Tr::tr("No executable specified."));
return;
}
@@ -479,7 +477,7 @@ void DebuggerRunTool::start()
// FIXME: Disabled due to Android. Make Android device report available ports instead.
// int portsUsed = portsUsedByDebugger();
// if (portsUsed > device()->freePorts().count()) {
-// reportFailure(tr("Cannot debug: Not enough free ports available."));
+// reportFailure(Tr::tr("Cannot debug: Not enough free ports available."));
// return;
// }
@@ -493,7 +491,7 @@ void DebuggerRunTool::start()
&& Utils::is64BitWindowsBinary(m_runParameters.inferior.command.executable())
&& !Utils::is64BitWindowsBinary(m_runParameters.debugger.command.executable())) {
reportFailure(
- DebuggerPlugin::tr(
+ Tr::tr(
"%1 is a 64 bit executable which can not be debugged by a 32 bit Debugger.\n"
"Please select a 64 bit Debugger in the kit settings for this kit.")
.arg(m_runParameters.inferior.command.executable().toUserOutput()));
@@ -501,7 +499,7 @@ void DebuggerRunTool::start()
}
Utils::globalMacroExpander()->registerFileVariables(
- "DebuggedExecutable", tr("Debugged executable"),
+ "DebuggedExecutable", Tr::tr("Debugged executable"),
[this] { return m_runParameters.inferior.command.executable(); }
);
@@ -515,7 +513,7 @@ void DebuggerRunTool::start()
break;
case CdbEngineType:
if (!HostOsInfo::isWindowsHost()) {
- reportFailure(tr("Unsupported CDB host system."));
+ reportFailure(Tr::tr("Unsupported CDB host system."));
return;
}
m_engine = createCdbEngine();
@@ -533,7 +531,7 @@ void DebuggerRunTool::start()
default:
if (!m_runParameters.isQmlDebugging) {
reportFailure(noEngineMessage() + '\n' +
- DebuggerPlugin::tr("Specify Debugger settings in Projects > Run."));
+ Tr::tr("Specify Debugger settings in Projects > Run."));
return;
}
// Can happen for pure Qml.
@@ -578,7 +576,7 @@ void DebuggerRunTool::start()
connect(m_engine, &DebuggerEngine::attachToCoreRequested, this, [this](const QString &coreFile) {
auto rc = new RunControl(ProjectExplorer::Constants::DEBUG_RUN_MODE);
rc->copyDataFromRunControl(runControl());
- auto name = QString(tr("%1 - Snapshot %2").arg(runControl()->displayName()).arg(++d->snapshotCounter));
+ auto name = QString(Tr::tr("%1 - Snapshot %2").arg(runControl()->displayName()).arg(++d->snapshotCounter));
auto debugger = new DebuggerRunTool(rc);
debugger->setStartMode(AttachToCore);
debugger->setRunControlName(name);
@@ -621,14 +619,14 @@ void DebuggerRunTool::start()
}
if (!unhandledIds.isEmpty()) {
QString warningMessage =
- DebuggerPlugin::tr("Some breakpoints cannot be handled by the debugger "
+ Tr::tr("Some breakpoints cannot be handled by the debugger "
"languages currently active, and will be ignored.<p>"
"Affected are breakpoints %1")
.arg(unhandledIds.join(", "));
if (hasQmlBreakpoints) {
warningMessage += "<p>" +
- DebuggerPlugin::tr("QML debugging needs to be enabled both in the Build "
+ Tr::tr("QML debugging needs to be enabled both in the Build "
"and the Run settings.");
}
@@ -637,20 +635,20 @@ void DebuggerRunTool::start()
static bool checked = true;
if (checked)
CheckableMessageBox::information(Core::ICore::dialogParent(),
- tr("Debugger"),
+ Tr::tr("Debugger"),
warningMessage,
- tr("&Show this message again."),
+ Tr::tr("&Show this message again."),
&checked, QDialogButtonBox::Ok);
}
}
- appendMessage(tr("Debugging %1 ...").arg(m_runParameters.inferior.command.toUserOutput()),
+ appendMessage(Tr::tr("Debugging %1 ...").arg(m_runParameters.inferior.command.toUserOutput()),
NormalMessageFormat);
QString debuggerName = m_engine->objectName();
if (m_engine2)
debuggerName += ' ' + m_engine2->objectName();
- const QString message = tr("Starting debugger \"%1\" for ABI \"%2\"...")
+ const QString message = Tr::tr("Starting debugger \"%1\" for ABI \"%2\"...")
.arg(debuggerName).arg(m_runParameters.toolChainAbi.toString());
DebuggerMainWindow::showStatusMessage(message, 10000);
@@ -691,9 +689,9 @@ void DebuggerRunTool::handleEngineFinished(DebuggerEngine *engine)
if (--d->engineStopsNeeded == 0) {
QString cmd = m_runParameters.inferior.command.toUserOutput();
QString msg = engine->runParameters().exitCode // Main engine.
- ? tr("Debugging of %1 has finished with exit code %2.")
+ ? Tr::tr("Debugging of %1 has finished with exit code %2.")
.arg(cmd).arg(engine->runParameters().exitCode.value())
- : tr("Debugging of %1 has finished.").arg(cmd);
+ : Tr::tr("Debugging of %1 has finished.").arg(cmd);
appendMessage(msg, NormalMessageFormat);
reportStopped();
}
@@ -756,7 +754,7 @@ bool DebuggerRunTool::fixupParameters()
if (rp.qmlServer.port() <= 0) {
rp.qmlServer = Utils::urlFromLocalHostAndFreePort();
if (rp.qmlServer.port() <= 0) {
- reportFailure(DebuggerPlugin::tr("Not enough free ports for QML debugging."));
+ reportFailure(Tr::tr("Not enough free ports for QML debugging."));
return false;
}
}
@@ -816,8 +814,8 @@ bool DebuggerRunTool::fixupParameters()
if (perr != ProcessArgs::SplitOk) {
// perr == BadQuoting is never returned on Windows
// FIXME? QTCREATORBUG-2809
- reportFailure(DebuggerPlugin::tr("Debugging complex command lines "
- "is currently not supported on Windows."));
+ reportFailure(Tr::tr("Debugging complex command lines "
+ "is currently not supported on Windows."));
return false;
}
}
@@ -857,8 +855,8 @@ DebuggerRunTool::DebuggerRunTool(RunControl *runControl, AllowTerminal allowTerm
runControl->setIcon(ProjectExplorer::Icons::DEBUG_START_SMALL_TOOLBAR);
runControl->setPromptToStop([](bool *optionalPrompt) {
return RunControl::showPromptToStopDialog(
- DebuggerRunTool::tr("Close Debugging Session"),
- DebuggerRunTool::tr("A debugging session is still in progress. "
+ Tr::tr("Close Debugging Session"),
+ Tr::tr("A debugging session is still in progress. "
"Terminating the session in the current"
" state can leave the target in an inconsistent state."
" Would you still like to terminate it?"),
diff --git a/src/plugins/debugger/debuggerruncontrol.h b/src/plugins/debugger/debuggerruncontrol.h
index a58ffaff9f..52b1c4db3d 100644
--- a/src/plugins/debugger/debuggerruncontrol.h
+++ b/src/plugins/debugger/debuggerruncontrol.h
@@ -46,8 +46,6 @@ class DebugServerPortsGatherer;
class DEBUGGER_EXPORT DebuggerRunTool : public ProjectExplorer::RunWorker
{
- Q_OBJECT
-
public:
enum AllowTerminal { DoAllowTerminal, DoNotAllowTerminal };
explicit DebuggerRunTool(ProjectExplorer::RunControl *runControl,
@@ -146,8 +144,6 @@ private:
class DEBUGGER_EXPORT DebugServerPortsGatherer : public ProjectExplorer::ChannelProvider
{
- Q_OBJECT
-
public:
explicit DebugServerPortsGatherer(ProjectExplorer::RunControl *runControl);
~DebugServerPortsGatherer() override;
@@ -167,8 +163,6 @@ private:
class DEBUGGER_EXPORT DebugServerRunner : public ProjectExplorer::SimpleTargetRunner
{
- Q_OBJECT
-
public:
explicit DebugServerRunner(ProjectExplorer::RunControl *runControl,
DebugServerPortsGatherer *portsGatherer);
diff --git a/src/plugins/debugger/debuggersourcepathmappingwidget.cpp b/src/plugins/debugger/debuggersourcepathmappingwidget.cpp
index c30c3cb9ec..00d4b095ec 100644
--- a/src/plugins/debugger/debuggersourcepathmappingwidget.cpp
+++ b/src/plugins/debugger/debuggersourcepathmappingwidget.cpp
@@ -27,6 +27,7 @@
#include "debuggeractions.h"
#include "debuggerengine.h"
+#include "debuggertr.h"
#include <utils/buildablehelperlibrary.h>
#include <utils/fancylineedit.h>
@@ -49,8 +50,7 @@
using namespace Utils;
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
class SourcePathMappingModel;
@@ -60,8 +60,6 @@ using Mapping = QPair<FilePath, FilePath>;
class DebuggerSourcePathMappingWidget : public QGroupBox
{
- Q_DECLARE_TR_FUNCTIONS(Debugger::Internal::DebuggerSourcePathMappingWidget)
-
public:
DebuggerSourcePathMappingWidget();
@@ -150,12 +148,12 @@ private:
SourcePathMappingModel::SourcePathMappingModel(QObject *parent) :
QStandardItemModel(0, ColumnCount, parent),
- m_newSourcePlaceHolder(DebuggerSourcePathMappingWidget::tr("<new source>")),
- m_newTargetPlaceHolder(DebuggerSourcePathMappingWidget::tr("<new target>"))
+ m_newSourcePlaceHolder(Tr::tr("<new source>")),
+ m_newTargetPlaceHolder(Tr::tr("<new target>"))
{
QStringList headers;
- headers.append(DebuggerSourcePathMappingWidget::tr("Source path"));
- headers.append(DebuggerSourcePathMappingWidget::tr("Target path"));
+ headers.append(Tr::tr("Source path"));
+ headers.append(Tr::tr("Target path"));
setHorizontalHeaderLabels(headers);
}
@@ -243,14 +241,14 @@ void SourcePathMappingModel::setTarget(int row, const QString &t)
DebuggerSourcePathMappingWidget::DebuggerSourcePathMappingWidget() :
m_model(new SourcePathMappingModel(this)),
m_treeView(new QTreeView(this)),
- m_addButton(new QPushButton(tr("Add"), this)),
- m_addQtButton(new QPushButton(tr("Add Qt sources..."), this)),
- m_removeButton(new QPushButton(tr("Remove"), this)),
+ m_addButton(new QPushButton(Tr::tr("Add"), this)),
+ m_addQtButton(new QPushButton(Tr::tr("Add Qt sources..."), this)),
+ m_removeButton(new QPushButton(Tr::tr("Remove"), this)),
m_sourceLineEdit(new QLineEdit(this)),
m_targetChooser(new PathChooser(this))
{
- setTitle(tr("Source Paths Mapping"));
- setToolTip(tr("<p>Mappings of source file folders to "
+ setTitle(Tr::tr("Source Paths Mapping"));
+ setToolTip(Tr::tr("<p>Mappings of source file folders to "
"be used in the debugger can be entered here.</p>"
"<p>This is useful when using a copy of the source tree "
"at a location different from the one "
@@ -275,7 +273,7 @@ DebuggerSourcePathMappingWidget::DebuggerSourcePathMappingWidget() :
buttonLayout->addWidget(m_addButton);
buttonLayout->addWidget(m_addQtButton);
m_addQtButton->setVisible(!qtBuildPaths().isEmpty());
- m_addQtButton->setToolTip(tr("<p>Add a mapping for Qt's source folders "
+ m_addQtButton->setToolTip(Tr::tr("<p>Add a mapping for Qt's source folders "
"when using an unpatched version of Qt."));
buttonLayout->addWidget(m_removeButton);
connect(m_addButton, &QAbstractButton::clicked,
@@ -299,17 +297,17 @@ DebuggerSourcePathMappingWidget::DebuggerSourcePathMappingWidget() :
connect(m_targetChooser, &PathChooser::filePathChanged,
this, &DebuggerSourcePathMappingWidget::slotEditTargetFieldChanged);
auto editLayout = new QFormLayout;
- const QString sourceToolTip = tr("<p>The source path contained in the "
+ const QString sourceToolTip = Tr::tr("<p>The source path contained in the "
"debug information of the executable as reported by the debugger");
- auto editSourceLabel = new QLabel(tr("&Source path:"));
+ auto editSourceLabel = new QLabel(Tr::tr("&Source path:"));
editSourceLabel->setToolTip(sourceToolTip);
m_sourceLineEdit->setToolTip(sourceToolTip);
editSourceLabel->setBuddy(m_sourceLineEdit);
editLayout->addRow(editSourceLabel, m_sourceLineEdit);
- const QString targetToolTip = tr("<p>The actual location of the source "
+ const QString targetToolTip = Tr::tr("<p>The actual location of the source "
"tree on the local machine");
- auto editTargetLabel = new QLabel(tr("&Target path:"));
+ auto editTargetLabel = new QLabel(Tr::tr("&Target path:"));
editTargetLabel->setToolTip(targetToolTip);
editTargetLabel->setBuddy(m_targetChooser);
m_targetChooser->setToolTip(targetToolTip);
@@ -405,7 +403,7 @@ void DebuggerSourcePathMappingWidget::slotAdd()
void DebuggerSourcePathMappingWidget::slotAddQt()
{
// Add a mapping for various Qt build locations in case of unpatched builds.
- const FilePath qtSourcesPath = FileUtils::getExistingDirectory(this, tr("Qt Sources"));
+ const FilePath qtSourcesPath = FileUtils::getExistingDirectory(this, Tr::tr("Qt Sources"));
if (qtSourcesPath.isEmpty())
return;
for (const QString &buildPath : qtBuildPaths())
@@ -584,5 +582,4 @@ void SourcePathMapAspect::readSettings(const QSettings *settings)
setValue(QVariant::fromValue(sourcePathMap));
}
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/debuggersourcepathmappingwidget.h b/src/plugins/debugger/debuggersourcepathmappingwidget.h
index a1f07a67c5..3a233939f0 100644
--- a/src/plugins/debugger/debuggersourcepathmappingwidget.h
+++ b/src/plugins/debugger/debuggersourcepathmappingwidget.h
@@ -28,14 +28,13 @@
#include <QMap>
#include <QString>
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
class DebuggerRunParameters;
using SourcePathMap = QMap<QString, QString>;
+
/* Merge settings for an installed Qt (unless another setting
* is already in the map. */
SourcePathMap mergePlatformQtPath(const DebuggerRunParameters &sp, const SourcePathMap &in);
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/debuggertooltipmanager.cpp b/src/plugins/debugger/debuggertooltipmanager.cpp
index 4177879653..853c53174b 100644
--- a/src/plugins/debugger/debuggertooltipmanager.cpp
+++ b/src/plugins/debugger/debuggertooltipmanager.cpp
@@ -30,6 +30,7 @@
#include "debuggerinternalconstants.h"
#include "debuggermainwindow.h"
#include "debuggerprotocol.h"
+#include "debuggertr.h"
#include "sourceutils.h"
#include "stackhandler.h"
#include "watchhandler.h"
@@ -77,8 +78,7 @@ using namespace ProjectExplorer;
using namespace TextEditor;
using namespace Utils;
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
//#define DEBUG(x) qDebug() << x
#define DEBUG(x)
@@ -280,9 +280,7 @@ class ToolTipModel : public TreeModel<ToolTipWatchItem>
public:
ToolTipModel()
{
- setHeader({DebuggerToolTipManager::tr("Name"),
- DebuggerToolTipManager::tr("Value"),
- DebuggerToolTipManager::tr("Type")});
+ setHeader({Tr::tr("Name"), Tr::tr("Value"), Tr::tr("Type")});
m_enabled = true;
auto item = new ToolTipWatchItem;
item->expandable = true;
@@ -550,7 +548,7 @@ DebuggerToolTipWidget::DebuggerToolTipWidget()
pinButton->setIcon(pinIcon);
auto copyButton = new QToolButton;
- copyButton->setToolTip(DebuggerToolTipManager::tr("Copy Contents to Clipboard"));
+ copyButton->setToolTip(Tr::tr("Copy Contents to Clipboard"));
copyButton->setIcon(Utils::Icons::COPY.icon());
titleLabel = new DraggableLabel(this);
@@ -736,7 +734,7 @@ bool DebuggerToolTipContext::isSame(const DebuggerToolTipContext &other) const
QString DebuggerToolTipContext::toolTip() const
{
- return DebuggerToolTipManager::tr("Expression %1 in function %2 from line %3 to %4")
+ return Tr::tr("Expression %1 in function %2 from line %3 to %4")
.arg(expression).arg(function).arg(scopeFromLine).arg(scopeToLine);
}
@@ -884,7 +882,7 @@ void DebuggerToolTipHolder::releaseEngine()
// a valid expression but can't be resolved by the debugger backend.
// (Out of scope items, keywords, ...)
ToolTip::show(context.mousePosition,
- DebuggerToolTipManager::tr("No valid expression"),
+ Tr::tr("No valid expression"),
DebuggerMainWindow::instance());
widget->deleteLater();
return;
@@ -893,7 +891,7 @@ void DebuggerToolTipHolder::releaseEngine()
setState(Released);
widget->model.m_enabled = false;
emit widget->model.layoutChanged();
- widget->titleLabel->setText(DebuggerToolTipManager::tr("%1 (Previous)").arg(context.expression));
+ widget->titleLabel->setText(Tr::tr("%1 (Previous)").arg(context.expression));
}
void DebuggerToolTipHolder::positionShow(const TextEditorWidget *editorWidget)
@@ -1115,7 +1113,7 @@ void DebuggerToolTipManagerPrivate::loadSessionData()
m_tooltips.push_back(tw);
tw->widget->model.restoreTreeModel(r);
tw->widget->pin();
- tw->widget->titleLabel->setText(DebuggerToolTipManager::tr("%1 (Restored)").arg(context.expression));
+ tw->widget->titleLabel->setText(Tr::tr("%1 (Restored)").arg(context.expression));
tw->widget->treeView->expandAll();
} else {
r.readElementText(QXmlStreamReader::SkipChildElements); // Skip
@@ -1203,7 +1201,7 @@ void DebuggerToolTipManagerPrivate::slotTooltipOverrideRequested
!= CppEditor::ProjectFile::Unsupported;
if (context.expression.isEmpty()) {
- ToolTip::show(point, DebuggerToolTipManager::tr("No valid expression"),
+ ToolTip::show(point, Tr::tr("No valid expression"),
DebuggerMainWindow::instance());
*handled = true;
return;
@@ -1259,7 +1257,7 @@ void DebuggerToolTipManagerPrivate::slotTooltipOverrideRequested
if (m_engine->canHandleToolTip(context)) {
m_engine->updateItem(context.iname);
} else {
- ToolTip::show(point, DebuggerToolTipManager::tr("Expression too complex"),
+ ToolTip::show(point, Tr::tr("Expression too complex"),
DebuggerMainWindow::instance());
tooltip->destroy();
}
@@ -1382,5 +1380,4 @@ void DebuggerToolTipManagerPrivate::purgeClosedToolTips()
}
}
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/debuggertooltipmanager.h b/src/plugins/debugger/debuggertooltipmanager.h
index 2c6853fcb6..09f7c87489 100644
--- a/src/plugins/debugger/debuggertooltipmanager.h
+++ b/src/plugins/debugger/debuggertooltipmanager.h
@@ -33,8 +33,7 @@
#include <QDate>
#include <QPoint>
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
class DebuggerEngine;
class StackFrame;
@@ -66,13 +65,13 @@ public:
using DebuggerToolTipContexts = QList<DebuggerToolTipContext>;
-class DebuggerToolTipManager : public QObject
+class DebuggerToolTipManager
{
- Q_OBJECT
+ Q_DISABLE_COPY_MOVE(DebuggerToolTipManager)
public:
explicit DebuggerToolTipManager(DebuggerEngine *engine);
- ~DebuggerToolTipManager() override;
+ ~DebuggerToolTipManager();
void deregisterEngine();
void updateToolTips();
@@ -87,5 +86,4 @@ private:
class DebuggerToolTipManagerPrivate *d;
};
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/disassembleragent.cpp b/src/plugins/debugger/disassembleragent.cpp
index 38d7af3b45..3a180e85ab 100644
--- a/src/plugins/debugger/disassembleragent.cpp
+++ b/src/plugins/debugger/disassembleragent.cpp
@@ -27,7 +27,6 @@
#include "breakhandler.h"
#include "debuggeractions.h"
-#include "debuggercore.h"
#include "debuggerengine.h"
#include "debuggerinternalconstants.h"
#include "disassemblerlines.h"
@@ -52,8 +51,7 @@
using namespace Core;
using namespace TextEditor;
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
///////////////////////////////////////////////////////////////////////
//
@@ -410,5 +408,4 @@ quint64 DisassemblerAgent::address() const
return d->location.address();
}
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/disassembleragent.h b/src/plugins/debugger/disassembleragent.h
index aef71ebeaf..8fdb53b77b 100644
--- a/src/plugins/debugger/disassembleragent.h
+++ b/src/plugins/debugger/disassembleragent.h
@@ -29,8 +29,7 @@
#include <QObject>
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
class DebuggerEngine;
class DisassemblerAgentPrivate;
@@ -73,5 +72,4 @@ private:
DisassemblerAgentPrivate *d;
};
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/disassemblerlines.cpp b/src/plugins/debugger/disassemblerlines.cpp
index cd56551837..e0d3d7cc0d 100644
--- a/src/plugins/debugger/disassemblerlines.cpp
+++ b/src/plugins/debugger/disassemblerlines.cpp
@@ -24,14 +24,12 @@
****************************************************************************/
#include "disassemblerlines.h"
-#include "sourceutils.h"
#include <QDebug>
#include <QFile>
#include <QTextStream>
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
void DisassemblerLine::fromString(const QString &unparsed)
{
@@ -248,5 +246,4 @@ QString DisassemblerLines::toString() const
return str;
}
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/disassemblerlines.h b/src/plugins/debugger/disassemblerlines.h
index 71cd5104a6..26111575b2 100644
--- a/src/plugins/debugger/disassemblerlines.h
+++ b/src/plugins/debugger/disassemblerlines.h
@@ -29,8 +29,7 @@
#include <QHash>
#include <QVector>
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
// A DisassemblerLine represents either
// - an assembler instruction (address, offset, function, data fields), or
@@ -89,5 +88,4 @@ private:
QHash<quint64, int> m_rowCache;
};
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/enginemanager.cpp b/src/plugins/debugger/enginemanager.cpp
index 0c5ef1dd68..b11e6ac756 100644
--- a/src/plugins/debugger/enginemanager.cpp
+++ b/src/plugins/debugger/enginemanager.cpp
@@ -25,13 +25,11 @@
#include "enginemanager.h"
-#include "analyzer/analyzermanager.h"
-#include "debuggeractions.h"
+#include "debuggerengine.h"
#include "debuggerinternalconstants.h"
#include "debuggericons.h"
-#include "debuggercore.h"
-#include "debuggerruncontrol.h"
-#include "stackhandler.h"
+#include "debuggermainwindow.h"
+#include "debuggertr.h"
#include <coreplugin/icontext.h>
#include <coreplugin/icore.h>
@@ -41,6 +39,7 @@
#include <utils/treemodel.h>
#include <utils/qtcassert.h>
+#include <QComboBox>
#include <QDebug>
#include <QMenu>
#include <QTimer>
@@ -48,8 +47,7 @@
using namespace Core;
using namespace Utils;
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
const bool hideSwitcherUnlessNeeded = false;
@@ -76,9 +74,9 @@ QString SnapshotData::toString() const
{
QString res;
QTextStream str(&res);
-/* str << SnapshotHandler::tr("Function:") << ' ' << function() << ' '
- << SnapshotHandler::tr("File:") << ' ' << m_location << ' '
- << SnapshotHandler::tr("Date:") << ' ' << m_date.toString(); */
+/* str << Tr::tr("Function:") << ' ' << function() << ' '
+ << Tr::tr("File:") << ' ' << m_location << ' '
+ << Tr::tr("Date:") << ' ' << m_date.toString(); */
return res;
}
@@ -88,9 +86,9 @@ QString SnapshotData::toToolTip() const
QTextStream str(&res);
str << "<html><body><table>"
/*
- << "<tr><td>" << SnapshotHandler::tr("Function:")
+ << "<tr><td>" << Tr::tr("Function:")
<< "</td><td>" << function() << "</td></tr>"
- << "<tr><td>" << SnapshotHandler::tr("File:")
+ << "<tr><td>" << Tr::tr("File:")
<< "</td><td>" << QDir::toNativeSeparators(m_location) << "</td></tr>"
<< "</table></body></html>"; */
return res;
@@ -132,8 +130,8 @@ class EngineManagerPrivate : public QObject
public:
EngineManagerPrivate()
{
- m_engineModel.setHeader({EngineManager::tr("Perspective"),
- EngineManager::tr("Debugged Application")});
+ m_engineModel.setHeader({Tr::tr("Perspective"), Tr::tr("Debugged Application")});
+
// The preset case:
auto preset = new EngineItem;
m_engineModel.rootItem()->appendChild(preset);
@@ -264,7 +262,7 @@ QVariant EngineItem::data(int column, int role) const
switch (role) {
case Qt::DisplayRole:
if (column == 0)
- return EngineManager::tr("Debugger Preset");
+ return Tr::tr("Debugger Preset");
return QString("-");
default:
break;
@@ -292,11 +290,11 @@ bool EngineItem::setData(int row, const QVariant &value, int role)
auto menu = new QMenu(ev.view());
- QAction *actCreate = menu->addAction(EngineManager::tr("Create Snapshot"));
+ QAction *actCreate = menu->addAction(Tr::tr("Create Snapshot"));
actCreate->setEnabled(m_engine->hasCapability(SnapshotCapabilityRole));
menu->addSeparator();
- QAction *actRemove = menu->addAction(EngineManager::tr("Abort Debugger"));
+ QAction *actRemove = menu->addAction(Tr::tr("Abort Debugger"));
actRemove->setEnabled(true);
QAction *act = menu->exec(cmev->globalPos());
@@ -502,5 +500,4 @@ bool EngineManager::shutDown()
return anyEngineAborting;
}
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/enginemanager.h b/src/plugins/debugger/enginemanager.h
index 1a6497aef0..8151b13a43 100644
--- a/src/plugins/debugger/enginemanager.h
+++ b/src/plugins/debugger/enginemanager.h
@@ -29,8 +29,7 @@
#include <QPointer>
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
class DebuggerEngine;
@@ -64,5 +63,4 @@ signals:
void currentEngineChanged();
};
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp
index 6dc3cb9d80..d22916a43d 100644
--- a/src/plugins/debugger/gdb/gdbengine.cpp
+++ b/src/plugins/debugger/gdb/gdbengine.cpp
@@ -25,31 +25,30 @@
#include "gdbengine.h"
-#include <debugger/debuggerinternalconstants.h>
-#include <debugger/debuggerruncontrol.h>
-#include <debugger/disassemblerlines.h>
-
+#include <debugger/breakhandler.h>
#include <debugger/debuggeractions.h>
#include <debugger/debuggercore.h>
+#include <debugger/debuggerinternalconstants.h>
#include <debugger/debuggermainwindow.h>
#include <debugger/debuggerplugin.h>
#include <debugger/debuggerprotocol.h>
+#include <debugger/debuggerruncontrol.h>
+#include <debugger/debuggersourcepathmappingwidget.h>
#include <debugger/debuggertooltipmanager.h>
+#include <debugger/debuggertr.h>
#include <debugger/disassembleragent.h>
+#include <debugger/disassemblerlines.h>
+#include <debugger/logwindow.h>
#include <debugger/memoryagent.h>
-#include <debugger/sourceutils.h>
-#include <debugger/terminal.h>
-
-#include <debugger/breakhandler.h>
#include <debugger/moduleshandler.h>
+#include <debugger/procinterrupt.h>
#include <debugger/registerhandler.h>
+#include <debugger/shared/hostutils.h>
#include <debugger/sourcefileshandler.h>
+#include <debugger/sourceutils.h>
#include <debugger/stackhandler.h>
+#include <debugger/terminal.h>
#include <debugger/threadshandler.h>
-#include <debugger/debuggersourcepathmappingwidget.h>
-#include <debugger/logwindow.h>
-#include <debugger/procinterrupt.h>
-#include <debugger/shared/hostutils.h>
#include <coreplugin/icore.h>
#include <coreplugin/messagebox.h>
@@ -78,8 +77,7 @@ using namespace Core;
using namespace ProjectExplorer;
using namespace Utils;
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
enum { debugPending = 0 };
@@ -191,7 +189,7 @@ GdbEngine::~GdbEngine()
QString GdbEngine::failedToStartMessage()
{
- return tr("The gdb process failed to start.");
+ return Tr::tr("The gdb process failed to start.");
}
// Parse "~:gdb: unknown target exception 0xc0000139 at 0x77bef04e\n"
@@ -204,14 +202,14 @@ static QString msgWinException(const QString &data, unsigned *exCodeIn = nullptr
const int blankPos = exCodePos != -1 ? data.indexOf(' ', exCodePos + 1) : -1;
const int addressPos = blankPos != -1 ? data.indexOf("0x", blankPos + 1) : -1;
if (addressPos < 0)
- return GdbEngine::tr("An exception was triggered.");
+ return Tr::tr("An exception was triggered.");
const unsigned exCode = data.mid(exCodePos, blankPos - exCodePos).toUInt(nullptr, 0);
if (exCodeIn)
*exCodeIn = exCode;
const quint64 address = data.mid(addressPos).trimmed().toULongLong(nullptr, 0);
QString rc;
QTextStream str(&rc);
- str << GdbEngine::tr("An exception was triggered:") << ' ';
+ str << Tr::tr("An exception was triggered:") << ' ';
formatWindowsException(exCode, address, 0, 0, 0, str);
str << '.';
return rc;
@@ -336,7 +334,7 @@ void GdbEngine::handleResponse(const QString &buff)
// Show some messages to give the impression something happens.
if (data.startsWith("Reading symbols from ")) {
- showStatusMessage(tr("Reading %1...").arg(data.mid(21)), 1000);
+ showStatusMessage(Tr::tr("Reading %1...").arg(data.mid(21)), 1000);
progressPing();
} else if (data.startsWith("[New ") || data.startsWith("[Thread ")) {
if (data.endsWith('\n'))
@@ -479,7 +477,7 @@ void GdbEngine::handleAsyncOutput(const QString &asyncClass, const GdbMi &result
// symbols-loaded="0",thread-group="i1"
QString id = result["id"].data();
if (!id.isEmpty())
- showStatusMessage(tr("Library %1 loaded.").arg(id), 1000);
+ showStatusMessage(Tr::tr("Library %1 loaded.").arg(id), 1000);
progressPing();
Module module;
module.startAddress = 0;
@@ -495,7 +493,7 @@ void GdbEngine::handleAsyncOutput(const QString &asyncClass, const GdbMi &result
QString id = result["id"].data();
modulesHandler()->removeModule(result["target-name"].data());
progressPing();
- showStatusMessage(tr("Library %1 unloaded.").arg(id), 1000);
+ showStatusMessage(Tr::tr("Library %1 unloaded.").arg(id), 1000);
} else if (asyncClass == "thread-group-added") {
// 7.1-symbianelf has "{id="i1"}"
} else if (asyncClass == "thread-group-started") {
@@ -505,13 +503,13 @@ void GdbEngine::handleAsyncOutput(const QString &asyncClass, const GdbMi &result
progressPing();
// 7.1.50 has thread-group-started,id="i1",pid="3529"
QString id = result["id"].data();
- showStatusMessage(tr("Thread group %1 created.").arg(id), 1000);
+ showStatusMessage(Tr::tr("Thread group %1 created.").arg(id), 1000);
notifyInferiorPid(result["pid"].toProcessHandle());
handleThreadGroupCreated(result);
} else if (asyncClass == "thread-created") {
//"{id="1",group-id="28902"}"
QString id = result["id"].data();
- showStatusMessage(tr("Thread %1 created.").arg(id), 1000);
+ showStatusMessage(Tr::tr("Thread %1 created.").arg(id), 1000);
ThreadData thread;
thread.id = id;
thread.groupId = result["group-id"].data();
@@ -519,18 +517,18 @@ void GdbEngine::handleAsyncOutput(const QString &asyncClass, const GdbMi &result
} else if (asyncClass == "thread-group-exited") {
// Archer has "{id="28902"}"
QString id = result["id"].data();
- showStatusMessage(tr("Thread group %1 exited.").arg(id), 1000);
+ showStatusMessage(Tr::tr("Thread group %1 exited.").arg(id), 1000);
handleThreadGroupExited(result);
} else if (asyncClass == "thread-exited") {
//"{id="1",group-id="28902"}"
QString id = result["id"].data();
QString groupid = result["group-id"].data();
- showStatusMessage(tr("Thread %1 in group %2 exited.")
+ showStatusMessage(Tr::tr("Thread %1 in group %2 exited.")
.arg(id).arg(groupid), 1000);
threadsHandler()->removeThread(id);
} else if (asyncClass == "thread-selected") {
QString id = result["id"].data();
- showStatusMessage(tr("Thread %1 selected.").arg(id), 1000);
+ showStatusMessage(Tr::tr("Thread %1 selected.").arg(id), 1000);
//"{id="2"}"
} else if (asyncClass == "breakpoint-modified") {
// New in FSF gdb since 2011-04-27.
@@ -684,7 +682,7 @@ void GdbEngine::interruptInferior()
if (usesExecInterrupt()) {
runCommand({"-exec-interrupt"});
} else {
- showStatusMessage(tr("Stop requested..."), 5000);
+ showStatusMessage(Tr::tr("Stop requested..."), 5000);
showMessage("TRYING TO INTERRUPT INFERIOR");
if (HostOsInfo::isWindowsHost() && !m_isQnxGdb) {
IDevice::ConstPtr dev = device();
@@ -748,7 +746,7 @@ void GdbEngine::runCommand(const DebuggerCommand &command)
return;
}
if (state() == InferiorRunOk) {
- showStatusMessage(tr("Stopping temporarily."), 1000);
+ showStatusMessage(Tr::tr("Stopping temporarily."), 1000);
m_onStop.append(cmd, wantContinue);
setState(InferiorStopRequested);
interruptInferior();
@@ -834,16 +832,16 @@ void GdbEngine::commandTimeout()
"COMMANDS STILL IN PROGRESS: ") + commands.join(", "));
int timeOut = m_commandTimer.interval();
//m_commandTimer.stop();
- const QString msg = tr("The gdb process has not responded "
+ const QString msg = Tr::tr("The gdb process has not responded "
"to a command within %n seconds. This could mean it is stuck "
"in an endless loop or taking longer than expected to perform "
"the operation.\nYou can choose between waiting "
"longer or aborting debugging.", nullptr, timeOut / 1000);
QMessageBox *mb = showMessageBox(QMessageBox::Critical,
- tr("GDB Not Responding"), msg,
+ Tr::tr("GDB Not Responding"), msg,
QMessageBox::Ok | QMessageBox::Cancel);
- mb->button(QMessageBox::Cancel)->setText(tr("Give GDB More Time"));
- mb->button(QMessageBox::Ok)->setText(tr("Stop Debugging"));
+ mb->button(QMessageBox::Cancel)->setText(Tr::tr("Give GDB More Time"));
+ mb->button(QMessageBox::Ok)->setText(Tr::tr("Stop Debugging"));
if (mb->exec() == QMessageBox::Ok) {
showMessage("KILLING DEBUGGER AS REQUESTED BY USER");
// This is an undefined state, so we just pull the emergency brake.
@@ -883,8 +881,8 @@ void GdbEngine::handleResultRecord(DebuggerResponse *response)
// with helpers enabled. In this case we get a second response with
// msg="Cannot find new threads: generic error"
showMessage("APPLYING WORKAROUND #1");
- AsynchronousMessageBox::critical(tr("Executable Failed"), msg);
- showStatusMessage(tr("Process failed to start."));
+ AsynchronousMessageBox::critical(Tr::tr("Executable Failed"), msg);
+ showStatusMessage(Tr::tr("Process failed to start."));
//shutdown();
notifyInferiorIll();
} else if (msg == "\"finish\" not meaningful in the outermost frame.") {
@@ -905,9 +903,9 @@ void GdbEngine::handleResultRecord(DebuggerResponse *response)
showMessage("APPLYING WORKAROUND #4");
notifyInferiorStopOk();
//notifyInferiorIll();
- //showStatusMessage(tr("Executable failed: %1").arg(msg));
+ //showStatusMessage(Tr::tr("Executable failed: %1").arg(msg));
//shutdown();
- //AsynchronousMessageBox::critical(tr("Executable Failed"), msg);
+ //AsynchronousMessageBox::critical(Tr::tr("Executable Failed"), msg);
} else if (msg.contains("Cannot insert breakpoint")) {
// For breakpoints set by address to non-existent addresses we
// might get something like "6^error,msg="Warning:\nCannot insert
@@ -920,7 +918,7 @@ void GdbEngine::handleResultRecord(DebuggerResponse *response)
// long as the breakpoints are enabled.
// FIXME: Should we silently disable the offending breakpoints?
showMessage("APPLYING WORKAROUND #5");
- AsynchronousMessageBox::critical(tr("Setting Breakpoints Failed"), msg);
+ AsynchronousMessageBox::critical(Tr::tr("Setting Breakpoints Failed"), msg);
QTC_CHECK(state() == InferiorRunOk);
notifyInferiorSpontaneousStop();
notifyEngineIll();
@@ -945,8 +943,8 @@ void GdbEngine::handleResultRecord(DebuggerResponse *response)
if (!m_lastWinException.isEmpty())
logMsg = m_lastWinException + '\n';
logMsg += msg;
- AsynchronousMessageBox::critical(tr("Executable Failed"), logMsg);
- showStatusMessage(tr("Executable failed: %1").arg(logMsg));
+ AsynchronousMessageBox::critical(Tr::tr("Executable Failed"), logMsg);
+ showStatusMessage(Tr::tr("Executable failed: %1").arg(logMsg));
}
}
return;
@@ -1073,7 +1071,7 @@ void GdbEngine::handleExecuteJumpToLine(const DebuggerResponse &response)
notifyInferiorRunOk(); // Only needed for gdb < 7.0.
} else if (response.resultClass == ResultError) {
// Could be "Unreasonable jump request" or similar.
- QString out = tr("Cannot jump. Stopped.");
+ QString out = Tr::tr("Cannot jump. Stopped.");
QString msg = response.data["msg"].data();
if (!msg.isEmpty())
out += ". " + msg;
@@ -1081,7 +1079,7 @@ void GdbEngine::handleExecuteJumpToLine(const DebuggerResponse &response)
notifyInferiorRunFailed();
} else if (response.resultClass == ResultDone) {
// This happens on old gdb. Trigger the effect of a '*stopped'.
- showStatusMessage(tr("Jumped. Stopped."));
+ showStatusMessage(Tr::tr("Jumped. Stopped."));
notifyInferiorSpontaneousStop();
handleStop2(response.data);
}
@@ -1100,7 +1098,7 @@ void GdbEngine::handleExecuteRunToLine(const DebuggerResponse &response)
//>~"testArray () at ../simple/app.cpp:241\n"
//>~"241\t s[1] = \"b\";\n"
//>122^done
- showStatusMessage(tr("Target line hit, and therefore stopped."));
+ showStatusMessage(Tr::tr("Target line hit, and therefore stopped."));
notifyInferiorRunOk();
}
}
@@ -1144,12 +1142,12 @@ void GdbEngine::handleStopResponse(const GdbMi &data)
if (reason == "exited") {
const int exitCode = data["exit-code"].toInt();
notifyExitCode(exitCode);
- msg = tr("Application exited with exit code %1").arg(exitCode);
+ msg = Tr::tr("Application exited with exit code %1").arg(exitCode);
} else if (reason == "exited-signalled" || reason == "signal-received") {
- msg = tr("Application exited after receiving signal %1")
+ msg = Tr::tr("Application exited after receiving signal %1")
.arg(data["signal-name"].toString());
} else {
- msg = tr("Application exited normally.");
+ msg = Tr::tr("Application exited normally.");
}
// Only show the message. Ramp-down will be triggered by -thread-group-exited.
showStatusMessage(msg);
@@ -1398,7 +1396,7 @@ void GdbEngine::handleStop2(const GdbMi &data)
GdbMi newValue = value["new"];
if (oldValue.isValid() && newValue.isValid()) {
msg += ' ';
- msg += tr("Value changed from %1 to %2.")
+ msg += Tr::tr("Value changed from %1 to %2.")
.arg(oldValue.data()).arg(newValue.data());
}
showStatusMessage(msg);
@@ -1505,13 +1503,13 @@ void GdbEngine::handlePythonSetup(const DebuggerResponse &response)
int pythonMajor = m_pythonVersion / 10000;
int pythonMinor = (m_pythonVersion / 100) % 100;
QString out = "<p>"
- + tr("The selected build of GDB supports Python scripting, "
+ + Tr::tr("The selected build of GDB supports Python scripting, "
"but the used version %1.%2 is not sufficient for "
"%3. Supported versions are Python 2.7 and 3.x.")
.arg(pythonMajor).arg(pythonMinor)
.arg(Core::Constants::IDE_DISPLAY_NAME);
showStatusMessage(out);
- AsynchronousMessageBox::critical(tr("Execution Error"), out);
+ AsynchronousMessageBox::critical(Tr::tr("Execution Error"), out);
}
loadInitScript();
CHECK_STATE(EngineSetupRequested);
@@ -1524,7 +1522,7 @@ void GdbEngine::handlePythonSetup(const DebuggerResponse &response)
QString out2 = QStringLiteral("It cannot be used in %1.")
.arg(Core::Constants::IDE_DISPLAY_NAME);
showStatusMessage(out1 + ' ' + out2);
- AsynchronousMessageBox::critical(tr("Execution Error"), out1 + "<br>" + out2);
+ AsynchronousMessageBox::critical(Tr::tr("Execution Error"), out1 + "<br>" + out2);
}
notifyEngineSetupFailed();
}
@@ -1532,8 +1530,8 @@ void GdbEngine::handlePythonSetup(const DebuggerResponse &response)
void GdbEngine::showExecutionError(const QString &message)
{
- AsynchronousMessageBox::critical(tr("Execution Error"),
- tr("Cannot continue debugged process:") + '\n' + message);
+ AsynchronousMessageBox::critical(Tr::tr("Execution Error"),
+ Tr::tr("Cannot continue debugged process:") + '\n' + message);
}
void GdbEngine::handleExecuteContinue(const DebuggerResponse &response)
@@ -1550,7 +1548,7 @@ void GdbEngine::handleExecuteContinue(const DebuggerResponse &response)
if (isDying())
return;
CHECK_STATE(InferiorStopOk);
- showStatusMessage(tr("Stopped."), 5000);
+ showStatusMessage(Tr::tr("Stopped."), 5000);
reloadStack();
} else if (msg.startsWith("Cannot access memory at address")) {
// Happens on single step on ARM prolog and epilogs.
@@ -1664,7 +1662,7 @@ void GdbEngine::handleInferiorShutdown(const DebuggerResponse &response)
// It is not really an error from a user's point of view.
showMessage("NOTE: " + msg);
} else if (m_gdbProc.isRunning()) {
- AsynchronousMessageBox::critical(tr("Failed to Shut Down Application"),
+ AsynchronousMessageBox::critical(Tr::tr("Failed to Shut Down Application"),
msgInferiorStopFailed(msg));
}
notifyInferiorShutdownFinished();
@@ -1735,7 +1733,7 @@ void GdbEngine::handleThreadGroupExited(const GdbMi &result)
static QString msgNoGdbBinaryForToolChain(const Abi &tc)
{
- return GdbEngine::tr("There is no GDB binary available for binaries in format \"%1\".")
+ return Tr::tr("There is no GDB binary available for binaries in format \"%1\".")
.arg(tc.toString());
}
@@ -1785,7 +1783,7 @@ void GdbEngine::continueInferiorInternal()
{
CHECK_STATE(InferiorStopOk);
notifyInferiorRunRequested();
- showStatusMessage(tr("Running requested..."), 5000);
+ showStatusMessage(Tr::tr("Running requested..."), 5000);
CHECK_STATE(InferiorRunRequested);
if (isNativeMixedActiveFrame()) {
DebuggerCommand cmd("executeContinue", RunRequest);
@@ -1811,7 +1809,7 @@ void GdbEngine::executeStepIn(bool byInstruction)
CHECK_STATE(InferiorStopOk);
setTokenBarrier();
notifyInferiorRunRequested();
- showStatusMessage(tr("Step requested..."), 5000);
+ showStatusMessage(Tr::tr("Step requested..."), 5000);
DebuggerCommand cmd;
if (isNativeMixedActiveFrame()) {
@@ -1876,7 +1874,7 @@ void GdbEngine::executeStepOut()
runCommand({"-stack-select-frame 0", Discardable});
setTokenBarrier();
notifyInferiorRunRequested();
- showStatusMessage(tr("Finish function requested..."), 5000);
+ showStatusMessage(Tr::tr("Finish function requested..."), 5000);
if (isNativeMixedActiveFrame()) {
runCommand({"executeStepOut", RunRequest});
} else {
@@ -1893,7 +1891,7 @@ void GdbEngine::executeStepOver(bool byInstruction)
CHECK_STATE(InferiorStopOk);
setTokenBarrier();
notifyInferiorRunRequested();
- showStatusMessage(tr("Step next requested..."), 5000);
+ showStatusMessage(Tr::tr("Step next requested..."), 5000);
DebuggerCommand cmd;
cmd.flags = RunRequest;
@@ -1941,8 +1939,8 @@ void GdbEngine::handleExecuteNext(const DebuggerResponse &response)
notifyInferiorRunFailed();
handleRecordingFailed();
} else {
- AsynchronousMessageBox::warning(tr("Execution Error"),
- tr("Cannot continue debugged process:") + '\n' + msg);
+ AsynchronousMessageBox::warning(Tr::tr("Execution Error"),
+ Tr::tr("Cannot continue debugged process:") + '\n' + msg);
//notifyInferiorIll();
}
}
@@ -1957,7 +1955,7 @@ void GdbEngine::executeRunToLine(const ContextData &data)
CHECK_STATE(InferiorStopOk);
setTokenBarrier();
notifyInferiorRunRequested();
- showStatusMessage(tr("Run to line %1 requested...").arg(data.lineNumber), 5000);
+ showStatusMessage(Tr::tr("Run to line %1 requested...").arg(data.lineNumber), 5000);
#if 1
QString loc;
if (data.address)
@@ -1980,7 +1978,7 @@ void GdbEngine::executeRunToFunction(const QString &functionName)
CHECK_STATE(InferiorStopOk);
setTokenBarrier();
runCommand({"-break-insert -t " + functionName});
- showStatusMessage(tr("Run to function %1 requested...").arg(functionName), 5000);
+ showStatusMessage(Tr::tr("Run to function %1 requested...").arg(functionName), 5000);
continueInferiorInternal();
}
@@ -2009,7 +2007,7 @@ void GdbEngine::executeReturn()
CHECK_STATE(InferiorStopOk);
setTokenBarrier();
notifyInferiorRunRequested();
- showStatusMessage(tr("Immediate return from function requested..."), 5000);
+ showStatusMessage(Tr::tr("Immediate return from function requested..."), 5000);
runCommand({"-exec-return", RunRequest, CB(handleExecuteReturn)});
}
@@ -2892,8 +2890,8 @@ static void handleShowModuleSymbols(const DebuggerResponse &response,
file.remove();
DebuggerEngine::showModuleSymbols(modulePath, symbols);
} else {
- AsynchronousMessageBox::critical(GdbEngine::tr("Cannot Read Symbols"),
- GdbEngine::tr("Cannot read symbols for module \"%1\".").arg(fileName));
+ AsynchronousMessageBox::critical(Tr::tr("Cannot Read Symbols"),
+ Tr::tr("Cannot read symbols for module \"%1\".").arg(fileName));
}
}
@@ -3087,12 +3085,12 @@ void GdbEngine::reloadSourceFiles()
void GdbEngine::selectThread(const Thread &thread)
{
- showStatusMessage(tr("Retrieving data for stack view thread %1...")
+ showStatusMessage(Tr::tr("Retrieving data for stack view thread %1...")
.arg(thread->id()), 10000);
DebuggerCommand cmd("-thread-select " + thread->id(), Discardable);
cmd.callback = [this](const DebuggerResponse &) {
QTC_CHECK(state() == InferiorUnrunnable || state() == InferiorStopOk);
- showStatusMessage(tr("Retrieving data for stack view..."), 3000);
+ showStatusMessage(Tr::tr("Retrieving data for stack view..."), 3000);
reloadStack(); // Will reload registers.
updateLocals();
};
@@ -3255,8 +3253,8 @@ void GdbEngine::createSnapshot()
cmd.callback = [this, fileName](const DebuggerResponse &r) { handleMakeSnapshot(r, fileName); };
runCommand(cmd);
} else {
- AsynchronousMessageBox::critical(tr("Snapshot Creation Error"),
- tr("Cannot create snapshot file."));
+ AsynchronousMessageBox::critical(Tr::tr("Snapshot Creation Error"),
+ Tr::tr("Cannot create snapshot file."));
}
}
@@ -3266,8 +3264,8 @@ void GdbEngine::handleMakeSnapshot(const DebuggerResponse &response, const QStri
emit attachToCoreRequested(coreFile);
} else {
QString msg = response.data["msg"].data();
- AsynchronousMessageBox::critical(tr("Snapshot Creation Error"),
- tr("Cannot create snapshot:") + '\n' + msg);
+ AsynchronousMessageBox::critical(Tr::tr("Snapshot Creation Error"),
+ Tr::tr("Cannot create snapshot:") + '\n' + msg);
}
}
@@ -3737,7 +3735,7 @@ void GdbEngine::fetchDisassemblerByCliRangePlain(const DisassemblerAgentCookie &
//76^error,msg="No function contains specified address."
//>568^error,msg="Line number 0 out of range;
QString msg = response.data["msg"].data();
- showStatusMessage(tr("Disassembler failed: %1").arg(msg), 5000);
+ showStatusMessage(Tr::tr("Disassembler failed: %1").arg(msg), 5000);
};
runCommand(cmd);
}
@@ -3827,7 +3825,7 @@ void GdbEngine::setupEngine()
if (usesOutputCollector()) {
if (!m_outputCollector.listen()) {
- handleAdapterStartFailed(tr("Cannot set up communication with child process: %1")
+ handleAdapterStartFailed(Tr::tr("Cannot set up communication with child process: %1")
.arg(m_outputCollector.errorString()));
return;
}
@@ -3928,7 +3926,7 @@ void GdbEngine::handleGdbStarted()
//runCommand("set remotecache on", ConsoleCommand);
//runCommand("set non-stop on", ConsoleCommand);
- showStatusMessage(tr("Setting up inferior..."));
+ showStatusMessage(Tr::tr("Setting up inferior..."));
const DebuggerRunParameters &rp = runParameters();
// Addint executable to modules list.
@@ -4025,8 +4023,8 @@ void GdbEngine::loadInitScript()
runCommand({"source " + script.path()});
} else {
AsynchronousMessageBox::warning(
- tr("Cannot Find Debugger Initialization Script"),
- tr("The debugger settings point to a script file at \"%1\", "
+ Tr::tr("Cannot Find Debugger Initialization Script"),
+ Tr::tr("The debugger settings point to a script file at \"%1\", "
"which is not accessible. If a script file is not needed, "
"consider clearing that entry to avoid this warning."
).arg(script.toUserOutput()));
@@ -4077,7 +4075,7 @@ void GdbEngine::handleGdbDone()
QString msg;
const FilePath wd = m_gdbProc.workingDirectory();
if (!wd.isReadableDir()) {
- msg = failedToStartMessage() + ' ' + tr("The working directory \"%1\" is not usable.")
+ msg = failedToStartMessage() + ' ' + Tr::tr("The working directory \"%1\" is not usable.")
.arg(wd.toUserOutput());
} else {
msg = RunWorker::userMessageForProcessError(QProcess::FailedToStart,
@@ -4099,7 +4097,7 @@ void GdbEngine::handleGdbDone()
if (error == QProcess::FailedToStart)
return; // This should be handled by the code trying to start the process.
- AsynchronousMessageBox::critical(tr("GDB I/O Error"), msg);
+ AsynchronousMessageBox::critical(Tr::tr("GDB I/O Error"), msg);
}
if (m_commandTimer.isActive())
m_commandTimer.stop();
@@ -4131,7 +4129,7 @@ void GdbEngine::handleAdapterStartFailed(const QString &msg, Id settingsIdHint)
{
showMessage("ADAPTER START FAILED");
if (!msg.isEmpty() && !Internal::isTestRun()) {
- const QString title = tr("Adapter Start Failed");
+ const QString title = Tr::tr("Adapter Start Failed");
ICore::showWarningWithOptions(title, msg, QString(), settingsIdHint);
}
notifyEngineSetupFailed();
@@ -4168,13 +4166,13 @@ void GdbEngine::handleDebugInfoLocation(const DebuggerResponse &response)
void GdbEngine::notifyInferiorSetupFailedHelper(const QString &msg)
{
- showStatusMessage(tr("Failed to start application:") + ' ' + msg);
+ showStatusMessage(Tr::tr("Failed to start application:") + ' ' + msg);
if (state() == EngineSetupFailed) {
showMessage("INFERIOR START FAILED, BUT ADAPTER DIED ALREADY");
return; // Adapter crashed meanwhile, so this notification is meaningless.
}
showMessage("INFERIOR START FAILED");
- AsynchronousMessageBox::critical(tr("Failed to Start Application"), msg);
+ AsynchronousMessageBox::critical(Tr::tr("Failed to Start Application"), msg);
notifyEngineSetupFailed();
}
@@ -4230,32 +4228,32 @@ void GdbEngine::scheduleTestResponse(int testCase, const QString &response)
QString GdbEngine::msgGdbStopFailed(const QString &why)
{
- return tr("The gdb process could not be stopped:\n%1").arg(why);
+ return Tr::tr("The gdb process could not be stopped:\n%1").arg(why);
}
QString GdbEngine::msgInferiorStopFailed(const QString &why)
{
- return tr("Application process could not be stopped:\n%1").arg(why);
+ return Tr::tr("Application process could not be stopped:\n%1").arg(why);
}
QString GdbEngine::msgInferiorSetupOk()
{
- return tr("Application started.");
+ return Tr::tr("Application started.");
}
QString GdbEngine::msgInferiorRunOk()
{
- return tr("Application running.");
+ return Tr::tr("Application running.");
}
QString GdbEngine::msgAttachedToStoppedInferior()
{
- return tr("Attached to stopped application.");
+ return Tr::tr("Attached to stopped application.");
}
QString GdbEngine::msgConnectRemoteServerFailed(const QString &why)
{
- return tr("Connecting to remote server failed:\n%1").arg(why);
+ return Tr::tr("Connecting to remote server failed:\n%1").arg(why);
}
void GdbEngine::interruptLocalInferior(qint64 pid)
@@ -4329,8 +4327,8 @@ void GdbEngine::claimInitialBreakpoints()
const DebuggerRunParameters &rp = runParameters();
if (rp.startMode != AttachToCore) {
- showStatusMessage(tr("Setting breakpoints..."));
- showMessage(tr("Setting breakpoints..."));
+ showStatusMessage(Tr::tr("Setting breakpoints..."));
+ showMessage(Tr::tr("Setting breakpoints..."));
BreakpointManager::claimBreakpointsForEngine(this);
const DebuggerSettings &s = *debuggerSettings();
@@ -4425,7 +4423,7 @@ void GdbEngine::setupInferior()
runCommand({"set target-async on", CB(handleSetTargetAsync)});
if (symbolFile.isEmpty()) {
- showMessage(tr("No symbol file given."), StatusBar);
+ showMessage(Tr::tr("No symbol file given."), StatusBar);
callTargetRemote();
} else {
runCommand({"-file-exec-and-symbols \"" + symbolFile + '"',
@@ -4442,16 +4440,16 @@ void GdbEngine::setupInferior()
CoreInfo cinfo = CoreInfo::readExecutableNameFromCore(rp.debugger, rp.coreFile);
if (!cinfo.isCore) {
- AsynchronousMessageBox::warning(tr("Error Loading Core File"),
- tr("The specified file does not appear to be a core file."));
+ AsynchronousMessageBox::warning(Tr::tr("Error Loading Core File"),
+ Tr::tr("The specified file does not appear to be a core file."));
notifyEngineSetupFailed();
return;
}
executable = cinfo.foundExecutableName;
if (executable.isEmpty()) {
- AsynchronousMessageBox::warning(tr("Error Loading Symbols"),
- tr("No executable to load symbols from specified core."));
+ AsynchronousMessageBox::warning(Tr::tr("Error Loading Symbols"),
+ Tr::tr("No executable to load symbols from specified core."));
notifyEngineSetupFailed();
return;
}
@@ -4518,7 +4516,7 @@ void GdbEngine::runEngine()
} else if (isLocalAttachEngine()) {
const qint64 pid = rp.attachPID.pid();
- showStatusMessage(tr("Attaching to process %1.").arg(pid));
+ showStatusMessage(Tr::tr("Attaching to process %1.").arg(pid));
runCommand({"attach " + QString::number(pid), [this](const DebuggerResponse &r) {
handleLocalAttach(r);
}});
@@ -4576,7 +4574,7 @@ void GdbEngine::handleLocalAttach(const DebuggerResponse &response)
// Happens e.g. for "Attach to unstarted application"
// We will get a '*stopped' later that we'll interpret as 'spontaneous'
// So acknowledge the current state and put a delayed 'continue' in the pipe.
- showMessage(tr("Attached to running application."), StatusBar);
+ showMessage(Tr::tr("Attached to running application."), StatusBar);
claimInitialBreakpoints();
notifyEngineRunAndInferiorRunOk();
} else {
@@ -4594,17 +4592,17 @@ void GdbEngine::handleLocalAttach(const DebuggerResponse &response)
case ResultError:
if (response.data["msg"].data() == "ptrace: Operation not permitted.") {
QString msg = msgPtraceError(runParameters().startMode);
- showStatusMessage(tr("Failed to attach to application: %1").arg(msg));
- AsynchronousMessageBox::warning(tr("Debugger Error"), msg);
+ showStatusMessage(Tr::tr("Failed to attach to application: %1").arg(msg));
+ AsynchronousMessageBox::warning(Tr::tr("Debugger Error"), msg);
notifyEngineIll();
break;
}
- showStatusMessage(tr("Failed to attach to application: %1")
+ showStatusMessage(Tr::tr("Failed to attach to application: %1")
.arg(QString(response.data["msg"].data())));
notifyEngineIll();
break;
default:
- showStatusMessage(tr("Failed to attach to application: %1")
+ showStatusMessage(Tr::tr("Failed to attach to application: %1")
.arg(QString(response.data["msg"].data())));
notifyEngineIll();
break;
@@ -4654,7 +4652,7 @@ void GdbEngine::interruptInferior2()
if (!ok) {
// FIXME: Extra state needed?
showMessage("NOTE: INFERIOR STOP NOT POSSIBLE");
- showStatusMessage(tr("Interrupting not possible."));
+ showStatusMessage(Tr::tr("Interrupting not possible."));
notifyInferiorRunOk();
}
}
@@ -4722,13 +4720,13 @@ void GdbEngine::handleFileExecAndSymbols(const DebuggerResponse &response)
const FilePath core = runParameters().coreFile;
if (response.resultClass == ResultDone) {
- showMessage(tr("Symbols found."), StatusBar);
+ showMessage(Tr::tr("Symbols found."), StatusBar);
handleInferiorPrepared();
} else {
- QString msg = tr("No symbols found in the core file \"%1\".").arg(core.toUserOutput())
- + ' ' + tr("This can be caused by a path length limitation "
+ QString msg = Tr::tr("No symbols found in the core file \"%1\".").arg(core.toUserOutput())
+ + ' ' + Tr::tr("This can be caused by a path length limitation "
"in the core file.")
- + ' ' + tr("Try to specify the binary in "
+ + ' ' + Tr::tr("Try to specify the binary in "
"Debug > Start Debugging > Load Core File.");
notifyInferiorSetupFailedHelper(msg);
}
@@ -4741,7 +4739,7 @@ void GdbEngine::handleFileExecAndSymbols(const DebuggerResponse &response)
QString msg = response.data["msg"].data();
// Extend the message a bit in unknown cases.
if (!msg.endsWith("File format not recognized"))
- msg = tr("Starting executable failed:") + '\n' + msg;
+ msg = Tr::tr("Starting executable failed:") + '\n' + msg;
notifyInferiorSetupFailedHelper(msg);
}
@@ -4829,8 +4827,8 @@ void GdbEngine::handleTargetExtendedRemote(const DebuggerResponse &response)
runCommand({"-gdb-set remote exec-file " + runParameters().inferior.command.executable().toString(),
CB(handleTargetExtendedAttach)});
} else {
- const QString title = tr("No Remote Executable or Process ID Specified");
- const QString msg = tr(
+ const QString title = Tr::tr("No Remote Executable or Process ID Specified");
+ const QString msg = Tr::tr(
"No remote executable could be determined from your build system files.<p>"
"In case you use qmake, consider adding<p>"
"&nbsp;&nbsp;&nbsp;&nbsp;target.path = /tmp/your_executable # path on device<br>"
@@ -4838,8 +4836,8 @@ void GdbEngine::handleTargetExtendedRemote(const DebuggerResponse &response)
"to your .pro file.");
QMessageBox *mb = showMessageBox(QMessageBox::Critical, title, msg,
QMessageBox::Ok | QMessageBox::Cancel);
- mb->button(QMessageBox::Cancel)->setText(tr("Continue Debugging"));
- mb->button(QMessageBox::Ok)->setText(tr("Stop Debugging"));
+ mb->button(QMessageBox::Cancel)->setText(Tr::tr("Continue Debugging"));
+ mb->button(QMessageBox::Ok)->setText(Tr::tr("Stop Debugging"));
if (mb->exec() == QMessageBox::Ok) {
showMessage("KILLING DEBUGGER AS REQUESTED BY USER");
notifyInferiorSetupFailedHelper(title);
@@ -5034,14 +5032,14 @@ void GdbEngine::handleTargetCore(const DebuggerResponse &response)
{
CHECK_STATE(EngineRunRequested);
notifyEngineRunOkAndInferiorUnrunnable();
- showMessage(tr("Attached to core."), StatusBar);
+ showMessage(Tr::tr("Attached to core."), StatusBar);
if (response.resultClass == ResultError) {
// We'll accept any kind of error e.g. &"Cannot access memory at address 0x2abc2a24\n"
// Even without the stack, the user can find interesting stuff by exploring
// the memory, globals etc.
- showStatusMessage(tr("Attach to core \"%1\" failed:").arg(runParameters().coreFile.toUserOutput())
- + '\n' + response.data["msg"].data()
- + '\n' + tr("Continuing nevertheless."));
+ showStatusMessage(
+ Tr::tr("Attach to core \"%1\" failed:").arg(runParameters().coreFile.toUserOutput())
+ + '\n' + response.data["msg"].data() + '\n' + Tr::tr("Continuing nevertheless."));
}
// Due to the auto-solib-add off setting, we don't have any
// symbols yet. Load them in order of importance.
@@ -5138,8 +5136,7 @@ DebuggerEngine *createGdbEngine()
return new GdbEngine;
}
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Internal
Q_DECLARE_METATYPE(Debugger::Internal::GdbMi)
Q_DECLARE_METATYPE(Debugger::Internal::TracepointCaptureData)
diff --git a/src/plugins/debugger/gdb/gdbengine.h b/src/plugins/debugger/gdb/gdbengine.h
index 49a090951a..227f850cb3 100644
--- a/src/plugins/debugger/gdb/gdbengine.h
+++ b/src/plugins/debugger/gdb/gdbengine.h
@@ -43,8 +43,7 @@
#include <QTextCodec>
#include <QTimer>
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
class BreakpointParameters;
class DebugInfoTask;
@@ -66,8 +65,6 @@ struct CoreInfo
class GdbEngine final : public CppDebuggerEngine
{
- Q_OBJECT
-
public:
GdbEngine();
~GdbEngine() final;
@@ -434,5 +431,4 @@ private: ////////// General Interface //////////
QString m_errorString;
};
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/gdb/gdboptionspage.cpp b/src/plugins/debugger/gdb/gdboptionspage.cpp
index f49a30e1fc..f4bd049bcb 100644
--- a/src/plugins/debugger/gdb/gdboptionspage.cpp
+++ b/src/plugins/debugger/gdb/gdboptionspage.cpp
@@ -24,9 +24,10 @@
****************************************************************************/
#include <debugger/debuggeractions.h>
+#include <debugger/debuggerconstants.h>
#include <debugger/debuggercore.h>
#include <debugger/debuggerinternalconstants.h>
-#include <debugger/debuggerconstants.h>
+#include <debugger/debuggertr.h>
#include <coreplugin/dialogs/ioptionspage.h>
@@ -35,8 +36,7 @@
using namespace Core;
using namespace Utils;
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
/////////////////////////////////////////////////////////////////////////
//
@@ -46,13 +46,11 @@ namespace Internal {
class GdbOptionsPage : public Core::IOptionsPage
{
- Q_DECLARE_TR_FUNCTIONS(Debugger::Internal::GdbOptionsPage)
-
public:
GdbOptionsPage()
{
setId("M.Gdb");
- setDisplayName(tr("GDB"));
+ setDisplayName(Tr::tr("GDB"));
setCategory(Constants::DEBUGGER_SETTINGS_CATEGORY);
setSettings(&debuggerSettings()->page2);
@@ -61,7 +59,7 @@ public:
DebuggerSettings &s = *debuggerSettings();
Group general {
- Title { tr("General") },
+ Title { Tr::tr("General") },
Row { s.gdbWatchdogTimeout, Stretch() },
s.skipKnownFrames,
s.useMessageBoxForSignals,
@@ -76,8 +74,8 @@ public:
};
Column commands {
- Group { Title { tr("Additional Startup Commands") }, s.gdbStartupCommands },
- Group { Title { tr("Additional Attach Commands") }, s.gdbPostAttachCommands },
+ Group { Title { Tr::tr("Additional Startup Commands") }, s.gdbStartupCommands },
+ Group { Title { Tr::tr("Additional Attach Commands") }, s.gdbPostAttachCommands },
Stretch()
};
@@ -99,13 +97,13 @@ public:
GdbOptionsPage2()
{
setId("M.Gdb2");
- setDisplayName(GdbOptionsPage::tr("GDB Extended"));
+ setDisplayName(Tr::tr("GDB Extended"));
setCategory(Constants::DEBUGGER_SETTINGS_CATEGORY);
setSettings(&debuggerSettings()->page3);
setLayouter([](QWidget *w) {
auto labelDangerous = new QLabel("<html><head/><body><i>" +
- GdbOptionsPage::tr("The options below give access to advanced "
+ Tr::tr("The options below give access to advanced "
"or experimental functions of GDB.<br>Enabling them may negatively "
"impact your debugging experience.") + "</i></body></html>");
@@ -113,7 +111,7 @@ public:
DebuggerSettings &s = *debuggerSettings();
Group extended {
- Title(GdbOptionsPage::tr("Extended")),
+ Title(Tr::tr("Extended")),
labelDangerous,
s.targetAsync,
s.autoEnrichParameters,
@@ -137,5 +135,4 @@ void addGdbOptionPages(QList<IOptionsPage *> *opts)
opts->push_back(new GdbOptionsPage2);
}
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/imageviewer.cpp b/src/plugins/debugger/imageviewer.cpp
index 863af85ebc..d51a3836f9 100644
--- a/src/plugins/debugger/imageviewer.cpp
+++ b/src/plugins/debugger/imageviewer.cpp
@@ -24,7 +24,9 @@
****************************************************************************/
#include "imageviewer.h"
+
#include "debuggerinternalconstants.h"
+#include "debuggertr.h"
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/editormanager/ieditor.h>
@@ -44,6 +46,8 @@
#include <QPainter>
#include <QDir>
+namespace Debugger::Internal {
+
// Widget showing the image in a 1-pixel frame with context menu.
class ImageWidget : public QWidget
{
@@ -80,7 +84,7 @@ void ImageWidget::mousePressEvent(QMouseEvent *ev)
} else {
const QRgb color = m_image.pixel(imagePos);
const QString message =
- ImageViewer::tr("Color at %1,%2: red: %3 green: %4 blue: %5 alpha: %6").
+ Tr::tr("Color at %1,%2: red: %3 green: %4 blue: %5 alpha: %6").
arg(imagePos.x()).arg(imagePos.y()).
arg(qRed(color)).arg(qGreen(color)).arg(qBlue(color)).arg(qAlpha(color));
emit clicked(message);
@@ -125,7 +129,7 @@ void ImageViewer::setInfo(const QString &info)
void ImageViewer::clicked(const QString &message)
{
const QString text = m_info + '\n'
- + (message.isEmpty() ? tr("<Click to display color>") : message);
+ + (message.isEmpty() ? Tr::tr("<Click to display color>") : message);
m_infoLabel->setText(text);
}
@@ -150,9 +154,9 @@ void ImageViewer::contextMenuEvent(QContextMenuEvent *ev)
const QImage &image = m_imageWidget->image();
const bool hasImage = !image.isNull();
QMenu menu;
- QAction *copyAction = menu.addAction(tr("Copy Image"));
+ QAction *copyAction = menu.addAction(Tr::tr("Copy Image"));
copyAction->setShortcut(QKeySequence::Copy);
- QAction *imageViewerAction = menu.addAction(tr("Open Image Viewer"));
+ QAction *imageViewerAction = menu.addAction(Tr::tr("Open Image Viewer"));
copyAction->setEnabled(hasImage);
imageViewerAction->setEnabled(hasImage);
QAction *action = menu.exec(ev->globalPos());
@@ -235,4 +239,6 @@ void PlotViewer::paintEvent(QPaintEvent *)
}
}
+} // Debugger::Internal
+
#include "imageviewer.moc"
diff --git a/src/plugins/debugger/imageviewer.h b/src/plugins/debugger/imageviewer.h
index 2d11d70851..cda6888987 100644
--- a/src/plugins/debugger/imageviewer.h
+++ b/src/plugins/debugger/imageviewer.h
@@ -36,12 +36,15 @@ class QImage;
class QContextMenuEvent;
QT_END_NAMESPACE
+namespace Debugger::Internal {
+
class ImageWidget;
// Image viewer showing images in scroll area, displays color on click.
class ImageViewer : public QWidget
{
Q_OBJECT
+
public:
explicit ImageViewer(QWidget *parent = nullptr);
@@ -61,6 +64,7 @@ private:
class PlotViewer : public QWidget
{
Q_OBJECT
+
public:
explicit PlotViewer(QWidget *parent = nullptr);
@@ -74,3 +78,5 @@ private:
Data m_data;
QString m_info;
};
+
+} // Debugger::Internal
diff --git a/src/plugins/debugger/lldb/lldbengine.cpp b/src/plugins/debugger/lldb/lldbengine.cpp
index 5d54fc56b5..d5ebc6c42e 100644
--- a/src/plugins/debugger/lldb/lldbengine.cpp
+++ b/src/plugins/debugger/lldb/lldbengine.cpp
@@ -25,23 +25,23 @@
#include "lldbengine.h"
+#include <debugger/breakhandler.h>
#include <debugger/debuggeractions.h>
#include <debugger/debuggercore.h>
#include <debugger/debuggerdialogs.h>
#include <debugger/debuggerinternalconstants.h>
+#include <debugger/debuggeritem.h>
#include <debugger/debuggermainwindow.h>
#include <debugger/debuggerprotocol.h>
-#include <debugger/debuggertooltipmanager.h>
-#include <debugger/terminal.h>
-
-#include <debugger/breakhandler.h>
-#include <debugger/debuggeritem.h>
#include <debugger/debuggersourcepathmappingwidget.h>
+#include <debugger/debuggertooltipmanager.h>
+#include <debugger/debuggertr.h>
#include <debugger/disassemblerlines.h>
#include <debugger/moduleshandler.h>
#include <debugger/registerhandler.h>
-#include <debugger/stackhandler.h>
#include <debugger/sourceutils.h>
+#include <debugger/stackhandler.h>
+#include <debugger/terminal.h>
#include <debugger/threadshandler.h>
#include <debugger/watchhandler.h>
#include <debugger/watchutils.h>
@@ -68,8 +68,7 @@
using namespace Core;
using namespace Utils;
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
static int &currentToken()
{
@@ -137,7 +136,7 @@ void LldbEngine::runCommand(const DebuggerCommand &command)
if (cmd.flags == NeedsFullStop) {
cmd.flags &= ~NeedsFullStop;
if (state() == InferiorRunOk) {
- showStatusMessage(tr("Stopping temporarily"), 1000);
+ showStatusMessage(Tr::tr("Stopping temporarily"), 1000);
m_onStop.append(cmd, false);
interruptInferior();
return;
@@ -191,7 +190,7 @@ void LldbEngine::abortDebuggerProcess()
static QString adapterStartFailed()
{
- return LldbEngine::tr("Adapter start failed.");
+ return Tr::tr("Adapter start failed.");
}
void LldbEngine::setupEngine()
@@ -237,7 +236,7 @@ void LldbEngine::handleLldbStarted()
{
m_lldbProc.waitForReadyRead(1000);
- showStatusMessage(tr("Setting up inferior..."));
+ showStatusMessage(Tr::tr("Setting up inferior..."));
const DebuggerRunParameters &rp = runParameters();
@@ -351,7 +350,7 @@ void LldbEngine::runEngine()
{
const DebuggerRunParameters &rp = runParameters();
QTC_ASSERT(state() == EngineRunRequested, qDebug() << state(); return);
- showStatusMessage(tr("Running requested..."), 5000);
+ showStatusMessage(Tr::tr("Running requested..."), 5000);
DebuggerCommand cmd("runEngine");
if (rp.startMode == AttachToCore)
cmd.arg("coreFile", rp.coreFile);
@@ -360,7 +359,7 @@ void LldbEngine::runEngine()
void LldbEngine::interruptInferior()
{
- showStatusMessage(tr("Interrupt requested..."), 5000);
+ showStatusMessage(Tr::tr("Interrupt requested..."), 5000);
runCommand({"interruptInferior"});
}
@@ -789,7 +788,7 @@ void LldbEngine::handleLldbDone()
if (m_lldbProc.result() == ProcessResult::StartFailed) {
notifyEngineSetupFailed();
showMessage("ADAPTER START FAILED");
- ICore::showWarningWithOptions(adapterStartFailed(), tr("Unable to start LLDB \"%1\": %2")
+ ICore::showWarningWithOptions(adapterStartFailed(), Tr::tr("Unable to start LLDB \"%1\": %2")
.arg(runParameters().debugger.command.executable().toUserOutput(),
m_lldbProc.errorString()));
return;
@@ -812,7 +811,7 @@ void LldbEngine::handleLldbDone()
case QProcess::Timedout:
default:
//setState(EngineShutdownRequested, true);
- AsynchronousMessageBox::critical(tr("LLDB I/O Error"), errorMessage(error));
+ AsynchronousMessageBox::critical(Tr::tr("LLDB I/O Error"), errorMessage(error));
break;
}
}
@@ -821,26 +820,26 @@ QString LldbEngine::errorMessage(QProcess::ProcessError error) const
{
switch (error) {
case QProcess::FailedToStart:
- return tr("The LLDB process failed to start. Either the "
+ return Tr::tr("The LLDB process failed to start. Either the "
"invoked program \"%1\" is missing, or you may have insufficient "
"permissions to invoke the program.")
.arg(runParameters().debugger.command.executable().toUserOutput());
case QProcess::Crashed:
- return tr("The LLDB process crashed some time after starting "
+ return Tr::tr("The LLDB process crashed some time after starting "
"successfully.");
case QProcess::Timedout:
- return tr("The last waitFor...() function timed out. "
+ return Tr::tr("The last waitFor...() function timed out. "
"The state of QProcess is unchanged, and you can try calling "
"waitFor...() again.");
case QProcess::WriteError:
- return tr("An error occurred when attempting to write "
+ return Tr::tr("An error occurred when attempting to write "
"to the LLDB process. For example, the process may not be running, "
"or it may have closed its input channel.");
case QProcess::ReadError:
- return tr("An error occurred when attempting to read from "
+ return Tr::tr("An error occurred when attempting to read from "
"the Lldb process. For example, the process may not be running.");
default:
- return tr("An unknown error in the LLDB process occurred.") + ' ';
+ return Tr::tr("An unknown error in the LLDB process occurred.") + ' ';
}
}
@@ -1131,5 +1130,4 @@ DebuggerEngine *createLldbEngine()
return new LldbEngine;
}
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/lldb/lldbengine.h b/src/plugins/debugger/lldb/lldbengine.h
index 5a0f7d6328..533d7451a8 100644
--- a/src/plugins/debugger/lldb/lldbengine.h
+++ b/src/plugins/debugger/lldb/lldbengine.h
@@ -40,8 +40,7 @@
#include <QMap>
#include <QVariant>
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
/* A debugger engine interfacing the LLDB debugger
* using its Python interface.
@@ -147,7 +146,6 @@ private:
DebuggerCommandSequence m_onStop;
};
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Internal
#endif // DEBUGGER_LLDBENGINE
diff --git a/src/plugins/debugger/loadcoredialog.cpp b/src/plugins/debugger/loadcoredialog.cpp
index 080bf0fa60..33cfeb5c47 100644
--- a/src/plugins/debugger/loadcoredialog.cpp
+++ b/src/plugins/debugger/loadcoredialog.cpp
@@ -26,6 +26,7 @@
#include "loadcoredialog.h"
#include "debuggerkitinformation.h"
+#include "debuggertr.h"
#include "gdb/gdbengine.h"
#include <projectexplorer/devicesupport/devicefilesystemmodel.h>
@@ -54,8 +55,7 @@ using namespace Core;
using namespace ProjectExplorer;
using namespace Utils;
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
///////////////////////////////////////////////////////////////////////
//
@@ -65,8 +65,6 @@ namespace Internal {
class SelectRemoteFileDialog : public QDialog
{
- Q_DECLARE_TR_FUNCTIONS(Debugger::Internal::SelectRemoteFileDialog)
-
public:
explicit SelectRemoteFileDialog(QWidget *parent);
@@ -123,10 +121,10 @@ SelectRemoteFileDialog::SelectRemoteFileDialog(QWidget *parent)
&& result.m_exitStatus == QProcess::NormalExit
&& result.m_exitCode == 0;
if (success) {
- m_textBrowser->append(tr("Download of remote file succeeded."));
+ m_textBrowser->append(Tr::tr("Download of remote file succeeded."));
accept();
} else {
- m_textBrowser->append(tr("Download of remote file failed: %1")
+ m_textBrowser->append(Tr::tr("Download of remote file failed: %1")
.arg(result.m_errorString));
m_buttonBox->button(QDialogButtonBox::Ok)->setEnabled(true);
m_fileSystemView->setEnabled(true);
@@ -222,7 +220,7 @@ public:
AttachCoreDialog::AttachCoreDialog(QWidget *parent)
: QDialog(parent), d(new AttachCoreDialogPrivate)
{
- setWindowTitle(tr("Load Core File"));
+ setWindowTitle(Tr::tr("Load Core File"));
d->buttonBox = new QDialogButtonBox(this);
d->buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok);
@@ -235,7 +233,7 @@ AttachCoreDialog::AttachCoreDialog(QWidget *parent)
d->forceLocalCheckBox = new QCheckBox(this);
d->forceLocalLabel = new QLabel(this);
- d->forceLocalLabel->setText(tr("Use local core file:"));
+ d->forceLocalLabel->setText(Tr::tr("Use local core file:"));
d->forceLocalLabel->setBuddy(d->forceLocalCheckBox);
d->remoteCoreFileName = new PathChooser(this);
@@ -244,27 +242,27 @@ AttachCoreDialog::AttachCoreDialog(QWidget *parent)
d->localCoreFileName = new PathChooser(this);
d->localCoreFileName->setHistoryCompleter("Debugger.CoreFile.History");
d->localCoreFileName->setExpectedKind(PathChooser::File);
- d->localCoreFileName->setPromptDialogTitle(tr("Select Core File"));
+ d->localCoreFileName->setPromptDialogTitle(Tr::tr("Select Core File"));
d->symbolFileName = new PathChooser(this);
d->symbolFileName->setHistoryCompleter("LocalExecutable");
d->symbolFileName->setExpectedKind(PathChooser::File);
- d->symbolFileName->setPromptDialogTitle(tr("Select Executable or Symbol File"));
+ d->symbolFileName->setPromptDialogTitle(Tr::tr("Select Executable or Symbol File"));
d->symbolFileName->setToolTip(
- tr("Select a file containing debug information corresponding to the core file. "
+ Tr::tr("Select a file containing debug information corresponding to the core file. "
"Typically, this is the executable or a *.debug file if the debug "
"information is stored separately from the executable."));
d->overrideStartScriptFileName = new PathChooser(this);
d->overrideStartScriptFileName->setHistoryCompleter("Debugger.StartupScript.History");
d->overrideStartScriptFileName->setExpectedKind(PathChooser::File);
- d->overrideStartScriptFileName->setPromptDialogTitle(tr("Select Startup Script"));
+ d->overrideStartScriptFileName->setPromptDialogTitle(Tr::tr("Select Startup Script"));
d->sysRootDirectory = new PathChooser(this);
d->sysRootDirectory->setHistoryCompleter("Debugger.SysRoot.History");
d->sysRootDirectory->setExpectedKind(PathChooser::Directory);
- d->sysRootDirectory->setPromptDialogTitle(tr("Select SysRoot Directory"));
- d->sysRootDirectory->setToolTip(tr(
+ d->sysRootDirectory->setPromptDialogTitle(Tr::tr("Select SysRoot Directory"));
+ d->sysRootDirectory->setToolTip(Tr::tr(
"This option can be used to override the kit's SysRoot setting"));
auto coreLayout = new QHBoxLayout;
@@ -276,12 +274,12 @@ AttachCoreDialog::AttachCoreDialog(QWidget *parent)
formLayout->setContentsMargins(0, 0, 0, 0);
formLayout->setHorizontalSpacing(6);
formLayout->setVerticalSpacing(6);
- formLayout->addRow(tr("Kit:"), d->kitChooser);
+ formLayout->addRow(Tr::tr("Kit:"), d->kitChooser);
formLayout->addRow(d->forceLocalLabel, d->forceLocalCheckBox);
- formLayout->addRow(tr("Core file:"), coreLayout);
- formLayout->addRow(tr("&Executable or symbol file:"), d->symbolFileName);
- formLayout->addRow(tr("Override &start script:"), d->overrideStartScriptFileName);
- formLayout->addRow(tr("Override S&ysRoot:"), d->sysRootDirectory);
+ formLayout->addRow(Tr::tr("Core file:"), coreLayout);
+ formLayout->addRow(Tr::tr("&Executable or symbol file:"), d->symbolFileName);
+ formLayout->addRow(Tr::tr("Override &start script:"), d->overrideStartScriptFileName);
+ formLayout->addRow(Tr::tr("Override S&ysRoot:"), d->sysRootDirectory);
auto line = new QFrame(this);
line->setFrameShape(QFrame::HLine);
@@ -381,7 +379,7 @@ void AttachCoreDialog::selectRemoteCoreFile()
changed();
QTC_ASSERT(!isLocalKit(), return);
SelectRemoteFileDialog dlg(this);
- dlg.setWindowTitle(tr("Select Remote Core File"));
+ dlg.setWindowTitle(Tr::tr("Select Remote Core File"));
dlg.attachToDevice(d->kitChooser->currentKit());
if (dlg.exec() == QDialog::Rejected)
return;
@@ -460,5 +458,4 @@ void AttachCoreDialog::setSysRoot(const FilePath &sysRoot)
d->sysRootDirectory->setFilePath(sysRoot);
}
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/loadcoredialog.h b/src/plugins/debugger/loadcoredialog.h
index 5c37bbb481..b4b9aaa410 100644
--- a/src/plugins/debugger/loadcoredialog.h
+++ b/src/plugins/debugger/loadcoredialog.h
@@ -32,13 +32,10 @@
namespace ProjectExplorer { class Kit; }
namespace Utils { class FilePath; }
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
class AttachCoreDialog : public QDialog
{
- Q_OBJECT
-
public:
explicit AttachCoreDialog(QWidget *parent);
~AttachCoreDialog() override;
@@ -72,5 +69,4 @@ private:
class AttachCoreDialogPrivate *d;
};
-} // namespace Debugger
-} // namespace Internal
+} // Debugger::Internal
diff --git a/src/plugins/debugger/localsandexpressionswindow.cpp b/src/plugins/debugger/localsandexpressionswindow.cpp
index 0c6ab3d5b8..aafbff1744 100644
--- a/src/plugins/debugger/localsandexpressionswindow.cpp
+++ b/src/plugins/debugger/localsandexpressionswindow.cpp
@@ -30,8 +30,7 @@
#include <QVBoxLayout>
#include <QStackedWidget>
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
enum { LocalsIndex = 0, InspectorIndex = 1 };
@@ -72,5 +71,4 @@ void LocalsAndInspectorWindow::setShowLocals(bool showLocals)
m_timer.start();
}
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/localsandexpressionswindow.h b/src/plugins/debugger/localsandexpressionswindow.h
index 7782952101..a52401da7d 100644
--- a/src/plugins/debugger/localsandexpressionswindow.h
+++ b/src/plugins/debugger/localsandexpressionswindow.h
@@ -28,8 +28,7 @@
#include <QWidget>
#include <QTimer>
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
class LocalsAndInspectorWindow : public QWidget
{
@@ -44,5 +43,4 @@ private:
bool m_showLocals = false;
};
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/logwindow.cpp b/src/plugins/debugger/logwindow.cpp
index 9a3654b875..b92bdbdbbe 100644
--- a/src/plugins/debugger/logwindow.cpp
+++ b/src/plugins/debugger/logwindow.cpp
@@ -26,10 +26,10 @@
#include "logwindow.h"
#include "debuggeractions.h"
-#include "debuggercore.h"
#include "debuggerengine.h"
#include "debuggericons.h"
#include "debuggerinternalconstants.h"
+#include "debuggertr.h"
#include <QDebug>
#include <QTime>
@@ -58,8 +58,7 @@
using namespace Utils;
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
GlobalLogWindow *theGlobalLog = nullptr;
@@ -96,7 +95,7 @@ static bool writeLogContents(const QPlainTextEdit *editor, QWidget *parent)
{
bool success = false;
while (!success) {
- const FilePath filePath = FileUtils::getSaveFilePath(parent, LogWindow::tr("Log File"));
+ const FilePath filePath = FileUtils::getSaveFilePath(parent, Tr::tr("Log File"));
if (filePath.isEmpty())
break;
FileSaver saver(filePath, QIODevice::Text);
@@ -195,8 +194,6 @@ private:
class DebuggerPane : public QPlainTextEdit
{
- Q_OBJECT
-
public:
explicit DebuggerPane()
{
@@ -204,11 +201,11 @@ public:
setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
m_clearContentsAction = new QAction(this);
- m_clearContentsAction->setText(tr("Clear Contents"));
+ m_clearContentsAction->setText(Tr::tr("Clear Contents"));
m_clearContentsAction->setEnabled(true);
m_saveContentsAction = new QAction(this);
- m_saveContentsAction->setText(tr("Save Contents"));
+ m_saveContentsAction->setText(Tr::tr("Save Contents"));
m_saveContentsAction->setEnabled(true);
connect(m_saveContentsAction, &QAction::triggered,
this, &DebuggerPane::saveContents);
@@ -320,7 +317,7 @@ private:
void focusInEvent(QFocusEvent *ev) override
{
- emit statusMessageRequested(tr("Type Ctrl-<Return> to execute a line."), -1);
+ emit statusMessageRequested(Tr::tr("Type Ctrl-<Return> to execute a line."), -1);
QPlainTextEdit::focusInEvent(ev);
}
@@ -340,7 +337,6 @@ private:
class CombinedPane : public DebuggerPane
{
- Q_OBJECT
public:
CombinedPane(LogWindow *logWindow)
{
@@ -386,7 +382,7 @@ public:
LogWindow::LogWindow(DebuggerEngine *engine)
: m_engine(engine)
{
- setWindowTitle(tr("Debugger &Log"));
+ setWindowTitle(Tr::tr("Debugger &Log"));
setObjectName("Log");
m_ignoreNextInputEcho = false;
@@ -410,11 +406,11 @@ LogWindow::LogWindow(DebuggerEngine *engine)
auto repeatButton = new QToolButton(this);
repeatButton->setIcon(Icons::STEP_OVER.icon());
repeatButton->setFixedSize(QSize(18, 18));
- repeatButton->setToolTip(tr("Repeat last command for debug reasons."));
+ repeatButton->setToolTip(Tr::tr("Repeat last command for debug reasons."));
auto commandBox = new QHBoxLayout;
commandBox->addWidget(repeatButton);
- commandBox->addWidget(new QLabel(tr("Command:"), this));
+ commandBox->addWidget(new QLabel(Tr::tr("Command:"), this));
commandBox->addWidget(m_commandEdit);
commandBox->setContentsMargins(2, 2, 2, 2);
commandBox->setSpacing(6);
@@ -465,7 +461,7 @@ LogWindow::LogWindow(DebuggerEngine *engine)
setMinimumHeight(60);
showOutput(LogWarning,
- tr("Note: This log contains possibly confidential information about your machine, "
+ Tr::tr("Note: This log contains possibly confidential information about your machine, "
"environment variables, in-memory data of the processes you are debugging, and more. "
"It is never transferred over the internet by %1, and only stored "
"to disk if you manually use the respective option from the context menu, or through "
@@ -505,7 +501,7 @@ void LogWindow::sendCommand()
if (m_engine->acceptsDebuggerCommands())
m_engine->executeDebuggerCommand(m_commandEdit->text());
else
- showOutput(LogError, tr("User commands are not accepted in the current state."));
+ showOutput(LogError, Tr::tr("User commands are not accepted in the current state."));
}
void LogWindow::showOutput(int channel, const QString &output)
@@ -660,7 +656,7 @@ GlobalLogWindow::GlobalLogWindow()
{
theGlobalLog = this;
- setWindowTitle(tr("Global Debugger &Log"));
+ setWindowTitle(Tr::tr("Global Debugger &Log"));
setObjectName("GlobalLog");
auto m_splitter = new Core::MiniSplitter(Qt::Horizontal);
@@ -747,7 +743,6 @@ void GlobalLogWindow::clearUndoRedoStacks()
m_rightPane->clearUndoRedoStacks();
}
-} // namespace Internal
-} // namespace Debugger
+} // namespace Debugger::Internal
#include "logwindow.moc"
diff --git a/src/plugins/debugger/logwindow.h b/src/plugins/debugger/logwindow.h
index db3de32b7c..619f7ef735 100644
--- a/src/plugins/debugger/logwindow.h
+++ b/src/plugins/debugger/logwindow.h
@@ -25,8 +25,6 @@
#pragma once
-#include "debuggerconstants.h"
-
#include <QWidget>
#include <QTimer>
@@ -37,8 +35,7 @@ QT_END_NAMESPACE
namespace Utils { class FancyLineEdit; }
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
class DebuggerEngine;
class DebuggerPane;
@@ -87,8 +84,6 @@ private:
class GlobalLogWindow final : public QWidget
{
- Q_OBJECT
-
public:
explicit GlobalLogWindow();
~GlobalLogWindow() final;
@@ -105,5 +100,4 @@ private:
DebuggerPane *m_leftPane; // combined input
};
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Internla
diff --git a/src/plugins/debugger/memoryagent.cpp b/src/plugins/debugger/memoryagent.cpp
index 8ad56dfe0a..aafca04d43 100644
--- a/src/plugins/debugger/memoryagent.cpp
+++ b/src/plugins/debugger/memoryagent.cpp
@@ -27,8 +27,8 @@
#include "breakhandler.h"
#include "debuggerengine.h"
-#include "debuggercore.h"
#include "debuggerinternalconstants.h"
+#include "debuggertr.h"
#include "registerhandler.h"
#include <bineditor/bineditorservice.h>
@@ -51,8 +51,7 @@
using namespace Core;
using namespace ProjectExplorer;
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
enum { BinBlockSize = 1024 };
enum { DataRange = 1024 * 1024 };
@@ -155,13 +154,12 @@ private:
QString registerViewTitle(const QString &registerName, quint64 addr)
{
- return MemoryAgent::tr("Memory at Register \"%1\" (0x%2)").arg(registerName).arg(addr, 0, 16);
+ return Tr::tr("Memory at Register \"%1\" (0x%2)").arg(registerName).arg(addr, 0, 16);
}
QList<MemoryMarkup> registerViewMarkup(quint64 a, const QString &regName)
{
- return {MemoryMarkup(a, 1, QColor(Qt::blue).lighter(),
- MemoryAgent::tr("Register \"%1\"").arg(regName))};
+ return {MemoryMarkup(a, 1, QColor(Qt::blue).lighter(), Tr::tr("Register \"%1\"").arg(regName))};
}
///////////////////////////////////////////////////////////////////////
@@ -213,7 +211,7 @@ MemoryAgent::MemoryAgent(const MemoryViewSetupData &data, DebuggerEngine *engine
if (!factory)
return;
- QString title = data.title.isEmpty() ? tr("Memory at 0x%1").arg(data.startAddress, 0, 16) : data.title;
+ QString title = data.title.isEmpty() ? Tr::tr("Memory at 0x%1").arg(data.startAddress, 0, 16) : data.title;
if (!data.separateView && !title.endsWith('$'))
title.append(" $");
@@ -314,6 +312,5 @@ bool MemoryAgent::isUsable()
return m_service != nullptr;
}
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/memoryagent.h b/src/plugins/debugger/memoryagent.h
index 755ef9c4bb..f693be8ec4 100644
--- a/src/plugins/debugger/memoryagent.h
+++ b/src/plugins/debugger/memoryagent.h
@@ -34,8 +34,7 @@
namespace BinEditor { class EditorService; }
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
class DebuggerEngine;
@@ -70,8 +69,6 @@ public:
class MemoryAgent : public QObject
{
- Q_OBJECT
-
public:
MemoryAgent(const MemoryViewSetupData &data, DebuggerEngine *engine);
~MemoryAgent() override;
@@ -94,5 +91,4 @@ private:
QList<MemoryMarkup> registerViewMarkup(quint64 address, const QString &regName);
QString registerViewTitle(const QString &registerName, quint64 address = 0);
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Intenal
diff --git a/src/plugins/debugger/moduleshandler.cpp b/src/plugins/debugger/moduleshandler.cpp
index 4f4e8a75d1..ef4f5f9033 100644
--- a/src/plugins/debugger/moduleshandler.cpp
+++ b/src/plugins/debugger/moduleshandler.cpp
@@ -29,6 +29,7 @@
#include "debuggerconstants.h"
#include "debuggercore.h"
#include "debuggerengine.h"
+#include "debuggertr.h"
#include <utils/basetreeview.h>
#include <utils/hostosinfo.h>
@@ -45,13 +46,10 @@
using namespace Utils;
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
class ModuleItem : public TreeItem
{
- Q_DECLARE_TR_FUNCTIONS(Debuggger::Internal::ModulesHandler)
-
public:
QVariant data(int column, int role) const override;
@@ -85,39 +83,39 @@ QVariant ModuleItem::data(int column, int role) const
case 2:
if (role == Qt::DisplayRole)
switch (module.symbolsRead) {
- case Module::UnknownReadState: return tr("Unknown");
- case Module::ReadFailed: return tr("No");
- case Module::ReadOk: return tr("Yes");
+ case Module::UnknownReadState: return Tr::tr("Unknown");
+ case Module::ReadFailed: return Tr::tr("No");
+ case Module::ReadOk: return Tr::tr("Yes");
}
break;
case 3:
if (role == Qt::DisplayRole)
switch (module.elfData.symbolsType) {
- case UnknownSymbols: return tr("Unknown");
- case NoSymbols: return tr("None");
- case PlainSymbols: return tr("Plain");
- case FastSymbols: return tr("Fast");
- case LinkedSymbols: return tr("debuglnk");
- case BuildIdSymbols: return tr("buildid");
+ case UnknownSymbols: return Tr::tr("Unknown");
+ case NoSymbols: return Tr::tr("None");
+ case PlainSymbols: return Tr::tr("Plain");
+ case FastSymbols: return Tr::tr("Fast");
+ case LinkedSymbols: return Tr::tr("debuglnk");
+ case BuildIdSymbols: return Tr::tr("buildid");
}
else if (role == Qt::ToolTipRole)
switch (module.elfData.symbolsType) {
case UnknownSymbols:
- return tr("It is unknown whether this module contains debug "
+ return Tr::tr("It is unknown whether this module contains debug "
"information.\nUse \"Examine Symbols\" from the "
"context menu to initiate a check.");
case NoSymbols:
- return tr("This module neither contains nor references debug "
+ return Tr::tr("This module neither contains nor references debug "
"information.\nStepping into the module or setting "
"breakpoints by file and line will not work.");
case PlainSymbols:
case FastSymbols:
- return tr("This module contains debug information.\nStepping "
+ return Tr::tr("This module contains debug information.\nStepping "
"into the module or setting breakpoints by file and "
"line is expected to work.");
case LinkedSymbols:
case BuildIdSymbols:
- return tr("This module does not contain debug information "
+ return Tr::tr("This module does not contain debug information "
"itself, but contains a reference to external "
"debug information.");
}
@@ -132,7 +130,7 @@ QVariant ModuleItem::data(int column, int role) const
if (module.endAddress)
return QString("0x" + QString::number(module.endAddress, 16));
//: End address of loaded module
- return tr("<unknown>", "address");
+ return Tr::tr("<unknown>", "address");
}
break;
}
@@ -147,8 +145,6 @@ QVariant ModuleItem::data(int column, int role) const
class ModulesModel : public TreeModel<TypedTreeItem<ModuleItem>, ModuleItem>
{
- Q_DECLARE_TR_FUNCTIONS(Debuggger::Internal::ModulesHandler)
-
public:
bool setData(const QModelIndex &idx, const QVariant &data, int role) override
{
@@ -180,46 +176,46 @@ bool ModulesModel::contextMenuEvent(const ItemViewEvent &ev)
auto menu = new QMenu;
- addAction(this, menu, tr("Update Module List"),
+ addAction(this, menu, Tr::tr("Update Module List"),
enabled && canReload,
[this] { engine->reloadModules(); });
- addAction(this, menu, tr("Show Source Files for Module \"%1\"").arg(moduleName),
- tr("Show Source Files for Module"),
+ addAction(this, menu, Tr::tr("Show Source Files for Module \"%1\"").arg(moduleName),
+ Tr::tr("Show Source Files for Module"),
moduleNameValid && enabled && canReload,
[this, modulePath] { engine->loadSymbols(modulePath); });
// FIXME: Dependencies only available on Windows, when "depends" is installed.
- addAction(this, menu, tr("Show Dependencies of \"%1\"").arg(moduleName),
- tr("Show Dependencies"),
+ addAction(this, menu, Tr::tr("Show Dependencies of \"%1\"").arg(moduleName),
+ Tr::tr("Show Dependencies"),
moduleNameValid && !moduleName.isEmpty() && HostOsInfo::isWindowsHost(),
[modulePath] { QtcProcess::startDetached({{"depends"}, {modulePath}}); });
- addAction(this, menu, tr("Load Symbols for All Modules"),
+ addAction(this, menu, Tr::tr("Load Symbols for All Modules"),
enabled && canLoadSymbols,
[this] { engine->loadAllSymbols(); });
- addAction(this, menu, tr("Examine All Modules"),
+ addAction(this, menu, Tr::tr("Examine All Modules"),
enabled && canLoadSymbols,
[this] { engine->examineModules(); });
- addAction(this, menu, tr("Load Symbols for Module \"%1\"").arg(moduleName),
- tr("Load Symbols for Module"),
+ addAction(this, menu, Tr::tr("Load Symbols for Module \"%1\"").arg(moduleName),
+ Tr::tr("Load Symbols for Module"),
moduleNameValid && canLoadSymbols,
[this, modulePath] { engine->loadSymbols(modulePath); });
- addAction(this, menu, tr("Edit File \"%1\"").arg(moduleName),
- tr("Edit File"),
+ addAction(this, menu, Tr::tr("Edit File \"%1\"").arg(moduleName),
+ Tr::tr("Edit File"),
moduleNameValid,
[this, modulePath] { engine->gotoLocation(FilePath::fromString(modulePath)); });
- addAction(this, menu, tr("Show Symbols in File \"%1\"").arg(moduleName),
- tr("Show Symbols"),
+ addAction(this, menu, Tr::tr("Show Symbols in File \"%1\"").arg(moduleName),
+ Tr::tr("Show Symbols"),
canShowSymbols && moduleNameValid,
[this, modulePath] { engine->requestModuleSymbols(modulePath); });
- addAction(this, menu, tr("Show Sections in File \"%1\"").arg(moduleName),
- tr("Show Sections"),
+ addAction(this, menu, Tr::tr("Show Sections in File \"%1\"").arg(moduleName),
+ Tr::tr("Show Sections"),
canShowSymbols && moduleNameValid,
[this, modulePath] { engine->requestModuleSections(modulePath); });
@@ -243,12 +239,12 @@ ModulesHandler::ModulesHandler(DebuggerEngine *engine)
m_model->engine = engine;
m_model->setObjectName("ModulesModel");
m_model->setHeader(QStringList({
- tr("Module Name") + pad,
- tr("Module Path") + pad,
- tr("Symbols Read") + pad,
- tr("Symbols Type") + pad,
- tr("Start Address") + pad,
- tr("End Address") + pad}));
+ Tr::tr("Module Name") + pad,
+ Tr::tr("Module Path") + pad,
+ Tr::tr("Symbols Read") + pad,
+ Tr::tr("Symbols Type") + pad,
+ Tr::tr("Start Address") + pad,
+ Tr::tr("End Address") + pad}));
m_proxyModel = new QSortFilterProxyModel(this);
m_proxyModel->setObjectName("ModulesProxyModel");
@@ -333,5 +329,4 @@ void ModulesHandler::endUpdateAll()
m_model->destroyItem(item);
}
-} // namespace Internal
-} // namespace Debugger
+} // namespace Debugger::Internal
diff --git a/src/plugins/debugger/moduleshandler.h b/src/plugins/debugger/moduleshandler.h
index 790d3fbe38..b72be2c0cb 100644
--- a/src/plugins/debugger/moduleshandler.h
+++ b/src/plugins/debugger/moduleshandler.h
@@ -33,8 +33,7 @@ class QAbstractItemModel;
class QSortFilterProxyModel;
QT_END_NAMESPACE
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
class DebuggerEngine;
class ModuleItem;
@@ -138,5 +137,4 @@ private:
QSortFilterProxyModel *m_proxyModel;
};
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/outputcollector.cpp b/src/plugins/debugger/outputcollector.cpp
index 1759cfd6d3..8dd307d01d 100644
--- a/src/plugins/debugger/outputcollector.cpp
+++ b/src/plugins/debugger/outputcollector.cpp
@@ -25,6 +25,8 @@
#include "outputcollector.h"
+#include "debuggertr.h"
+
#ifdef Q_OS_WIN
#include <QLocalServer>
@@ -52,8 +54,7 @@
#endif
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
OutputCollector::~OutputCollector()
{
@@ -78,7 +79,7 @@ bool OutputCollector::listen()
{
Utils::TemporaryFile tf("outputcollector");
if (!tf.open()) {
- m_errorString = tr("Cannot create temporary file: %1").arg(tf.errorString());
+ m_errorString = Tr::tr("Cannot create temporary file: %1").arg(tf.errorString());
m_serverPath.clear();
return false;
}
@@ -89,14 +90,14 @@ bool OutputCollector::listen()
if (!::mkfifo(codedServerPath.constData(), 0600))
break;
if (errno != EEXIST) {
- m_errorString = tr("Cannot create FiFo %1: %2").
+ m_errorString = Tr::tr("Cannot create FiFo %1: %2").
arg(m_serverPath, QString::fromLocal8Bit(strerror(errno)));
m_serverPath.clear();
return false;
}
}
if ((m_serverFd = ::open(codedServerPath.constData(), O_RDONLY|O_NONBLOCK)) < 0) {
- m_errorString = tr("Cannot open FiFo %1: %2").
+ m_errorString = Tr::tr("Cannot open FiFo %1: %2").
arg(m_serverPath, QString::fromLocal8Bit(strerror(errno)));
m_serverPath.clear();
return false;
@@ -170,5 +171,4 @@ void OutputCollector::bytesAvailable()
#endif
}
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/outputcollector.h b/src/plugins/debugger/outputcollector.h
index 8d04e56364..bae14e4450 100644
--- a/src/plugins/debugger/outputcollector.h
+++ b/src/plugins/debugger/outputcollector.h
@@ -33,14 +33,7 @@ class QLocalSocket;
class QSocketNotifier;
QT_END_NAMESPACE
-namespace Debugger {
-namespace Internal {
-
-///////////////////////////////////////////////////////////////////////
-//
-// OutputCollector
-//
-///////////////////////////////////////////////////////////////////////
+namespace Debugger::Internal {
class OutputCollector : public QObject
{
@@ -71,5 +64,4 @@ private:
#endif
};
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/pdb/pdbengine.cpp b/src/plugins/debugger/pdb/pdbengine.cpp
index 54375baf7f..52eb8d0fd6 100644
--- a/src/plugins/debugger/pdb/pdbengine.cpp
+++ b/src/plugins/debugger/pdb/pdbengine.cpp
@@ -25,20 +25,20 @@
#include "pdbengine.h"
+#include <debugger/breakhandler.h>
#include <debugger/debuggeractions.h>
#include <debugger/debuggercore.h>
#include <debugger/debuggerdialogs.h>
#include <debugger/debuggerplugin.h>
#include <debugger/debuggerprotocol.h>
#include <debugger/debuggertooltipmanager.h>
-#include <debugger/threaddata.h>
-
-#include <debugger/breakhandler.h>
+#include <debugger/debuggertr.h>
#include <debugger/moduleshandler.h>
#include <debugger/procinterrupt.h>
#include <debugger/registerhandler.h>
-#include <debugger/stackhandler.h>
#include <debugger/sourceutils.h>
+#include <debugger/stackhandler.h>
+#include <debugger/threaddata.h>
#include <debugger/watchhandler.h>
#include <debugger/watchutils.h>
@@ -61,8 +61,7 @@
using namespace Core;
using namespace Utils;
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
PdbEngine::PdbEngine()
{
@@ -128,8 +127,9 @@ void PdbEngine::setupEngine()
const FilePath scriptFile = runParameters().mainScript;
if (!scriptFile.isReadableFile()) {
- AsynchronousMessageBox::critical(tr("Python Error"),
- QString("Cannot open script file %1").arg(scriptFile.toUserOutput()));
+ AsynchronousMessageBox::critical(Tr::tr("Python Error"),
+ QString("Cannot open script file %1")
+ .arg(scriptFile.toUserOutput()));
notifyEngineSetupFailed();
}
@@ -146,7 +146,7 @@ void PdbEngine::handlePdbStarted()
notifyEngineSetupOk();
QTC_ASSERT(state() == EngineRunRequested, qDebug() << state());
- showStatusMessage(tr("Running requested..."), 5000);
+ showStatusMessage(Tr::tr("Running requested..."), 5000);
BreakpointManager::claimBreakpointsForEngine(this);
notifyEngineRunAndInferiorStopOk();
updateAll();
@@ -387,26 +387,26 @@ QString PdbEngine::errorMessage(QProcess::ProcessError error) const
{
switch (error) {
case QProcess::FailedToStart:
- return tr("The Pdb process failed to start. Either the "
+ return Tr::tr("The Pdb process failed to start. Either the "
"invoked program \"%1\" is missing, or you may have insufficient "
"permissions to invoke the program.")
.arg(m_interpreter.toUserOutput());
case QProcess::Crashed:
- return tr("The Pdb process crashed some time after starting "
+ return Tr::tr("The Pdb process crashed some time after starting "
"successfully.");
case QProcess::Timedout:
- return tr("The last waitFor...() function timed out. "
+ return Tr::tr("The last waitFor...() function timed out. "
"The state of QProcess is unchanged, and you can try calling "
"waitFor...() again.");
case QProcess::WriteError:
- return tr("An error occurred when attempting to write "
+ return Tr::tr("An error occurred when attempting to write "
"to the Pdb process. For example, the process may not be running, "
"or it may have closed its input channel.");
case QProcess::ReadError:
- return tr("An error occurred when attempting to read from "
+ return Tr::tr("An error occurred when attempting to read from "
"the Pdb process. For example, the process may not be running.");
default:
- return tr("An unknown error in the Pdb process occurred.") + ' ';
+ return Tr::tr("An unknown error in the Pdb process occurred.") + ' ';
}
}
@@ -415,7 +415,7 @@ void PdbEngine::handlePdbDone()
if (m_proc.result() == ProcessResult::StartFailed) {
notifyEngineSetupFailed();
showMessage("ADAPTER START FAILED");
- ICore::showWarningWithOptions(tr("Adapter start failed"), m_proc.exitMessage());
+ ICore::showWarningWithOptions(Tr::tr("Adapter start failed"), m_proc.exitMessage());
return;
}
@@ -423,7 +423,7 @@ void PdbEngine::handlePdbDone()
if (error != QProcess::UnknownError) {
showMessage("HANDLE PDB ERROR");
if (error != QProcess::Crashed)
- AsynchronousMessageBox::critical(tr("Pdb I/O Error"), errorMessage(error));
+ AsynchronousMessageBox::critical(Tr::tr("Pdb I/O Error"), errorMessage(error));
if (error == QProcess::FailedToStart)
return;
}
@@ -585,5 +585,4 @@ DebuggerEngine *createPdbEngine()
return new PdbEngine;
}
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/pdb/pdbengine.h b/src/plugins/debugger/pdb/pdbengine.h
index efde41e2ce..0d94a28c9b 100644
--- a/src/plugins/debugger/pdb/pdbengine.h
+++ b/src/plugins/debugger/pdb/pdbengine.h
@@ -30,8 +30,8 @@
#include <QVariant>
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
+
class DebuggerCommand;
class GdbMi;
@@ -41,8 +41,6 @@ class GdbMi;
class PdbEngine : public DebuggerEngine
{
- Q_OBJECT
-
public:
PdbEngine();
@@ -115,5 +113,4 @@ private:
Utils::FilePath m_interpreter;
};
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/peripheralregisterhandler.cpp b/src/plugins/debugger/peripheralregisterhandler.cpp
index b1748d3b98..726a92e92e 100644
--- a/src/plugins/debugger/peripheralregisterhandler.cpp
+++ b/src/plugins/debugger/peripheralregisterhandler.cpp
@@ -27,7 +27,7 @@
#include "debuggeractions.h"
#include "debuggercore.h"
-#include "debuggerdialogs.h"
+#include "debuggertr.h"
#include <utils/basetreeview.h>
@@ -41,10 +41,8 @@
using namespace Utils;
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
-namespace {
// Keys of a properties in SVD file.
constexpr char kAccess[] = "access";
constexpr char kAddressOffset[] = "addressOffset";
@@ -71,7 +69,6 @@ constexpr char kRegisters[] = "registers";
constexpr char kResetvalue[] = "resetValue";
constexpr char kSize[] = "size";
constexpr char kWritOnlye[] = "write-only";
-} // namespace
enum PeripheralRegisterColumns
{
@@ -90,13 +87,13 @@ static QString accessName(PeripheralRegisterAccess access)
{
switch (access) {
case PeripheralRegisterAccess::ReadOnly:
- return PeripheralRegisterHandler::tr("RO");
+ return Tr::tr("RO");
case PeripheralRegisterAccess::WriteOnly:
- return PeripheralRegisterHandler::tr("WO");
+ return Tr::tr("WO");
case PeripheralRegisterAccess::ReadWrite:
- return PeripheralRegisterHandler::tr("RW");
+ return Tr::tr("RW");
default:
- return PeripheralRegisterHandler::tr("N/A");
+ return Tr::tr("N/A");
}
}
@@ -173,7 +170,7 @@ QString PeripheralRegisterField::bitRangeString() const
{
const int from = bitOffset;
const int to = bitOffset + bitWidth - 1;
- return PeripheralRegisterHandler::tr("[%1..%2]").arg(to).arg(from);
+ return Tr::tr("[%1..%2]").arg(to).arg(from);
}
QString PeripheralRegisterField::bitValueString(quint64 regValue) const
@@ -562,7 +559,7 @@ PeripheralRegisterHandler::PeripheralRegisterHandler(DebuggerEngine *engine)
: m_engine(engine)
{
setObjectName("PeripheralRegisterModel");
- setHeader({tr("Name"), tr("Value"), tr("Access")});
+ setHeader({Tr::tr("Name"), Tr::tr("Value"), Tr::tr("Access")});
}
static void handleField(QXmlStreamReader &in, PeripheralRegister &reg)
@@ -804,7 +801,7 @@ bool PeripheralRegisterHandler::contextMenuEvent(const ItemViewEvent &ev)
QMenu *PeripheralRegisterHandler::createRegisterGroupsMenu(DebuggerState state) const
{
- const auto groupMenu = new QMenu(tr("View Groups"));
+ const auto groupMenu = new QMenu(Tr::tr("View Groups"));
const auto actionGroup = new QActionGroup(groupMenu);
bool hasActions = false;
for (const PeripheralRegisterGroup &group : qAsConst(m_peripheralRegisterGroups)) {
@@ -830,7 +827,7 @@ QMenu *PeripheralRegisterHandler::createRegisterGroupsMenu(DebuggerState state)
QMenu *PeripheralRegisterHandler::createRegisterFormatMenu(
DebuggerState state, PeripheralRegisterItem *item) const
{
- const auto fmtMenu = new QMenu(tr("Format"));
+ const auto fmtMenu = new QMenu(Tr::tr("Format"));
const auto actionGroup = new QActionGroup(fmtMenu);
const bool on = m_engine->hasCapability(RegisterCapability)
@@ -840,7 +837,7 @@ QMenu *PeripheralRegisterHandler::createRegisterFormatMenu(
// Hexadecimal action.
const auto hexAct = addCheckableAction(
- this, fmtMenu, tr("Hexadecimal"), on,
+ this, fmtMenu, Tr::tr("Hexadecimal"), on,
fmt == PeripheralRegisterFormat::Hexadecimal,
[item] {
item->m_reg.format = PeripheralRegisterFormat::Hexadecimal;
@@ -850,7 +847,7 @@ QMenu *PeripheralRegisterHandler::createRegisterFormatMenu(
// Decimal action.
const auto decAct = addCheckableAction(
- this, fmtMenu, tr("Decimal"), on,
+ this, fmtMenu, Tr::tr("Decimal"), on,
fmt == PeripheralRegisterFormat::Decimal,
[item] {
item->m_reg.format = PeripheralRegisterFormat::Decimal;
@@ -860,7 +857,7 @@ QMenu *PeripheralRegisterHandler::createRegisterFormatMenu(
// Octal action.
const auto octAct = addCheckableAction(
- this, fmtMenu, tr("Octal"), on,
+ this, fmtMenu, Tr::tr("Octal"), on,
fmt == PeripheralRegisterFormat::Octal,
[item] {
item->m_reg.format = PeripheralRegisterFormat::Octal;
@@ -870,7 +867,7 @@ QMenu *PeripheralRegisterHandler::createRegisterFormatMenu(
// Binary action.
const auto binAct = addCheckableAction(
- this, fmtMenu, tr("Binary"), on,
+ this, fmtMenu, Tr::tr("Binary"), on,
fmt == PeripheralRegisterFormat::Binary,
[item] {
item->m_reg.format = PeripheralRegisterFormat::Binary;
@@ -884,7 +881,7 @@ QMenu *PeripheralRegisterHandler::createRegisterFormatMenu(
QMenu *PeripheralRegisterHandler::createRegisterFieldFormatMenu(
DebuggerState state, PeripheralRegisterFieldItem *item) const
{
- const auto fmtMenu = new QMenu(tr("Format"));
+ const auto fmtMenu = new QMenu(Tr::tr("Format"));
const auto actionGroup = new QActionGroup(fmtMenu);
const bool on = m_engine->hasCapability(RegisterCapability)
@@ -894,7 +891,7 @@ QMenu *PeripheralRegisterHandler::createRegisterFieldFormatMenu(
// Hexadecimal action.
const auto hexAct = addCheckableAction(
- this, fmtMenu, tr("Hexadecimal"), on,
+ this, fmtMenu, Tr::tr("Hexadecimal"), on,
fmt == PeripheralRegisterFormat::Hexadecimal,
[item] {
item->m_fld.format = PeripheralRegisterFormat::Hexadecimal;
@@ -904,7 +901,7 @@ QMenu *PeripheralRegisterHandler::createRegisterFieldFormatMenu(
// Decimal action.
const auto decAct = addCheckableAction(
- this, fmtMenu, tr("Decimal"), on,
+ this, fmtMenu, Tr::tr("Decimal"), on,
fmt == PeripheralRegisterFormat::Decimal,
[item] {
item->m_fld.format = PeripheralRegisterFormat::Decimal;
@@ -914,7 +911,7 @@ QMenu *PeripheralRegisterHandler::createRegisterFieldFormatMenu(
// Octal action.
const auto octAct = addCheckableAction(
- this, fmtMenu, tr("Octal"), on,
+ this, fmtMenu, Tr::tr("Octal"), on,
fmt == PeripheralRegisterFormat::Octal,
[item] {
item->m_fld.format = PeripheralRegisterFormat::Octal;
@@ -924,7 +921,7 @@ QMenu *PeripheralRegisterHandler::createRegisterFieldFormatMenu(
// Binary action.
const auto binAct = addCheckableAction(
- this, fmtMenu, tr("Binary"), on,
+ this, fmtMenu, Tr::tr("Binary"), on,
fmt == PeripheralRegisterFormat::Binary,
[item] {
item->m_fld.format = PeripheralRegisterFormat::Binary;
@@ -977,5 +974,4 @@ void PeripheralRegisterHandler::deactivateGroups()
m_activeRegisters.clear();
}
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/peripheralregisterhandler.h b/src/plugins/debugger/peripheralregisterhandler.h
index a0382d3a58..0f8cacb080 100644
--- a/src/plugins/debugger/peripheralregisterhandler.h
+++ b/src/plugins/debugger/peripheralregisterhandler.h
@@ -37,8 +37,7 @@ QT_END_NAMESPACE
namespace Utils { class ItemViewEvent; }
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
class DebuggerEngine;
@@ -152,7 +151,6 @@ using PeripheralRegisterModel = Utils::TreeModel<PeripheralRegisterRootItem,
class PeripheralRegisterHandler final : public PeripheralRegisterModel
{
- Q_OBJECT
public:
explicit PeripheralRegisterHandler(DebuggerEngine *engine);
@@ -181,5 +179,4 @@ private:
DebuggerEngine * const m_engine;
};
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/procinterrupt.h b/src/plugins/debugger/procinterrupt.h
index b1d71e6db9..b58c5bf91d 100644
--- a/src/plugins/debugger/procinterrupt.h
+++ b/src/plugins/debugger/procinterrupt.h
@@ -27,11 +27,9 @@
#include <QString>
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
bool interruptProcess(qint64 pID, int engineType, QString *errorMessage,
const bool engineExecutableIs64Bit = false);
-} // Internal
-} // GdbDebugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/qml/interactiveinterpreter.cpp b/src/plugins/debugger/qml/interactiveinterpreter.cpp
index 9f82b09360..9f81311588 100644
--- a/src/plugins/debugger/qml/interactiveinterpreter.cpp
+++ b/src/plugins/debugger/qml/interactiveinterpreter.cpp
@@ -25,8 +25,7 @@
#include "interactiveinterpreter.h"
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
bool InteractiveInterpreter::canEvaluate()
{
@@ -80,5 +79,4 @@ again:
return false;
}
-}
-}
+} // Debugger::Internal
diff --git a/src/plugins/debugger/qml/interactiveinterpreter.h b/src/plugins/debugger/qml/interactiveinterpreter.h
index 541e33a558..f1142d1ce7 100644
--- a/src/plugins/debugger/qml/interactiveinterpreter.h
+++ b/src/plugins/debugger/qml/interactiveinterpreter.h
@@ -28,8 +28,7 @@
#include <qmljs/parser/qmljslexer_p.h>
#include <qmljs/parser/qmljsengine_p.h>
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
class InteractiveInterpreter: QmlJS::Lexer
{
@@ -54,5 +53,4 @@ private:
QString m_code;
};
-}
-}
+} // Debugger::Internal
diff --git a/src/plugins/debugger/qml/qmlengine.cpp b/src/plugins/debugger/qml/qmlengine.cpp
index 9687179c44..fccc458fd6 100644
--- a/src/plugins/debugger/qml/qmlengine.cpp
+++ b/src/plugins/debugger/qml/qmlengine.cpp
@@ -31,17 +31,18 @@
#include "qmlengineutils.h"
#include <debugger/breakhandler.h>
+#include <debugger/console/console.h>
#include <debugger/debuggeractions.h>
#include <debugger/debuggercore.h>
#include <debugger/debuggerinternalconstants.h>
#include <debugger/debuggerruncontrol.h>
#include <debugger/debuggertooltipmanager.h>
+#include <debugger/debuggertr.h>
#include <debugger/sourcefileshandler.h>
#include <debugger/stackhandler.h>
#include <debugger/threaddata.h>
#include <debugger/watchhandler.h>
#include <debugger/watchwindow.h>
-#include <debugger/console/console.h>
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/helpmanager.h>
@@ -98,8 +99,7 @@ using namespace QmlJS;
using namespace TextEditor;
using namespace Utils;
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
enum Exceptions
{
@@ -353,7 +353,7 @@ void QmlEngine::tryToConnect()
if (state() == EngineRunRequested) {
if (isDying()) {
// Probably cpp is being debugged and hence we did not get the output yet.
- appStartupFailed(tr("No application output received in time"));
+ appStartupFailed(Tr::tr("No application output received in time"));
} else {
beginConnection();
}
@@ -410,7 +410,7 @@ void QmlEngine::connectionStartupFailed()
auto infoBox = new QMessageBox(ICore::dialogParent());
infoBox->setIcon(QMessageBox::Critical);
infoBox->setWindowTitle(Core::Constants::IDE_DISPLAY_NAME);
- infoBox->setText(tr("Could not connect to the in-process QML debugger."
+ infoBox->setText(Tr::tr("Could not connect to the in-process QML debugger."
"\nDo you want to retry?"));
infoBox->setStandardButtons(QMessageBox::Retry | QMessageBox::Cancel |
QMessageBox::Help);
@@ -425,7 +425,7 @@ void QmlEngine::connectionStartupFailed()
void QmlEngine::appStartupFailed(const QString &errorMessage)
{
- QString error = tr("Could not connect to the in-process QML debugger. %1").arg(errorMessage);
+ QString error = Tr::tr("Could not connect to the in-process QML debugger. %1").arg(errorMessage);
if (companionEngine()) {
auto infoBox = new QMessageBox(ICore::dialogParent());
@@ -473,7 +473,7 @@ void QmlEngine::gotoLocation(const Location &location)
// internal file from source files -> show generated .js
QTC_ASSERT(d->sourceDocuments.contains(fileName), return);
- QString titlePattern = tr("JS Source for %1").arg(fileName);
+ QString titlePattern = Tr::tr("JS Source for %1").arg(fileName);
//Check if there are open documents with the same title
const QList<IDocument *> documents = DocumentModel::openedDocuments();
for (IDocument *document: documents) {
@@ -513,7 +513,7 @@ void QmlEngine::startProcess()
d->process.setCommand(runParameters().inferior.command);
d->process.setWorkingDirectory(runParameters().inferior.workingDirectory);
d->process.setEnvironment(runParameters().inferior.environment);
- showMessage(tr("Starting %1").arg(d->process.commandLine().toUserOutput()),
+ showMessage(Tr::tr("Starting %1").arg(d->process.commandLine().toUserOutput()),
NormalMessageFormat);
d->process.start();
}
@@ -595,7 +595,7 @@ void QmlEngine::interruptInferior()
{
showMessage(INTERRUPT, LogInput);
d->runDirectCommand(INTERRUPT);
- showStatusMessage(tr("Waiting for JavaScript engine to interrupt on next statement."));
+ showStatusMessage(Tr::tr("Waiting for JavaScript engine to interrupt on next statement."));
}
void QmlEngine::executeStepIn(bool)
@@ -625,7 +625,7 @@ void QmlEngine::executeStepOver(bool)
void QmlEngine::executeRunToLine(const ContextData &data)
{
QTC_ASSERT(state() == InferiorStopOk, qDebug() << state());
- showStatusMessage(tr("Run to line %1 (%2) requested...")
+ showStatusMessage(Tr::tr("Run to line %1 (%2) requested...")
.arg(data.lineNumber)
.arg(data.fileName.toString()),
5000);
@@ -817,7 +817,7 @@ void QmlEngine::assignValueInDebugger(WatchItem *item,
if (handler->isContentsValid() && handler->currentFrame().isUsable()) {
d->evaluate(exp, -1, [this](const QVariantMap &) { d->updateLocals(); });
} else {
- showMessage(tr("Cannot evaluate %1 in current stack frame.")
+ showMessage(Tr::tr("Cannot evaluate %1 in current stack frame.")
.arg(expression), ConsoleOutput);
}
}
@@ -977,7 +977,7 @@ Context QmlEngine::languageContext() const
void QmlEngine::disconnected()
{
- showMessage(tr("QML Debugger disconnected."), StatusBar);
+ showMessage(Tr::tr("QML Debugger disconnected."), StatusBar);
notifyInferiorExited();
}
@@ -1014,8 +1014,8 @@ void QmlEngine::updateCurrentContext()
return;
}
- debuggerConsole()->setContext(tr("Context:") + ' '
- + (context.isEmpty() ? tr("Global QML Context") : context));
+ debuggerConsole()->setContext(Tr::tr("Context:") + ' '
+ + (context.isEmpty() ? Tr::tr("Global QML Context") : context));
}
void QmlEngine::executeDebuggerCommand(const QString &command)
@@ -1124,7 +1124,7 @@ void QmlEngine::connectionFailed()
{
// this is only an error if we are already connected and something goes wrong.
if (isConnected()) {
- showMessage(tr("QML Debugger: Connection failed."), StatusBar);
+ showMessage(Tr::tr("QML Debugger: Connection failed."), StatusBar);
notifyInferiorSpontaneousStop();
notifyInferiorIll();
} else {
@@ -2483,5 +2483,4 @@ DebuggerEngine *createQmlEngine()
return new QmlEngine;
}
-} // Internal
-} // Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/qml/qmlengine.h b/src/plugins/debugger/qml/qmlengine.h
index 100901fc25..7d0a8f3608 100644
--- a/src/plugins/debugger/qml/qmlengine.h
+++ b/src/plugins/debugger/qml/qmlengine.h
@@ -31,16 +31,13 @@
#include <qmldebug/qmloutputparser.h>
#include <qmljs/qmljsdocument.h>
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
class QmlEnginePrivate;
class QmlInspectorAgent;
class QmlEngine : public DebuggerEngine
{
- Q_OBJECT
-
public:
QmlEngine();
~QmlEngine() override;
@@ -137,5 +134,4 @@ private:
QmlEnginePrivate *d;
};
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/qml/qmlengineutils.cpp b/src/plugins/debugger/qml/qmlengineutils.cpp
index 3fe5c4c8dd..c70270dc2b 100644
--- a/src/plugins/debugger/qml/qmlengineutils.cpp
+++ b/src/plugins/debugger/qml/qmlengineutils.cpp
@@ -23,11 +23,10 @@
**
****************************************************************************/
-#include "qmlengine.h"
-
#include <qmljs/parser/qmljsast_p.h>
#include <qmljs/qmljsmodelmanagerinterface.h>
#include <debugger/console/console.h>
+#include <qmldebug/qdebugmessageclient.h>
#include <coreplugin/editormanager/documentmodel.h>
@@ -44,8 +43,7 @@ using namespace QmlJS;
using namespace QmlJS::AST;
using namespace TextEditor;
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
class ASTWalker : public Visitor
{
@@ -228,8 +226,6 @@ void appendDebugOutput(QtMsgType type, const QString &message, const QDebugConte
break;
}
- QTC_ASSERT(itemType != ConsoleItem::DefaultType, return);
-
debuggerConsole()->printItem(new ConsoleItem(itemType, message, info.file, info.line));
}
@@ -282,5 +278,4 @@ QStringList highlightExceptionCode(int lineNumber, const QString &filePath, cons
return messages;
}
-} // Internal
-} // Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/qml/qmlengineutils.h b/src/plugins/debugger/qml/qmlengineutils.h
index abb6c4c103..4a0f4f5fc8 100644
--- a/src/plugins/debugger/qml/qmlengineutils.h
+++ b/src/plugins/debugger/qml/qmlengineutils.h
@@ -28,13 +28,11 @@
#include <qmldebug/qdebugmessageclient.h>
#include <qmldebug/qmloutputparser.h>
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
void appendDebugOutput(QtMsgType type, const QString &message, const QmlDebug::QDebugContextInfo &info);
void clearExceptionSelection();
QStringList highlightExceptionCode(int lineNumber, const QString &filePath, const QString &errorMessage);
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/qml/qmlinspectoragent.cpp b/src/plugins/debugger/qml/qmlinspectoragent.cpp
index 3aa668c78d..7731730bcc 100644
--- a/src/plugins/debugger/qml/qmlinspectoragent.cpp
+++ b/src/plugins/debugger/qml/qmlinspectoragent.cpp
@@ -31,6 +31,7 @@
#include <debugger/debuggerengine.h>
#include <debugger/debuggerinternalconstants.h>
#include <debugger/debuggerruncontrol.h>
+#include <debugger/debuggertr.h>
#include <debugger/watchhandler.h>
#include <coreplugin/actionmanager/actionmanager.h>
@@ -55,8 +56,7 @@
using namespace QmlDebug;
using namespace QmlDebug::Constants;
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
static Q_LOGGING_CATEGORY(qmlInspectorLog, "qtc.dbg.qmlinspector", QtWarningMsg)
@@ -231,7 +231,7 @@ void QmlInspectorAgent::onResult(quint32 queryId, const QVariant &value,
|| type == "RESET_BINDING_R"
|| type == "SET_METHOD_BODY_R") {
// FIXME: This is not supported anymore.
- QString msg = type + tr("Success:");
+ QString msg = type + Tr::tr("Success:");
msg += ' ';
msg += value.toBool() ? '1' : '0';
// if (!value.toBool())
@@ -608,7 +608,7 @@ void QmlInspectorAgent::addWatchData(const ObjectReference &obj,
}
if (name.isEmpty())
- name = tr("<anonymous>");
+ name = Tr::tr("<anonymous>");
// object
auto objWatch = new WatchItem;
@@ -644,7 +644,7 @@ void QmlInspectorAgent::addWatchData(const ObjectReference &obj,
QString iname = objIname + ".[properties]";
auto propertiesWatch = new WatchItem;
propertiesWatch->iname = iname;
- propertiesWatch->name = tr("Properties");
+ propertiesWatch->name = Tr::tr("Properties");
propertiesWatch->id = objDebugId;
propertiesWatch->value = "list";
propertiesWatch->wantsChildren = true;
@@ -780,5 +780,4 @@ void QmlInspectorAgent::onReloaded()
reloadEngines();
}
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/qml/qmlinspectoragent.h b/src/plugins/debugger/qml/qmlinspectoragent.h
index 4ee2e60d9e..154db78cf2 100644
--- a/src/plugins/debugger/qml/qmlinspectoragent.h
+++ b/src/plugins/debugger/qml/qmlinspectoragent.h
@@ -41,16 +41,13 @@ class FileReference;
class QmlDebugConnection;
}
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
class DebuggerEngine;
class QmlEngine;
class QmlInspectorAgent : public QObject
{
- Q_OBJECT
-
public:
QmlInspectorAgent(QmlEngine *engine, QmlDebug::QmlDebugConnection *connection);
@@ -129,5 +126,4 @@ private:
QAction *m_showAppOnTopAction = nullptr;
};
-} // Internal
-} // Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/registerhandler.cpp b/src/plugins/debugger/registerhandler.cpp
index 1dbafd23f3..b79be3a88d 100644
--- a/src/plugins/debugger/registerhandler.cpp
+++ b/src/plugins/debugger/registerhandler.cpp
@@ -26,13 +26,13 @@
#include "registerhandler.h"
#include "debuggerengine.h"
-#include "watchdelegatewidgets.h"
#include "memoryagent.h"
#include "debuggeractions.h"
#include "debuggerdialogs.h"
#include "debuggercore.h"
#include "debuggerengine.h"
+#include "debuggertr.h"
#include <utils/basetreeview.h>
#include <utils/qtcassert.h>
@@ -44,8 +44,7 @@
using namespace Utils;
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
enum RegisterColumns
{
@@ -582,20 +581,20 @@ QVariant RegisterSubItem::data(int column, int role) const
case Qt::ToolTipRole:
if (m_subKind == IntegerRegister) {
if (m_subFormat == CharacterFormat)
- return RegisterHandler::tr("Content as ASCII Characters");
+ return Tr::tr("Content as ASCII Characters");
if (m_subFormat == SignedDecimalFormat)
- return RegisterHandler::tr("Content as %1-bit Signed Decimal Values").arg(8 * m_subSize);
+ return Tr::tr("Content as %1-bit Signed Decimal Values").arg(8 * m_subSize);
if (m_subFormat == DecimalFormat)
- return RegisterHandler::tr("Content as %1-bit Unsigned Decimal Values").arg(8 * m_subSize);
+ return Tr::tr("Content as %1-bit Unsigned Decimal Values").arg(8 * m_subSize);
if (m_subFormat == HexadecimalFormat)
- return RegisterHandler::tr("Content as %1-bit Hexadecimal Values").arg(8 * m_subSize);
+ return Tr::tr("Content as %1-bit Hexadecimal Values").arg(8 * m_subSize);
if (m_subFormat == OctalFormat)
- return RegisterHandler::tr("Content as %1-bit Octal Values").arg(8 * m_subSize);
+ return Tr::tr("Content as %1-bit Octal Values").arg(8 * m_subSize);
if (m_subFormat == BinaryFormat)
- return RegisterHandler::tr("Content as %1-bit Binary Values").arg(8 * m_subSize);
+ return Tr::tr("Content as %1-bit Binary Values").arg(8 * m_subSize);
}
if (m_subKind == FloatRegister)
- return RegisterHandler::tr("Content as %1-bit Floating Point Values").arg(8 * m_subSize);
+ return Tr::tr("Content as %1-bit Floating Point Values").arg(8 * m_subSize);
default:
break;
@@ -643,7 +642,7 @@ QVariant RegisterGroup::data(int column, int role) const
break;
case Qt::ToolTipRole:
- return RegisterHandler::tr("A group of registers.");
+ return Tr::tr("A group of registers.");
default:
break;
@@ -692,7 +691,7 @@ RegisterHandler::RegisterHandler(DebuggerEngine *engine)
: m_engine(engine)
{
setObjectName("RegisterModel");
- setHeader({tr("Name"), tr("Value")});
+ setHeader({Tr::tr("Name"), Tr::tr("Value")});
}
void RegisterHandler::updateRegister(const Register &r)
@@ -764,16 +763,16 @@ bool RegisterHandler::contextMenuEvent(const ItemViewEvent &ev)
auto menu = new QMenu;
- addAction(this, menu, tr("Reload Register Listing"),
+ addAction(this, menu, Tr::tr("Reload Register Listing"),
m_engine->hasCapability(RegisterCapability)
&& (state == InferiorStopOk || state == InferiorUnrunnable),
[this] { m_engine->reloadRegisters(); });
menu->addSeparator();
- addAction(this, menu, tr("Open Memory View at Value of Register %1 0x%2")
+ addAction(this, menu, Tr::tr("Open Memory View at Value of Register %1 0x%2")
.arg(registerName).arg(address, 0, 16),
- tr("Open Memory View at Value of Register"),
+ Tr::tr("Open Memory View at Value of Register"),
address,
[this, registerName, address] {
MemoryViewSetupData data;
@@ -784,8 +783,8 @@ bool RegisterHandler::contextMenuEvent(const ItemViewEvent &ev)
m_engine->openMemoryView(data);
});
- addAction(this, menu, tr("Open Memory Editor at 0x%1").arg(address, 0, 16),
- tr("Open Memory Editor"),
+ addAction(this, menu, Tr::tr("Open Memory Editor at 0x%1").arg(address, 0, 16),
+ Tr::tr("Open Memory Editor"),
address && actionsEnabled && m_engine->hasCapability(ShowMemoryCapability),
[this, registerName, address] {
MemoryViewSetupData data;
@@ -796,12 +795,12 @@ bool RegisterHandler::contextMenuEvent(const ItemViewEvent &ev)
m_engine->openMemoryView(data);
});
- addAction(this, menu, tr("Open Disassembler at 0x%1").arg(address, 0, 16),
- tr("Open Disassembler"),
+ addAction(this, menu, Tr::tr("Open Disassembler at 0x%1").arg(address, 0, 16),
+ Tr::tr("Open Disassembler"),
address && m_engine->hasCapability(DisassemblerCapability),
[this, address] { m_engine->openDisassemblerView(Location(address)); });
- addAction(this, menu, tr("Open Disassembler..."),
+ addAction(this, menu, Tr::tr("Open Disassembler..."),
m_engine->hasCapability(DisassemblerCapability),
[this, address] {
AddressDialog dialog;
@@ -829,10 +828,10 @@ bool RegisterHandler::contextMenuEvent(const ItemViewEvent &ev)
});
};
- addFormatAction(tr("Hexadecimal"), HexadecimalFormat);
- addFormatAction(tr("Decimal"), DecimalFormat);
- addFormatAction(tr("Octal"), OctalFormat);
- addFormatAction(tr("Binary"), BinaryFormat);
+ addFormatAction(Tr::tr("Hexadecimal"), HexadecimalFormat);
+ addFormatAction(Tr::tr("Decimal"), DecimalFormat);
+ addFormatAction(Tr::tr("Octal"), OctalFormat);
+ addFormatAction(Tr::tr("Binary"), BinaryFormat);
menu->addAction(debuggerSettings()->settingsDialog.action());
connect(menu, &QMenu::aboutToHide, menu, &QObject::deleteLater);
@@ -874,7 +873,7 @@ QVariant RegisterEditItem::data(int column, int role) const
break;
case Qt::ToolTipRole: {
RegisterItem *registerItem = parent()->parent();
- return RegisterHandler::tr("Edit bits %1...%2 of register %3")
+ return Tr::tr("Edit bits %1...%2 of register %3")
.arg(m_index * 8).arg(m_index * 8 + 7).arg(registerItem->m_reg.name);
}
default:
@@ -908,5 +907,4 @@ Qt::ItemFlags RegisterEditItem::flags(int column) const
return f;
}
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/registerhandler.h b/src/plugins/debugger/registerhandler.h
index 0d1f92e340..0d3234479e 100644
--- a/src/plugins/debugger/registerhandler.h
+++ b/src/plugins/debugger/registerhandler.h
@@ -32,8 +32,7 @@
namespace Utils { class ItemViewEvent; }
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
class DebuggerEngine;
@@ -134,5 +133,4 @@ private:
DebuggerEngine * const m_engine;
};
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/shared/cdbsymbolpathlisteditor.cpp b/src/plugins/debugger/shared/cdbsymbolpathlisteditor.cpp
index 9fb662bc4e..212c5d3ead 100644
--- a/src/plugins/debugger/shared/cdbsymbolpathlisteditor.cpp
+++ b/src/plugins/debugger/shared/cdbsymbolpathlisteditor.cpp
@@ -25,26 +25,26 @@
#include "cdbsymbolpathlisteditor.h"
+#include "debuggertr.h"
+#include "symbolpathsdialog.h"
+
#include <coreplugin/icore.h>
#include <coreplugin/messagebox.h>
-#include <utils/pathchooser.h>
#include <utils/checkablemessagebox.h>
+#include <utils/pathchooser.h>
#include <utils/temporarydirectory.h>
-#include "symbolpathsdialog.h"
-
+#include <QAction>
#include <QCheckBox>
#include <QDebug>
-#include <QAction>
#include <QFormLayout>
#include <QLabel>
#include <QPushButton>
using namespace Utils;
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
// Internal helper dialog prompting for a cache directory using a PathChooser.
//
@@ -55,8 +55,6 @@ namespace Internal {
class CacheDirectoryDialog : public QDialog
{
- Q_DECLARE_TR_FUNCTIONS(Debugger::Internal::CaheDirectoryDialog)
-
public:
explicit CacheDirectoryDialog(QWidget *parent);
@@ -74,14 +72,14 @@ CacheDirectoryDialog::CacheDirectoryDialog(QWidget *parent) :
QDialog(parent), m_chooser(new PathChooser),
m_buttonBox(new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel))
{
- setWindowTitle(tr("Select Local Cache Folder"));
+ setWindowTitle(Tr::tr("Select Local Cache Folder"));
setModal(true);
auto formLayout = new QFormLayout;
m_chooser->setExpectedKind(PathChooser::ExistingDirectory);
m_chooser->setHistoryCompleter("Debugger.CdbCacheDir.History");
m_chooser->setMinimumWidth(400);
- formLayout->addRow(tr("Path:"), m_chooser);
+ formLayout->addRow(Tr::tr("Path:"), m_chooser);
auto mainLayout = new QVBoxLayout;
mainLayout->addLayout(formLayout);
@@ -109,14 +107,14 @@ void CacheDirectoryDialog::accept()
}
// Does a file of the same name exist?
if (cache.exists()) {
- Core::AsynchronousMessageBox::warning(tr("Already Exists"),
- tr("A file named \"%1\" already exists.").arg(cache.toUserOutput()));
+ Core::AsynchronousMessageBox::warning(Tr::tr("Already Exists"),
+ Tr::tr("A file named \"%1\" already exists.").arg(cache.toUserOutput()));
return;
}
// Create
if (!cache.ensureWritableDir()) {
- Core::AsynchronousMessageBox::warning(tr("Cannot Create"),
- tr("The folder \"%1\" could not be created.").arg(cache.toUserOutput()));
+ Core::AsynchronousMessageBox::warning(Tr::tr("Cannot Create"),
+ Tr::tr("The folder \"%1\" could not be created.").arg(cache.toUserOutput()));
return;
}
QDialog::accept();
@@ -133,21 +131,21 @@ CdbSymbolPathListEditor::CdbSymbolPathListEditor(QWidget *parent) :
PathListEditor(parent)
{
QPushButton *button = insertButton(lastInsertButtonIndex + 1,
- tr("Insert Symbol Server..."), this, [this](){
+ Tr::tr("Insert Symbol Server..."), this, [this] {
addSymbolPath(SymbolServerPath);
});
- button->setToolTip(tr("Adds the Microsoft symbol server providing symbols for operating system "
- "libraries. Requires specifying a local cache directory."));
+ button->setToolTip(Tr::tr("Adds the Microsoft symbol server providing symbols for operating system "
+ "libraries. Requires specifying a local cache directory."));
- button = insertButton(lastInsertButtonIndex + 1, tr("Insert Symbol Cache..."), this, [this]() {
+ button = insertButton(lastInsertButtonIndex + 1, Tr::tr("Insert Symbol Cache..."), this, [this] {
addSymbolPath(SymbolCachePath);
});
- button->setToolTip(tr("Uses a directory to cache symbols used by the debugger."));
+ button->setToolTip(Tr::tr("Uses a directory to cache symbols used by the debugger."));
- button = insertButton(lastInsertButtonIndex + 1, tr("Set up Symbol Paths..."), this, [this](){
+ button = insertButton(lastInsertButtonIndex + 1, Tr::tr("Set up Symbol Paths..."), this, [this] {
setupSymbolPaths();
});
- button->setToolTip(tr("Configure Symbol paths that are used to locate debug symbol files."));
+ button->setToolTip(Tr::tr("Configure Symbol paths that are used to locate debug symbol files."));
}
bool CdbSymbolPathListEditor::promptCacheDirectory(QWidget *parent, FilePath *cacheDirectory)
@@ -252,5 +250,4 @@ int CdbSymbolPathListEditor::indexOfSymbolPath(const QStringList &paths,
return -1;
}
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/shared/cdbsymbolpathlisteditor.h b/src/plugins/debugger/shared/cdbsymbolpathlisteditor.h
index f7dffcdda0..3e02d7c627 100644
--- a/src/plugins/debugger/shared/cdbsymbolpathlisteditor.h
+++ b/src/plugins/debugger/shared/cdbsymbolpathlisteditor.h
@@ -29,8 +29,7 @@
namespace Utils { class FilePath; }
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
// Internal helper dialog prompting for a cache directory
// using a PathChooser.
@@ -41,7 +40,6 @@ namespace Internal {
class CdbSymbolPathListEditor : public Utils::PathListEditor
{
- Q_OBJECT
public:
enum SymbolPathMode{
SymbolServerPath,
@@ -66,5 +64,4 @@ private:
void setupSymbolPaths();
};
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/shared/symbolpathsdialog.cpp b/src/plugins/debugger/shared/symbolpathsdialog.cpp
index 379f01ecb6..0ebbf3ff8c 100644
--- a/src/plugins/debugger/shared/symbolpathsdialog.cpp
+++ b/src/plugins/debugger/shared/symbolpathsdialog.cpp
@@ -25,6 +25,8 @@
#include "symbolpathsdialog.h"
+#include "debuggertr.h"
+
#include <QDialogButtonBox>
#include <QHBoxLayout>
#include <QMessageBox>
@@ -32,13 +34,12 @@
using namespace Utils;
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
SymbolPathsDialog::SymbolPathsDialog(QWidget *parent) :
QDialog(parent)
{
- setWindowTitle(tr("Set up Symbol Paths", nullptr));
+ setWindowTitle(Tr::tr("Set up Symbol Paths", nullptr));
m_pixmapLabel = new QLabel(this);
m_pixmapLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
@@ -46,7 +47,7 @@ SymbolPathsDialog::SymbolPathsDialog(QWidget *parent) :
m_pixmapLabel->setMargin(5);
m_pixmapLabel->setPixmap(QMessageBox::standardIcon(QMessageBox::Question));
- m_msgLabel = new QLabel(tr("<html><head/><body><p>The debugger is not configured to use the "
+ m_msgLabel = new QLabel(Tr::tr("<html><head/><body><p>The debugger is not configured to use the "
"public Microsoft Symbol Server.<br/>This is recommended for retrieval of the symbols "
"of the operating system libraries.</p>"
"<p><span style=\" font-style:italic;\">Note:</span> It is recommended, that if you use "
@@ -58,9 +59,9 @@ SymbolPathsDialog::SymbolPathsDialog(QWidget *parent) :
m_msgLabel->setTextFormat(Qt::RichText);
m_msgLabel->setAlignment(Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop);
- m_useLocalSymbolCache = new QCheckBox(tr("Use Local Symbol Cache"));
+ m_useLocalSymbolCache = new QCheckBox(Tr::tr("Use Local Symbol Cache"));
- m_useSymbolServer = new QCheckBox(tr("Use Microsoft Symbol Server"));
+ m_useSymbolServer = new QCheckBox(Tr::tr("Use Microsoft Symbol Server"));
m_pathChooser = new PathChooser;
@@ -130,5 +131,4 @@ bool SymbolPathsDialog::useCommonSymbolPaths(bool &useSymbolCache,
return ret == QDialog::Accepted;
}
-} // Internal
-} // Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/shared/symbolpathsdialog.h b/src/plugins/debugger/shared/symbolpathsdialog.h
index 1619de0193..408e0f352e 100644
--- a/src/plugins/debugger/shared/symbolpathsdialog.h
+++ b/src/plugins/debugger/shared/symbolpathsdialog.h
@@ -36,8 +36,6 @@ namespace Debugger::Internal {
class SymbolPathsDialog : public QDialog
{
- Q_OBJECT
-
public:
explicit SymbolPathsDialog(QWidget *parent = nullptr);
~SymbolPathsDialog() override;
diff --git a/src/plugins/debugger/simplifytype.cpp b/src/plugins/debugger/simplifytype.cpp
index dce3be83bd..1e01c4ae28 100644
--- a/src/plugins/debugger/simplifytype.cpp
+++ b/src/plugins/debugger/simplifytype.cpp
@@ -35,8 +35,7 @@
#define QTC_ASSERT_STRING(cond) qDebug("SOFT ASSERT: \"" cond"\" in file " __FILE__ ", line " QTC_ASSERT_STRINGIFY(__LINE__))
#define QTC_ASSERT(cond, action) if (cond) {} else { QTC_ASSERT_STRING(#cond); action; } do {} while (0)
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
// Simplify complicated STL template types,
// such as 'std::basic_string<char,std::char_traits<char>,std::allocator<char> >'
@@ -316,5 +315,4 @@ QString simplifyType(const QString &typeIn)
return type;
}
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/simplifytype.h b/src/plugins/debugger/simplifytype.h
index ac4f981dcc..3eec6ee6d2 100644
--- a/src/plugins/debugger/simplifytype.h
+++ b/src/plugins/debugger/simplifytype.h
@@ -27,13 +27,11 @@
#include <QString>
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
// Simplify complicated STL template types, such as
// 'std::basic_string<char,std::char_traits<char>,std::allocator<char> > '->
// 'std::string'.
QString simplifyType(const QString &typeIn);
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/sourceagent.cpp b/src/plugins/debugger/sourceagent.cpp
index 02bddf6bfa..dd5dc9c5c9 100644
--- a/src/plugins/debugger/sourceagent.cpp
+++ b/src/plugins/debugger/sourceagent.cpp
@@ -50,8 +50,7 @@
using namespace Core;
using namespace TextEditor;
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
class SourceAgentPrivate
{
@@ -151,5 +150,4 @@ void SourceAgent::updateLocationMarker()
}
}
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/sourceagent.h b/src/plugins/debugger/sourceagent.h
index 592d8ce66a..98666d73f2 100644
--- a/src/plugins/debugger/sourceagent.h
+++ b/src/plugins/debugger/sourceagent.h
@@ -27,11 +27,9 @@
#include <QString>
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
class DebuggerEngine;
-class SourceAgentPrivate;
class SourceAgent
{
@@ -42,9 +40,9 @@ public:
void resetLocation();
void setContent(const QString &name, const QString &content);
void updateLocationMarker();
+
private:
- SourceAgentPrivate *d;
+ class SourceAgentPrivate *d;
};
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/sourcefileshandler.cpp b/src/plugins/debugger/sourcefileshandler.cpp
index 53ae125ba7..26248c55a1 100644
--- a/src/plugins/debugger/sourcefileshandler.cpp
+++ b/src/plugins/debugger/sourcefileshandler.cpp
@@ -26,8 +26,8 @@
#include "sourcefileshandler.h"
#include "debuggeractions.h"
-#include "debuggercore.h"
#include "debuggerengine.h"
+#include "debuggertr.h"
#include <utils/basetreeview.h>
@@ -38,8 +38,7 @@
using namespace Utils;
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
SourceFilesHandler::SourceFilesHandler(DebuggerEngine *engine)
: m_engine(engine)
@@ -66,8 +65,8 @@ QVariant SourceFilesHandler::headerData(int section,
{
if (orientation == Qt::Horizontal && role == Qt::DisplayRole) {
static QString headers[] = {
- tr("Internal Name") + " ",
- tr("Full Name") + " ",
+ Tr::tr("Internal Name") + " ",
+ Tr::tr("Full Name") + " ",
};
return headers[section];
}
@@ -128,13 +127,13 @@ bool SourceFilesHandler::setData(const QModelIndex &idx, const QVariant &data, i
return act;
};
- addAction(tr("Reload Data"), m_engine->debuggerActionsEnabled(),
+ addAction(Tr::tr("Reload Data"), m_engine->debuggerActionsEnabled(),
[this] { m_engine->reloadSourceFiles(); });
if (name.isEmpty())
- addAction(tr("Open File"), false, {});
+ addAction(Tr::tr("Open File"), false, {});
else
- addAction(tr("Open File \"%1\"").arg(name), true,
+ addAction(Tr::tr("Open File \"%1\"").arg(name), true,
[this, name] { m_engine->gotoLocation(FilePath::fromString(name)); });
menu->addAction(debuggerSettings()->settingsDialog.action());
@@ -166,5 +165,4 @@ void SourceFilesHandler::removeAll()
//header()->setSectionResizeMode(0, QHeaderView::ResizeToContents);
}
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/sourcefileshandler.h b/src/plugins/debugger/sourcefileshandler.h
index 54879fcd68..a04c837d1d 100644
--- a/src/plugins/debugger/sourcefileshandler.h
+++ b/src/plugins/debugger/sourcefileshandler.h
@@ -28,15 +28,12 @@
#include <QAbstractItemModel>
#include <QStringList>
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
class DebuggerEngine;
class SourceFilesHandler : public QAbstractItemModel
{
- Q_OBJECT
-
public:
explicit SourceFilesHandler(DebuggerEngine *engine);
@@ -66,5 +63,4 @@ private:
QAbstractItemModel *m_proxyModel;
};
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/sourceutils.cpp b/src/plugins/debugger/sourceutils.cpp
index e13c1afe60..951fd600c8 100644
--- a/src/plugins/debugger/sourceutils.cpp
+++ b/src/plugins/debugger/sourceutils.cpp
@@ -134,8 +134,7 @@ QDebug operator<<(QDebug d, const Scope &scope)
} // namespace CPlusPlus
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
/* getUninitializedVariables(): Get variables that are not initialized
* at a certain line of a function from the code model to be able to
@@ -439,5 +438,4 @@ void setValueAnnotations(const Location &loc, const QMap<QString, QString> &valu
}
}
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/sourceutils.h b/src/plugins/debugger/sourceutils.h
index 0487c35435..f6a96c5e66 100644
--- a/src/plugins/debugger/sourceutils.h
+++ b/src/plugins/debugger/sourceutils.h
@@ -36,8 +36,7 @@ class TextEditorWidget;
namespace Utils { class FilePath; }
namespace CPlusPlus { class Snapshot; }
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
class ContextData;
class Location;
@@ -59,5 +58,4 @@ ContextData getLocationContext(TextEditor::TextDocument *document, int lineNumbe
void setValueAnnotations(const Location &loc, const QMap<QString, QString> &values);
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/stackframe.cpp b/src/plugins/debugger/stackframe.cpp
index d223d686da..0c5d2f716b 100644
--- a/src/plugins/debugger/stackframe.cpp
+++ b/src/plugins/debugger/stackframe.cpp
@@ -27,6 +27,7 @@
#include "debuggerengine.h"
#include "debuggerprotocol.h"
+#include "debuggertr.h"
#include "watchutils.h"
#include <QDebug>
@@ -37,8 +38,7 @@
using namespace Utils;
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
////////////////////////////////////////////////////////////////////////
//
@@ -67,16 +67,16 @@ QString StackFrame::toString() const
{
QString res;
QTextStream str(&res);
- str << tr("Address:") << ' ';
+ str << Tr::tr("Address:") << ' ';
str.setIntegerBase(16);
str << address;
str.setIntegerBase(10);
str << ' '
- << tr("Function:") << ' ' << function << ' '
- << tr("File:") << ' ' << file << ' '
- << tr("Line:") << ' ' << line << ' '
- << tr("From:") << ' ' << module << ' '
- << tr("To:") << ' ' << receiver;
+ << Tr::tr("Function:") << ' ' << function << ' '
+ << Tr::tr("File:") << ' ' << file << ' '
+ << Tr::tr("Line:") << ' ' << line << ' '
+ << Tr::tr("From:") << ' ' << module << ' '
+ << Tr::tr("To:") << ' ' << receiver;
return res;
}
@@ -121,40 +121,40 @@ QString StackFrame::toToolTip() const
QTextStream str(&res);
str << "<html><body><table>";
if (address)
- str << "<tr><td>" << tr("Address:") << "</td><td>"
+ str << "<tr><td>" << Tr::tr("Address:") << "</td><td>"
<< formatToolTipAddress(address) << "</td></tr>";
if (!function.isEmpty())
str << "<tr><td>"
- << (language == CppLanguage ? tr("Function:") : tr("JS-Function:"))
+ << (language == CppLanguage ? Tr::tr("Function:") : Tr::tr("JS-Function:"))
<< "</td><td>" << function << "</td></tr>";
if (!file.isEmpty())
- str << "<tr><td>" << tr("File:") << "</td><td>" << filePath << "</td></tr>";
+ str << "<tr><td>" << Tr::tr("File:") << "</td><td>" << filePath << "</td></tr>";
if (line != -1)
- str << "<tr><td>" << tr("Line:") << "</td><td>" << line << "</td></tr>";
+ str << "<tr><td>" << Tr::tr("Line:") << "</td><td>" << line << "</td></tr>";
if (!module.isEmpty())
- str << "<tr><td>" << tr("Module:") << "</td><td>" << module << "</td></tr>";
+ str << "<tr><td>" << Tr::tr("Module:") << "</td><td>" << module << "</td></tr>";
if (!receiver.isEmpty())
- str << "<tr><td>" << tr("Receiver:") << "</td><td>" << receiver << "</td></tr>";
+ str << "<tr><td>" << Tr::tr("Receiver:") << "</td><td>" << receiver << "</td></tr>";
str << "</table>";
- str <<"<br> <br><i>" << tr("Note:") << " </i> ";
+ str <<"<br> <br><i>" << Tr::tr("Note:") << " </i> ";
bool showDistributionNote = false;
if (isUsable()) {
- str << tr("Sources for this frame are available.<br>Double-click on "
+ str << Tr::tr("Sources for this frame are available.<br>Double-click on "
"the file name to open an editor.");
} else if (line <= 0) {
- str << tr("Binary debug information is not accessible for this "
+ str << Tr::tr("Binary debug information is not accessible for this "
"frame. This either means the core was not compiled "
"with debug information, or the debug information is not "
"accessible.");
showDistributionNote = true;
} else {
- str << tr("Binary debug information is accessible for this "
+ str << Tr::tr("Binary debug information is accessible for this "
"frame. However, matching sources have not been found.");
showDistributionNote = true;
}
if (file.osType() != OsTypeWindows && showDistributionNote) {
- str << ' ' << tr("Note that most distributions ship debug information "
+ str << ' ' << Tr::tr("Note that most distributions ship debug information "
"in separate packages.");
}
@@ -218,5 +218,4 @@ QDebug operator<<(QDebug d, const StackFrame &f)
return d;
}
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/stackframe.h b/src/plugins/debugger/stackframe.h
index 9fd83a15e7..16ef932af7 100644
--- a/src/plugins/debugger/stackframe.h
+++ b/src/plugins/debugger/stackframe.h
@@ -29,15 +29,9 @@
#include <utils/filepath.h>
-#include <QCoreApplication>
#include <QMetaType>
-QT_BEGIN_NAMESPACE
-class QDebug;
-QT_END_NAMESPACE
-
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
class DebuggerRunParameters;
class GdbMi;
@@ -65,13 +59,10 @@ public:
quint64 address = 0;
bool usable = false;
QString context; // Opaque value produced and consumed by the native backends.
-
- Q_DECLARE_TR_FUNCTIONS(Debugger::Internal::StackHandler)
};
using StackFrames = QList<StackFrame>;
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Internal
Q_DECLARE_METATYPE(Debugger::Internal::StackFrame)
diff --git a/src/plugins/debugger/stackhandler.cpp b/src/plugins/debugger/stackhandler.cpp
index 4001b85448..38c1013074 100644
--- a/src/plugins/debugger/stackhandler.cpp
+++ b/src/plugins/debugger/stackhandler.cpp
@@ -31,6 +31,7 @@
#include "debuggerengine.h"
#include "debuggericons.h"
#include "debuggerprotocol.h"
+#include "debuggertr.h"
#include "memoryagent.h"
#include "simplifytype.h"
@@ -54,8 +55,7 @@
using namespace Utils;
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
/*!
\class Debugger::Internal::StackHandler
@@ -67,7 +67,7 @@ StackHandler::StackHandler(DebuggerEngine *engine)
: m_engine(engine)
{
setObjectName("StackModel");
- setHeader({tr("Level"), tr("Function"), tr("File"), tr("Line"), tr("Address") });
+ setHeader({Tr::tr("Level"), Tr::tr("Function"), Tr::tr("File"), Tr::tr("Line"), Tr::tr("Address") });
connect(debuggerSettings()->expandStack.action(), &QAction::triggered,
this, &StackHandler::reloadFullStack);
@@ -83,9 +83,9 @@ StackHandler::~StackHandler() = default;
QVariant SpecialStackItem::data(int column, int role) const
{
if (role == Qt::DisplayRole && column == StackLevelColumn)
- return StackHandler::tr("...");
+ return Tr::tr("...");
if (role == Qt::DisplayRole && column == StackFunctionNameColumn)
- return StackHandler::tr("<More>");
+ return Tr::tr("<More>");
if (role == Qt::DecorationRole && column == StackLevelColumn)
return Icons::EMPTY.icon();
return QVariant();
@@ -334,8 +334,8 @@ static StackFrame inputFunctionForDisassembly()
StackFrame frame;
QInputDialog dialog;
dialog.setInputMode(QInputDialog::TextInput);
- dialog.setLabelText(StackHandler::tr("Function:"));
- dialog.setWindowTitle(StackHandler::tr("Disassemble Function"));
+ dialog.setLabelText(Tr::tr("Function:"));
+ dialog.setWindowTitle(Tr::tr("Disassemble Function"));
if (dialog.exec() != QDialog::Accepted)
return frame;
const QString function = dialog.textValue();
@@ -422,9 +422,9 @@ void StackHandler::saveTaskFile()
const QString fileName = fileDialog.selectedFiles().constFirst();
file.setFileName(fileName);
if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) {
- QString msg = tr("Cannot open \"%1\": %2")
+ QString msg = Tr::tr("Cannot open \"%1\": %2")
.arg(QDir::toNativeSeparators(fileName), file.errorString());
- Core::AsynchronousMessageBox::warning(tr("Cannot Open Task File"), msg);
+ Core::AsynchronousMessageBox::warning(Tr::tr("Cannot Open Task File"), msg);
}
}
@@ -448,43 +448,43 @@ bool StackHandler::contextMenuEvent(const ItemViewEvent &ev)
menu->addAction(debuggerSettings()->expandStack.action());
- addAction(this, menu, tr("Copy Contents to Clipboard"), true, [ev] {
+ addAction(this, menu, Tr::tr("Copy Contents to Clipboard"), true, [ev] {
setClipboardAndSelection(selectedText(ev.view(), true));
});
- addAction(this, menu, tr("Copy Selection to Clipboard"), true, [ev] {
+ addAction(this, menu, Tr::tr("Copy Selection to Clipboard"), true, [ev] {
setClipboardAndSelection(selectedText(ev.view(), false));
});
- addAction(this, menu, tr("Save as Task File..."), true, [this] { saveTaskFile(); });
+ addAction(this, menu, Tr::tr("Save as Task File..."), true, [this] { saveTaskFile(); });
if (m_engine->hasCapability(CreateFullBacktraceCapability))
menu->addAction(debuggerSettings()->createFullBacktrace.action());
if (m_engine->hasCapability(AdditionalQmlStackCapability))
- addAction(this, menu, tr("Load QML Stack"), true, [this] { m_engine->loadAdditionalQmlStack(); });
+ addAction(this, menu, Tr::tr("Load QML Stack"), true, [this] { m_engine->loadAdditionalQmlStack(); });
if (m_engine->hasCapability(ShowMemoryCapability))
- addAction(this, menu, tr("Open Memory Editor at 0x%1").arg(address, 0, 16),
- tr("Open Memory Editor"),
+ addAction(this, menu, Tr::tr("Open Memory Editor at 0x%1").arg(address, 0, 16),
+ Tr::tr("Open Memory Editor"),
address,
[this, row, frame, address] {
MemoryViewSetupData data;
data.startAddress = address;
- data.title = tr("Memory at Frame #%1 (%2) 0x%3")
+ data.title = Tr::tr("Memory at Frame #%1 (%2) 0x%3")
.arg(row).arg(frame.function).arg(address, 0, 16);
data.markup.push_back(MemoryMarkup(address, 1, QColor(Qt::blue).lighter(),
- tr("Frame #%1 (%2)").arg(row).arg(frame.function)));
+ Tr::tr("Frame #%1 (%2)").arg(row).arg(frame.function)));
m_engine->openMemoryView(data);
});
if (m_engine->hasCapability(DisassemblerCapability)) {
- addAction(this, menu, tr("Open Disassembler at 0x%1").arg(address, 0, 16),
- tr("Open Disassembler"),
+ addAction(this, menu, Tr::tr("Open Disassembler at 0x%1").arg(address, 0, 16),
+ Tr::tr("Open Disassembler"),
address,
[this, frame] { m_engine->openDisassemblerView(frame); });
- addAction(this, menu, tr("Open Disassembler at Address..."), true,
+ addAction(this, menu, Tr::tr("Open Disassembler at Address..."), true,
[this, address] {
AddressDialog dialog;
if (address)
@@ -493,7 +493,7 @@ bool StackHandler::contextMenuEvent(const ItemViewEvent &ev)
m_engine->openDisassemblerView(Location(dialog.address()));
});
- addAction(this, menu, tr("Disassemble Function..."), true,
+ addAction(this, menu, Tr::tr("Disassemble Function..."), true,
[this] {
const StackFrame frame = inputFunctionForDisassembly();
if (!frame.function.isEmpty())
@@ -502,7 +502,7 @@ bool StackHandler::contextMenuEvent(const ItemViewEvent &ev)
}
if (m_engine->hasCapability(ShowModuleSymbolsCapability)) {
- addAction(this, menu, tr("Try to Load Unknown Symbols"), true,
+ addAction(this, menu, Tr::tr("Try to Load Unknown Symbols"), true,
[this] { m_engine->loadSymbolsForStack(); });
}
@@ -519,5 +519,4 @@ void StackHandler::reloadFullStack()
m_engine->reloadFullStack();
}
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/stackhandler.h b/src/plugins/debugger/stackhandler.h
index 0b38d8d49b..32a7e6d001 100644
--- a/src/plugins/debugger/stackhandler.h
+++ b/src/plugins/debugger/stackhandler.h
@@ -30,8 +30,7 @@
#include <utils/basetreeview.h>
#include <utils/treemodel.h>
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
class DebuggerEngine;
class StackHandler;
@@ -136,5 +135,4 @@ private:
bool m_contentsValid = false;
};
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/stackwindow.cpp b/src/plugins/debugger/stackwindow.cpp
index df71e361c6..4c8c9cce71 100644
--- a/src/plugins/debugger/stackwindow.cpp
+++ b/src/plugins/debugger/stackwindow.cpp
@@ -25,15 +25,12 @@
#include "stackwindow.h"
-#include "debuggeractions.h"
-#include "debuggercore.h"
#include "stackhandler.h"
#include <QAction>
#include <QHeaderView>
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
StackTreeView::StackTreeView(QWidget *parent)
: BaseTreeView(parent)
@@ -80,5 +77,4 @@ void StackTreeView::adjustForContents(bool refreshSpan)
m_contentsAdjusted = true;
}
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/stackwindow.h b/src/plugins/debugger/stackwindow.h
index 79f2974e82..08ada7fa5c 100644
--- a/src/plugins/debugger/stackwindow.h
+++ b/src/plugins/debugger/stackwindow.h
@@ -27,10 +27,7 @@
#include <utils/basetreeview.h>
-#include <QCoreApplication>
-
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
class StackTreeView : public Utils::BaseTreeView
{
@@ -46,5 +43,4 @@ private:
bool m_contentsAdjusted = false;
};
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/terminal.cpp b/src/plugins/debugger/terminal.cpp
index f2dd9b0b1d..07a04652d0 100644
--- a/src/plugins/debugger/terminal.cpp
+++ b/src/plugins/debugger/terminal.cpp
@@ -25,6 +25,8 @@
#include "terminal.h"
+#include "debuggertr.h"
+
#include <coreplugin/icore.h>
#include <projectexplorer/runconfiguration.h>
@@ -55,8 +57,7 @@ using namespace Core;
using namespace ProjectExplorer;
using namespace Utils;
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
static QString currentError()
{
@@ -77,13 +78,13 @@ void Terminal::setup()
m_masterFd = ::open("/dev/ptmx", O_RDWR);
if (m_masterFd < 0) {
- error(tr("Terminal: Cannot open /dev/ptmx: %1").arg(currentError()));
+ error(Tr::tr("Terminal: Cannot open /dev/ptmx: %1").arg(currentError()));
return;
}
const char *sName = ptsname(m_masterFd);
if (!sName) {
- error(tr("Terminal: ptsname failed: %1").arg(currentError()));
+ error(Tr::tr("Terminal: ptsname failed: %1").arg(currentError()));
return;
}
m_slaveName = sName;
@@ -91,11 +92,11 @@ void Terminal::setup()
struct stat s;
int r = ::stat(m_slaveName.constData(), &s);
if (r != 0) {
- error(tr("Terminal: Error: %1").arg(currentError()));
+ error(Tr::tr("Terminal: Error: %1").arg(currentError()));
return;
}
if (!S_ISCHR(s.st_mode)) {
- error(tr("Terminal: Slave is no character device."));
+ error(Tr::tr("Terminal: Slave is no character device."));
return;
}
@@ -105,13 +106,13 @@ void Terminal::setup()
r = grantpt(m_masterFd);
if (r != 0) {
- error(tr("Terminal: grantpt failed: %1").arg(currentError()));
+ error(Tr::tr("Terminal: grantpt failed: %1").arg(currentError()));
return;
}
r = unlockpt(m_masterFd);
if (r != 0) {
- error(tr("Terminal: unlock failed: %1").arg(currentError()));
+ error(Tr::tr("Terminal: unlock failed: %1").arg(currentError()));
return;
}
@@ -158,7 +159,7 @@ void Terminal::onSlaveReaderActivated(int fd)
ssize_t got = ::read(fd, buffer.data(), available);
int err = errno;
if (got < 0) {
- error(tr("Terminal: Read failed: %1").arg(QString::fromLatin1(strerror(err))));
+ error(Tr::tr("Terminal: Read failed: %1").arg(QString::fromLatin1(strerror(err))));
return;
}
buffer.resize(got);
@@ -235,6 +236,5 @@ void TerminalRunner::stubDone()
reportDone();
}
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/threadshandler.cpp b/src/plugins/debugger/threadshandler.cpp
index 07e9fb8ae3..d2155712e6 100644
--- a/src/plugins/debugger/threadshandler.cpp
+++ b/src/plugins/debugger/threadshandler.cpp
@@ -26,10 +26,10 @@
#include "threadshandler.h"
#include "debuggeractions.h"
-#include "debuggercore.h"
#include "debuggerengine.h"
#include "debuggericons.h"
#include "debuggerprotocol.h"
+#include "debuggertr.h"
#include "watchutils.h"
#include <utils/algorithm.h>
@@ -43,14 +43,7 @@
using namespace Utils;
-namespace Debugger {
-namespace Internal {
-
-////////////////////////////////////////////////////////////////////////
-//
-// ThreadItem
-//
-///////////////////////////////////////////////////////////////////////
+namespace Debugger::Internal {
// ThreadItem
@@ -86,25 +79,25 @@ QString ThreadItem::threadToolTip() const
QString rc;
QTextStream str(&rc);
str << "<html><head/><body><table>"
- << start << ThreadsHandler::tr("Thread&nbsp;id:")
+ << start << Tr::tr("Thread&nbsp;id:")
<< sep << threadData.id << end;
if (!threadData.targetId.isEmpty())
- str << start << ThreadsHandler::tr("Target&nbsp;id:")
+ str << start << Tr::tr("Target&nbsp;id:")
<< sep << threadData.targetId << end;
if (!threadData.groupId.isEmpty())
- str << start << ThreadsHandler::tr("Group&nbsp;id:")
+ str << start << Tr::tr("Group&nbsp;id:")
<< sep << threadData.groupId << end;
if (!threadData.name.isEmpty())
- str << start << ThreadsHandler::tr("Name:")
+ str << start << Tr::tr("Name:")
<< sep << threadData.name << end;
if (!threadData.state.isEmpty())
- str << start << ThreadsHandler::tr("State:")
+ str << start << Tr::tr("State:")
<< sep << threadData.state << end;
if (!threadData.core.isEmpty())
- str << start << ThreadsHandler::tr("Core:")
+ str << start << Tr::tr("Core:")
<< sep << threadData.core << end;
if (threadData.address) {
- str << start << ThreadsHandler::tr("Stopped&nbsp;at:") << sep;
+ str << start << Tr::tr("Stopped&nbsp;at:") << sep;
if (!threadData.function.isEmpty())
str << threadData.function << "<br>";
if (!threadData.fileName.isEmpty())
@@ -215,10 +208,9 @@ ThreadsHandler::ThreadsHandler(DebuggerEngine *engine)
: m_engine(engine)
{
setObjectName("ThreadsModel");
- setHeader({
- " " + tr("ID") + " ",
- tr("Address"), tr("Function"), tr("File"), tr("Line"), tr("State"),
- tr("Name"), tr("Target ID"), tr("Details"), tr("Core"),
+ setHeader({" " + Tr::tr("ID") + " ",
+ Tr::tr("Address"), Tr::tr("Function"), Tr::tr("File"), Tr::tr("Line"), Tr::tr("State"),
+ Tr::tr("Name"), Tr::tr("Target ID"), Tr::tr("Details"), Tr::tr("Core"),
});
}
@@ -419,5 +411,4 @@ QAbstractItemModel *ThreadsHandler::model()
return this;
}
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/threadshandler.h b/src/plugins/debugger/threadshandler.h
index e365c8e462..4df0cc2666 100644
--- a/src/plugins/debugger/threadshandler.h
+++ b/src/plugins/debugger/threadshandler.h
@@ -38,8 +38,7 @@
//
////////////////////////////////////////////////////////////////////////
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
class DebuggerEngine;
class GdbMi;
@@ -47,8 +46,6 @@ class ThreadsHandler;
class ThreadItem : public QObject, public Utils::TreeItem
{
- Q_OBJECT
-
public:
ThreadItem(const ThreadData &data = ThreadData());
@@ -73,8 +70,6 @@ using ThreadsHandlerModel = Utils::TreeModel<Utils::TypedTreeItem<ThreadItem>, T
class ThreadsHandler : public ThreadsHandlerModel
{
- Q_OBJECT
-
public:
explicit ThreadsHandler(DebuggerEngine *engine);
~ThreadsHandler();
@@ -109,5 +104,4 @@ private:
QPointer<QComboBox> m_comboBox;
};
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/unstartedappwatcherdialog.cpp b/src/plugins/debugger/unstartedappwatcherdialog.cpp
index 95c59eea5a..3a44d30c4d 100644
--- a/src/plugins/debugger/unstartedappwatcherdialog.cpp
+++ b/src/plugins/debugger/unstartedappwatcherdialog.cpp
@@ -27,6 +27,7 @@
#include "debuggeritem.h"
#include "debuggerkitinformation.h"
+#include "debuggertr.h"
#include <utils/pathchooser.h>
@@ -55,8 +56,7 @@
using namespace ProjectExplorer;
using namespace Utils;
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
static bool isLocal(RunConfiguration *runConfiguration)
{
@@ -89,7 +89,7 @@ static bool isLocal(RunConfiguration *runConfiguration)
UnstartedAppWatcherDialog::UnstartedAppWatcherDialog(QWidget *parent)
: QDialog(parent)
{
- setWindowTitle(tr("Attach to Process Not Yet Started"));
+ setWindowTitle(Tr::tr("Attach to Process Not Yet Started"));
m_kitChooser = new KitChooser(this);
m_kitChooser->setKitPredicate([](const Kit *k) {
@@ -114,7 +114,7 @@ UnstartedAppWatcherDialog::UnstartedAppWatcherDialog(QWidget *parent)
m_pathChooser->setHistoryCompleter("LocalExecutable", true);
m_pathChooser->setMinimumWidth(400);
- auto resetExecutable = new QPushButton(tr("Reset"));
+ auto resetExecutable = new QPushButton(Tr::tr("Reset"));
resetExecutable->setEnabled(false);
pathLayout->addWidget(m_pathChooser);
pathLayout->addWidget(resetExecutable);
@@ -130,14 +130,14 @@ UnstartedAppWatcherDialog::UnstartedAppWatcherDialog(QWidget *parent)
}
}
- m_hideOnAttachCheckBox = new QCheckBox(tr("Reopen dialog when application finishes"), this);
- m_hideOnAttachCheckBox->setToolTip(tr("Reopens this dialog when application finishes."));
+ m_hideOnAttachCheckBox = new QCheckBox(Tr::tr("Reopen dialog when application finishes"), this);
+ m_hideOnAttachCheckBox->setToolTip(Tr::tr("Reopens this dialog when application finishes."));
m_hideOnAttachCheckBox->setChecked(false);
m_hideOnAttachCheckBox->setVisible(true);
- m_continueOnAttachCheckBox = new QCheckBox(tr("Continue on attach"), this);
- m_continueOnAttachCheckBox->setToolTip(tr("Debugger does not stop the"
+ m_continueOnAttachCheckBox = new QCheckBox(Tr::tr("Continue on attach"), this);
+ m_continueOnAttachCheckBox->setToolTip(Tr::tr("Debugger does not stop the"
" application after attach."));
m_continueOnAttachCheckBox->setChecked(true);
@@ -147,15 +147,15 @@ UnstartedAppWatcherDialog::UnstartedAppWatcherDialog(QWidget *parent)
m_waitingLabel->setAlignment(Qt::AlignCenter);
auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Close, this);
- m_watchingPushButton = buttonBox->addButton(tr("Start Watching"), QDialogButtonBox::ActionRole);
+ m_watchingPushButton = buttonBox->addButton(Tr::tr("Start Watching"), QDialogButtonBox::ActionRole);
m_watchingPushButton->setCheckable(true);
m_watchingPushButton->setChecked(false);
m_watchingPushButton->setEnabled(false);
m_watchingPushButton->setDefault(true);
auto mainLayout = new QFormLayout(this);
- mainLayout->addRow(new QLabel(tr("Kit: "), this), m_kitChooser);
- mainLayout->addRow(new QLabel(tr("Executable: "), this), pathLayout);
+ mainLayout->addRow(new QLabel(Tr::tr("Kit: "), this), m_kitChooser);
+ mainLayout->addRow(new QLabel(Tr::tr("Executable: "), this), pathLayout);
mainLayout->addRow(m_hideOnAttachCheckBox);
mainLayout->addRow(m_continueOnAttachCheckBox);
mainLayout->addRow(m_waitingLabel);
@@ -244,7 +244,7 @@ void UnstartedAppWatcherDialog::pidFound(const ProcessInfo &p)
void UnstartedAppWatcherDialog::startStopWatching(bool start)
{
setWaitingState(start ? WatchingState : NotWatchingState);
- m_watchingPushButton->setText(start ? tr("Stop Watching") : tr("Start Watching"));
+ m_watchingPushButton->setText(start ? Tr::tr("Stop Watching") : Tr::tr("Start Watching"));
startStopTimer(start);
}
@@ -325,7 +325,7 @@ void UnstartedAppWatcherDialog::setWaitingState(UnstartedAppWacherState state)
{
switch (state) {
case InvalidWacherState:
- m_waitingLabel->setText(tr("Select valid executable."));
+ m_waitingLabel->setText(Tr::tr("Select valid executable."));
m_watchingPushButton->setEnabled(false);
m_watchingPushButton->setChecked(false);
m_pathChooser->setEnabled(true);
@@ -333,7 +333,7 @@ void UnstartedAppWatcherDialog::setWaitingState(UnstartedAppWacherState state)
break;
case NotWatchingState:
- m_waitingLabel->setText(tr("Not watching."));
+ m_waitingLabel->setText(Tr::tr("Not watching."));
m_watchingPushButton->setEnabled(true);
m_watchingPushButton->setChecked(false);
m_pathChooser->setEnabled(true);
@@ -341,7 +341,7 @@ void UnstartedAppWatcherDialog::setWaitingState(UnstartedAppWacherState state)
break;
case WatchingState:
- m_waitingLabel->setText(tr("Waiting for process to start..."));
+ m_waitingLabel->setText(Tr::tr("Waiting for process to start..."));
m_watchingPushButton->setEnabled(true);
m_watchingPushButton->setChecked(true);
m_pathChooser->setEnabled(false);
@@ -349,7 +349,7 @@ void UnstartedAppWatcherDialog::setWaitingState(UnstartedAppWacherState state)
break;
case FoundState:
- m_waitingLabel->setText(tr("Attach"));
+ m_waitingLabel->setText(Tr::tr("Attach"));
m_watchingPushButton->setEnabled(false);
m_watchingPushButton->setChecked(true);
m_pathChooser->setEnabled(false);
@@ -358,5 +358,4 @@ void UnstartedAppWatcherDialog::setWaitingState(UnstartedAppWacherState state)
}
}
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/unstartedappwatcherdialog.h b/src/plugins/debugger/unstartedappwatcherdialog.h
index 5186f304b5..7754b38a2f 100644
--- a/src/plugins/debugger/unstartedappwatcherdialog.h
+++ b/src/plugins/debugger/unstartedappwatcherdialog.h
@@ -42,8 +42,7 @@ class Kit;
namespace Utils { class PathChooser; }
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
class UnstartedAppWatcherDialog : public QDialog
{
@@ -93,5 +92,4 @@ private:
QTimer m_timer;
};
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/uvsc/uvscclient.cpp b/src/plugins/debugger/uvsc/uvscclient.cpp
index 50738d3377..f9a4e81205 100644
--- a/src/plugins/debugger/uvsc/uvscclient.cpp
+++ b/src/plugins/debugger/uvsc/uvscclient.cpp
@@ -24,7 +24,9 @@
****************************************************************************/
#include "uvscclient.h"
+
#include "uvscutils.h"
+#include "../debuggertr.h"
#include <QMutexLocker>
@@ -33,8 +35,7 @@
using namespace Utils;
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
constexpr int kMaximumAflmapSize = 65536;
constexpr int kMaximumTaskEnumsCount = 512;
@@ -155,8 +156,8 @@ void UvscClient::version(QString &uvscVersion, QString &uvsockVersion)
quint32 uvsc = 0;
quint32 uvsock = 0;
::UVSC_Version(&uvsc, &uvsock);
- uvscVersion = tr("%1.%2").arg(uvsc / 100).arg(uvsc % 100);
- uvsockVersion = tr("%1.%2").arg(uvsock / 100).arg(uvsock % 100);
+ uvscVersion = Tr::tr("%1.%2").arg(uvsc / 100).arg(uvsc % 100);
+ uvsockVersion = Tr::tr("%1.%2").arg(uvsock / 100).arg(uvsock % 100);
}
bool UvscClient::connectSession(qint32 uvscPort)
@@ -1087,7 +1088,7 @@ void UvscClient::setError(UvscError error, const QString &errorString)
reinterpret_cast<qint8 *>(buffer.data()),
buffer.size());
m_errorString = (st == UVSC_STATUS_SUCCESS)
- ? QString::fromLocal8Bit(buffer) : tr("Unknown error.");
+ ? QString::fromLocal8Bit(buffer) : Tr::tr("Unknown error.");
} else {
m_errorString = errorString;
}
@@ -1116,7 +1117,7 @@ void UvscClient::customEvent(QEvent *event)
bool UvscClient::checkConnection()
{
if (m_descriptor == -1) {
- setError(ConfigurationError, tr("Connection is not open."));
+ setError(ConfigurationError, Tr::tr("Connection is not open."));
return false;
}
return true;
@@ -1230,5 +1231,4 @@ bool UvscClient::executeCommand(const QString &cmd, QString &output)
return true;
}
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/uvsc/uvscclient.h b/src/plugins/debugger/uvsc/uvscclient.h
index 98b001ac4e..e6c9a65a57 100644
--- a/src/plugins/debugger/uvsc/uvscclient.h
+++ b/src/plugins/debugger/uvsc/uvscclient.h
@@ -40,8 +40,7 @@ struct BKRSP;
namespace Utils { class FilePath; }
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
// UvscClient
@@ -152,5 +151,4 @@ private:
QString m_errorString;
};
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/uvsc/uvscengine.cpp b/src/plugins/debugger/uvsc/uvscengine.cpp
index 6a6253c9dc..2f409cc031 100644
--- a/src/plugins/debugger/uvsc/uvscengine.cpp
+++ b/src/plugins/debugger/uvsc/uvscengine.cpp
@@ -28,6 +28,7 @@
#include <debugger/breakhandler.h>
#include <debugger/debuggercore.h>
+#include <debugger/debuggertr.h>
#include <debugger/disassembleragent.h>
#include <debugger/disassemblerlines.h>
#include <debugger/memoryagent.h>
@@ -56,8 +57,7 @@ using namespace Core;
using namespace ProjectExplorer;
using namespace Utils;
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
constexpr int kRootStackFrameLevel = 1;
@@ -104,24 +104,24 @@ void UvscEngine::setupEngine()
const QUrl channel(rp.remoteChannel);
const int port = channel.port();
if (port <= 0) {
- handleSetupFailure(tr("Internal error: Invalid TCP/IP port specified %1.")
+ handleSetupFailure(Tr::tr("Internal error: Invalid TCP/IP port specified %1.")
.arg(port));
return;
}
// Check for valid uVision executable.
if (rp.debugger.command.isEmpty()) {
- handleSetupFailure(tr("Internal error: No uVision executable specified."));
+ handleSetupFailure(Tr::tr("Internal error: No uVision executable specified."));
return;
} else if (!rp.debugger.command.executable().exists()) {
- handleSetupFailure(tr("Internal error: The specified uVision executable does not exist."));
+ handleSetupFailure(Tr::tr("Internal error: The specified uVision executable does not exist."));
return;
}
showMessage("UVSC: RESOLVING LIBRARY SYMBOLS...");
m_client.reset(new UvscClient(rp.debugger.command.executable().parentDir().toString()));
if (m_client->error() != UvscClient::NoError) {
- handleSetupFailure(tr("Internal error: Cannot resolve the library: %1.")
+ handleSetupFailure(Tr::tr("Internal error: Cannot resolve the library: %1.")
.arg(m_client->errorString()));
return;
} else {
@@ -129,7 +129,7 @@ void UvscEngine::setupEngine()
QString uvscVersion;
QString uvsockVersion;
m_client->version(uvscVersion, uvsockVersion);
- const QString msg = tr("UVSC Version: %1, UVSOCK Version: %2.")
+ const QString msg = Tr::tr("UVSC Version: %1, UVSOCK Version: %2.")
.arg(uvscVersion, uvsockVersion);
showMessage(msg, LogMisc);
@@ -152,7 +152,7 @@ void UvscEngine::setupEngine()
showMessage("UVSC: CONNECTING SESSION...");
if (!m_client->connectSession(port)) {
- handleSetupFailure(tr("Internal error: Cannot open the session: %1.")
+ handleSetupFailure(Tr::tr("Internal error: Cannot open the session: %1.")
.arg(m_client->errorString()));
return;
} else {
@@ -172,18 +172,18 @@ void UvscEngine::runEngine()
{
showMessage("UVSC: STARTING DEBUGGER...");
if (!m_client->startSession(true)) {
- showStatusMessage(tr("Internal error: Failed to start the debugger: %1")
+ showStatusMessage(Tr::tr("Internal error: Failed to start the debugger: %1")
.arg(m_client->errorString()));
notifyEngineRunFailed();
return;
} else {
showMessage("UVSC: DEBUGGER STARTED");
- showMessage(tr("Application started."), StatusBar);
+ showMessage(Tr::tr("Application started."), StatusBar);
}
// Initial attempt to set breakpoints.
- showStatusMessage(tr("Setting breakpoints..."));
- showMessage(tr("Setting breakpoints..."));
+ showStatusMessage(Tr::tr("Setting breakpoints..."));
+ showMessage(Tr::tr("Setting breakpoints..."));
BreakpointManager::claimBreakpointsForEngine(this);
showMessage("UVSC RUNNING SUCCESSFULLY.");
@@ -194,7 +194,7 @@ void UvscEngine::shutdownInferior()
{
showMessage("UVSC: STOPPING DEBUGGER...");
if (!m_client->stopSession()) {
- AsynchronousMessageBox::critical(tr("Failed to Shut Down Application"),
+ AsynchronousMessageBox::critical(Tr::tr("Failed to Shut Down Application"),
m_client->errorString());
} else {
showMessage("UVSC: DEBUGGER STOPPED");
@@ -285,10 +285,10 @@ void UvscEngine::continueInferior()
return;
notifyInferiorRunRequested();
- showStatusMessage(tr("Running requested..."), 5000);
+ showStatusMessage(Tr::tr("Running requested..."), 5000);
if (!m_client->startExecution()) {
- showMessage(tr("UVSC: Starting execution failed."), LogMisc);
+ showMessage(Tr::tr("UVSC: Starting execution failed."), LogMisc);
handleExecutionFailure(m_client->errorString());
}
}
@@ -299,7 +299,7 @@ void UvscEngine::interruptInferior()
return;
if (!m_client->stopExecution()) {
- showMessage(tr("UVSC: Stopping execution failed."), LogMisc);
+ showMessage(Tr::tr("UVSC: Stopping execution failed."), LogMisc);
handleStoppingFailure(m_client->errorString());
}
}
@@ -313,10 +313,10 @@ void UvscEngine::assignValueInDebugger(WatchItem *item, const QString &expr,
const int taskId = currentThreadId();
const int frameId = currentFrameLevel();
if (!m_client->setLocalValue(item->id, taskId, frameId, value.toString()))
- showMessage(tr("UVSC: Setting local value failed."), LogMisc);
+ showMessage(Tr::tr("UVSC: Setting local value failed."), LogMisc);
} else if (item->isWatcher()) {
if (!m_client->setWatcherValue(item->id, value.toString()))
- showMessage(tr("UVSC: Setting watcher value failed."), LogMisc);
+ showMessage(Tr::tr("UVSC: Setting watcher value failed."), LogMisc);
}
updateLocals();
@@ -415,7 +415,7 @@ void UvscEngine::fetchDisassembler(DisassemblerAgent *agent)
const Location location = agent->location();
if (const quint64 address = location.address()) {
if (!m_client->disassemblyAddress(address, data))
- showMessage(tr("UVSC: Disassembling by address failed."), LogMisc);
+ showMessage(Tr::tr("UVSC: Disassembling by address failed."), LogMisc);
}
DisassemblerLines result;
@@ -468,7 +468,7 @@ void UvscEngine::changeMemory(MemoryAgent *agent, quint64 address, const QByteAr
{
QTC_ASSERT(!data.isEmpty(), return);
if (!m_client->changeMemory(address, data))
- showMessage(tr("UVSC: Changing memory at address 0x%1 failed.").arg(address, 0, 16), LogMisc);
+ showMessage(Tr::tr("UVSC: Changing memory at address 0x%1 failed.").arg(address, 0, 16), LogMisc);
else
handleChangeMemory(agent, address, data);
}
@@ -477,7 +477,7 @@ void UvscEngine::fetchMemory(MemoryAgent *agent, quint64 address, quint64 length
{
QByteArray data(int(length), 0);
if (!m_client->fetchMemory(address, data))
- showMessage(tr("UVSC: Fetching memory at address 0x%1 failed.").arg(address, 0, 16), LogMisc);
+ showMessage(Tr::tr("UVSC: Fetching memory at address 0x%1 failed.").arg(address, 0, 16), LogMisc);
handleFetchMemory(agent, address, data);
}
@@ -541,13 +541,13 @@ bool UvscEngine::configureProject(const DebuggerRunParameters &rp)
showMessage("UVSC: LOADING PROJECT...");
if (!optionsPath.exists()) {
- handleSetupFailure(tr("Internal error: The specified uVision project options file does not exist."));
+ handleSetupFailure(Tr::tr("Internal error: The specified uVision project options file does not exist."));
return false;
} else if (!projectPath.exists()) {
- handleSetupFailure(tr("Internal error: The specified uVision project file does not exist."));
+ handleSetupFailure(Tr::tr("Internal error: The specified uVision project file does not exist."));
return false;
} else if (!m_client->openProject(projectPath)) {
- handleSetupFailure(tr("Internal error: Unable to open the uVision project %1: %2.")
+ handleSetupFailure(Tr::tr("Internal error: Unable to open the uVision project %1: %2.")
.arg(projectPath.toString(), m_client->errorString()));
return false;
} else {
@@ -557,7 +557,7 @@ bool UvscEngine::configureProject(const DebuggerRunParameters &rp)
showMessage("UVSC: SETTING PROJECT DEBUG TARGET...");
m_simulator = rp.uVisionSimulator;
if (!m_client->setProjectDebugTarget(m_simulator)) {
- handleSetupFailure(tr("Internal error: Unable to set the uVision debug target: %1.")
+ handleSetupFailure(Tr::tr("Internal error: Unable to set the uVision debug target: %1.")
.arg(m_client->errorString()));
return false;
} else {
@@ -568,10 +568,10 @@ bool UvscEngine::configureProject(const DebuggerRunParameters &rp)
showMessage("UVSC: SETTING PROJECT OUTPUT TARGET...");
const FilePath targetPath = rp.inferior.command.executable().relativeChildPath(projectPath.parentDir());
if (!rp.inferior.command.executable().exists()) {
- handleSetupFailure(tr("Internal error: The specified output file does not exist."));
+ handleSetupFailure(Tr::tr("Internal error: The specified output file does not exist."));
return false;
} else if (!m_client->setProjectOutputTarget(targetPath)) {
- handleSetupFailure(tr("Internal error: Unable to set the uVision output file %1: %2.")
+ handleSetupFailure(Tr::tr("Internal error: Unable to set the uVision output file %1: %2.")
.arg(targetPath.toString(), m_client->errorString()));
return false;
} else {
@@ -613,7 +613,7 @@ void UvscEngine::handleProjectClosed()
// Re-open the project again.
if (!m_client->openProject(projectPath)) {
- handleSetupFailure(tr("Internal error: Unable to open the uVision project %1: %2.")
+ handleSetupFailure(Tr::tr("Internal error: Unable to open the uVision project %1: %2.")
.arg(projectPath.toString(), m_client->errorString()));
return;
}
@@ -703,7 +703,7 @@ void UvscEngine::handleReloadRegisters()
{
m_registers.clear();
if (!m_client->fetchRegisters(m_registers)) {
- showMessage(tr("UVSC: Reading registers failed."), LogMisc);
+ showMessage(Tr::tr("UVSC: Reading registers failed."), LogMisc);
} else {
RegisterHandler *handler = registerHandler();
for (const auto &reg : qAsConst(m_registers))
@@ -717,7 +717,7 @@ void UvscEngine::handleReloadPeripheralRegisters(const QList<quint64> &addresses
for (const quint64 address : addresses) {
QByteArray data = UvscUtils::encodeU32(0);
if (!m_client->fetchMemory(address, data)) {
- showMessage(tr("UVSC: Fetching peripheral register failed."), LogMisc);
+ showMessage(Tr::tr("UVSC: Fetching peripheral register failed."), LogMisc);
} else {
const quint32 value = UvscUtils::decodeU32(data);
peripheralRegisterHandler()->updateRegister(address, value);
@@ -774,9 +774,9 @@ void UvscEngine::handleUpdateLocals(bool partial)
}
if (!m_client->fetchLocals(expandedLocalINames, taskId, frameId, data))
- showMessage(tr("UVSC: Locals enumeration failed."), LogMisc);
+ showMessage(Tr::tr("UVSC: Locals enumeration failed."), LogMisc);
if (!m_client->fetchWatchers(expandedWatcherINames, rootWatchers, data))
- showMessage(tr("UVSC: Watchers enumeration failed."), LogMisc);
+ showMessage(Tr::tr("UVSC: Watchers enumeration failed."), LogMisc);
all.addChild(data);
@@ -793,7 +793,7 @@ void UvscEngine::handleInsertBreakpoint(const QString &exp, const Breakpoint &bp
QString function;
QString fileName;
if (!m_client->createBreakpoint(exp, tickMark, address, line, function, fileName)) {
- showMessage(tr("UVSC: Inserting breakpoint failed."), LogMisc);
+ showMessage(Tr::tr("UVSC: Inserting breakpoint failed."), LogMisc);
notifyBreakpointInsertFailed(bp);
} else {
bp->setPending(false);
@@ -810,7 +810,7 @@ void UvscEngine::handleRemoveBreakpoint(const Breakpoint &bp)
{
const quint32 tickMark = bp->responseId().toULong();
if (!m_client->deleteBreakpoint(tickMark)) {
- showMessage(tr("UVSC: Removing breakpoint failed."), LogMisc);
+ showMessage(Tr::tr("UVSC: Removing breakpoint failed."), LogMisc);
notifyBreakpointRemoveFailed(bp);
} else {
notifyBreakpointRemoveOk(bp);
@@ -823,13 +823,13 @@ void UvscEngine::handleChangeBreakpoint(const Breakpoint &bp)
const BreakpointParameters &requested = bp->requestedParameters();
if (requested.enabled && !bp->isEnabled()) {
if (!m_client->enableBreakpoint(tickMark)) {
- showMessage(tr("UVSC: Enabling breakpoint failed."), LogMisc);
+ showMessage(Tr::tr("UVSC: Enabling breakpoint failed."), LogMisc);
notifyBreakpointChangeFailed(bp);
return;
}
} else if (!requested.enabled && bp->isEnabled()) {
if (!m_client->disableBreakpoint(tickMark)) {
- showMessage(tr("UVSC: Disabling breakpoint failed."), LogMisc);
+ showMessage(Tr::tr("UVSC: Disabling breakpoint failed."), LogMisc);
notifyBreakpointChangeFailed(bp);
return;
}
@@ -841,34 +841,34 @@ void UvscEngine::handleChangeBreakpoint(const Breakpoint &bp)
void UvscEngine::handleSetupFailure(const QString &errorMessage)
{
showMessage("UVSC INITIALIZATION FAILED");
- AsynchronousMessageBox::critical(tr("Failed to initialize the UVSC."), errorMessage);
+ AsynchronousMessageBox::critical(Tr::tr("Failed to initialize the UVSC."), errorMessage);
notifyEngineSetupFailed();
}
void UvscEngine::handleShutdownFailure(const QString &errorMessage)
{
showMessage("UVSC SHUTDOWN FAILED");
- AsynchronousMessageBox::critical(tr("Failed to de-initialize the UVSC."), errorMessage);
+ AsynchronousMessageBox::critical(Tr::tr("Failed to de-initialize the UVSC."), errorMessage);
}
void UvscEngine::handleRunFailure(const QString &errorMessage)
{
showMessage("UVSC RUN FAILED");
- AsynchronousMessageBox::critical(tr("Failed to run the UVSC."), errorMessage);
+ AsynchronousMessageBox::critical(Tr::tr("Failed to run the UVSC."), errorMessage);
notifyEngineSetupFailed();
}
void UvscEngine::handleExecutionFailure(const QString &errorMessage)
{
- AsynchronousMessageBox::critical(tr("Execution Error"),
- tr("Cannot continue debugged process:\n") + errorMessage);
+ AsynchronousMessageBox::critical(Tr::tr("Execution Error"),
+ Tr::tr("Cannot continue debugged process:\n") + errorMessage);
notifyInferiorRunFailed();
}
void UvscEngine::handleStoppingFailure(const QString &errorMessage)
{
- AsynchronousMessageBox::critical(tr("Execution Error"),
- tr("Cannot stop debugged process:\n") + errorMessage);
+ AsynchronousMessageBox::critical(Tr::tr("Execution Error"),
+ Tr::tr("Cannot stop debugged process:\n") + errorMessage);
notifyInferiorStopFailed();
}
@@ -888,5 +888,4 @@ void UvscEngine::handleChangeMemory(MemoryAgent *agent, quint64 address, const Q
reloadPeripheralRegisters();
}
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/uvsc/uvscengine.h b/src/plugins/debugger/uvsc/uvscengine.h
index 14a6524814..1cb91d0b9c 100644
--- a/src/plugins/debugger/uvsc/uvscengine.h
+++ b/src/plugins/debugger/uvsc/uvscengine.h
@@ -29,13 +29,10 @@
#include <debugger/debuggerengine.h>
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
class UvscEngine final : public CppDebuggerEngine
{
- Q_OBJECT
-
public:
explicit UvscEngine();
@@ -76,7 +73,7 @@ public:
void reloadFullStack() final;
-private slots:
+private:
void handleProjectClosed();
void handleUpdateLocation(quint64 address);
@@ -101,7 +98,6 @@ private slots:
void handleFetchMemory(MemoryAgent *agent, quint64 address, const QByteArray &data);
void handleChangeMemory(MemoryAgent *agent, quint64 address, const QByteArray &data);
-private:
void doUpdateLocals(const UpdateParameters &params) final;
void updateAll() final;
@@ -119,5 +115,4 @@ private:
std::unique_ptr<UvscClient> m_client;
};
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/watchdata.cpp b/src/plugins/debugger/watchdata.cpp
index b10b47db8e..50051aa4b5 100644
--- a/src/plugins/debugger/watchdata.cpp
+++ b/src/plugins/debugger/watchdata.cpp
@@ -34,8 +34,7 @@
#include <QDebug>
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
bool isPointerType(const QString &type)
{
@@ -627,6 +626,5 @@ int WatchItem::guessSize() const
return 0;
}
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/watchdata.h b/src/plugins/debugger/watchdata.h
index 4e3e319775..00e85584b3 100644
--- a/src/plugins/debugger/watchdata.h
+++ b/src/plugins/debugger/watchdata.h
@@ -33,8 +33,7 @@
#include <vector>
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
class GdbMi;
@@ -105,5 +104,4 @@ private:
void parseHelper(const GdbMi &input, bool maySort);
};
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/watchdelegatewidgets.cpp b/src/plugins/debugger/watchdelegatewidgets.cpp
index efd2dca064..3e47f56ee5 100644
--- a/src/plugins/debugger/watchdelegatewidgets.cpp
+++ b/src/plugins/debugger/watchdelegatewidgets.cpp
@@ -32,8 +32,7 @@
enum { debug = 0 };
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
// Basic watch line edit.
WatchLineEdit::WatchLineEdit(QWidget *parent)
@@ -337,5 +336,4 @@ void BooleanComboBox::setModelData(const QVariant &v)
setCurrentIndex(value ? 1 : 0);
}
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/watchdelegatewidgets.h b/src/plugins/debugger/watchdelegatewidgets.h
index 90da2f8cbe..e88c388d10 100644
--- a/src/plugins/debugger/watchdelegatewidgets.h
+++ b/src/plugins/debugger/watchdelegatewidgets.h
@@ -28,8 +28,8 @@
#include <QLineEdit>
#include <QComboBox>
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
+
class IntegerValidator;
/* Watch edit widgets. The logic is based on the QVariant 'modelData' property,
@@ -105,5 +105,4 @@ public:
virtual void setModelData(const QVariant &);
};
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/watchhandler.cpp b/src/plugins/debugger/watchhandler.cpp
index 7a24390a4b..cc6158d96a 100644
--- a/src/plugins/debugger/watchhandler.cpp
+++ b/src/plugins/debugger/watchhandler.cpp
@@ -2469,12 +2469,15 @@ void WatchModel::showEditValue(const WatchItem *item)
if (size == nbytes) {
std::memcpy(im.bits(), bits, nbytes);
auto v = m_separatedView->prepareObject<ImageViewer>(item);
- v->setInfo(item->address ?
- Tr::tr("%1 Object at %2").arg(item->type, item->hexAddress()) :
- Tr::tr("%1 Object at Unknown Address").arg(item->type) + " " +
- ImageViewer::tr("Size: %1x%2, %3 byte, format: %4, depth: %5")
- .arg(width).arg(height).arg(nbytes).arg(im.format()).arg(im.depth())
- );
+ v->setInfo(item->address
+ ? Tr::tr("%1 Object at %2").arg(item->type, item->hexAddress())
+ : Tr::tr("%1 Object at Unknown Address").arg(item->type) + " "
+ + Tr::tr("Size: %1x%2, %3 byte, format: %4, depth: %5")
+ .arg(width)
+ .arg(height)
+ .arg(nbytes)
+ .arg(im.format())
+ .arg(im.depth()));
v->setImage(im);
}
} else if (format == DisplayLatin1String