# HG changeset patch # User Chris Cannam # Date 1587557292 -3600 # Node ID 5e091b0e317cea226578f0c34dd00e0f12e635c8 # Parent b1f3b56785490a61a25c1b92f5a9fd312fc3c57e Add list of packs, fix download test logic diff -r b1f3b5678549 -r 5e091b0e317c widgets/TransformFinder.cpp --- a/widgets/TransformFinder.cpp Mon Apr 20 18:46:49 2020 +0100 +++ b/widgets/TransformFinder.cpp Wed Apr 22 13:08:12 2020 +0100 @@ -285,25 +285,53 @@ .arg(XmlExportable::encodeEntities(desc.description)); } + QString indentation = tr("      —"); + selectedText += tr(""); if (desc.type != TransformDescription::UnknownType) { - selectedText += tr("
      — Plugin type: %1") - .arg(XmlExportable::encodeEntities(factory->getTransformTypeName(desc.type))); + selectedText += tr("
%1 Plugin type: %2") + .arg(indentation) + .arg(XmlExportable::encodeEntities + (factory->getTransformTypeName(desc.type))); } if (desc.category != "") { - selectedText += tr("
      — Category: %1") + selectedText += tr("
%1 Category: %2") + .arg(indentation) .arg(XmlExportable::encodeEntities(desc.category)); } - selectedText += tr("
      — System identifier: %1") + selectedText += tr("
%1 System identifier: %2") + .arg(indentation) .arg(XmlExportable::encodeEntities(desc.identifier)); if (desc.provider.infoUrl != "") { - selectedText += tr("
      — More information: %1") + selectedText += tr("
%1 More information: %2") + .arg(indentation) .arg(desc.provider.infoUrl); } - if (desc.provider.downloadUrl != "") { - selectedText += tr("
      — Downloads: %1") - .arg(desc.provider.downloadUrl); + if (status != TransformFactory::TransformInstalled) { + bool haveSuitableDownloadLink = + (desc.provider.downloadUrl != "" && + desc.provider.hasDownloadForThisPlatform()); + if (haveSuitableDownloadLink) { + selectedText += tr("
%1 Download for %2: %3") + .arg(indentation) + .arg(desc.provider.thisPlatformName()) + .arg(desc.provider.downloadUrl); + } + if (!desc.provider.foundInPacks.empty()) { + QStringList packsLinks; + for (auto p: desc.provider.foundInPacks) { + packsLinks << + tr("%2").arg(p.second).arg(p.first); + } + selectedText += + (haveSuitableDownloadLink ? + tr("
%1 Also available in: %2") : + tr("
%1 Available in: %2")) + .arg(indentation) + .arg(packsLinks.join(tr(", "))); + } } + selectedText += tr("
"); if (i >= (int)m_labels.size()) {