comparison widgets/TransformFinder.cpp @ 1599:5e091b0e317c

Add list of packs, fix download test logic
author Chris Cannam
date Wed, 22 Apr 2020 13:08:12 +0100
parents b1f3b5678549
children
comparison
equal deleted inserted replaced
1598:b1f3b5678549 1599:5e091b0e317c
283 } else if (desc.description != "") { 283 } else if (desc.description != "") {
284 selectedText += tr("<small>%1</small>") 284 selectedText += tr("<small>%1</small>")
285 .arg(XmlExportable::encodeEntities(desc.description)); 285 .arg(XmlExportable::encodeEntities(desc.description));
286 } 286 }
287 287
288 QString indentation = tr("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&mdash;");
289
288 selectedText += tr("<small>"); 290 selectedText += tr("<small>");
289 if (desc.type != TransformDescription::UnknownType) { 291 if (desc.type != TransformDescription::UnknownType) {
290 selectedText += tr("<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&mdash; Plugin type: %1") 292 selectedText += tr("<br>%1 Plugin type: %2")
291 .arg(XmlExportable::encodeEntities(factory->getTransformTypeName(desc.type))); 293 .arg(indentation)
294 .arg(XmlExportable::encodeEntities
295 (factory->getTransformTypeName(desc.type)));
292 } 296 }
293 if (desc.category != "") { 297 if (desc.category != "") {
294 selectedText += tr("<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&mdash; Category: %1") 298 selectedText += tr("<br>%1 Category: %2")
299 .arg(indentation)
295 .arg(XmlExportable::encodeEntities(desc.category)); 300 .arg(XmlExportable::encodeEntities(desc.category));
296 } 301 }
297 selectedText += tr("<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&mdash; System identifier: %1") 302 selectedText += tr("<br>%1 System identifier: %2")
303 .arg(indentation)
298 .arg(XmlExportable::encodeEntities(desc.identifier)); 304 .arg(XmlExportable::encodeEntities(desc.identifier));
299 if (desc.provider.infoUrl != "") { 305 if (desc.provider.infoUrl != "") {
300 selectedText += tr("<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&mdash; More information: <a href=\"%1\">%1</a>") 306 selectedText += tr("<br>%1 More information: <a href=\"%2\">%2</a>")
307 .arg(indentation)
301 .arg(desc.provider.infoUrl); 308 .arg(desc.provider.infoUrl);
302 } 309 }
303 if (desc.provider.downloadUrl != "") { 310 if (status != TransformFactory::TransformInstalled) {
304 selectedText += tr("<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&mdash; Downloads: <a href=\"%1\">%1</a>") 311 bool haveSuitableDownloadLink =
305 .arg(desc.provider.downloadUrl); 312 (desc.provider.downloadUrl != "" &&
306 } 313 desc.provider.hasDownloadForThisPlatform());
314 if (haveSuitableDownloadLink) {
315 selectedText += tr("<br>%1 Download for %2: <a href=\"%3\">%3</a>")
316 .arg(indentation)
317 .arg(desc.provider.thisPlatformName())
318 .arg(desc.provider.downloadUrl);
319 }
320 if (!desc.provider.foundInPacks.empty()) {
321 QStringList packsLinks;
322 for (auto p: desc.provider.foundInPacks) {
323 packsLinks <<
324 tr("<a href=\"%1\">%2</a>").arg(p.second).arg(p.first);
325 }
326 selectedText +=
327 (haveSuitableDownloadLink ?
328 tr("<br>%1 Also available in: %2") :
329 tr("<br>%1 Available in: %2"))
330 .arg(indentation)
331 .arg(packsLinks.join(tr(", ")));
332 }
333 }
334
307 selectedText += tr("</small>"); 335 selectedText += tr("</small>");
308 336
309 if (i >= (int)m_labels.size()) { 337 if (i >= (int)m_labels.size()) {
310 SelectableLabel *label = new SelectableLabel(m_resultsFrame); 338 SelectableLabel *label = new SelectableLabel(m_resultsFrame);
311 m_resultsLayout->addWidget(label); 339 m_resultsLayout->addWidget(label);