summaryrefslogtreecommitdiff
path: root/src/plugins/projectexplorer/projectmodels.cpp
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2023-01-13 12:38:22 +0100
committerhjk <hjk@qt.io>2023-01-16 12:10:24 +0000
commitc5f7f5ab0aab672180714cb172818aa3cd394c90 (patch)
treec0c37400cacb71c62af445a599cfa7d39802c38c /src/plugins/projectexplorer/projectmodels.cpp
parente373fe6aa91f455c52b4fc390e600c4116871652 (diff)
downloadqt-creator-c5f7f5ab0aab672180714cb172818aa3cd394c90.tar.gz
ProjectExplorer: Tr::tr
Change-Id: I8f1b463c5cc7a53627f7a9ad261998b92f13e56a Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Diffstat (limited to 'src/plugins/projectexplorer/projectmodels.cpp')
-rw-r--r--src/plugins/projectexplorer/projectmodels.cpp40
1 files changed, 20 insertions, 20 deletions
diff --git a/src/plugins/projectexplorer/projectmodels.cpp b/src/plugins/projectexplorer/projectmodels.cpp
index 0ca3092e6d..0a761f91e6 100644
--- a/src/plugins/projectexplorer/projectmodels.cpp
+++ b/src/plugins/projectexplorer/projectmodels.cpp
@@ -7,6 +7,7 @@
#include "project.h"
#include "projectnodes.h"
#include "projectexplorer.h"
+#include "projectexplorertr.h"
#include "projecttree.h"
#include "session.h"
#include "target.h"
@@ -209,7 +210,7 @@ QVariant FlatModel::data(const QModelIndex &index, int role) const
if (!projectIssues.isEmpty())
tooltip += "<p>" + projectIssues;
} else {
- tooltip += "<p>" + tr("No kits are enabled for this project. "
+ tooltip += "<p>" + Tr::tr("No kits are enabled for this project. "
"Enable kits in the \"Projects\" mode.");
}
}
@@ -295,8 +296,8 @@ bool FlatModel::setData(const QModelIndex &index, const QVariant &value, int rol
});
fileNames.removeDuplicates();
const QMessageBox::StandardButton reply = QMessageBox::question(
- Core::ICore::dialogParent(), tr("Rename More Files?"),
- tr("Would you like to rename these files as well?\n %1")
+ Core::ICore::dialogParent(), Tr::tr("Rename More Files?"),
+ Tr::tr("Would you like to rename these files as well?\n %1")
.arg(fileNames.join("\n ")),
QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel,
QMessageBox::Yes);
@@ -570,17 +571,16 @@ enum class DropAction { Copy, CopyWithFiles, Move, MoveWithFiles };
class DropFileDialog : public QDialog
{
- Q_DECLARE_TR_FUNCTIONS(ProjectExplorer::Internal::FlatModel)
public:
DropFileDialog(const FilePath &defaultTargetDir)
: m_buttonBox(new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel)),
m_buttonGroup(new QButtonGroup(this))
{
- setWindowTitle(tr("Choose Drop Action"));
+ setWindowTitle(Tr::tr("Choose Drop Action"));
const bool offerFileIo = !defaultTargetDir.isEmpty();
auto * const layout = new QVBoxLayout(this);
const QString idename(Core::Constants::IDE_DISPLAY_NAME);
- layout->addWidget(new QLabel(tr("You just dragged some files from one project node to "
+ layout->addWidget(new QLabel(Tr::tr("You just dragged some files from one project node to "
"another.\nWhat should %1 do now?").arg(idename), this));
auto * const copyButton = new QRadioButton(this);
m_buttonGroup->addButton(copyButton, int(DropAction::Copy));
@@ -589,20 +589,20 @@ public:
m_buttonGroup->addButton(moveButton, int(DropAction::Move));
layout->addWidget(moveButton);
if (offerFileIo) {
- copyButton->setText(tr("Copy Only File References"));
- moveButton->setText(tr("Move Only File References"));
+ copyButton->setText(Tr::tr("Copy Only File References"));
+ moveButton->setText(Tr::tr("Move Only File References"));
auto * const copyWithFilesButton
- = new QRadioButton(tr("Copy file references and files"), this);
+ = new QRadioButton(Tr::tr("Copy file references and files"), this);
m_buttonGroup->addButton(copyWithFilesButton, int(DropAction::CopyWithFiles));
layout->addWidget(copyWithFilesButton);
auto * const moveWithFilesButton
- = new QRadioButton(tr("Move file references and files"), this);
+ = new QRadioButton(Tr::tr("Move file references and files"), this);
m_buttonGroup->addButton(moveWithFilesButton, int(DropAction::MoveWithFiles));
layout->addWidget(moveWithFilesButton);
moveWithFilesButton->setChecked(true);
auto * const targetDirLayout = new QHBoxLayout;
layout->addLayout(targetDirLayout);
- targetDirLayout->addWidget(new QLabel(tr("Target directory:"), this));
+ targetDirLayout->addWidget(new QLabel(Tr::tr("Target directory:"), this));
m_targetDirChooser = new PathChooser(this);
m_targetDirChooser->setExpectedKind(PathChooser::ExistingDirectory);
m_targetDirChooser->setFilePath(defaultTargetDir);
@@ -626,8 +626,8 @@ public:
}
});
} else {
- copyButton->setText(tr("Copy File References"));
- moveButton->setText(tr("Move File References"));
+ copyButton->setText(Tr::tr("Copy File References"));
+ moveButton->setText(Tr::tr("Move File References"));
moveButton->setChecked(true);
}
connect(m_buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
@@ -821,31 +821,31 @@ bool FlatModel::dropMimeData(const QMimeData *data, Qt::DropAction action, int r
};
if (!failedAddToProject.empty() || !failedRemoveFromProject.empty()
|| !failedCopyOrMove.empty() || !failedDelete.empty() || !failedVcsOp.empty()) {
- QString message = tr("Not all operations finished successfully.");
+ QString message = Tr::tr("Not all operations finished successfully.");
if (!failedCopyOrMove.empty()) {
- message.append('\n').append(tr("The following files could not be copied or moved:"))
+ message.append('\n').append(Tr::tr("The following files could not be copied or moved:"))
.append("\n ").append(makeUserFileList(failedCopyOrMove));
}
if (!failedRemoveFromProject.empty()) {
- message.append('\n').append(tr("The following files could not be removed from the "
+ message.append('\n').append(Tr::tr("The following files could not be removed from the "
"project file:"))
.append("\n ").append(makeUserFileList(failedRemoveFromProject));
}
if (!failedAddToProject.empty()) {
- message.append('\n').append(tr("The following files could not be added to the "
+ message.append('\n').append(Tr::tr("The following files could not be added to the "
"project file:"))
.append("\n ").append(makeUserFileList(failedAddToProject));
}
if (!failedDelete.empty()) {
- message.append('\n').append(tr("The following files could not be deleted:"))
+ message.append('\n').append(Tr::tr("The following files could not be deleted:"))
.append("\n ").append(makeUserFileList(failedDelete));
}
if (!failedVcsOp.empty()) {
- message.append('\n').append(tr("A version control operation failed for the following "
+ message.append('\n').append(Tr::tr("A version control operation failed for the following "
"files. Please check your repository."))
.append("\n ").append(makeUserFileList(failedVcsOp));
}
- QMessageBox::warning(Core::ICore::dialogParent(), tr("Failure Updating Project"), message);
+ QMessageBox::warning(Core::ICore::dialogParent(), Tr::tr("Failure Updating Project"), message);
}
return true;