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 <tobias.hunger@nokia.com>
This commit is contained in:
Friedemann Kleint
2012-07-27 15:43:00 +02:00
parent 5635272b44
commit bf980649d2
42 changed files with 133 additions and 85 deletions

View File

@@ -80,7 +80,7 @@ StartRemoteDialog::StartRemoteDialog(QWidget *parent)
QFormLayout *formLayout = new QFormLayout; QFormLayout *formLayout = new QFormLayout;
formLayout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow); 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("Executable:"), d->executable);
formLayout->addRow(tr("Arguments:"), d->arguments); formLayout->addRow(tr("Arguments:"), d->arguments);
formLayout->addRow(tr("Working directory:"), d->workingDirectory); formLayout->addRow(tr("Working directory:"), d->workingDirectory);

View File

@@ -44,7 +44,7 @@ AndroidDevice::AndroidDevice()
IDevice::Hardware, IDevice::Hardware,
Core::Id(Constants::ANDROID_DEVICE_ID)) 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); setDeviceState(DeviceReadyToUse);
} }
@@ -60,7 +60,7 @@ IDevice::DeviceInfo AndroidDevice::deviceInformation() const
QString AndroidDevice::displayType() const QString AndroidDevice::displayType() const
{ {
return QCoreApplication::translate("ProjectExplorer::AndroidDevice", "Android"); return QCoreApplication::translate("Android::Internal::AndroidDevice", "Android");
} }
IDeviceWidget *AndroidDevice::createWidget() IDeviceWidget *AndroidDevice::createWidget()

View File

