diff options
author | hjk <hjk@qt.io> | 2023-01-13 12:38:22 +0100 |
---|---|---|
committer | hjk <hjk@qt.io> | 2023-01-16 12:10:24 +0000 |
commit | c5f7f5ab0aab672180714cb172818aa3cd394c90 (patch) | |
tree | c0c37400cacb71c62af445a599cfa7d39802c38c /src/plugins/projectexplorer/appoutputpane.cpp | |
parent | e373fe6aa91f455c52b4fc390e600c4116871652 (diff) |
ProjectExplorer: Tr::tr
Change-Id: I8f1b463c5cc7a53627f7a9ad261998b92f13e56a
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Diffstat (limited to 'src/plugins/projectexplorer/appoutputpane.cpp')
-rw-r--r-- | src/plugins/projectexplorer/appoutputpane.cpp | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/src/plugins/projectexplorer/appoutputpane.cpp b/src/plugins/projectexplorer/appoutputpane.cpp index 4ff83030f4..a5590a7bb1 100644 --- a/src/plugins/projectexplorer/appoutputpane.cpp +++ b/src/plugins/projectexplorer/appoutputpane.cpp @@ -6,6 +6,7 @@ #include "projectexplorer.h" #include "projectexplorerconstants.h" #include "projectexplorericons.h" +#include "projectexplorertr.h" #include "runcontrol.h" #include "session.h" #include "showoutputtaskhandler.h" @@ -68,8 +69,8 @@ static QObject *debuggerPlugin() static QString msgAttachDebuggerTooltip(const QString &handleDescription = QString()) { return handleDescription.isEmpty() ? - AppOutputPane::tr("Attach debugger to this process") : - AppOutputPane::tr("Attach debugger to %1").arg(handleDescription); + Tr::tr("Attach debugger to this process") : + Tr::tr("Attach debugger to %1").arg(handleDescription); } class TabWidget : public QTabWidget @@ -136,19 +137,19 @@ AppOutputPane::RunControlTab::RunControlTab(RunControl *runControl, Core::Output AppOutputPane::AppOutputPane() : m_tabWidget(new TabWidget), - m_stopAction(new QAction(tr("Stop"), this)), - m_closeCurrentTabAction(new QAction(tr("Close Tab"), this)), - m_closeAllTabsAction(new QAction(tr("Close All Tabs"), this)), - m_closeOtherTabsAction(new QAction(tr("Close Other Tabs"), this)), + m_stopAction(new QAction(Tr::tr("Stop"), this)), + m_closeCurrentTabAction(new QAction(Tr::tr("Close Tab"), this)), + m_closeAllTabsAction(new QAction(Tr::tr("Close All Tabs"), this)), + m_closeOtherTabsAction(new QAction(Tr::tr("Close Other Tabs"), this)), m_reRunButton(new QToolButton), m_stopButton(new QToolButton), m_attachButton(new QToolButton), m_settingsButton(new QToolButton), m_formatterWidget(new QWidget), m_handler(new ShowOutputTaskHandler(this, - tr("Show &App Output"), - tr("Show the output that generated this issue in Application Output."), - tr("A"))) + Tr::tr("Show &App Output"), + Tr::tr("Show the output that generated this issue in Application Output."), + Tr::tr("A"))) { ExtensionSystem::PluginManager::addObject(m_handler); @@ -157,14 +158,14 @@ AppOutputPane::AppOutputPane() : // Rerun m_reRunButton->setIcon(Utils::Icons::RUN_SMALL_TOOLBAR.icon()); - m_reRunButton->setToolTip(tr("Re-run this run-configuration.")); + m_reRunButton->setToolTip(Tr::tr("Re-run this run-configuration.")); m_reRunButton->setEnabled(false); connect(m_reRunButton, &QToolButton::clicked, this, &AppOutputPane::reRunRunControl); // Stop m_stopAction->setIcon(Utils::Icons::STOP_SMALL_TOOLBAR.icon()); - m_stopAction->setToolTip(tr("Stop running program.")); + m_stopAction->setToolTip(Tr::tr("Stop running program.")); m_stopAction->setEnabled(false); Core::Command *cmd = Core::ActionManager::registerAction(m_stopAction, Constants::STOP); @@ -187,7 +188,7 @@ AppOutputPane::AppOutputPane() : connect(this, &IOutputPane::zoomOutRequested, this, &AppOutputPane::zoomOut); connect(this, &IOutputPane::resetZoomRequested, this, &AppOutputPane::resetZoom); - m_settingsButton->setToolTip(tr("Open Settings Page")); + m_settingsButton->setToolTip(Tr::tr("Open Settings Page")); m_settingsButton->setIcon(Utils::Icons::SETTINGS_TOOLBAR.icon()); connect(m_settingsButton, &QToolButton::clicked, this, [] { Core::ICore::showOptionsDialog(OPTIONS_PAGE_ID); @@ -305,7 +306,7 @@ QList<QWidget*> AppOutputPane::toolBarWidgets() const QString AppOutputPane::displayName() const { - return tr("Application Output"); + return Tr::tr("Application Output"); } int AppOutputPane::priorityInStatusBar() const @@ -427,7 +428,7 @@ void AppOutputPane::createNewOutputWindow(RunControl *rc) Id contextId = Id(C_APP_OUTPUT).withSuffix(counter++); Core::Context context(contextId); Core::OutputWindow *ow = new Core::OutputWindow(context, SETTINGS_KEY, m_tabWidget); - ow->setWindowTitle(tr("Application Output Window")); + ow->setWindowTitle(Tr::tr("Application Output Window")); ow->setWindowIcon(Icons::WINDOW.icon()); ow->setWordWrapEnabled(m_settings.wrapOutput); ow->setMaxCharCount(m_settings.maxCharCount); @@ -698,8 +699,8 @@ void AppOutputPane::enableButtons(const RunControl *rc) if (isRunning && debuggerPlugin() && rc->applicationProcessHandle().isValid()) { m_attachButton->setEnabled(true); ProcessHandle h = rc->applicationProcessHandle(); - QString tip = h.isValid() ? RunControl::tr("PID %1").arg(h.pid()) - : RunControl::tr("Invalid"); + QString tip = h.isValid() ? Tr::tr("PID %1").arg(h.pid()) + : Tr::tr("Invalid"); m_attachButton->setToolTip(msgAttachDebuggerTooltip(tip)); } else { m_attachButton->setEnabled(false); @@ -804,22 +805,21 @@ bool AppOutputPane::canNavigate() const class AppOutputSettingsWidget : public Core::IOptionsPageWidget { - Q_DECLARE_TR_FUNCTIONS(ProjectExplorer::Internal::AppOutputSettingsPage) public: AppOutputSettingsWidget() { const AppOutputSettings &settings = ProjectExplorerPlugin::appOutputSettings(); - m_wrapOutputCheckBox.setText(tr("Word-wrap output")); + m_wrapOutputCheckBox.setText(Tr::tr("Word-wrap output")); m_wrapOutputCheckBox.setChecked(settings.wrapOutput); - m_cleanOldOutputCheckBox.setText(tr("Clear old output on a new run")); + m_cleanOldOutputCheckBox.setText(Tr::tr("Clear old output on a new run")); m_cleanOldOutputCheckBox.setChecked(settings.cleanOldOutput); - m_mergeChannelsCheckBox.setText(tr("Merge stderr and stdout")); + m_mergeChannelsCheckBox.setText(Tr::tr("Merge stderr and stdout")); m_mergeChannelsCheckBox.setChecked(settings.mergeChannels); for (QComboBox * const modeComboBox : {&m_runOutputModeComboBox, &m_debugOutputModeComboBox}) { - modeComboBox->addItem(tr("Always"), int(AppOutputPaneMode::PopupOnOutput)); - modeComboBox->addItem(tr("Never"), int(AppOutputPaneMode::FlashOnOutput)); - modeComboBox->addItem(tr("On First Output Only"), + modeComboBox->addItem(Tr::tr("Always"), int(AppOutputPaneMode::PopupOnOutput)); + modeComboBox->addItem(Tr::tr("Never"), int(AppOutputPaneMode::FlashOnOutput)); + modeComboBox->addItem(Tr::tr("On First Output Only"), int(AppOutputPaneMode::PopupOnFirstOutput)); } m_runOutputModeComboBox.setCurrentIndex(m_runOutputModeComboBox @@ -833,15 +833,15 @@ public: layout->addWidget(&m_cleanOldOutputCheckBox); layout->addWidget(&m_mergeChannelsCheckBox); const auto maxCharsLayout = new QHBoxLayout; - const QString msg = tr("Limit output to %1 characters"); + const QString msg = Tr::tr("Limit output to %1 characters"); const QStringList parts = msg.split("%1") << QString() << QString(); maxCharsLayout->addWidget(new QLabel(parts.at(0).trimmed())); maxCharsLayout->addWidget(&m_maxCharsBox); maxCharsLayout->addWidget(new QLabel(parts.at(1).trimmed())); maxCharsLayout->addStretch(1); const auto outputModeLayout = new QFormLayout; - outputModeLayout->addRow(tr("Open Application Output when running:"), &m_runOutputModeComboBox); - outputModeLayout->addRow(tr("Open Application Output when debugging:"), + outputModeLayout->addRow(Tr::tr("Open Application Output when running:"), &m_runOutputModeComboBox); + outputModeLayout->addRow(Tr::tr("Open Application Output when debugging:"), &m_debugOutputModeComboBox); layout->addLayout(outputModeLayout); layout->addLayout(maxCharsLayout); @@ -875,7 +875,7 @@ private: AppOutputSettingsPage::AppOutputSettingsPage() { setId(OPTIONS_PAGE_ID); - setDisplayName(AppOutputSettingsWidget::tr("Application Output")); + setDisplayName(Tr::tr("Application Output")); setCategory(Constants::BUILD_AND_RUN_SETTINGS_CATEGORY); setWidgetCreator([] { return new AppOutputSettingsWidget; }); } |