forked from qt-creator/qt-creator
CMakeProjectManager: Keep using Tr::tr
Amends ac2ca7244
.
Change-Id: I2373767d842c18f68c141a7dce3eab641dd5061d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -2,9 +2,10 @@
|
|||||||
// Copyright (C) 2022 Xavier BESSON
|
// Copyright (C) 2022 Xavier BESSON
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||||
|
|
||||||
|
#include "cmakeformatteroptionspage.h"
|
||||||
|
|
||||||
#include "cmakeprojectconstants.h"
|
#include "cmakeprojectconstants.h"
|
||||||
#include "cmakeprojectmanagertr.h"
|
#include "cmakeprojectmanagertr.h"
|
||||||
#include "cmakeformatteroptionspage.h"
|
|
||||||
#include "cmakeformattersettings.h"
|
#include "cmakeformattersettings.h"
|
||||||
|
|
||||||
#include <utils/layoutbuilder.h>
|
#include <utils/layoutbuilder.h>
|
||||||
@@ -20,8 +21,6 @@ namespace CMakeProjectManager::Internal {
|
|||||||
|
|
||||||
class CMakeFormatterOptionsPageWidget : public Core::IOptionsPageWidget
|
class CMakeFormatterOptionsPageWidget : public Core::IOptionsPageWidget
|
||||||
{
|
{
|
||||||
Q_DECLARE_TR_FUNCTIONS(CMakeFormat::Internal::GeneralOptionsPageWidget)
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit CMakeFormatterOptionsPageWidget();
|
explicit CMakeFormatterOptionsPageWidget();
|
||||||
|
|
||||||
@@ -40,33 +39,33 @@ CMakeFormatterOptionsPageWidget::CMakeFormatterOptionsPageWidget()
|
|||||||
|
|
||||||
auto settings = CMakeFormatterSettings::instance();
|
auto settings = CMakeFormatterSettings::instance();
|
||||||
|
|
||||||
m_autoFormat = new QCheckBox(tr("Enable auto format on file save"));
|
m_autoFormat = new QCheckBox(Tr::tr("Enable auto format on file save"));
|
||||||
m_autoFormat->setChecked(settings->autoFormatOnSave());
|
m_autoFormat->setChecked(settings->autoFormatOnSave());
|
||||||
|
|
||||||
auto mimeLabel = new QLabel(tr("Restrict to MIME types:"));
|
auto mimeLabel = new QLabel(Tr::tr("Restrict to MIME types:"));
|
||||||
mimeLabel->setEnabled(false);
|
mimeLabel->setEnabled(false);
|
||||||
|
|
||||||
m_autoFormatMime = new QLineEdit(settings->autoFormatMimeAsString());
|
m_autoFormatMime = new QLineEdit(settings->autoFormatMimeAsString());
|
||||||
m_autoFormatMime->setEnabled(m_autoFormat->isChecked());
|
m_autoFormatMime->setEnabled(m_autoFormat->isChecked());
|
||||||
|
|
||||||
m_autoFormatOnlyCurrentProject =
|
m_autoFormatOnlyCurrentProject =
|
||||||
new QCheckBox(tr("Restrict to files contained in the current project"));
|
new QCheckBox(Tr::tr("Restrict to files contained in the current project"));
|
||||||
m_autoFormatOnlyCurrentProject->setEnabled(m_autoFormat->isChecked());
|
m_autoFormatOnlyCurrentProject->setEnabled(m_autoFormat->isChecked());
|
||||||
m_autoFormatOnlyCurrentProject->setChecked(settings->autoFormatOnlyCurrentProject());
|
m_autoFormatOnlyCurrentProject->setChecked(settings->autoFormatOnlyCurrentProject());
|
||||||
|
|
||||||
m_command = new Utils::PathChooser;
|
m_command = new Utils::PathChooser;
|
||||||
m_command->setExpectedKind(Utils::PathChooser::ExistingCommand);
|
m_command->setExpectedKind(Utils::PathChooser::ExistingCommand);
|
||||||
m_command->setCommandVersionArguments({"--version"});
|
m_command->setCommandVersionArguments({"--version"});
|
||||||
m_command->setPromptDialogTitle(tr("%1 Command").arg(Tr::Tr::tr("Formatter")));
|
m_command->setPromptDialogTitle(Tr::tr("%1 Command").arg(Tr::tr("Formatter")));
|
||||||
m_command->setFilePath(settings->command());
|
m_command->setFilePath(settings->command());
|
||||||
|
|
||||||
using namespace Utils::Layouting;
|
using namespace Utils::Layouting;
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
Group {
|
Group {
|
||||||
title(tr("Automatic Formatting on File Save")),
|
title(Tr::tr("Automatic Formatting on File Save")),
|
||||||
Form {
|
Form {
|
||||||
tr("CMakeFormat command:"), m_command, br,
|
Tr::tr("CMakeFormat command:"), m_command, br,
|
||||||
Span(2, m_autoFormat), br,
|
Span(2, m_autoFormat), br,
|
||||||
mimeLabel, m_autoFormatMime, br,
|
mimeLabel, m_autoFormatMime, br,
|
||||||
Span(2, m_autoFormatOnlyCurrentProject)
|
Span(2, m_autoFormatOnlyCurrentProject)
|
||||||
@@ -93,7 +92,7 @@ void CMakeFormatterOptionsPageWidget::apply()
|
|||||||
CMakeFormatterOptionsPage::CMakeFormatterOptionsPage()
|
CMakeFormatterOptionsPage::CMakeFormatterOptionsPage()
|
||||||
{
|
{
|
||||||
setId(Constants::Settings::FORMATTER_ID);
|
setId(Constants::Settings::FORMATTER_ID);
|
||||||
setDisplayName(Tr::Tr::tr("Formatter"));
|
setDisplayName(Tr::tr("Formatter"));
|
||||||
setDisplayCategory("CMake");
|
setDisplayCategory("CMake");
|
||||||
setCategory(Constants::Settings::CATEGORY);
|
setCategory(Constants::Settings::CATEGORY);
|
||||||
setWidgetCreator([] { return new CMakeFormatterOptionsPageWidget; });
|
setWidgetCreator([] { return new CMakeFormatterOptionsPageWidget; });
|
||||||
|
Reference in New Issue
Block a user