@@ -67,8 +67,7 @@ QList<Core::Id> AndroidPackageCreationFactory::availableCreationIds(ProjectExplo
QString AndroidPackageCreationFactory::displayNameForId(const Core::Id id) const QString AndroidPackageCreationFactory::displayNameForId(const Core::Id id) const
{ {
if (id == AndroidPackageCreationStep::CreatePackageId) if (id == AndroidPackageCreationStep::CreatePackageId)
return QCoreApplication::translate("Qt4ProjectManager::Internal::AndroidPackageCreationFactory", return tr("Create Android (.apk) Package");
"Create Android (.apk) Package");
return QString(); return QString();
} }

View File

@@ -38,6 +38,7 @@ namespace Internal {
class AndroidPackageCreationFactory : public ProjectExplorer::IBuildStepFactory class AndroidPackageCreationFactory : public ProjectExplorer::IBuildStepFactory
{ {
Q_OBJECT
public: public:
explicit AndroidPackageCreationFactory(QObject *parent = 0); explicit AndroidPackageCreationFactory(QObject *parent = 0);

View File

@@ -65,8 +65,7 @@ QList<Core::Id> AndroidPackageInstallationFactory::availableCreationIds(BuildSte
QString AndroidPackageInstallationFactory::displayNameForId(const Core::Id id) const QString AndroidPackageInstallationFactory::displayNameForId(const Core::Id id) const
{ {
if (id == AndroidPackageInstallationStep::Id) if (id == AndroidPackageInstallationStep::Id)
return QCoreApplication::translate("Qt4ProjectManager::Internal::AndroidPackageInstallationFactory", return tr("Deploy to device");
"Deploy to device");
return QString(); return QString();
} }

View File

@@ -34,8 +34,6 @@
#include <qtsupport/qtsupportconstants.h> #include <qtsupport/qtsupportconstants.h>
#include <QCoreApplication>
using namespace Android::Internal; using namespace Android::Internal;
AndroidQtVersion::AndroidQtVersion() AndroidQtVersion::AndroidQtVersion()
@@ -77,7 +75,7 @@ QString AndroidQtVersion::invalidReason() const
{ {
QString tmp = BaseQtVersion::invalidReason(); QString tmp = BaseQtVersion::invalidReason();
if (tmp.isEmpty() && qtAbis().isEmpty()) 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; return tmp;
} }
@@ -90,7 +88,7 @@ QList<ProjectExplorer::Abi> AndroidQtVersion::detectQtAbis() const
QString AndroidQtVersion::description() 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 Core::FeatureSet AndroidQtVersion::availableFeatures() const

View File

@@ -30,13 +30,17 @@
#ifndef ANDROIDQTVERSION_H #ifndef ANDROIDQTVERSION_H
#define ANDROIDQTVERSION_H #define ANDROIDQTVERSION_H
#include <qtsupport/baseqtversion.h> #include <qtsupport/baseqtversion.h>
#include <QCoreApplication>
namespace Android { namespace Android {
namespace Internal { namespace Internal {
class AndroidQtVersion : public QtSupport::BaseQtVersion class AndroidQtVersion : public QtSupport::BaseQtVersion
{ {
Q_DECLARE_TR_FUNCTIONS(Android::Internal::AndroidQtVersion)
public: public:
AndroidQtVersion(); AndroidQtVersion();
AndroidQtVersion(const Utils::FileName &path, bool isAutodetected = false, const QString &autodetectionSource = QString()); AndroidQtVersion(const Utils::FileName &path, bool isAutodetected = false, const QString &autodetectionSource = QString());

View File

@@ -304,7 +304,7 @@ void MakeStepConfigWidget::updateDetails()
param.setArguments(arguments); param.setArguments(arguments);
m_summaryText = param.summary(displayName()); m_summaryText = param.summary(displayName());
} else { } 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(); emit updateSummary();

View File

@@ -322,7 +322,7 @@ void MakeStepConfigWidget::updateDetails()
param.setArguments(arguments); param.setArguments(arguments);
m_summaryText = param.summary(displayName()); m_summaryText = param.summary(displayName());
} else { } else {
m_summaryText = tr("<b>No tool chain set for this target</b>"); m_summaryText = QLatin1String("<b>") + ProjectExplorer::ToolChainProfileInformation::msgNoToolChainInTarget() + QLatin1String("</b>");
} }
emit updateSummary(); emit updateSummary();
} }

View File

@@ -326,17 +326,44 @@ bool VcsManager::promptToDelete(IVersionControl *vc, const QString &fileName)
return vc->vcsDelete(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) void VcsManager::promptToAdd(const QString &directory, const QStringList &fileNames)
{ {
IVersionControl *vc = findVersionControlForDirectory(directory); IVersionControl *vc = findVersionControlForDirectory(directory);
if (!vc || !vc->supportsOperation(Core::IVersionControl::AddOperation)) if (!vc || !vc->supportsOperation(Core::IVersionControl::AddOperation))
return; return;
const QString files = fileNames.join(QString(QLatin1Char('\n')));
QMessageBox::StandardButton button = QMessageBox::StandardButton button =
QMessageBox::question(Core::ICore::mainWindow(), tr("Add to Version Control"), QMessageBox::question(Core::ICore::mainWindow(), VcsManager::msgAddToVcsTitle(),
tr("Add files\n%1\nto version control (%2)?").arg(files, vc->displayName()), VcsManager::msgPromptToAddToVcs(fileNames, vc),
QMessageBox::Yes | QMessageBox::No); QMessageBox::Yes | QMessageBox::No);
if (button == QMessageBox::Yes) { if (button == QMessageBox::Yes) {
QStringList notAddedToVc; QStringList notAddedToVc;
foreach (const QString &file, fileNames) { foreach (const QString &file, fileNames) {
@@ -345,10 +372,8 @@ void VcsManager::promptToAdd(const QString &directory, const QStringList &fileNa
} }
if (!notAddedToVc.isEmpty()) { if (!notAddedToVc.isEmpty()) {
const QString message = tr("Could not add following files to version control (%1)\n").arg(vc->displayName()); QMessageBox::warning(Core::ICore::mainWindow(), VcsManager::msgAddToVcsFailedTitle(),
const QString filesNotAdded = notAddedToVc.join(QString(QLatin1Char('\n'))); VcsManager::msgToAddToVcsFailed(notAddedToVc, vc));
QMessageBox::warning(Core::ICore::mainWindow(), tr("Adding to Version Control Failed"),
message + filesNotAdded);
} }
} }
} }

View File

@@ -87,6 +87,12 @@ public:
// added to revision control. Calls vcsAdd for each file. // added to revision control. Calls vcsAdd for each file.
void promptToAdd(const QString &directory, const QStringList &fileNames); 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: signals:
void repositoryChanged(const QString &repository); void repositoryChanged(const QString &repository);

View File

@@ -77,7 +77,7 @@ private:
class FunctionDeclDefLink class FunctionDeclDefLink
{ {
Q_DECLARE_TR_FUNCTIONS(FunctionDeclDefLink) Q_DECLARE_TR_FUNCTIONS(CppEditor::Internal::FunctionDeclDefLink)
Q_DISABLE_COPY(FunctionDeclDefLink) Q_DISABLE_COPY(FunctionDeclDefLink)
public: public:
~FunctionDeclDefLink(); ~FunctionDeclDefLink();

View File

@@ -1243,7 +1243,7 @@ StartRemoteEngineDialog::StartRemoteEngineDialog(QWidget *parent)
QFormLayout *formLayout = new QFormLayout(); QFormLayout *formLayout = new QFormLayout();
formLayout->addRow(tr("&Host:"), d->host); 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("&Password:"), d->password);
formLayout->addRow(tr("&Engine path:"), d->enginePath); formLayout->addRow(tr("&Engine path:"), d->enginePath);
formLayout->addRow(tr("&Inferior path:"), d->inferiorPath); formLayout->addRow(tr("&Inferior path:"), d->inferiorPath);

View File

@@ -62,7 +62,7 @@ public:
quint64 address; quint64 address;
bool usable; bool usable;
Q_DECLARE_TR_FUNCTIONS(StackHandler) Q_DECLARE_TR_FUNCTIONS(Debugger::Internal::StackHandler)
}; };
QDebug operator<<(QDebug d, const StackFrame &frame); QDebug operator<<(QDebug d, const StackFrame &frame);

View File

@@ -127,8 +127,7 @@ QByteArray section(Core::Id deviceType) {
void raiseError(const QString &reason) void raiseError(const QString &reason)
{ {
QMessageBox::critical(0, QCoreApplication::translate("Madde::DebianManager", QMessageBox::critical(0, Madde::Internal::DebianManager::tr("Error Creating Debian Project Templates"), reason);
"Error creating debian project templates"), reason);
} }
QString defaultPackageFileName(ProjectExplorer::Project *project) QString defaultPackageFileName(ProjectExplorer::Project *project)

View File

@@ -39,7 +39,7 @@ namespace Internal {
class MaddeDevice : public RemoteLinux::LinuxDeviceConfiguration class MaddeDevice : public RemoteLinux::LinuxDeviceConfiguration
{ {
Q_DECLARE_TR_FUNCTIONS(MaddeDevice) Q_DECLARE_TR_FUNCTIONS(Madde::Internal::MaddeDevice)
public: public:
typedef QSharedPointer<MaddeDevice> Ptr; typedef QSharedPointer<MaddeDevice> Ptr;
typedef QSharedPointer<const MaddeDevice> ConstPtr; typedef QSharedPointer<const MaddeDevice> ConstPtr;

View File

@@ -312,8 +312,10 @@ void MaemoPublisherFremantleFree::handleProcessFinished(bool failedToStart)
// Toolchain might be null! (yes because this sucks) // Toolchain might be null! (yes because this sucks)
ProjectExplorer::ToolChain *tc ProjectExplorer::ToolChain *tc
= ProjectExplorer::ToolChainProfileInformation::toolChain(m_buildConfig->target()->profile()); = ProjectExplorer::ToolChainProfileInformation::toolChain(m_buildConfig->target()->profile());
if (!tc) if (!tc) {
finishWithFailure(QString(), tr("Make distclean failed. No toolchain in profile.")); finishWithFailure(QString(), tr("Make distclean failed: %1")
.arg(ProjectExplorer::ToolChainProfileInformation::msgNoToolChainInTarget()));
}
m_process->start(tc->makeCommand(), QStringList() << QLatin1String("distclean")); m_process->start(tc->makeCommand(), QStringList() << QLatin1String("distclean"));
} }
break; break;

View File

@@ -81,9 +81,10 @@ QList<Task> SysRootProfileInformation::validate(Profile *p) const
{ {
QList<Task> result; QList<Task> result;
const Utils::FileName dir = SysRootProfileInformation::sysRoot(p); const Utils::FileName dir = SysRootProfileInformation::sysRoot(p);
if (!dir.toFileInfo().isDir() && SysRootProfileInformation::hasSysRoot(p)) if (!dir.toFileInfo().isDir() && SysRootProfileInformation::hasSysRoot(p)) {
result << Task(Task::Error, QObject::tr("Sys Root \"%1\" is not a directory.").arg(dir.toUserOutput()), result << Task(Task::Error, tr("Sys Root \"%1\" is not a directory.").arg(dir.toUserOutput()),
Utils::FileName(), -1, Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM)); Utils::FileName(), -1, Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM));
}
return result; return result;
} }
@@ -165,7 +166,7 @@ QList<Task> ToolChainProfileInformation::validate(Profile *p) const
QList<Task> result; QList<Task> result;
if (!toolChain(p)) { if (!toolChain(p)) {
setToolChain(p, 0); // make sure to clear out no longer known tool chains 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)); Utils::FileName(), -1, Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM));
} }
return result; return result;
@@ -203,6 +204,11 @@ void ToolChainProfileInformation::setToolChain(Profile *p, ToolChain *tc)
p->setValue(Core::Id(TOOLCHAIN_INFORMATION), tc ? tc->id() : QString()); p->setValue(Core::Id(TOOLCHAIN_INFORMATION), tc ? tc->id() : QString());
} }
QString ToolChainProfileInformation::msgNoToolChainInTarget()
{
return tr("No tool chain set in target.");
}
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
// DeviceTypeInformation: // DeviceTypeInformation:
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
@@ -236,7 +242,7 @@ QList<Task> DeviceTypeProfileInformation::validate(Profile *p) const
IDevice::ConstPtr dev = DeviceProfileInformation::device(p); IDevice::ConstPtr dev = DeviceProfileInformation::device(p);
QList<Task> result; QList<Task> result;
if (!dev.isNull() && dev->type() != DeviceTypeProfileInformation::deviceTypeId(p)) 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))); Utils::FileName(), -1, Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM)));
return result; return result;
} }

