forked from qt-creator/qt-creator
Autotest: Convert to Tr::tr
Change-Id: Ifd4b6ace78d02804ec3b3c1d60c5418081cad6c4 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
|
||||
#include "autotestconstants.h"
|
||||
#include "autotesticons.h"
|
||||
#include "autotesttr.h"
|
||||
#include "testcodeparser.h"
|
||||
#include "testframeworkmanager.h"
|
||||
#include "testrunner.h"
|
||||
@@ -59,7 +60,7 @@ namespace Internal {
|
||||
TestNavigationWidget::TestNavigationWidget(QWidget *parent) :
|
||||
QWidget(parent)
|
||||
{
|
||||
setWindowTitle(tr("Tests"));
|
||||
setWindowTitle(Tr::tr("Tests"));
|
||||
m_model = TestTreeModel::instance();
|
||||
m_sortFilterModel = new TestTreeSortFilterModel(m_model, m_model);
|
||||
m_sortFilterModel->setDynamicSortFilter(true);
|
||||
@@ -78,7 +79,7 @@ TestNavigationWidget::TestNavigationWidget(QWidget *parent) :
|
||||
m_missingFrameworksWidget->setAutoFillBackground(true);
|
||||
QHBoxLayout *hLayout = new QHBoxLayout;
|
||||
m_missingFrameworksWidget->setLayout(hLayout);
|
||||
hLayout->addWidget(new QLabel(tr("No active test frameworks.")));
|
||||
hLayout->addWidget(new QLabel(Tr::tr("No active test frameworks.")));
|
||||
const bool hasActiveFrameworks = Utils::anyOf(TestFrameworkManager::registeredFrameworks(),
|
||||
&ITestFramework::active);
|
||||
m_missingFrameworksWidget->setVisible(!hasActiveFrameworks);
|
||||
@@ -141,13 +142,13 @@ void TestNavigationWidget::contextMenuEvent(QContextMenuEvent *event)
|
||||
ITestTreeItem *item = static_cast<ITestTreeItem *>(
|
||||
m_model->itemForIndex(m_sortFilterModel->mapToSource(index)));
|
||||
if (item->canProvideTestConfiguration()) {
|
||||
runThisTest = new QAction(tr("Run This Test"), &menu);
|
||||
runThisTest = new QAction(Tr::tr("Run This Test"), &menu);
|
||||
runThisTest->setEnabled(enabled);
|
||||
connect(runThisTest, &QAction::triggered,
|
||||
this, [this] () {
|
||||
onRunThisTestTriggered(TestRunMode::Run);
|
||||
});
|
||||
runWithoutDeploy = new QAction(tr("Run Without Deployment"), &menu);
|
||||
runWithoutDeploy = new QAction(Tr::tr("Run Without Deployment"), &menu);
|
||||
runWithoutDeploy->setEnabled(enabled);
|
||||
connect(runWithoutDeploy, &QAction::triggered,
|
||||
this, [this] () {
|
||||
@@ -158,13 +159,13 @@ void TestNavigationWidget::contextMenuEvent(QContextMenuEvent *event)
|
||||
? static_cast<TestTreeItem *>(item)
|
||||
: nullptr;
|
||||
if (ttitem && ttitem->canProvideDebugConfiguration()) {
|
||||
debugThisTest = new QAction(tr("Debug This Test"), &menu);
|
||||
debugThisTest = new QAction(Tr::tr("Debug This Test"), &menu);
|
||||
debugThisTest->setEnabled(enabled);
|
||||
connect(debugThisTest, &QAction::triggered,
|
||||
this, [this] () {
|
||||
onRunThisTestTriggered(TestRunMode::Debug);
|
||||
});
|
||||
debugWithoutDeploy = new QAction(tr("Debug Without Deployment"), &menu);
|
||||
debugWithoutDeploy = new QAction(Tr::tr("Debug Without Deployment"), &menu);
|
||||
debugWithoutDeploy->setEnabled(enabled);
|
||||
connect(debugWithoutDeploy, &QAction::triggered,
|
||||
this, [this] () {
|
||||
@@ -178,8 +179,8 @@ void TestNavigationWidget::contextMenuEvent(QContextMenuEvent *event)
|
||||
QAction *runSelected = Core::ActionManager::command(Constants::ACTION_RUN_SELECTED_ID)->action();
|
||||
QAction *runAllNoDeploy = Core::ActionManager::command(Constants::ACTION_RUN_ALL_NODEPLOY_ID)->action();
|
||||
QAction *runSelectedNoDeploy = Core::ActionManager::command(Constants::ACTION_RUN_SELECTED_NODEPLOY_ID)->action();
|
||||
QAction *selectAll = new QAction(tr("Select All"), &menu);
|
||||
QAction *deselectAll = new QAction(tr("Deselect All"), &menu);
|
||||
QAction *selectAll = new QAction(Tr::tr("Select All"), &menu);
|
||||
QAction *deselectAll = new QAction(Tr::tr("Deselect All"), &menu);
|
||||
// TODO remove?
|
||||
QAction *rescan = Core::ActionManager::command(Constants::ACTION_SCAN_ID)->action();
|
||||
|
||||
@@ -216,7 +217,7 @@ QList<QToolButton *> TestNavigationWidget::createToolButtons()
|
||||
|
||||
m_filterButton = new QToolButton(m_view);
|
||||
m_filterButton->setIcon(Utils::Icons::FILTER.icon());
|
||||
m_filterButton->setToolTip(tr("Filter Test Tree"));
|
||||
m_filterButton->setToolTip(Tr::tr("Filter Test Tree"));
|
||||
m_filterButton->setProperty("noArrow", true);
|
||||
m_filterButton->setPopupMode(QToolButton::InstantPopup);
|
||||
m_filterMenu = new QMenu(m_filterButton);
|
||||
@@ -227,15 +228,15 @@ QList<QToolButton *> TestNavigationWidget::createToolButtons()
|
||||
m_sortAlphabetically = true;
|
||||
m_sort = new QToolButton(this);
|
||||
m_sort->setIcon(Icons::SORT_NATURALLY.icon());
|
||||
m_sort->setToolTip(tr("Sort Naturally"));
|
||||
m_sort->setToolTip(Tr::tr("Sort Naturally"));
|
||||
|
||||
QToolButton *expand = new QToolButton(this);
|
||||
expand->setIcon(Utils::Icons::EXPAND_TOOLBAR.icon());
|
||||
expand->setToolTip(tr("Expand All"));
|
||||
expand->setToolTip(Tr::tr("Expand All"));
|
||||
|
||||
QToolButton *collapse = new QToolButton(this);
|
||||
collapse->setIcon(Utils::Icons::COLLAPSE_TOOLBAR.icon());
|
||||
collapse->setToolTip(tr("Collapse All"));
|
||||
collapse->setToolTip(Tr::tr("Collapse All"));
|
||||
|
||||
connect(expand, &QToolButton::clicked, m_view, [this]() {
|
||||
m_view->blockSignals(true);
|
||||
@@ -278,11 +279,11 @@ void TestNavigationWidget::onSortClicked()
|
||||
{
|
||||
if (m_sortAlphabetically) {
|
||||
m_sort->setIcon(Utils::Icons::SORT_ALPHABETICALLY_TOOLBAR.icon());
|
||||
m_sort->setToolTip(tr("Sort Alphabetically"));
|
||||
m_sort->setToolTip(Tr::tr("Sort Alphabetically"));
|
||||
m_sortFilterModel->setSortMode(TestTreeItem::Naturally);
|
||||
} else {
|
||||
m_sort->setIcon(Icons::SORT_NATURALLY.icon());
|
||||
m_sort->setToolTip(tr("Sort Naturally"));
|
||||
m_sort->setToolTip(Tr::tr("Sort Naturally"));
|
||||
m_sortFilterModel->setSortMode(TestTreeItem::Alphabetically);
|
||||
}
|
||||
m_sortAlphabetically = !m_sortAlphabetically;
|
||||
@@ -308,13 +309,13 @@ void TestNavigationWidget::onParsingFinished()
|
||||
void TestNavigationWidget::initializeFilterMenu()
|
||||
{
|
||||
QAction *action = new QAction(m_filterMenu);
|
||||
action->setText(tr("Show Init and Cleanup Functions"));
|
||||
action->setText(Tr::tr("Show Init and Cleanup Functions"));
|
||||
action->setCheckable(true);
|
||||
action->setChecked(false);
|
||||
action->setData(TestTreeSortFilterModel::ShowInitAndCleanup);
|
||||
m_filterMenu->addAction(action);
|
||||
action = new QAction(m_filterMenu);
|
||||
action->setText(tr("Show Data Functions"));
|
||||
action->setText(Tr::tr("Show Data Functions"));
|
||||
action->setCheckable(true);
|
||||
action->setChecked(false);
|
||||
action->setData(TestTreeSortFilterModel::ShowTestData);
|
||||
@@ -351,7 +352,7 @@ void TestNavigationWidget::reapplyCachedExpandedState()
|
||||
|
||||
TestNavigationWidgetFactory::TestNavigationWidgetFactory()
|
||||
{
|
||||
setDisplayName(tr("Tests"));
|
||||
setDisplayName(Tr::tr("Tests"));
|
||||
setId(Autotest::Constants::AUTOTEST_ID);
|
||||
setPriority(666);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user