]> git.sesse.net Git - kdenlive/commitdiff
Allow feedback message for clip jobs
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Sat, 3 Nov 2012 15:24:47 +0000 (16:24 +0100)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Sat, 3 Nov 2012 15:24:47 +0000 (16:24 +0100)
src/mainwindow.cpp
src/mainwindow.h
src/projectlist.cpp
src/projectlist.h
src/statusbarmessagelabel.cpp

index 855096a2527a818656d7b7b0f1d73ff77f8a7a49..2936b538703ba00cc22e593364ddfd8481e86d51 100644 (file)
@@ -236,7 +236,7 @@ MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, const QString &
     connect(m_projectList, SIGNAL(clipSelected(DocClipBase *, QPoint, bool)), m_clipMonitor, SLOT(slotSetClipProducer(DocClipBase *, QPoint, bool)));
     connect(m_projectList, SIGNAL(raiseClipMonitor(bool)), m_clipMonitor, SLOT(slotActivateMonitor(bool)));
     connect(m_projectList, SIGNAL(loadingIsOver()), this, SLOT(slotElapsedTime()));
-    connect(m_projectList, SIGNAL(displayMessage(const QString&, int)), this, SLOT(slotGotProgressInfo(const QString&, int)));
+    connect(m_projectList, SIGNAL(displayMessage(const QString&, int, MessageType)), this, SLOT(slotGotProgressInfo(const QString&, int, MessageType)));
     connect(m_projectList, SIGNAL(updateRenderStatus()), this, SLOT(slotCheckRenderStatus()));
     connect(m_projectList, SIGNAL(clipNeedsReload(const QString&)),this, SLOT(slotUpdateClip(const QString &)));
     connect(m_projectList, SIGNAL(updateProfile(const QString &)), this, SLOT(slotUpdateProjectProfile(const QString &)));
@@ -3212,19 +3212,13 @@ void MainWindow::slotUpdateZoomSliderToolTip(int zoomlevel)
     m_zoomSlider->setToolTip(i18n("Zoom Level: %1/13", (13 - zoomlevel)));
 }
 
-void MainWindow::slotGotProgressInfo(const QString &message, int progress)
+void MainWindow::slotGotProgressInfo(const QString &message, int progress, MessageType type)
 {
-    m_statusProgressBar->setValue(progress);
+    if (type == DefaultMessage) m_statusProgressBar->setValue(progress);
+    m_messageLabel->setMessage(message, type);
     if (progress >= 0) {
-        if (!message.isEmpty())
-            m_messageLabel->setMessage(message, InformationMessage);//statusLabel->setText(message);
-        m_statusProgressBar->setVisible(true);
-    } else if (progress == -2) {
-        if (!message.isEmpty())
-            m_messageLabel->setMessage(message, ErrorMessage);
-        m_statusProgressBar->setVisible(false);
+        if (type == DefaultMessage) m_statusProgressBar->setVisible(true);
     } else {
-        m_messageLabel->setMessage(QString(), DefaultMessage);
         m_statusProgressBar->setVisible(false);
     }
 }
index 32298a71841f7abfefc8425bd6892768ea35b2be..141c7e246621c8ab7819631d95086a3e4f17cba0 100644 (file)
@@ -328,7 +328,7 @@ public slots:
     *
     * Checks if already open and whether backup exists */
     void openFile(const KUrl &url);
-    void slotGotProgressInfo(const QString &message, int progress);
+    void slotGotProgressInfo(const QString &message, int progress, MessageType type = DefaultMessage);
     void slotReloadEffects();
     Q_SCRIPTABLE void setRenderingProgress(const QString &url, int progress);
     Q_SCRIPTABLE void setRenderingFinished(const QString &url, int status, const QString &error);
index 1b3dcacec6b88cd3ffa10108eff0701f2706e10c..5db34b1a4b288e05e0ae2db6986895133576455b 100644 (file)
@@ -587,7 +587,7 @@ void ProjectList::editClipSelection(QList<QTreeWidgetItem *> list)
         kDebug() << "Result: " << p.key() << " = " << p.value();
     }*/
     if (clipList.isEmpty()) {
-        emit displayMessage(i18n("No available clip selected"), -2);
+        emit displayMessage(i18n("No available clip selected"), -2, ErrorMessage);
     }
     else emit showClipProperties(clipList, commonproperties);
 }
@@ -778,7 +778,7 @@ void ProjectList::slotMissingClip(const QString &id)
         }
     }
     update();
-    emit displayMessage(i18n("Check missing clips"), -2);
+    emit displayMessage(i18n("Check missing clips"), -2, ErrorMessage);
     emit updateRenderStatus();
 }
 