View File

@@ -113,6 +113,8 @@ public:
static ToolChain *toolChain(const Profile *p); static ToolChain *toolChain(const Profile *p);
static void setToolChain(Profile *p, ToolChain *tc); static void setToolChain(Profile *p, ToolChain *tc);
static QString msgNoToolChainInTarget();
}; };
class PROJECTEXPLORER_EXPORT ToolChainMatcher : public ProfileMatcher class PROJECTEXPLORER_EXPORT ToolChainMatcher : public ProfileMatcher

View File

@@ -93,7 +93,7 @@ ProfileManagerConfigWidget::ProfileManagerConfigWidget(Profile *p, QWidget *pare
QString ProfileManagerConfigWidget::displayName() const QString ProfileManagerConfigWidget::displayName() const
{ {
return tr("Profiles"); return tr("Targets");
} }
void ProfileManagerConfigWidget::apply() void ProfileManagerConfigWidget::apply()

View File

@@ -336,16 +336,15 @@ void ProfileModel::apply()
if (removedSts.count() == 1) { if (removedSts.count() == 1) {
QMessageBox::warning(0, QMessageBox::warning(0,
tr("Duplicate profiles detected"), tr("Duplicate Target Detected"),
tr("The following profile was already configured:<br>" tr("The target<br>&nbsp;%1<br>"
"&nbsp;%1<br>" " was already configured. It was not configured again.")
"It was not configured again.")
.arg(removedSts.at(0))); .arg(removedSts.at(0)));
} else if (!removedSts.isEmpty()) { } else if (!removedSts.isEmpty()) {
QMessageBox::warning(0, QMessageBox::warning(0,
tr("Duplicate profile detected"), tr("Duplicate Targets Detected"),
tr("The following profiles were already configured:<br>" tr("The following targets were already configured:<br>"
"&nbsp;%1<br>" "&nbsp;%1<br>"
"They were not configured again.") "They were not configured again.")
.arg(removedSts.join(QLatin1String(",<br>&nbsp;")))); .arg(removedSts.join(QLatin1String(",<br>&nbsp;"))));

View File

@@ -122,7 +122,7 @@ QWidget *ProfileOptionsPage::createPage(QWidget *parent)
connect(m_delButton, SIGNAL(clicked()), this, SLOT(removeProfile())); connect(m_delButton, SIGNAL(clicked()), this, SLOT(removeProfile()));
connect(m_makeDefaultButton, SIGNAL(clicked()), this, SLOT(makeDefaultProfile())); connect(m_makeDefaultButton, SIGNAL(clicked()), this, SLOT(makeDefaultProfile()));
m_searchKeywords = tr("Profiles"); m_searchKeywords = tr("Targets");
updateState(); updateState();

View File

@@ -1288,7 +1288,7 @@ void ProjectExplorerPlugin::openProjectWelcomePage(const QString &fileName)
QString errorMessage; QString errorMessage;
openProject(fileName, &errorMessage); openProject(fileName, &errorMessage);
if (!errorMessage.isEmpty()) 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) Project *ProjectExplorerPlugin::openProject(const QString &fileName, QString *errorString)

View File

@@ -110,21 +110,15 @@ public:
Core::IVersionControl *versionControl = Core::ICore::vcsManager()->findVersionControlForDirectory(path); Core::IVersionControl *versionControl = Core::ICore::vcsManager()->findVersionControlForDirectory(path);
if (versionControl if (versionControl
&& versionControl->supportsOperation(Core::IVersionControl::AddOperation)) { && versionControl->supportsOperation(Core::IVersionControl::AddOperation)) {
QString title = QCoreApplication::translate("QmlJSEditor::ComponentFromObjectDef", const QMessageBox::StandardButton button =
"Add to Version Control"); QMessageBox::question(Core::ICore::mainWindow(),
QString question = QCoreApplication::translate("QmlJSEditor::ComponentFromObjectDef", Core::VcsManager::msgAddToVcsTitle(),
"Add file\n%1\nto version control (%2)?") Core::VcsManager::msgPromptToAddToVcs(QStringList(newFileName), versionControl),
.arg(newFileName, versionControl->displayName()); QMessageBox::Yes | QMessageBox::No);
QString error = QCoreApplication::translate("QmlJSEditor::ComponentFromObjectDef", if (button == QMessageBox::Yes && !versionControl->vcsAdd(newFileName)) {
"Could not add file\n%1\nto version control (%2).") QMessageBox::warning(Core::ICore::mainWindow(),
.arg(newFileName, versionControl->displayName()); Core::VcsManager::msgAddToVcsFailedTitle(),
Core::VcsManager::msgToAddToVcsFailed(QStringList(newFileName), versionControl));
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);
} }
} }
QString replacement = componentName + QLatin1String(" {\n"); QString replacement = componentName + QLatin1String(" {\n");

