diff options
author | Alessandro Portale <[email protected]> | 2023-01-24 16:49:41 +0100 |
---|---|---|
committer | Alessandro Portale <[email protected]> | 2023-02-01 13:48:22 +0000 |
commit | 4d6827dde9248b6b47949b535ae361e8c6b04cfa (patch) | |
tree | 8f84c51ee000d05fcfede7f47e10ed5d85b6853c /src/libs/utils/projectintropage.cpp | |
parent | 17b28909a99cce2dc908ad2ffbb43a85539fa526 (diff) |
Utils: Tr::tr
Change-Id: Ic03e20993f05fb5b49a12c891d86afb2c8e18e08
Reviewed-by: Qt CI Bot <[email protected]>
Reviewed-by: hjk <[email protected]>
Diffstat (limited to 'src/libs/utils/projectintropage.cpp')
-rw-r--r-- | src/libs/utils/projectintropage.cpp | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/src/libs/utils/projectintropage.cpp b/src/libs/utils/projectintropage.cpp index 2a9dbe7ffa9..8df64b97f06 100644 --- a/src/libs/utils/projectintropage.cpp +++ b/src/libs/utils/projectintropage.cpp @@ -9,6 +9,7 @@ #include "infolabel.h" #include "layoutbuilder.h" #include "pathchooser.h" +#include "utilstr.h" #include "wizard.h" #include <QApplication> @@ -66,7 +67,7 @@ ProjectIntroPage::ProjectIntroPage(QWidget *parent) : d(new ProjectIntroPagePrivate) { resize(355, 289); - setTitle(tr("Introduction and Project Location")); + setTitle(Tr::tr("Introduction and Project Location")); d->m_descriptionLabel = new QLabel(this); d->m_descriptionLabel->setWordWrap(true); @@ -81,7 +82,7 @@ ProjectIntroPage::ProjectIntroPage(QWidget *parent) : d->m_pathChooser->setExpectedKind(PathChooser::Directory); d->m_pathChooser->setDisabled(d->m_forceSubProject); - d->m_projectsDirectoryCheckBox = new QCheckBox(tr("Use as default project location")); + d->m_projectsDirectoryCheckBox = new QCheckBox(Tr::tr("Use as default project location")); d->m_projectsDirectoryCheckBox->setObjectName("projectsDirectoryCheckBox"); d->m_projectsDirectoryCheckBox->setDisabled(d->m_forceSubProject); @@ -94,7 +95,7 @@ ProjectIntroPage::ProjectIntroPage(QWidget *parent) : d->m_stateLabel->setFilled(true); hideStatusLabel(); - d->m_nameLineEdit->setPlaceholderText(tr("Enter project name")); + d->m_nameLineEdit->setPlaceholderText(Tr::tr("Enter project name")); d->m_nameLineEdit->setObjectName("nameLineEdit"); d->m_nameLineEdit->setFocus(); d->m_nameLineEdit->setValidationFunction([this](FancyLineEdit *edit, QString *errorString) { @@ -107,10 +108,10 @@ ProjectIntroPage::ProjectIntroPage(QWidget *parent) : using namespace Layouting; Form { - tr("Name:"), d->m_nameLineEdit, br, + Tr::tr("Name:"), d->m_nameLineEdit, br, d->m_projectLabel, d->m_projectComboBox, br, Column { Space(12) }, br, - tr("Create in:"), d->m_pathChooser, br, + Tr::tr("Create in:"), d->m_pathChooser, br, Span(2, d->m_projectsDirectoryCheckBox) }.attachTo(frame); @@ -134,7 +135,7 @@ ProjectIntroPage::ProjectIntroPage(QWidget *parent) : connect(d->m_projectComboBox, &QComboBox::currentIndexChanged, this, &ProjectIntroPage::slotChanged); - setProperty(SHORT_TITLE_PROPERTY, tr("Location")); + setProperty(SHORT_TITLE_PROPERTY, Tr::tr("Location")); registerFieldWithName(QLatin1String("Path"), d->m_pathChooser, "path", SIGNAL(textChanged(QString))); registerFieldWithName(QLatin1String("ProjectName"), d->m_nameLineEdit); } @@ -207,7 +208,7 @@ bool ProjectIntroPage::validate() displayStatusMessage(InfoLabel::Error, d->m_nameLineEdit->errorMessage()); return false; case FancyLineEdit::DisplayingPlaceholderText: - displayStatusMessage(InfoLabel::Error, tr("Name is empty.")); + displayStatusMessage(InfoLabel::Error, Tr::tr("Name is empty.")); return false; case FancyLineEdit::Valid: break; @@ -219,7 +220,7 @@ bool ProjectIntroPage::validate() if (!projectDir.exists()) { // All happy if (!d->m_pathChooser->filePath().exists()) { - displayStatusMessage(InfoLabel::Information, tr("Directory \"%1\" will be created.") + displayStatusMessage(InfoLabel::Information, Tr::tr("Directory \"%1\" will be created.") .arg(d->m_pathChooser->filePath().toUserOutput())); } else { hideStatusLabel(); @@ -228,11 +229,11 @@ bool ProjectIntroPage::validate() } if (projectDir.isDir()) { - displayStatusMessage(InfoLabel::Warning, tr("The project already exists.")); + displayStatusMessage(InfoLabel::Warning, Tr::tr("The project already exists.")); return true; } // Not a directory, but something else, likely causing directory creation to fail - displayStatusMessage(InfoLabel::Error, tr("A file with that name already exists.")); + displayStatusMessage(InfoLabel::Error, Tr::tr("A file with that name already exists.")); return false; } @@ -293,7 +294,7 @@ bool ProjectIntroPage::validateProjectName(const QString &name, QString *errorMe if (!d->m_projectNameValidator.regularExpression().pattern().isEmpty()) { if (name.isEmpty()) { if (errorMessage) - *errorMessage = tr("Name is empty."); + *errorMessage = Tr::tr("Name is empty."); return false; } // pos is set by reference @@ -305,7 +306,7 @@ bool ProjectIntroPage::validateProjectName(const QString &name, QString *errorMe if (validatorState != QValidator::Acceptable && (pos == -1 || pos >= name.count())) { if (errorMessage) { if (d->m_projectNameValidatorUserMessage.isEmpty()) - *errorMessage = tr("Project name is invalid."); + *errorMessage = Tr::tr("Project name is invalid."); else *errorMessage = d->m_projectNameValidatorUserMessage; } @@ -317,14 +318,14 @@ bool ProjectIntroPage::validateProjectName(const QString &name, QString *errorMe return false; if (name.contains(QLatin1Char('.'))) { if (errorMessage) - *errorMessage = tr("Invalid character \".\"."); + *errorMessage = Tr::tr("Invalid character \".\"."); return false; } pos = FileUtils::indexOfQmakeUnfriendly(name); } if (pos >= 0) { if (errorMessage) - *errorMessage = tr("Invalid character \"%1\" found.").arg(name.at(pos)); + *errorMessage = Tr::tr("Invalid character \"%1\" found.").arg(name.at(pos)); return false; } return true; |