From: Jean-Baptiste Mardelle Date: Sat, 3 Nov 2012 15:24:47 +0000 (+0100) Subject: Allow feedback message for clip jobs X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=76c9abb930245e56533fb0282b919deb33a6d126;p=kdenlive Allow feedback message for clip jobs --- diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 855096a2..2936b538 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -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); } } diff --git a/src/mainwindow.h b/src/mainwindow.h index 32298a71..141c7e24 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -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); diff --git a/src/projectlist.cpp b/src/projectlist.cpp index 1b3dcace..5db34b1a 100644 --- a/src/projectlist.cpp +++ b/src/projectlist.cpp @@ -587,7 +587,7 @@ void ProjectList::editClipSelection(QList 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 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 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; "<, QMap 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 diff --git a/src/statusbarmessagelabel.cpp b/src/statusbarmessagelabel.cpp index a50b5db6..acc24487 100644 --- a/src/statusbarmessagelabel.cpp +++ b/src/statusbarmessagelabel.cpp @@ -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)); } }