aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Baptiste Mardelle <[email protected]>2015-01-12 01:36:32 +0100
committerJean-Baptiste Mardelle <[email protected]>2015-01-12 01:36:32 +0100
commite98fc71c34b7b1ec43f7e92a1053e73ccf7f9fe4 (patch)
tree52bcb3fba8c68096f34df7b200e9b121082c7828
parent325b90062aeb7e489e7c7f138010c29253fc641e (diff)
More user feedback when clip jobs fail
-rw-r--r--src/bin/bin.cpp10
-rw-r--r--src/bin/bin.h1
-rw-r--r--src/project/jobs/jobmanager.cpp14
3 files changed, 20 insertions, 5 deletions
diff --git a/src/bin/bin.cpp b/src/bin/bin.cpp
index 3e03872..fa19150 100644
--- a/src/bin/bin.cpp
+++ b/src/bin/bin.cpp
@@ -1158,6 +1158,16 @@ void Bin::slotUpdateJobStatus(const QString&id, int jobType, int status, const Q
}
}
+void Bin::displayMessage(const QString &text, KMessageWidget::MessageType type)
+{
+ if (m_infoMessage->isHidden()) {
+ m_infoMessage->setText(text);
+ m_infoMessage->setWordWrap(m_infoMessage->text().length() > 35);
+ m_infoMessage->setMessageType(type);
+ m_infoMessage->animatedShow();
+ }
+}
+
void Bin::slotShowJobLog()
{
QDialog d(this);
diff --git a/src/bin/bin.h b/src/bin/bin.h
index f5a8ccf..13b1f93 100644
--- a/src/bin/bin.h
+++ b/src/bin/bin.h
@@ -349,6 +349,7 @@ public:
void setupGeneratorMenu(const QHash<QString,QMenu*>& menus);
void startClipJob(const QStringList &params);
void droppedUrls(QList <QUrl> urls, const QMap<QString,QString> properties = QMap<QString,QString>());
+ void displayMessage(const QString &text, KMessageWidget::MessageType type);
private slots:
void slotAddClip();
diff --git a/src/project/jobs/jobmanager.cpp b/src/project/jobs/jobmanager.cpp
index 5c3b1ed..b762e59 100644
--- a/src/project/jobs/jobmanager.cpp
+++ b/src/project/jobs/jobmanager.cpp
@@ -37,7 +37,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <QDebug>
#include <QtConcurrent>
-
+#include <KMessageWidget>
#include <klocalizedstring.h>
#include <KMessageBox>
#include "ui_scenecutdialog_ui.h"
@@ -227,14 +227,18 @@ QList <ProjectClip *> JobManager::filterClips(QList <ProjectClip *>clips, Abstra
void JobManager::prepareJobs(QList <ProjectClip *>clips, AbstractClipJob::JOBTYPE jobType, const QStringList params)
{
//TODO filter clips
- //QMap <QString, QString> matching = filterClips(clips, jobType, params);
+ QList <ProjectClip *> matching = filterClips(clips, jobType, params);
+ if (matching.isEmpty()) {
+ m_bin->displayMessage(i18n("No valid clip to process"), KMessageWidget::Information);
+ return;
+ }
QMap <ProjectClip *, AbstractClipJob *> jobs;
if (jobType == AbstractClipJob::TRANSCODEJOB) {
- jobs = CutClipJob::prepareJob(m_fps, clips, params);
+ jobs = CutClipJob::prepareJob(m_fps, matching, params);
} else if (jobType == AbstractClipJob::FILTERCLIPJOB) {
- jobs = FilterJob::prepareJob(clips, params);
+ jobs = FilterJob::prepareJob(matching, params);
} else if (jobType == AbstractClipJob::PROXYJOB) {
- jobs = ProxyJob::prepareJob(m_bin, clips);
+ jobs = ProxyJob::prepareJob(m_bin, matching);
}
if (!jobs.isEmpty()) {
QMapIterator<ProjectClip *, AbstractClipJob *> i(jobs);