Commit 4c9f1b29 authored by Daniel Teske's avatar Daniel Teske

Show warning if qmlviewer is missing

Change-Id: Ie6275ebf6a49f0b1732cc146abeaa23c7b6eafd4
Reviewed-on: http://codereview.qt.nokia.com/1843Reviewed-by: default avatarQt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: default avatarKai Koehne <kai.koehne@nokia.com>
parent 13cc8db2
......@@ -89,6 +89,13 @@ QString DesktopQtVersion::invalidReason() const
return tmp;
}
QString DesktopQtVersion::warningReason() const
{
if (qtVersion() >= QtSupport::QtVersionNumber(4, 7, 0) && qmlviewerCommand().isEmpty())
return QCoreApplication::translate("QtVersion", "No qmlviewer installed.");
return QString();
}
QList<ProjectExplorer::Abi> DesktopQtVersion::qtAbis() const
{
if (!m_qtAbisUpToDate) {
......
......@@ -51,6 +51,7 @@ public:
virtual bool isValid() const;
virtual QString invalidReason() const;
virtual QString warningReason() const;
virtual QList<ProjectExplorer::Abi> qtAbis() const;
......
......@@ -89,6 +89,13 @@ QString SimulatorQtVersion::invalidReason() const
return tmp;
}
QString SimulatorQtVersion::warningReason() const
{
if (qtVersion() >= QtSupport::QtVersionNumber(4, 7, 0) && qmlviewerCommand().isEmpty())
return QCoreApplication::translate("QtVersion", "No qmlviewer installed.");
return QString();
}
QList<ProjectExplorer::Abi> SimulatorQtVersion::qtAbis() const
{
if (!m_qtAbisUpToDate) {
......
......@@ -51,6 +51,7 @@ public:
virtual bool isValid() const;
virtual QString invalidReason() const;
virtual QString warningReason() const;
virtual QList<ProjectExplorer::Abi> qtAbis() const;
......
......@@ -318,6 +318,11 @@ QString BaseQtVersion::invalidReason() const
return QString();
}
QString BaseQtVersion::warningReason() const
{
return QString();
}
QString BaseQtVersion::qmakeCommand() const
{
return m_qmakeCommand;
......
......@@ -109,6 +109,7 @@ public:
virtual QVariantMap toMap() const;
virtual bool isValid() const;
virtual QString invalidReason() const;
virtual QString warningReason() const;
virtual bool toolChainAvailable(const QString &id) const;
......
......@@ -379,6 +379,7 @@ QtOptionsPageWidget::ValidityInfo QtOptionsPageWidget::validInformation(const Ba
++abiCount;
}
bool useable = true;
if (missingToolChains.isEmpty()) {
// No:
info.message = tr("Qt version %1 for %2").arg(version->qtVersionString(), version->description());
......@@ -386,6 +387,7 @@ QtOptionsPageWidget::ValidityInfo QtOptionsPageWidget::validInformation(const Ba
// Yes, this Qt version can't be used at all!
info.message = tr("No tool chain can produce code for this Qt version. Please define one or more tool chains.");
info.icon = m_invalidVersionIcon;
useable = false;
} else {
// Yes, some ABIs are unsupported
info.message = tr("Not all possible target environments can be supported due to missing tool chains.");
......@@ -393,6 +395,17 @@ QtOptionsPageWidget::ValidityInfo QtOptionsPageWidget::validInformation(const Ba
.arg(missingToolChains.join(QLatin1String("</li><li>")));
info.icon = m_warningVersionIcon;
}
if (useable) {
QString warning = version->warningReason();
if (!warning.isEmpty()) {
if (!info.message.isEmpty())
info.message.append('\n');
info.message += warning;
info.icon = m_warningVersionIcon;
}
}
return info;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment