diff options
author | Friedemann Kleint <[email protected]> | 2012-07-27 15:43:00 +0200 |
---|---|---|
committer | Friedemann Kleint <[email protected]> | 2012-07-27 17:08:12 +0200 |
commit | bf980649d2f28266838b7e16e8828a2271d8a69c (patch) | |
tree | 0a9b6a0bebea42de04404f1d737fe75c885af6b8 /src | |
parent | 5635272b44a8a5a79fbb073180ca8aa8414d1dab (diff) |
tr()-Fixes for 2.6.
- ProjectExplorer::Profile should appear as 'Target' in the UI.
- Fix messagebox title capitalization
- Fix Q_DECLARE_TR_FUNCTIONS to contain fully qualified class
names, add where applicable to replace
QCoreApplication::translate().
- Introduce message utility function for the commonly used
'No tool chain set up for this profile' message to
ToolChainProfileInformation.
- Introduce message utility functions related to adding files
to version control to VcsManager to be shared by QmlJsEditor.
- Fix typos.
- Remove QObject::tr(), QCoreApplication::tr().
- Do not translate diagnostic console warnings of
QmlProfiler.
Change-Id: I6cee717a504796ef39f6eae58f552c5c8630adf3
Reviewed-by: Tobias Hunger <[email protected]>
Diffstat (limited to 'src')
42 files changed, 133 insertions, 85 deletions
diff --git a/src/plugins/analyzerbase/startremotedialog.cpp b/src/plugins/analyzerbase/startremotedialog.cpp index 5d1e3856c1e..ec728134592 100644 --- a/src/plugins/analyzerbase/startremotedialog.cpp +++ b/src/plugins/analyzerbase/startremotedialog.cpp @@ -80,7 +80,7 @@ StartRemoteDialog::StartRemoteDialog(QWidget *parent) QFormLayout *formLayout = new QFormLayout; formLayout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow); - formLayout->addRow(tr("Profile:"), d->profileChooser); + formLayout->addRow(tr("Target:"), d->profileChooser); formLayout->addRow(tr("Executable:"), d->executable); formLayout->addRow(tr("Arguments:"), d->arguments); formLayout->addRow(tr("Working directory:"), d->workingDirectory); diff --git a/src/plugins/android/androiddevice.cpp b/src/plugins/android/androiddevice.cpp index 35ff2d1f4bc..83ee64d9401 100644 --- a/src/plugins/android/androiddevice.cpp +++ b/src/plugins/android/androiddevice.cpp @@ -44,7 +44,7 @@ AndroidDevice::AndroidDevice() IDevice::Hardware, Core::Id(Constants::ANDROID_DEVICE_ID)) { - setDisplayName(QCoreApplication::translate("ProjectExplorer::AndroidDevice", "Run on Android")); + setDisplayName(QCoreApplication::translate("Android::Internal::AndroidDevice", "Run on Android")); setDeviceState(DeviceReadyToUse); } @@ -60,7 +60,7 @@ IDevice::DeviceInfo AndroidDevice::deviceInformation() const QString AndroidDevice::displayType() const { - return QCoreApplication::translate("ProjectExplorer::AndroidDevice", "Android"); + return QCoreApplication::translate("Android::Internal::AndroidDevice", "Android"); } IDeviceWidget *AndroidDevice::createWidget() diff --git a/src/plugins/android/androidpackagecreationfactory.cpp b/src/plugins/android/androidpackagecreationfactory.cpp index bc4ad5d618e..17866624306 100644 --- a/src/plugins/android/androidpackagecreationfactory.cpp +++ b/src/plugins/android/androidpackagecreationfactory.cpp @@ -67,8 +67,7 @@ QList<Core::Id> AndroidPackageCreationFactory::availableCreationIds(ProjectExplo QString AndroidPackageCreationFactory::displayNameForId(const Core::Id id) const { if (id == AndroidPackageCreationStep::CreatePackageId) - return QCoreApplication::translate("Qt4ProjectManager::Internal::AndroidPackageCreationFactory", - "Create Android (.apk) Package"); + return tr("Create Android (.apk) Package"); return QString(); } diff --git a/src/plugins/android/androidpackagecreationfactory.h b/src/plugins/android/androidpackagecreationfactory.h index 81abadd06b5..c8bac435e4c 100644 --- a/src/plugins/android/androidpackagecreationfactory.h +++ b/src/plugins/android/androidpackagecreationfactory.h @@ -38,6 +38,7 @@ namespace Internal { class AndroidPackageCreationFactory : public ProjectExplorer::IBuildStepFactory { + Q_OBJECT public: explicit AndroidPackageCreationFactory(QObject *parent = 0); diff --git a/src/plugins/android/androidpackageinstallationfactory.cpp b/src/plugins/android/androidpackageinstallationfactory.cpp index 15ae7b0f7fb..821a5e7a4a9 100644 --- a/src/plugins/android/androidpackageinstallationfactory.cpp +++ b/src/plugins/android/androidpackageinstallationfactory.cpp @@ -65,8 +65,7 @@ QList<Core::Id> AndroidPackageInstallationFactory::availableCreationIds(BuildSte QString AndroidPackageInstallationFactory::displayNameForId(const Core::Id id) const { if (id == AndroidPackageInstallationStep::Id) - return QCoreApplication::translate("Qt4ProjectManager::Internal::AndroidPackageInstallationFactory", - "Deploy to device"); + return tr("Deploy to device"); return QString(); } diff --git a/src/plugins/android/androidqtversion.cpp b/src/plugins/android/androidqtversion.cpp index c1046a7f1d3..36a9c3ecaf3 100644 --- a/src/plugins/android/androidqtversion.cpp +++ b/src/plugins/android/androidqtversion.cpp @@ -34,8 +34,6 @@ #include <qtsupport/qtsupportconstants.h> -#include <QCoreApplication> - using namespace Android::Internal; AndroidQtVersion::AndroidQtVersion() @@ -77,7 +75,7 @@ QString AndroidQtVersion::invalidReason() const { QString tmp = BaseQtVersion::invalidReason(); if (tmp.isEmpty() && qtAbis().isEmpty()) - return QCoreApplication::translate("QtVersion", "Failed to detect the ABI(s) used by the Qt version."); + return tr("Failed to detect the ABI(s) used by the Qt version."); return tmp; } @@ -90,7 +88,7 @@ QList<ProjectExplorer::Abi> AndroidQtVersion::detectQtAbis() const QString AndroidQtVersion::description() const { - return QCoreApplication::translate("QtVersion", "Android", "Qt Version is meant for Android"); + return tr("Android::Internal::AndroidQtVersion", "Qt Version is meant for Android"); } Core::FeatureSet AndroidQtVersion::availableFeatures() const diff --git a/src/plugins/android/androidqtversion.h b/src/plugins/android/androidqtversion.h index 81108cfe7e9..6dd4df85be0 100644 --- a/src/plugins/android/androidqtversion.h +++ b/src/plugins/android/androidqtversion.h @@ -30,13 +30,17 @@ #ifndef ANDROIDQTVERSION_H #define ANDROIDQTVERSION_H + #include <qtsupport/baseqtversion.h> +#include <QCoreApplication> + namespace Android { namespace Internal { class AndroidQtVersion : public QtSupport::BaseQtVersion { + Q_DECLARE_TR_FUNCTIONS(Android::Internal::AndroidQtVersion) public: AndroidQtVersion(); AndroidQtVersion(const Utils::FileName &path, bool isAutodetected = false, const QString &autodetectionSource = QString()); diff --git a/src/plugins/autotoolsprojectmanager/makestep.cpp b/src/plugins/autotoolsprojectmanager/makestep.cpp index 508ab163718..a03d696104e 100644 --- a/src/plugins/autotoolsprojectmanager/makestep.cpp +++ b/src/plugins/autotoolsprojectmanager/makestep.cpp @@ -304,7 +304,7 @@ void MakeStepConfigWidget::updateDetails() param.setArguments(arguments); m_summaryText = param.summary(displayName()); } else { - m_summaryText = tr("<b>No tool chain set up for this profile</b>"); + m_summaryText = QLatin1String("<b>") + ProjectExplorer::ToolChainProfileInformation::msgNoToolChainInTarget() + QLatin1String("</b>"); } emit updateSummary(); diff --git a/src/plugins/cmakeprojectmanager/makestep.cpp b/src/plugins/cmakeprojectmanager/makestep.cpp index 35b3d79915a..87798353206 100644 --- a/src/plugins/cmakeprojectmanager/makestep.cpp +++ b/src/plugins/cmakeprojectmanager/makestep.cpp @@ -322,7 +322,7 @@ void MakeStepConfigWidget::updateDetails() param.setArguments(arguments); m_summaryText = param.summary(displayName()); } else { - m_summaryText = tr("<b>No tool chain set for this target</b>"); + m_summaryText = QLatin1String("<b>") + ProjectExplorer::ToolChainProfileInformation::msgNoToolChainInTarget() + QLatin1String("</b>"); } emit updateSummary(); } diff --git a/src/plugins/coreplugin/vcsmanager.cpp b/src/plugins/coreplugin/vcsmanager.cpp index b392cd1ab2b..443feb8256f 100644 --- a/src/plugins/coreplugin/vcsmanager.cpp +++ b/src/plugins/coreplugin/vcsmanager.cpp @@ -326,17 +326,44 @@ bool VcsManager::promptToDelete(IVersionControl *vc, const QString &fileName) return vc->vcsDelete(fileName); } +QString VcsManager::msgAddToVcsTitle() +{ + return tr("Add to Version Control"); +} + +QString VcsManager::msgPromptToAddToVcs(const QStringList &files, const IVersionControl *vc) +{ + return files.size() == 1 + ? tr("Add the file\n%1\nto version control (%2)?") + .arg(files.front(), vc->displayName()) + : tr("Add the files\n%1\nto version control (%2)?") + .arg(files.join(QString(QLatin1Char('\n'))), vc->displayName()); +} + +QString VcsManager::msgAddToVcsFailedTitle() +{ + return tr("Adding to Version Control Failed"); +} + +QString VcsManager::msgToAddToVcsFailed(const QStringList &files, const IVersionControl *vc) +{ + return files.size() == 1 + ? tr("Could not add the file\n%1\nto version control (%2)\n") + .arg(files.front(), vc->displayName()) + : tr("Could not add the following files to version control (%1)\n%2") + .arg(vc->displayName(), files.join(QString(QLatin1Char('\n')))); +} + void VcsManager::promptToAdd(const QString &directory, const QStringList &fileNames) { IVersionControl *vc = findVersionControlForDirectory(directory); if (!vc || !vc->supportsOperation(Core::IVersionControl::AddOperation)) return; - const QString files = fileNames.join(QString(QLatin1Char('\n'))); QMessageBox::StandardButton button = - QMessageBox::question(Core::ICore::mainWindow(), tr("Add to Version Control"), - tr("Add files\n%1\nto version control (%2)?").arg(files, vc->displayName()), - QMessageBox::Yes | QMessageBox::No); + QMessageBox::question(Core::ICore::mainWindow(), VcsManager::msgAddToVcsTitle(), + VcsManager::msgPromptToAddToVcs(fileNames, vc), + QMessageBox::Yes | QMessageBox::No); if (button == QMessageBox::Yes) { QStringList notAddedToVc; foreach (const QString &file, fileNames) { @@ -345,10 +372,8 @@ void VcsManager::promptToAdd(const QString &directory, const QStringList &fileNa } if (!notAddedToVc.isEmpty()) { - const QString message = tr("Could not add following files to version control (%1)\n").arg(vc->displayName()); - const QString filesNotAdded = notAddedToVc.join(QString(QLatin1Char('\n'))); - QMessageBox::warning(Core::ICore::mainWindow(), tr("Adding to Version Control Failed"), - message + filesNotAdded); + QMessageBox::warning(Core::ICore::mainWindow(), VcsManager::msgAddToVcsFailedTitle(), + VcsManager::msgToAddToVcsFailed(notAddedToVc, vc)); } } } diff --git a/src/plugins/coreplugin/vcsmanager.h b/src/plugins/coreplugin/vcsmanager.h index 4f25d36f523..42d25de13af 100644 --- a/src/plugins/coreplugin/vcsmanager.h +++ b/src/plugins/coreplugin/vcsmanager.h @@ -87,6 +87,12 @@ public: // added to revision control. Calls vcsAdd for each file. void promptToAdd(const QString &directory, const QStringList &fileNames); + // Utility messages for adding files + static QString msgAddToVcsTitle(); + static QString msgPromptToAddToVcs(const QStringList &files, const IVersionControl *vc); + static QString msgAddToVcsFailedTitle(); + static QString msgToAddToVcsFailed(const QStringList &files, const IVersionControl *vc); + signals: void repositoryChanged(const QString &repository); diff --git a/src/plugins/cppeditor/cppfunctiondecldeflink.h b/src/plugins/cppeditor/cppfunctiondecldeflink.h index b8052296ae7..599d8bc2101 100644 --- a/src/plugins/cppeditor/cppfunctiondecldeflink.h +++ b/src/plugins/cppeditor/cppfunctiondecldeflink.h @@ -77,7 +77,7 @@ private: class FunctionDeclDefLink { - Q_DECLARE_TR_FUNCTIONS(FunctionDeclDefLink) + Q_DECLARE_TR_FUNCTIONS(CppEditor::Internal::FunctionDeclDefLink) Q_DISABLE_COPY(FunctionDeclDefLink) public: ~FunctionDeclDefLink(); diff --git a/src/plugins/debugger/debuggerdialogs.cpp b/src/plugins/debugger/debuggerdialogs.cpp index 9b74cd31de1..87cc1348478 100644 --- a/src/plugins/debugger/debuggerdialogs.cpp +++ b/src/plugins/debugger/debuggerdialogs.cpp @@ -1243,7 +1243,7 @@ StartRemoteEngineDialog::StartRemoteEngineDialog(QWidget *parent) QFormLayout *formLayout = new QFormLayout(); formLayout->addRow(tr("&Host:"), d->host); - formLayout->addRow(tr("&Usename:"), d->username); + formLayout->addRow(tr("&Username:"), d->username); formLayout->addRow(tr("&Password:"), d->password); formLayout->addRow(tr("&Engine path:"), d->enginePath); formLayout->addRow(tr("&Inferior path:"), d->inferiorPath); diff --git a/src/plugins/debugger/stackframe.h b/src/plugins/debugger/stackframe.h index 9bfba2a09ea..3c7ed26c380 100644 --- a/src/plugins/debugger/stackframe.h +++ b/src/plugins/debugger/stackframe.h @@ -62,7 +62,7 @@ public: quint64 address; bool usable; - Q_DECLARE_TR_FUNCTIONS(StackHandler) + Q_DECLARE_TR_FUNCTIONS(Debugger::Internal::StackHandler) }; QDebug operator<<(QDebug d, const StackFrame &frame); diff --git a/src/plugins/madde/debianmanager.cpp b/src/plugins/madde/debianmanager.cpp index 399f1b0040c..a2b6442bd31 100644 --- a/src/plugins/madde/debianmanager.cpp +++ b/src/plugins/madde/debianmanager.cpp @@ -127,8 +127,7 @@ QByteArray section(Core::Id deviceType) { void raiseError(const QString &reason) { - QMessageBox::critical(0, QCoreApplication::translate("Madde::DebianManager", - "Error creating debian project templates"), reason); + QMessageBox::critical(0, Madde::Internal::DebianManager::tr("Error Creating Debian Project Templates"), reason); } QString defaultPackageFileName(ProjectExplorer::Project *project) diff --git a/src/plugins/madde/maddedevice.h b/src/plugins/madde/maddedevice.h index 27feaa10bfb..052471cb4b0 100644 --- a/src/plugins/madde/maddedevice.h +++ b/src/plugins/madde/maddedevice.h @@ -39,7 +39,7 @@ namespace Internal { class MaddeDevice : public RemoteLinux::LinuxDeviceConfiguration { - Q_DECLARE_TR_FUNCTIONS(MaddeDevice) + Q_DECLARE_TR_FUNCTIONS(Madde::Internal::MaddeDevice) public: typedef QSharedPointer<MaddeDevice> Ptr; typedef QSharedPointer<const MaddeDevice> ConstPtr; diff --git a/src/plugins/madde/maemopublisherfremantlefree.cpp b/src/plugins/madde/maemopublisherfremantlefree.cpp index 9ea038b0cb7..f754e9e1100 100644 --- a/src/plugins/madde/maemopublisherfremantlefree.cpp +++ b/src/plugins/madde/maemopublisherfremantlefree.cpp @@ -312,8 +312,10 @@ void MaemoPublisherFremantleFree::handleProcessFinished(bool failedToStart) // Toolchain might be null! (yes because this sucks) ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainProfileInformation::toolChain(m_buildConfig->target()->profile()); - if (!tc) - finishWithFailure(QString(), tr("Make distclean failed. No toolchain in profile.")); + if (!tc) { + finishWithFailure(QString(), tr("Make distclean failed: %1") + .arg(ProjectExplorer::ToolChainProfileInformation::msgNoToolChainInTarget())); + } m_process->start(tc->makeCommand(), QStringList() << QLatin1String("distclean")); } break; diff --git a/src/plugins/projectexplorer/profileinformation.cpp b/src/plugins/projectexplorer/profileinformation.cpp index 39e1648b5fe..c75f265a9aa 100644 --- a/src/plugins/projectexplorer/profileinformation.cpp +++ b/src/plugins/projectexplorer/profileinformation.cpp @@ -81,9 +81,10 @@ QList<Task> SysRootProfileInformation::validate(Profile *p) const { QList<Task> result; const Utils::FileName dir = SysRootProfileInformation::sysRoot(p); - if (!dir.toFileInfo().isDir() && SysRootProfileInformation::hasSysRoot(p)) - result << Task(Task::Error, QObject::tr("Sys Root \"%1\" is not a directory.").arg(dir.toUserOutput()), + if (!dir.toFileInfo().isDir() && SysRootProfileInformation::hasSysRoot(p)) { + result << Task(Task::Error, tr("Sys Root \"%1\" is not a directory.").arg(dir.toUserOutput()), Utils::FileName(), -1, Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM)); + } return result; } @@ -165,7 +166,7 @@ QList<Task> ToolChainProfileInformation::validate(Profile *p) const QList<Task> result; if (!toolChain(p)) { setToolChain(p, 0); // make sure to clear out no longer known tool chains - result << Task(Task::Error, QObject::tr("No tool chain set up."), + result << Task(Task::Error, ToolChainProfileInformation::msgNoToolChainInTarget(), Utils::FileName(), -1, Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM)); } return result; @@ -203,6 +204,11 @@ void ToolChainProfileInformation::setToolChain(Profile *p, ToolChain *tc) p->setValue(Core::Id(TOOLCHAIN_INFORMATION), tc ? tc->id() : QString()); } +QString ToolChainProfileInformation::msgNoToolChainInTarget() +{ + return tr("No tool chain set in target."); +} + // -------------------------------------------------------------------------- // DeviceTypeInformation: // -------------------------------------------------------------------------- @@ -236,7 +242,7 @@ QList<Task> DeviceTypeProfileInformation::validate(Profile *p) const IDevice::ConstPtr dev = DeviceProfileInformation::device(p); QList<Task> result; if (!dev.isNull() && dev->type() != DeviceTypeProfileInformation::deviceTypeId(p)) - result.append(Task(Task::Error, QObject::tr("Device does not match device type."), + result.append(Task(Task::Error, tr("Device does not match device type."), Utils::FileName(), -1, Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM))); return result; } diff --git a/src/plugins/projectexplorer/profileinformation.h b/src/plugins/projectexplorer/profileinformation.h index 8565d2153f1..24485b33e69 100644 --- a/src/plugins/projectexplorer/profileinformation.h +++ b/src/plugins/projectexplorer/profileinformation.h @@ -113,6 +113,8 @@ public: static ToolChain *toolChain(const Profile *p); static void setToolChain(Profile *p, ToolChain *tc); + + static QString msgNoToolChainInTarget(); }; class PROJECTEXPLORER_EXPORT ToolChainMatcher : public ProfileMatcher diff --git a/src/plugins/projectexplorer/profilemanagerconfigwidget.cpp b/src/plugins/projectexplorer/profilemanagerconfigwidget.cpp index fe0d94f02b2..72d7693b983 100644 --- a/src/plugins/projectexplorer/profilemanagerconfigwidget.cpp +++ b/src/plugins/projectexplorer/profilemanagerconfigwidget.cpp @@ -93,7 +93,7 @@ ProfileManagerConfigWidget::ProfileManagerConfigWidget(Profile *p, QWidget *pare QString ProfileManagerConfigWidget::displayName() const { - return tr("Profiles"); + return tr("Targets"); } void ProfileManagerConfigWidget::apply() diff --git a/src/plugins/projectexplorer/profilemodel.cpp b/src/plugins/projectexplorer/profilemodel.cpp index f7beab2530a..ebcf76b88ce 100644 --- a/src/plugins/projectexplorer/profilemodel.cpp +++ b/src/plugins/projectexplorer/profilemodel.cpp @@ -336,16 +336,15 @@ void ProfileModel::apply() if (removedSts.count() == 1) { QMessageBox::warning(0, - tr("Duplicate profiles detected"), - tr("The following profile was already configured:<br>" - " %1<br>" - "It was not configured again.") + tr("Duplicate Target Detected"), + tr("The target<br> %1<br>" + " was already configured. It was not configured again.") .arg(removedSts.at(0))); } else if (!removedSts.isEmpty()) { QMessageBox::warning(0, - tr("Duplicate profile detected"), - tr("The following profiles were already configured:<br>" + tr("Duplicate Targets Detected"), + tr("The following targets were already configured:<br>" " %1<br>" "They were not configured again.") .arg(removedSts.join(QLatin1String(",<br> ")))); diff --git a/src/plugins/projectexplorer/profileoptionspage.cpp b/src/plugins/projectexplorer/profileoptionspage.cpp index 15bbebe50ac..1e00bb2b7a2 100644 --- a/src/plugins/projectexplorer/profileoptionspage.cpp +++ b/src/plugins/projectexplorer/profileoptionspage.cpp @@ -122,7 +122,7 @@ QWidget *ProfileOptionsPage::createPage(QWidget *parent) connect(m_delButton, SIGNAL(clicked()), this, SLOT(removeProfile())); connect(m_makeDefaultButton, SIGNAL(clicked()), this, SLOT(makeDefaultProfile())); - m_searchKeywords = tr("Profiles"); + m_searchKeywords = tr("Targets"); updateState(); diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index f17705bf41e..b55b0aaf1bc 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -1288,7 +1288,7 @@ void ProjectExplorerPlugin::openProjectWelcomePage(const QString &fileName) QString errorMessage; openProject(fileName, &errorMessage); if (!errorMessage.isEmpty()) - QMessageBox::critical(Core::ICore::mainWindow(), tr("Failed to open project"), errorMessage); + QMessageBox::critical(Core::ICore::mainWindow(), tr("Failed to Open Project"), errorMessage); } Project *ProjectExplorerPlugin::openProject(const QString &fileName, QString *errorString) diff --git a/src/plugins/qmljseditor/qmljscomponentfromobjectdef.cpp b/src/plugins/qmljseditor/qmljscomponentfromobjectdef.cpp index e28e6f68193..75b5b26f93d 100644 --- a/src/plugins/qmljseditor/qmljscomponentfromobjectdef.cpp +++ b/src/plugins/qmljseditor/qmljscomponentfromobjectdef.cpp @@ -110,21 +110,15 @@ public: Core::IVersionControl *versionControl = Core::ICore::vcsManager()->findVersionControlForDirectory(path); if (versionControl && versionControl->supportsOperation(Core::IVersionControl::AddOperation)) { - QString title = QCoreApplication::translate("QmlJSEditor::ComponentFromObjectDef", - "Add to Version Control"); - QString question = QCoreApplication::translate("QmlJSEditor::ComponentFromObjectDef", - "Add file\n%1\nto version control (%2)?") - .arg(newFileName, versionControl->displayName()); - QString error = QCoreApplication::translate("QmlJSEditor::ComponentFromObjectDef", - "Could not add file\n%1\nto version control (%2).") - .arg(newFileName, versionControl->displayName()); - - QMessageBox::StandardButton button = - QMessageBox::question(Core::ICore::mainWindow(), title, - question, QMessageBox::Yes | QMessageBox::No); - if (button == QMessageBox::Yes) { - if (!versionControl->vcsAdd(newFileName)) - QMessageBox::warning(Core::ICore::mainWindow(), title, error); + const QMessageBox::StandardButton button = + QMessageBox::question(Core::ICore::mainWindow(), + Core::VcsManager::msgAddToVcsTitle(), + Core::VcsManager::msgPromptToAddToVcs(QStringList(newFileName), versionControl), + QMessageBox::Yes | QMessageBox::No); + if (button == QMessageBox::Yes && !versionControl->vcsAdd(newFileName)) { + QMessageBox::warning(Core::ICore::mainWindow(), + Core::VcsManager::msgAddToVcsFailedTitle(), + Core::VcsManager::msgToAddToVcsFailed(QStringList(newFileName), versionControl)); } } QString replacement = componentName + QLatin1String(" {\n"); diff --git a/src/plugins/qmljstools/qmljsfindexportedcpptypes.h b/src/plugins/qmljstools/qmljsfindexportedcpptypes.h index 975b7905936..461912426f3 100644 --- a/src/plugins/qmljstools/qmljsfindexportedcpptypes.h +++ b/src/plugins/qmljstools/qmljsfindexportedcpptypes.h @@ -41,7 +41,7 @@ namespace QmlJSTools { class FindExportedCppTypes { - Q_DECLARE_TR_FUNCTIONS(FindExportedCppTypes) + Q_DECLARE_TR_FUNCTIONS(QmlJSTools::FindExportedCppTypes) public: FindExportedCppTypes(const CPlusPlus::Snapshot &snapshot); diff --git a/src/plugins/qmlprofiler/qmlprofilerengine.cpp b/src/plugins/qmlprofiler/qmlprofilerengine.cpp index c029817df2c..7149c5a42b6 100644 --- a/src/plugins/qmlprofiler/qmlprofilerengine.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerengine.cpp @@ -217,8 +217,11 @@ void QmlProfilerEngine::stop() case QmlProfilerStateManager::AppDying : // valid, but no further action is needed break; - default: - qDebug() << tr("Unexpected engine stop from state %1 in %2:%3").arg(d->m_profilerState->currentStateAsString(), QString(__FILE__), QString::number(__LINE__)); + default: { + const QString message = QString::fromLatin1("Unexpected engine stop from state %1 in %2:%3") + .arg(d->m_profilerState->currentStateAsString(), QString::fromLatin1(__FILE__), QString::number(__LINE__)); + qWarning("%s", qPrintable(message)); + } break; } } @@ -239,8 +242,11 @@ void QmlProfilerEngine::processEnded() case QmlProfilerStateManager::AppKilled : d->m_profilerState->setCurrentState(QmlProfilerStateManager::Idle); break; - default: - qDebug() << tr("Process died unexpectedly from state %1 in %2:%3").arg(d->m_profilerState->currentStateAsString(), QString(__FILE__), QString::number(__LINE__)); + default: { + const QString message = QString::fromLatin1("Process died unexpectedly from state %1 in %2:%3") + .arg(d->m_profilerState->currentStateAsString(), QString::fromLatin1(__FILE__), QString::number(__LINE__)); + qWarning("%s", qPrintable(message)); +} break; } } @@ -259,7 +265,9 @@ void QmlProfilerEngine::cancelProcess() break; } default: { - qDebug() << tr("Unexpected process termination requested with state %1 in %2:%3").arg(d->m_profilerState->currentStateAsString(), QString(__FILE__), QString::number(__LINE__)); + const QString message = QString::fromLatin1("Unexpected process termination requested with state %1 in %2:%3") + .arg(d->m_profilerState->currentStateAsString(), QString::fromLatin1(__FILE__), QString::number(__LINE__)); + qWarning("%s", qPrintable(message)); return; } } diff --git a/src/plugins/qmlprofiler/qmlprofilerstatemanager.cpp b/src/plugins/qmlprofiler/qmlprofilerstatemanager.cpp index e7b78b436d5..adeaa3926f7 100644 --- a/src/plugins/qmlprofiler/qmlprofilerstatemanager.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerstatemanager.cpp @@ -141,8 +141,10 @@ void QmlProfilerStateManager::setCurrentState(QmlProfilerState newState) QTC_ASSERT(d->m_currentState == AppDying, qDebug() << "from" << stringForState(d->m_currentState)); break; - default: - qDebug() << tr("Switching to unknown state in %1:%2").arg(QString(__FILE__), QString::number(__LINE__)); + default: { + const QString message = QString::fromLatin1("Switching to unknown state in %1:%2").arg(QString::fromLatin1(__FILE__), QString::number(__LINE__)); + qWarning("%s", qPrintable(message)); + } break; } diff --git a/src/plugins/qnx/blackberrydeviceconfiguration.h b/src/plugins/qnx/blackberrydeviceconfiguration.h index afd0084c24b..ce18b9442c3 100644 --- a/src/plugins/qnx/blackberrydeviceconfiguration.h +++ b/src/plugins/qnx/blackberrydeviceconfiguration.h @@ -45,7 +45,7 @@ namespace Internal { class BlackBerryDeviceConfiguration : public RemoteLinux::LinuxDeviceConfiguration { - Q_DECLARE_TR_FUNCTIONS(BlackBerryDeviceConfiguration) + Q_DECLARE_TR_FUNCTIONS(Qnx::Internal::BlackBerryDeviceConfiguration) public: typedef QSharedPointer<BlackBerryDeviceConfiguration> Ptr; typedef QSharedPointer<const BlackBerryDeviceConfiguration> ConstPtr; diff --git a/src/plugins/qnx/blackberryqtversion.cpp b/src/plugins/qnx/blackberryqtversion.cpp index e176dd79c56..259bc32ca03 100644 --- a/src/plugins/qnx/blackberryqtversion.cpp +++ b/src/plugins/qnx/blackberryqtversion.cpp @@ -136,7 +136,7 @@ QString BlackBerryQtVersion::type() const QString BlackBerryQtVersion::description() const { - return QCoreApplication::translate("QtVersion", "BlackBerry %1", "Qt Version is meant for BlackBerry").arg(archString()); + return tr("BlackBerry %1", "Qt Version is meant for BlackBerry").arg(archString()); } QMultiMap<QString, QString> BlackBerryQtVersion::environment() const @@ -167,10 +167,10 @@ QString BlackBerryQtVersion::platformName() const QString BlackBerryQtVersion::platformDisplayName() const { - return QCoreApplication::tr("BlackBerry"); + return tr("BlackBerry"); } QString BlackBerryQtVersion::sdkDescription() const { - return QCoreApplication::tr("BlackBerry Native SDK:"); + return tr("BlackBerry Native SDK:"); } diff --git a/src/plugins/qnx/blackberryqtversion.h b/src/plugins/qnx/blackberryqtversion.h index 3efce970369..2471ae42a7b 100644 --- a/src/plugins/qnx/blackberryqtversion.h +++ b/src/plugins/qnx/blackberryqtversion.h @@ -42,6 +42,7 @@ namespace Internal { class BlackBerryQtVersion : public QnxAbstractQtVersion { + Q_DECLARE_TR_FUNCTIONS(Qnx::Internal::BlackBerryQtVersion) public: BlackBerryQtVersion(); BlackBerryQtVersion(QnxArchitecture arch, const Utils::FileName &path, diff --git a/src/plugins/qnx/qnxabstractqtversion.cpp b/src/plugins/qnx/qnxabstractqtversion.cpp index 4d7b1b63f96..db2f154f049 100644 --- a/src/plugins/qnx/qnxabstractqtversion.cpp +++ b/src/plugins/qnx/qnxabstractqtversion.cpp @@ -167,7 +167,6 @@ bool QnxAbstractQtVersion::isValid() const QString QnxAbstractQtVersion::invalidReason() const { if (sdkPath().isEmpty()) - return QCoreApplication::translate("QtVersion", "No SDK path set"); - + return tr("No SDK path set"); return QtSupport::BaseQtVersion::invalidReason(); } diff --git a/src/plugins/qnx/qnxabstractqtversion.h b/src/plugins/qnx/qnxabstractqtversion.h index ea01cddfb1e..ca9a4de34e8 100644 --- a/src/plugins/qnx/qnxabstractqtversion.h +++ b/src/plugins/qnx/qnxabstractqtversion.h @@ -38,12 +38,15 @@ #include <qtsupport/baseqtversion.h> +#include <QCoreApplication> + namespace Qnx { namespace Internal { class QnxAbstractQtVersion : public QtSupport::BaseQtVersion { friend class QnxBaseQtConfigWidget; + Q_DECLARE_TR_FUNCTIONS(Qnx::Internal::QnxAbstractQtVersion) public: QnxAbstractQtVersion(); QnxAbstractQtVersion(QnxArchitecture arch, const Utils::FileName &path, diff --git a/src/plugins/qnx/qnxdeviceconfiguration.h b/src/plugins/qnx/qnxdeviceconfiguration.h index 1972b0049d2..556bcd66db4 100644 --- a/src/plugins/qnx/qnxdeviceconfiguration.h +++ b/src/plugins/qnx/qnxdeviceconfiguration.h @@ -41,7 +41,7 @@ namespace Internal { class QnxDeviceConfiguration : public RemoteLinux::LinuxDeviceConfiguration { - Q_DECLARE_TR_FUNCTIONS(QnxDeviceConfiguration) + Q_DECLARE_TR_FUNCTIONS(Qnx::Internal::QnxDeviceConfiguration) public: typedef QSharedPointer<QnxDeviceConfiguration> Ptr; typedef QSharedPointer<const QnxDeviceConfiguration> ConstPtr; diff --git a/src/plugins/qnx/qnxqtversion.cpp b/src/plugins/qnx/qnxqtversion.cpp index 5851b78d13e..2af97c7694d 100644 --- a/src/plugins/qnx/qnxqtversion.cpp +++ b/src/plugins/qnx/qnxqtversion.cpp @@ -64,7 +64,7 @@ QString QnxQtVersion::type() const QString QnxQtVersion::description() const { - return QCoreApplication::translate("QtVersion", "QNX %1", "Qt Version is meant for QNX").arg(archString()); + return tr("QNX %1", "Qt Version is meant for QNX").arg(archString()); } Core::FeatureSet QnxQtVersion::availableFeatures() const diff --git a/src/plugins/qnx/qnxqtversion.h b/src/plugins/qnx/qnxqtversion.h index 574cbb94c20..cb00bc979fe 100644 --- a/src/plugins/qnx/qnxqtversion.h +++ b/src/plugins/qnx/qnxqtversion.h @@ -42,6 +42,7 @@ namespace Internal { class QnxQtVersion : public QnxAbstractQtVersion { + Q_DECLARE_TR_FUNCTIONS(Qnx::Internal::QnxQtVersion) public: QnxQtVersion(); QnxQtVersion(QnxArchitecture arch, const Utils::FileName &path, diff --git a/src/plugins/qt4projectmanager/makestep.cpp b/src/plugins/qt4projectmanager/makestep.cpp index 847c80628d3..70c69f38191 100644 --- a/src/plugins/qt4projectmanager/makestep.cpp +++ b/src/plugins/qt4projectmanager/makestep.cpp @@ -418,7 +418,7 @@ void MakeStepConfigWidget::updateDetails() m_ui->makeLabel->setText(tr("Make:")); if (!tc) { - setSummaryText(tr("<b>Make:</b> No tool chain set in target.")); + setSummaryText(tr("<b>Make:</b> %1").arg(ProjectExplorer::ToolChainProfileInformation::msgNoToolChainInTarget())); return; } Qt4BuildConfiguration *bc = m_makeStep->qt4BuildConfiguration(); diff --git a/src/plugins/qt4projectmanager/qt-s60/s60createpackagestep.cpp b/src/plugins/qt4projectmanager/qt-s60/s60createpackagestep.cpp index 673f6b92956..2eb5f2063f2 100644 --- a/src/plugins/qt4projectmanager/qt-s60/s60createpackagestep.cpp +++ b/src/plugins/qt4projectmanager/qt-s60/s60createpackagestep.cpp @@ -192,11 +192,11 @@ bool S60CreatePackageStep::init() SymbianQtVersion *sqv = dynamic_cast<SymbianQtVersion *>(QtSupport::QtProfileInformation::qtVersion(target()->profile())); if (!sqv) { - emit addOutput(tr("The selected profile is not configured with a Symbian Qt"), BuildStep::ErrorOutput); + emit addOutput(tr("The selected target is not configured with a Symbian Qt"), BuildStep::ErrorOutput); return false; } if (!tc) { - emit addOutput(tr("The selected profile has no toolchain"), BuildStep::ErrorOutput); + emit addOutput(ProjectExplorer::ToolChainProfileInformation::msgNoToolChainInTarget(), BuildStep::ErrorOutput); return false; } m_isBuildWithSymbianSbsV2 = sqv->isBuildWithSymbianSbsV2(); diff --git a/src/plugins/qt4projectmanager/unconfiguredprojectpanel.cpp b/src/plugins/qt4projectmanager/unconfiguredprojectpanel.cpp index f5dc135c4cf..2eef2b43548 100644 --- a/src/plugins/qt4projectmanager/unconfiguredprojectpanel.cpp +++ b/src/plugins/qt4projectmanager/unconfiguredprojectpanel.cpp @@ -150,20 +150,20 @@ void TargetSetupPageWrapper::updateNoteText() QString text; if (!p) text = tr("<p>The project <b>%1</b> is not yet configured.</p>" - "<p>Qt Creator cannot parse the project, because no profile " - "has been setup. You can setup profiles " + "<p>Qt Creator cannot parse the project, because no target " + "has been set up. You can set up targets " "in the <b><a href=\"edit\">settings.</a></b></p>") .arg(m_project->displayName()); else if (p->isValid()) text = tr("<p>The project <b>%1</b> is not yet configured.</p>" - "<p>Qt Creator uses the profile: <b>%2</b> " + "<p>Qt Creator uses the target: <b>%2</b> " "to parse the project. You can edit " "these in the <b><a href=\"edit\">settings.</a></b></p>") .arg(m_project->displayName()) .arg(p->displayName()); else text = tr("<p>The project <b>%1</b> is not yet configured.</p>" - "<p>Qt Creator uses the <b>invalid</b> profile: <b>%2</b> " + "<p>Qt Creator uses the <b>invalid</b> target: <b>%2</b> " "to parse the project. You can edit " "these in the <b><a href=\"edit\">settings</a></b></p>") .arg(m_project->displayName()) diff --git a/src/plugins/qtsupport/baseqtversion.cpp b/src/plugins/qtsupport/baseqtversion.cpp index 7e541185d01..abe8d65b470 100644 --- a/src/plugins/qtsupport/baseqtversion.cpp +++ b/src/plugins/qtsupport/baseqtversion.cpp @@ -302,7 +302,7 @@ QList<ProjectExplorer::Task> BaseQtVersion::validateProfile(const ProjectExplore ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainProfileInformation::toolChain(p); if (!tc) result << ProjectExplorer::Task(ProjectExplorer::Task::Error, - QCoreApplication::translate("BaseQtVersion", "No tool chain set up in profile."), + ProjectExplorer::ToolChainProfileInformation::msgNoToolChainInTarget(), Utils::FileName(), -1, Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)); diff --git a/src/plugins/qtsupport/gettingstartedwelcomepage.cpp b/src/plugins/qtsupport/gettingstartedwelcomepage.cpp index 34f1c821b48..fcad695031c 100644 --- a/src/plugins/qtsupport/gettingstartedwelcomepage.cpp +++ b/src/plugins/qtsupport/gettingstartedwelcomepage.cpp @@ -423,7 +423,7 @@ void ExamplesWelcomePage::openProject(const QString &projectFile, const QStringL Core::ICore::helpManager()->handleHelpRequest(help.toString()+QLatin1String("?view=split")); } if (!errorMessage.isEmpty()) - QMessageBox::critical(Core::ICore::mainWindow(), tr("Failed to open project"), errorMessage); + QMessageBox::critical(Core::ICore::mainWindow(), tr("Failed to Open Project"), errorMessage); } void ExamplesWelcomePage::updateTagsModel() diff --git a/src/plugins/qtsupport/qtoptionspage.cpp b/src/plugins/qtsupport/qtoptionspage.cpp index f0c0ab580d4..245d6443587 100644 --- a/src/plugins/qtsupport/qtoptionspage.cpp +++ b/src/plugins/qtsupport/qtoptionspage.cpp @@ -274,7 +274,7 @@ void QtOptionsPageWidget::cleanUpQtVersions() if (toRemove.isEmpty()) return; - if (QMessageBox::warning(0, tr("Remove invalid Qt Versions"), + if (QMessageBox::warning(0, tr("Remove Invalid Qt Versions"), tr("Do you want to remove all invalid Qt Versions?<br>" "<ul><li>%1</li></ul><br>" "will be removed.").arg(toRemove.join(QLatin1String("</li><li>"))), @@ -699,7 +699,7 @@ void QtOptionsPageWidget::editPath() // Same type? then replace! if (current->type() != version->type()) { // not the same type, error out - QMessageBox::critical(this, tr("Qt versions incompatible"), + QMessageBox::critical(this, tr("Incompatible Qt Versions"), tr("The Qt version selected must be for the same target."), QMessageBox::Ok); delete version; diff --git a/src/plugins/remotelinux/linuxdeviceconfiguration.h b/src/plugins/remotelinux/linuxdeviceconfiguration.h index 99512611d42..bfb82f7cb7b 100644 --- a/src/plugins/remotelinux/linuxdeviceconfiguration.h +++ b/src/plugins/remotelinux/linuxdeviceconfiguration.h @@ -46,7 +46,7 @@ class LinuxDeviceConfigurationPrivate; class REMOTELINUX_EXPORT LinuxDeviceConfiguration : public ProjectExplorer::IDevice { - Q_DECLARE_TR_FUNCTIONS(LinuxDeviceConfiguration) + Q_DECLARE_TR_FUNCTIONS(RemoteLinux::Internal::LinuxDeviceConfiguration) public: typedef QSharedPointer<LinuxDeviceConfiguration> Ptr; typedef QSharedPointer<const LinuxDeviceConfiguration> ConstPtr; |