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 "autotestplugin.h"
|
||||
#include "autotesttr.h"
|
||||
#include "testframeworkmanager.h"
|
||||
#include "testsettings.h"
|
||||
#include "testtreemodel.h"
|
||||
@@ -57,8 +58,6 @@ namespace Internal {
|
||||
|
||||
class TestSettingsWidget : public QWidget
|
||||
{
|
||||
Q_DECLARE_TR_FUNCTIONS(Autotest::Internal::TestSettingsWidget)
|
||||
|
||||
public:
|
||||
explicit TestSettingsWidget(QWidget *parent = nullptr);
|
||||
|
||||
@@ -94,21 +93,21 @@ TestSettingsWidget::TestSettingsWidget(QWidget *parent)
|
||||
{
|
||||
resize(586, 469);
|
||||
|
||||
m_omitInternalMsgCB = new QCheckBox(tr("Omit internal messages"));
|
||||
m_omitInternalMsgCB = new QCheckBox(Tr::tr("Omit internal messages"));
|
||||
m_omitInternalMsgCB->setChecked(true);
|
||||
m_omitInternalMsgCB->setToolTip(tr("Hides internal messages by default. "
|
||||
m_omitInternalMsgCB->setToolTip(Tr::tr("Hides internal messages by default. "
|
||||
"You can still enable them by using the test results filter."));
|
||||
|
||||
m_omitRunConfigWarnCB = new QCheckBox(tr("Omit run configuration warnings"));
|
||||
m_omitRunConfigWarnCB->setToolTip(tr("Hides warnings related to a deduced run configuration."));
|
||||
m_omitRunConfigWarnCB = new QCheckBox(Tr::tr("Omit run configuration warnings"));
|
||||
m_omitRunConfigWarnCB->setToolTip(Tr::tr("Hides warnings related to a deduced run configuration."));
|
||||
|
||||
m_limitResultOutputCB = new QCheckBox(tr("Limit result output"));
|
||||
m_limitResultOutputCB = new QCheckBox(Tr::tr("Limit result output"));
|
||||
m_limitResultOutputCB->setChecked(true);
|
||||
m_limitResultOutputCB->setToolTip(tr("Limits result output to 100000 characters."));
|
||||
m_limitResultOutputCB->setToolTip(Tr::tr("Limits result output to 100000 characters."));
|
||||
|
||||
m_limitResultDescriptionCb = new QCheckBox(tr("Limit result description:"));
|
||||
m_limitResultDescriptionCb = new QCheckBox(Tr::tr("Limit result description:"));
|
||||
m_limitResultDescriptionCb->setToolTip(
|
||||
tr("Limit number of lines shown in test result tooltip and description."));
|
||||
Tr::tr("Limit number of lines shown in test result tooltip and description."));
|
||||
|
||||
m_limitResultDescriptionSpinBox = new QSpinBox;
|
||||
m_limitResultDescriptionSpinBox->setEnabled(false);
|
||||
@@ -116,64 +115,64 @@ TestSettingsWidget::TestSettingsWidget(QWidget *parent)
|
||||
m_limitResultDescriptionSpinBox->setMaximum(1000000);
|
||||
m_limitResultDescriptionSpinBox->setValue(10);
|
||||
|
||||
m_openResultsOnStartCB = new QCheckBox(tr("Open results when tests start"));
|
||||
m_openResultsOnStartCB = new QCheckBox(Tr::tr("Open results when tests start"));
|
||||
m_openResultsOnStartCB->setToolTip(
|
||||
tr("Displays test results automatically when tests are started."));
|
||||
Tr::tr("Displays test results automatically when tests are started."));
|
||||
|
||||
m_openResultsOnFinishCB = new QCheckBox(tr("Open results when tests finish"));
|
||||
m_openResultsOnFinishCB = new QCheckBox(Tr::tr("Open results when tests finish"));
|
||||
m_openResultsOnFinishCB->setChecked(true);
|
||||
m_openResultsOnFinishCB->setToolTip(
|
||||
tr("Displays test results automatically when tests are finished."));
|
||||
Tr::tr("Displays test results automatically when tests are finished."));
|
||||
|
||||
m_openResultsOnFailCB = new QCheckBox(tr("Only for unsuccessful test runs"));
|
||||
m_openResultsOnFailCB = new QCheckBox(Tr::tr("Only for unsuccessful test runs"));
|
||||
m_openResultsOnFailCB->setToolTip(
|
||||
tr("Displays test results only if the test run contains failed, fatal or unexpectedly passed tests."));
|
||||
Tr::tr("Displays test results only if the test run contains failed, fatal or unexpectedly passed tests."));
|
||||
|
||||
m_autoScrollCB = new QCheckBox(tr("Automatically scroll results"));
|
||||
m_autoScrollCB = new QCheckBox(Tr::tr("Automatically scroll results"));
|
||||
m_autoScrollCB->setChecked(true);
|
||||
m_autoScrollCB->setToolTip(tr("Automatically scrolls down when new items are added and scrollbar is at bottom."));
|
||||
m_autoScrollCB->setToolTip(Tr::tr("Automatically scrolls down when new items are added and scrollbar is at bottom."));
|
||||
|
||||
m_displayAppCB = new QCheckBox(tr("Group results by application"));
|
||||
m_displayAppCB = new QCheckBox(Tr::tr("Group results by application"));
|
||||
|
||||
m_processArgsCB = new QCheckBox(tr("Process arguments"));
|
||||
m_processArgsCB = new QCheckBox(Tr::tr("Process arguments"));
|
||||
m_processArgsCB->setToolTip(
|
||||
tr("Allow passing arguments specified on the respective run configuration.\n"
|
||||
Tr::tr("Allow passing arguments specified on the respective run configuration.\n"
|
||||
"Warning: this is an experimental feature and might lead to failing to execute the test executable."));
|
||||
|
||||
m_runAfterBuildCB = new QComboBox;
|
||||
m_runAfterBuildCB->setToolTip(tr("Runs chosen tests automatically if a build succeeded."));
|
||||
m_runAfterBuildCB->addItem(tr("None"));
|
||||
m_runAfterBuildCB->addItem(tr("All"));
|
||||
m_runAfterBuildCB->addItem(tr("Selected"));
|
||||
m_runAfterBuildCB->setToolTip(Tr::tr("Runs chosen tests automatically if a build succeeded."));
|
||||
m_runAfterBuildCB->addItem(Tr::tr("None"));
|
||||
m_runAfterBuildCB->addItem(Tr::tr("All"));
|
||||
m_runAfterBuildCB->addItem(Tr::tr("Selected"));
|
||||
|
||||
auto timeoutLabel = new QLabel(tr("Timeout:"));
|
||||
timeoutLabel->setToolTip(tr("Timeout used when executing each test case."));
|
||||
auto timeoutLabel = new QLabel(Tr::tr("Timeout:"));
|
||||
timeoutLabel->setToolTip(Tr::tr("Timeout used when executing each test case."));
|
||||
|
||||
m_timeoutSpin = new QSpinBox;
|
||||
m_timeoutSpin->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
|
||||
m_timeoutSpin->setRange(5, 36000);
|
||||
m_timeoutSpin->setValue(60);
|
||||
m_timeoutSpin->setSuffix(tr(" s"));
|
||||
m_timeoutSpin->setSuffix(Tr::tr(" s"));
|
||||
m_timeoutSpin->setToolTip(
|
||||
tr("Timeout used when executing test cases. This will apply "
|
||||
"for each test case on its own, not the whole project."));
|
||||
Tr::tr("Timeout used when executing test cases. This will apply "
|
||||
"for each test case on its own, not the whole project."));
|
||||
|
||||
auto resetChoicesButton = new QPushButton(tr("Reset Cached Choices"));
|
||||
auto resetChoicesButton = new QPushButton(Tr::tr("Reset Cached Choices"));
|
||||
resetChoicesButton->setToolTip(
|
||||
tr("Clear all cached choices of run configurations for tests where the executable could not be deduced."));
|
||||
Tr::tr("Clear all cached choices of run configurations for tests where the executable could not be deduced."));
|
||||
|
||||
m_frameworkTreeWidget = new QTreeWidget;
|
||||
m_frameworkTreeWidget->setRootIsDecorated(false);
|
||||
m_frameworkTreeWidget->setHeaderHidden(false);
|
||||
m_frameworkTreeWidget->setColumnCount(2);
|
||||
m_frameworkTreeWidget->header()->setDefaultSectionSize(150);
|
||||
m_frameworkTreeWidget->setToolTip(tr("Selects the test frameworks to be handled by the AutoTest plugin."));
|
||||
m_frameworkTreeWidget->setToolTip(Tr::tr("Selects the test frameworks to be handled by the AutoTest plugin."));
|
||||
|
||||
QTreeWidgetItem *item = m_frameworkTreeWidget->headerItem();
|
||||
item->setText(0, tr("Framework"));
|
||||
item->setToolTip(0, tr("Selects the test frameworks to be handled by the AutoTest plugin."));
|
||||
item->setText(1, tr("Group"));
|
||||
item->setToolTip(1, tr("Enables grouping of test cases."));
|
||||
item->setText(0, Tr::tr("Framework"));
|
||||
item->setToolTip(0, Tr::tr("Selects the test frameworks to be handled by the AutoTest plugin."));
|
||||
item->setText(1, Tr::tr("Group"));
|
||||
item->setToolTip(1, Tr::tr("Enables grouping of test cases."));
|
||||
|
||||
m_frameworksWarn = new Utils::InfoLabel;
|
||||
m_frameworksWarn->setVisible(false);
|
||||
@@ -183,7 +182,7 @@ TestSettingsWidget::TestSettingsWidget(QWidget *parent)
|
||||
using namespace Utils::Layouting;
|
||||
|
||||
Group generalGroup {
|
||||
title(tr("General")),
|
||||
title(Tr::tr("General")),
|
||||
Column {
|
||||
m_omitInternalMsgCB,
|
||||
m_omitRunConfigWarnCB,
|
||||
@@ -195,14 +194,14 @@ TestSettingsWidget::TestSettingsWidget(QWidget *parent)
|
||||
m_autoScrollCB,
|
||||
m_displayAppCB,
|
||||
m_processArgsCB,
|
||||
Row { new QLabel(tr("Automatically run")), m_runAfterBuildCB, st },
|
||||
Row { Tr::tr("Automatically run"), m_runAfterBuildCB, st },
|
||||
Row { timeoutLabel, m_timeoutSpin, st },
|
||||
Row { resetChoicesButton, st }
|
||||
}
|
||||
};
|
||||
|
||||
Group activeFrameworks {
|
||||
title(tr("Active Test Frameworks")),
|
||||
title(Tr::tr("Active Test Frameworks")),
|
||||
Column {
|
||||
m_frameworkTreeWidget,
|
||||
m_frameworksWarn,
|
||||
@@ -286,11 +285,11 @@ void TestSettingsWidget::populateFrameworksListWidget(const QHash<Utils::Id, boo
|
||||
item->setData(0, BaseId, id.toSetting());
|
||||
item->setData(0, BaseType, ITestBase::Framework);
|
||||
item->setData(1, Qt::CheckStateRole, framework->grouping() ? Qt::Checked : Qt::Unchecked);
|
||||
item->setToolTip(0, tr("Enable or disable test frameworks to be handled by the AutoTest "
|
||||
"plugin."));
|
||||
item->setToolTip(0, Tr::tr("Enable or disable test frameworks to be handled by the "
|
||||
"AutoTest plugin."));
|
||||
QString toolTip = framework->groupingToolTip();
|
||||
if (toolTip.isEmpty())
|
||||
toolTip = tr("Enable or disable grouping of test cases by folder.");
|
||||
toolTip = Tr::tr("Enable or disable grouping of test cases by folder.");
|
||||
item->setToolTip(1, toolTip);
|
||||
}
|
||||
// ...and now the test tools
|
||||
@@ -351,13 +350,13 @@ void TestSettingsWidget::onFrameworkItemChanged()
|
||||
|
||||
if (!atLeastOneEnabled || (mixed == (ITestBase::Framework | ITestBase::Tool))) {
|
||||
if (!atLeastOneEnabled) {
|
||||
m_frameworksWarn->setText(tr("No active test frameworks or tools."));
|
||||
m_frameworksWarn->setToolTip(tr("You will not be able to use the AutoTest plugin "
|
||||
"without having at least one active test framework."));
|
||||
m_frameworksWarn->setText(Tr::tr("No active test frameworks or tools."));
|
||||
m_frameworksWarn->setToolTip(Tr::tr("You will not be able to use the AutoTest plugin "
|
||||
"without having at least one active test framework."));
|
||||
} else {
|
||||
m_frameworksWarn->setText(tr("Mixing test frameworks and test tools."));
|
||||
m_frameworksWarn->setToolTip(tr("Mixing test frameworks and test tools can lead "
|
||||
"to duplicating run information when using "
|
||||
m_frameworksWarn->setText(Tr::tr("Mixing test frameworks and test tools."));
|
||||
m_frameworksWarn->setToolTip(Tr::tr("Mixing test frameworks and test tools can lead "
|
||||
"to duplicating run information when using "
|
||||
"\"Run All Tests\", for example."));
|
||||
}
|
||||
}
|
||||
@@ -369,9 +368,9 @@ TestSettingsPage::TestSettingsPage(TestSettings *settings)
|
||||
: m_settings(settings)
|
||||
{
|
||||
setId(Constants::AUTOTEST_SETTINGS_ID);
|
||||
setDisplayName(tr("General"));
|
||||
setDisplayName(Tr::tr("General"));
|
||||
setCategory(Constants::AUTOTEST_SETTINGS_CATEGORY);
|
||||
setDisplayCategory(QCoreApplication::translate("AutoTest", Constants::AUTOTEST_SETTINGS_TR));
|
||||
setDisplayCategory(Tr::tr("Testing"));
|
||||
setCategoryIconPath(":/autotest/images/settingscategory_autotest.png");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user