]> git.sesse.net Git - kdenlive/commitdiff
Show proxy status in tooltip, and graphical thumbnail overlay
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Mon, 19 Dec 2011 00:59:59 +0000 (01:59 +0100)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Mon, 19 Dec 2011 00:59:59 +0000 (01:59 +0100)
src/projectitem.cpp
src/projectlist.h

index 4767f705231dd98c8b8a0b83d15c0e3d7dbe0d10..8d280912085e0c2fc007d827031942fb1e3baf2a 100644 (file)
@@ -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") + " | ");
     }
index 8236cfdd99a1e479adeabe0301146a99e6dfdf3e..ed448fea176f32ae059c647ec69852dbae7ab2d7 100644 (file)
@@ -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());