@@ -1818,7 +1818,7 @@ void ProjectList::slotRemoveInvalidProxy(const QString &id, bool durationError)
         item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsDragEnabled | Qt::ItemIsEnabled | Qt::ItemIsEditable | Qt::ItemIsDropEnabled);
         if (durationError) {
             kDebug() << "Proxy duration is wrong, try changing transcoding parameters.";
-            emit displayMessage(i18n("Proxy clip unusable (duration is different from original)."), -2);
+            emit displayMessage(i18n("Proxy clip unusable (duration is different from original)."), -2, ErrorMessage);
         }
         slotUpdateJobStatus(item, PROXYJOB, JOBCRASHED, i18n("Failed to create proxy for %1. check parameters", item->text(0)), "project_settings");
         QString path = item->referencedClip()->getProperty("proxy");
@@ -2708,7 +2708,7 @@ void ProjectList::slotAddOrUpdateSequence(const QString frameName)
                         
             m_doc->slotCreateSlideshowClipFile(properties, groupInfo.at(0), groupInfo.at(1));
         }
-    } else emit displayMessage(i18n("Sequence not found"), -2);
+    } else emit displayMessage(i18n("Sequence not found"), -2, ErrorMessage);
 }
 
 QMap <QString, QString> ProjectList::getProxies()
@@ -3461,7 +3461,7 @@ void ProjectList::startClipFilterJob(const QString &filterName, const QString &c
     QString destination;
     ProjectItem *item = getItemById(ids.at(0));
     if (!item) {
-        emit displayMessage(i18n("Cannot find clip to process filter %1", filterName), -2);
+        emit displayMessage(i18n("Cannot find clip to process filter %1", filterName), -2, ErrorMessage);
         return;
     }
     if (ids.count() == 1) {
@@ -3490,12 +3490,13 @@ void ProjectList::startClipFilterJob(const QString &filterName, const QString &c
        // Producer params
        jobParams << QString();
        // Filter params, use a smaller region of the image to speed up operation
-       jobParams << filterName << "bounding=\"25%x25%:25%x25\" shot_change_list=0";
+       jobParams << filterName << "bounding=\"25%x25%:15%x15\" shot_change_list=0 denoise=0";
        // Consumer
        jobParams << "null" << "all=1 terminate_on_pause=1 real_time=-1";
        QMap <QString, QString> extraParams;
        extraParams.insert("key", "shot_change_list");
        extraParams.insert("projecttreefilter", "1");
+       extraParams.insert("resultmessage", i18n("Found %1 scenes.", "%count"));
        if (ui.add_markers->isChecked()) {
            // We want to create markers
            extraParams.insert("addmarkers", QString::number(ui.marker_type->currentIndex()));
@@ -3622,14 +3623,19 @@ void ProjectList::slotGotFilterJobResults(QString id, int , int , stringMap resu
     int markersType = -1;
     if (filterInfo.contains("addmarkers")) markersType = filterInfo.value("addmarkers").toInt();
     if (results.isEmpty()) {
-       emit displayMessage(i18n("No data returned from clip analysis"), ErrorMessage);
+       emit displayMessage(i18n("No data returned from clip analysis"), 0, ErrorMessage);
        return;
     }
-    emit displayMessage(i18n("Processing data analysis"), InformationMessage);
     bool dataProcessed = false;
     QString key = filterInfo.value("key");
     QStringList value = results.value(key).split(';', QString::SkipEmptyParts);
     kDebug()<<"// RESULT; "<<key<<" = "<<value;
+    if (filterInfo.contains("resultmessage")) {
+       QString mess = filterInfo.value("resultmessage");
+       mess.replace("%count", QString::number(value.count()));
+       emit displayMessage(mess, 0, InformationMessage);
+    }
+    else emit displayMessage(i18n("Processing data analysis"), 0, InformationMessage);
     if (filterInfo.contains("cutscenes")) {
        // Check if we want to cut scenes from returned data
        dataProcessed = true;
index 49bccdf0e87374f87c74e332bdc6b876378a2eb5..af8605b1e67235bb20657115dcd4a247759affae 100644 (file)
@@ -501,7 +501,7 @@ signals:
     void showClipProperties(QList <DocClipBase *>, QMap<QString, QString> commonproperties);
     void projectModified();
     void loadingIsOver();
-    void displayMessage(const QString, int progress);
+    void displayMessage(const QString, int progress, MessageType type = DefaultMessage);
     void clipNameChanged(const QString, const QString);
     void clipNeedsReload(const QString&);
     /** @brief A property affecting display was changed, so we need to update monitors and thumbnails
index a50b5db6ba01e03d8a902355e6ffedf856a1752b..acc24487016014c0056a8babe29fb97aef2c5584 100644 (file)
@@ -135,7 +135,7 @@ bool StatusBarMessageLabel::slotMessageTimeout()
 
             // If we only have the default message left to show in the queue,
             // keep the current one for a little longer.
-            m_queueTimer.start(m_currentMessage.timeoutMillis + 2000*(m_messageQueue.at(0).type == DefaultMessage));
+            m_queueTimer.start(m_currentMessage.timeoutMillis + 4000*(m_messageQueue.at(0).type == DefaultMessage));
 
         }
     }