diff --git a/src/plugins/qmldesigner/designercore/instances/nodeinstanceserverproxy.cpp b/src/plugins/qmldesigner/designercore/instances/nodeinstanceserverproxy.cpp index a80d43a35a652942bd261a02c2c513417a879aee..7844d4b90f24f55b16cb4a0d8a1a01eafe0a77ea 100644 --- a/src/plugins/qmldesigner/designercore/instances/nodeinstanceserverproxy.cpp +++ b/src/plugins/qmldesigner/designercore/instances/nodeinstanceserverproxy.cpp @@ -401,6 +401,25 @@ static QString generatePuppetCompilingHelp(const QString &puppetName, const QStr return puppetCompileHelp; } +static void formatQmlPuppetCompilationMessage(const QString &puppetName, + const QString &sharedDirPath, + const QString &pathToQt, + QTextStream &messageStream) +{ + const QString sourcePath = sharedDirPath + QStringLiteral("/qml/qmlpuppet/") + puppetName + QLatin1Char('/'); + messageStream << "

" + //: %1 Puppet binary name ("qmlpuppet", "qml2puppet"), %2 source path. + << NodeInstanceServerProxy::tr("You can build %1 yourself with Qt 5.2.0 or higher. " + "The source can be found in %2.") + .arg(puppetName, QDir::toNativeSeparators(sourcePath)) + << "

" + << NodeInstanceServerProxy::tr("%1 will be installed to the bin directory of your Qt version. " + "Qt Quick Designer will check the bin directory of the currently active Qt version " + "of your project.").arg(puppetName) + << "

" + << generatePuppetCompilingHelp(puppetName, pathToQt); +} + QString NodeInstanceServerProxy::missingQmlPuppetErrorMessage(const QString &pathToQt, const QString &preMessage) const { QString message; @@ -408,29 +427,10 @@ QString NodeInstanceServerProxy::missingQmlPuppetErrorMessage(const QString &pat messageStream << "

" << preMessage << "

"; - if (hasQtQuick2(m_nodeInstanceView.data())) { - messageStream << "

" - << tr("You can build qml2puppet yourself with Qt 5.2.0 or higher. " - "The source can be found in %1."). - arg(QDir::toNativeSeparators(sharedDirPath() + QLatin1String("/qml/qmlpuppet/qml2puppet/"))) - << "

" - << tr("qml2puppet will be installed to the bin directory of your Qt version. " - "Qt Quick Designer will check the bin directory of the currently active Qt version " - "of your project.") - << "

" - << generatePuppetCompilingHelp(QStringLiteral("qml2puppet"), pathToQt); - } else if (hasQtQuick1(m_nodeInstanceView.data())) { - messageStream << "

" - << tr("You can build qml2puppet yourself with Qt 5.2.0 or higher. " - "The source can be found in %1."). - arg(QDir::toNativeSeparators(sharedDirPath() + QLatin1String("/qml/qmlpuppet/qmlpuppet/"))) - << "

" - << tr("qmlpuppet will be installed to the bin directory of your Qt version. " - "Qt Quick Designer will check the bin directory of the currently active Qt version " - "of your project.") - << "

" - << generatePuppetCompilingHelp(QStringLiteral("qmlpuppet"), pathToQt); - } + if (hasQtQuick2(m_nodeInstanceView.data())) + formatQmlPuppetCompilationMessage(QStringLiteral("qml2puppet"), sharedDirPath(), pathToQt, messageStream); + else if (hasQtQuick1(m_nodeInstanceView.data())) + formatQmlPuppetCompilationMessage(QStringLiteral("qmlpuppet"), sharedDirPath(), pathToQt, messageStream); messageStream << "

"; return message; }