View File

@@ -41,7 +41,7 @@ namespace QmlJSTools {
class FindExportedCppTypes class FindExportedCppTypes
{ {
Q_DECLARE_TR_FUNCTIONS(FindExportedCppTypes) Q_DECLARE_TR_FUNCTIONS(QmlJSTools::FindExportedCppTypes)
public: public:
FindExportedCppTypes(const CPlusPlus::Snapshot &snapshot); FindExportedCppTypes(const CPlusPlus::Snapshot &snapshot);

View File

@@ -217,8 +217,11 @@ void QmlProfilerEngine::stop()
case QmlProfilerStateManager::AppDying : case QmlProfilerStateManager::AppDying :
// valid, but no further action is needed // valid, but no further action is needed
break; break;
default: default: {
qDebug() << tr("Unexpected engine stop from state %1 in %2:%3").arg(d->m_profilerState->currentStateAsString(), QString(__FILE__), QString::number(__LINE__)); 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; break;
} }
} }
@@ -239,8 +242,11 @@ void QmlProfilerEngine::processEnded()
case QmlProfilerStateManager::AppKilled : case QmlProfilerStateManager::AppKilled :
d->m_profilerState->setCurrentState(QmlProfilerStateManager::Idle); d->m_profilerState->setCurrentState(QmlProfilerStateManager::Idle);
break; break;
default: default: {
qDebug() << tr("Process died unexpectedly from state %1 in %2:%3").arg(d->m_profilerState->currentStateAsString(), QString(__FILE__), QString::number(__LINE__)); 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; break;
} }
} }
@@ -259,7 +265,9 @@ void QmlProfilerEngine::cancelProcess()
break; break;
} }
default: { 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; return;
} }
} }

View File

@@ -141,8 +141,10 @@ void QmlProfilerStateManager::setCurrentState(QmlProfilerState newState)
QTC_ASSERT(d->m_currentState == AppDying, QTC_ASSERT(d->m_currentState == AppDying,
qDebug() << "from" << stringForState(d->m_currentState)); qDebug() << "from" << stringForState(d->m_currentState));
break; break;
default: default: {
qDebug() << tr("Switching to unknown state in %1:%2").arg(QString(__FILE__), QString::number(__LINE__)); const QString message = QString::fromLatin1("Switching to unknown state in %1:%2").arg(QString::fromLatin1(__FILE__), QString::number(__LINE__));
qWarning("%s", qPrintable(message));
}
break; break;
} }

View File

@@ -45,7 +45,7 @@ namespace Internal {
class BlackBerryDeviceConfiguration : public RemoteLinux::LinuxDeviceConfiguration class BlackBerryDeviceConfiguration : public RemoteLinux::LinuxDeviceConfiguration
{ {
Q_DECLARE_TR_FUNCTIONS(BlackBerryDeviceConfiguration) Q_DECLARE_TR_FUNCTIONS(Qnx::Internal::BlackBerryDeviceConfiguration)
public: public:
typedef QSharedPointer<BlackBerryDeviceConfiguration> Ptr; typedef QSharedPointer<BlackBerryDeviceConfiguration> Ptr;
typedef QSharedPointer<const BlackBerryDeviceConfiguration> ConstPtr; typedef QSharedPointer<const BlackBerryDeviceConfiguration> ConstPtr;

View File

@@ -136,7 +136,7 @@ QString BlackBerryQtVersion::type() const
QString BlackBerryQtVersion::description() 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 QMultiMap<QString, QString> BlackBerryQtVersion::environment() const
@@ -167,10 +167,10 @@ QString BlackBerryQtVersion::platformName() const
QString BlackBerryQtVersion::platformDisplayName() const QString BlackBerryQtVersion::platformDisplayName() const
{ {
return QCoreApplication::tr("BlackBerry"); return tr("BlackBerry");
} }
QString BlackBerryQtVersion::sdkDescription() const QString BlackBerryQtVersion::sdkDescription() const
{ {
return QCoreApplication::tr("BlackBerry Native SDK:"); return tr("BlackBerry Native SDK:");
} }

View File

@@ -42,6 +42,7 @@ namespace Internal {
class BlackBerryQtVersion : public QnxAbstractQtVersion class BlackBerryQtVersion : public QnxAbstractQtVersion
{ {
Q_DECLARE_TR_FUNCTIONS(Qnx::Internal::BlackBerryQtVersion)
public: public:
BlackBerryQtVersion(); BlackBerryQtVersion();
BlackBerryQtVersion(QnxArchitecture arch, const Utils::FileName &path, BlackBerryQtVersion(QnxArchitecture arch, const Utils::FileName &path,

View File

@@ -167,7 +167,6 @@ bool QnxAbstractQtVersion::isValid() const
QString QnxAbstractQtVersion::invalidReason() const QString QnxAbstractQtVersion::invalidReason() const
{ {
if (sdkPath().isEmpty()) if (sdkPath().isEmpty())
return QCoreApplication::translate("QtVersion", "No SDK path set"); return tr("No SDK path set");
return QtSupport::BaseQtVersion::invalidReason(); return QtSupport::BaseQtVersion::invalidReason();
} }

View File

@@ -38,12 +38,15 @@
#include <qtsupport/baseqtversion.h> #include <qtsupport/baseqtversion.h>
#include <QCoreApplication>
namespace Qnx { namespace Qnx {
namespace Internal { namespace Internal {
class QnxAbstractQtVersion : public QtSupport::BaseQtVersion class QnxAbstractQtVersion : public QtSupport::BaseQtVersion
{ {
friend class QnxBaseQtConfigWidget; friend class QnxBaseQtConfigWidget;
Q_DECLARE_TR_FUNCTIONS(Qnx::Internal::QnxAbstractQtVersion)
public: public:
QnxAbstractQtVersion(); QnxAbstractQtVersion();
QnxAbstractQtVersion(QnxArchitecture arch, const Utils::FileName &path, QnxAbstractQtVersion(QnxArchitecture arch, const Utils::FileName &path,

View File

@@ -41,7 +41,7 @@ namespace Internal {
class QnxDeviceConfiguration : public RemoteLinux::LinuxDeviceConfiguration class QnxDeviceConfiguration : public RemoteLinux::LinuxDeviceConfiguration
{ {
Q_DECLARE_TR_FUNCTIONS(QnxDeviceConfiguration) Q_DECLARE_TR_FUNCTIONS(Qnx::Internal::QnxDeviceConfiguration)
public: public:
typedef QSharedPointer<QnxDeviceConfiguration> Ptr; typedef QSharedPointer<QnxDeviceConfiguration> Ptr;
typedef QSharedPointer<const QnxDeviceConfiguration> ConstPtr; typedef QSharedPointer<const QnxDeviceConfiguration> ConstPtr;

View File

@@ -64,7 +64,7 @@ QString QnxQtVersion::type() const
QString QnxQtVersion::description() 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 Core::FeatureSet QnxQtVersion::availableFeatures() const

View File

@@ -42,6 +42,7 @@ namespace Internal {
class QnxQtVersion : public QnxAbstractQtVersion class QnxQtVersion : public QnxAbstractQtVersion
{ {
Q_DECLARE_TR_FUNCTIONS(Qnx::Internal::QnxQtVersion)
public: public:
QnxQtVersion(); QnxQtVersion();
QnxQtVersion(QnxArchitecture arch, const Utils::FileName &path, QnxQtVersion(QnxArchitecture arch, const Utils::FileName &path,

View File

@@ -418,7 +418,7 @@ void MakeStepConfigWidget::updateDetails()
m_ui->makeLabel->setText(tr("Make:")); m_ui->makeLabel->setText(tr("Make:"));
if (!tc) { if (!tc) {
setSummaryText(tr("<b>Make:</b> No tool chain set in target.")); setSummaryText(tr("<b>Make:</b> %1").arg(ProjectExplorer::ToolChainProfileInformation::msgNoToolChainInTarget()));
return; return;
} }
Qt4BuildConfiguration *bc = m_makeStep->qt4BuildConfiguration(); Qt4BuildConfiguration *bc = m_makeStep->qt4BuildConfiguration();

View File

@@ -192,11 +192,11 @@ bool S60CreatePackageStep::init()
SymbianQtVersion *sqv SymbianQtVersion *sqv
= dynamic_cast<SymbianQtVersion *>(QtSupport::QtProfileInformation::qtVersion(target()->profile())); = dynamic_cast<SymbianQtVersion *>(QtSupport::QtProfileInformation::qtVersion(target()->profile()));
if (!sqv) { 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; return false;
} }
if (!tc) { if (!tc) {
emit addOutput(tr("The selected profile has no toolchain"), BuildStep::ErrorOutput); emit addOutput(ProjectExplorer::ToolChainProfileInformation::msgNoToolChainInTarget(), BuildStep::ErrorOutput);
return false; return false;
} }
m_isBuildWithSymbianSbsV2 = sqv->isBuildWithSymbianSbsV2(); m_isBuildWithSymbianSbsV2 = sqv->isBuildWithSymbianSbsV2();

View File

@@ -150,20 +150,20 @@ void TargetSetupPageWrapper::updateNoteText()
QString text; QString text;
if (!p) if (!p)
text = tr("<p>The project <b>%1</b> is not yet configured.</p>" text = tr("<p>The project <b>%1</b> is not yet configured.</p>"
"<p>Qt Creator cannot parse the project, because no profile " "<p>Qt Creator cannot parse the project, because no target "
"has been setup. You can setup profiles " "has been set up. You can set up targets "
"in the <b><a href=\"edit\">settings.</a></b></p>") "in the <b><a href=\"edit\">settings.</a></b></p>")
.arg(m_project->displayName()); .arg(m_project->displayName());
else if (p->isValid()) else if (p->isValid())
text = tr("<p>The project <b>%1</b> is not yet configured.</p>" 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 " "to parse the project. You can edit "
"these in the <b><a href=\"edit\">settings.</a></b></p>") "these in the <b><a href=\"edit\">settings.</a></b></p>")
.arg(m_project->displayName()) .arg(m_project->displayName())
.arg(p->displayName()); .arg(p->displayName());
else else
text = tr("<p>The project <b>%1</b> is not yet configured.</p>" 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 " "to parse the project. You can edit "
"these in the <b><a href=\"edit\">settings</a></b></p>") "these in the <b><a href=\"edit\">settings</a></b></p>")
.arg(m_project->displayName()) .arg(m_project->displayName())

View File

@@ -302,7 +302,7 @@ QList<ProjectExplorer::Task> BaseQtVersion::validateProfile(const ProjectExplore
ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainProfileInformation::toolChain(p); ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainProfileInformation::toolChain(p);
if (!tc) if (!tc)
result << ProjectExplorer::Task(ProjectExplorer::Task::Error, result << ProjectExplorer::Task(ProjectExplorer::Task::Error,
QCoreApplication::translate("BaseQtVersion", "No tool chain set up in profile."), ProjectExplorer::ToolChainProfileInformation::msgNoToolChainInTarget(),
Utils::FileName(), -1, Utils::FileName(), -1,
Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)); Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM));

View File

@@ -423,7 +423,7 @@ void ExamplesWelcomePage::openProject(const QString &projectFile, const QStringL
Core::ICore::helpManager()->handleHelpRequest(help.toString()+QLatin1String("?view=split")); Core::ICore::helpManager()->handleHelpRequest(help.toString()+QLatin1String("?view=split"));
} }
if (!errorMessage.isEmpty()) 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() void ExamplesWelcomePage::updateTagsModel()

View File

@@ -274,7 +274,7 @@ void QtOptionsPageWidget::cleanUpQtVersions()
if (toRemove.isEmpty()) if (toRemove.isEmpty())
return; 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>" tr("Do you want to remove all invalid Qt Versions?<br>"
"<ul><li>%1</li></ul><br>" "<ul><li>%1</li></ul><br>"
"will be removed.").arg(toRemove.join(QLatin1String("</li><li>"))), "will be removed.").arg(toRemove.join(QLatin1String("</li><li>"))),
@@ -699,7 +699,7 @@ void QtOptionsPageWidget::editPath()
// Same type? then replace! // Same type? then replace!
if (current->type() != version->type()) { if (current->type() != version->type()) {
// not the same type, error out // 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."), tr("The Qt version selected must be for the same target."),
QMessageBox::Ok); QMessageBox::Ok);
delete version; delete version;

View File

@@ -46,7 +46,7 @@ class LinuxDeviceConfigurationPrivate;
class REMOTELINUX_EXPORT LinuxDeviceConfiguration : public ProjectExplorer::IDevice class REMOTELINUX_EXPORT LinuxDeviceConfiguration : public ProjectExplorer::IDevice
{ {
Q_DECLARE_TR_FUNCTIONS(LinuxDeviceConfiguration) Q_DECLARE_TR_FUNCTIONS(RemoteLinux::Internal::LinuxDeviceConfiguration)
public: public:
typedef QSharedPointer<LinuxDeviceConfiguration> Ptr; typedef QSharedPointer<LinuxDeviceConfiguration> Ptr;
typedef QSharedPointer<const LinuxDeviceConfiguration> ConstPtr; typedef QSharedPointer<const LinuxDeviceConfiguration> ConstPtr;