From: Jean-Baptiste Mardelle Date: Mon, 19 Dec 2011 00:59:59 +0000 (+0100) Subject: Show proxy status in tooltip, and graphical thumbnail overlay X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=7d83f7bc4349abb58dceac82b301469857db9733;p=kdenlive Show proxy status in tooltip, and graphical thumbnail overlay --- diff --git a/src/projectitem.cpp b/src/projectitem.cpp index 4767f705..8d280912 100644 --- a/src/projectitem.cpp +++ b/src/projectitem.cpp @@ -167,9 +167,13 @@ void ProjectItem::slotSetToolTip() { QString tip; if (m_clip->isPlaceHolder()) tip.append(i18n("Missing") + " | "); - if (isProxyRunning()) { + int s = data(0, ProxyRole).toInt(); + if (s == CREATINGPROXY || s > 0) { tip.append(i18n("Building proxy clip") + " | "); } + else if (s == PROXYWAITING) { + tip.append(i18n("Waiting - proxy clip") + " | "); + } else if (hasProxy()) { tip.append(i18n("Proxy clip") + " | "); } diff --git a/src/projectlist.h b/src/projectlist.h index 8236cfdd..ed448fea 100644 --- a/src/projectlist.h +++ b/src/projectlist.h @@ -133,7 +133,7 @@ public: if (proxy != 0 && proxy != PROXYDONE) { QString proxyText; QColor color; - if (proxy > 0) { + if (proxy != PROXYCRASHED) { // Draw proxy progress bar color = option.palette.alternateBase().color(); painter->setPen(Qt::NoPen); @@ -142,22 +142,21 @@ public: QRect progress(pixmapPoint.x() + 1, pixmapPoint.y() + pixmap.height() - 5, pixmap.width() - 2, 4); painter->drawRect(progress); painter->setBrush(option.palette.text()); - progress.adjust(1, 1, 0, -1); - progress.setWidth((pixmap.width() - 4) * proxy / 100); - painter->drawRect(progress); - } - else { - switch (proxy) { - case CREATINGPROXY: - proxyText = i18n("Generating proxy ..."); - break; - case PROXYWAITING: - proxyText = i18n("Waiting proxy ..."); - break; - case PROXYCRASHED: - default: - proxyText = i18n("Proxy crashed"); + if (proxy > 0) { + progress.adjust(1, 1, 0, -1); + progress.setWidth((pixmap.width() - 4) * proxy / 100); + painter->drawRect(progress); } + else if (proxy == PROXYWAITING) { + // Draw kind of a pause icon + progress.adjust(1, 1, 0, -1); + progress.setWidth(2); + painter->drawRect(progress); + progress.moveLeft(progress.right() + 2); + painter->drawRect(progress); + } + } + else if (proxy == PROXYCRASHED) { QRectF txtBounding = painter->boundingRect(r2, Qt::AlignRight | Qt::AlignVCenter, " " + proxyText + " "); painter->setPen(Qt::NoPen); painter->setBrush(option.palette.highlight());