From 7bc04c60cfe7b4d2af289c8d2a6f9a50fe950069 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Mardelle Date: Thu, 22 Dec 2011 19:43:35 +0100 Subject: [PATCH] Fix clip job tooltip info --- src/projectitem.cpp | 10 +++------- src/projectitem.h | 4 +--- src/projectlist.cpp | 16 +++++++++------- src/projectlist.h | 4 ++-- 4 files changed, 15 insertions(+), 19 deletions(-) diff --git a/src/projectitem.cpp b/src/projectitem.cpp index df355f9c..3e78ae06 100644 --- a/src/projectitem.cpp +++ b/src/projectitem.cpp @@ -262,21 +262,17 @@ void ProjectItem::setProperties(const QMap < QString, QString > &attributes, con } } -void ProjectItem::setJobStatus(JOBTYPE jobType, CLIPJOBSTATUS status, int progress) +void ProjectItem::setJobStatus(JOBTYPE jobType, CLIPJOBSTATUS status, int progress, const QString &statusMessage) { setData(0, JobTypeRole, jobType); if (progress > 0) setData(0, JobProgressRole, progress); else { setData(0, JobProgressRole, status); + setData(0, JobStatusMessage, statusMessage); + slotSetToolTip(); } } -void ProjectItem::setJobInfo(const QString &statusMessage) -{ - setData(0, JobStatusMessage, statusMessage); - slotSetToolTip(); -} - void ProjectItem::setConditionalJobStatus(CLIPJOBSTATUS status, JOBTYPE requestedJobType) { if (data(0, JobTypeRole).toInt() == requestedJobType) { diff --git a/src/projectitem.h b/src/projectitem.h index ac02e0d4..6b29fb76 100644 --- a/src/projectitem.h +++ b/src/projectitem.h @@ -66,9 +66,7 @@ public: static int itemDefaultHeight(); void slotSetToolTip(); /** \brief Set the status of the clip job. */ - void setJobStatus(JOBTYPE jobType, CLIPJOBSTATUS status, int progress = 0); - /** \brief Set the info string for this clip job. */ - void setJobInfo(const QString &statusMessage); + void setJobStatus(JOBTYPE jobType, CLIPJOBSTATUS status, int progress = 0, const QString &statusMessage = QString()); /** \brief Set the status of a clip job if it is of the specified job type. */ void setConditionalJobStatus(CLIPJOBSTATUS status, JOBTYPE requestedJobType); /** \brief Returns the proxy status for this clip (true means there is a proxy clip). */ diff --git a/src/projectlist.cpp b/src/projectlist.cpp index 40ad435c..516e60ad 100644 --- a/src/projectlist.cpp +++ b/src/projectlist.cpp @@ -290,7 +290,7 @@ ProjectList::ProjectList(QWidget *parent) : connect(m_listView, SIGNAL(showProperties(DocClipBase *)), this, SIGNAL(showClipProperties(DocClipBase *))); connect(this, SIGNAL(cancelRunningJob(const QString, stringMap )), this, SLOT(slotCancelRunningJob(const QString, stringMap))); - connect(this, SIGNAL(processLog(const QString, int , int)), this, SLOT(slotProcessLog(const QString, int , int))); + connect(this, SIGNAL(processLog(const QString, int , int, const QString)), this, SLOT(slotProcessLog(const QString, int , int, const QString))); connect(this, SIGNAL(updateJobStatus(const QString &, int, int, const QString &, const QString &, const QString)), this, SLOT(slotUpdateJobStatus(const QString &, int, int, const QString &, const QString &, const QString))); @@ -2547,7 +2547,7 @@ void ProjectList::slotCreateProxy(const QString id) ProxyJob *job = new ProxyJob(item->clipType(), id, QStringList() << path << item->clipUrl().path() << item->referencedClip()->producerProperty("_exif_orientation") << m_doc->getDocumentProperty("proxyparams").simplified() << QString::number(m_render->frameRenderWidth()) << QString::number(m_render->renderHeight())); m_jobList.append(job); - setJobStatus(item, job->jobType, JOBWAITING); + setJobStatus(item, job->jobType, JOBWAITING, 0, job->statusMessage()); slotCheckJobProcess(); } @@ -2613,7 +2613,7 @@ void ProjectList::slotCutClipJob(const QString &id, QPoint zone) if (!extraParams.isEmpty()) jobParams << extraParams; CutClipJob *job = new CutClipJob(item->clipType(), id, jobParams); m_jobList.append(job); - setJobStatus(item, job->jobType, JOBWAITING); + setJobStatus(item, job->jobType, JOBWAITING, 0, job->statusMessage()); slotCheckJobProcess(); } @@ -2686,12 +2686,14 @@ void ProjectList::slotProcessJobs() } QString destination = job->destination(); - // Get the list of clips that will need to get progress info + // Check if the clip is still here ProjectItem *processingItem = getItemById(job->clipId()); if (processingItem == NULL) { job->setStatus(JOBDONE); continue; } + // Set clip status to started + emit processLog(job->clipId(), 0, job->jobType, job->statusMessage()); // Make sure destination path is writable QFile file(destination); @@ -2851,10 +2853,10 @@ void ProjectList::updateProxyConfig() else delete command; } -void ProjectList::slotProcessLog(const QString id, int progress, int type) +void ProjectList::slotProcessLog(const QString id, int progress, int type, const QString message) { ProjectItem *item = getItemById(id); - setJobStatus(item, (JOBTYPE) type, JOBWORKING, progress); + setJobStatus(item, (JOBTYPE) type, JOBWORKING, progress, message); } void ProjectList::slotProxyCurrentItem(bool doProxy, ProjectItem *itemToProxy) @@ -2968,7 +2970,7 @@ void ProjectList::setJobStatus(ProjectItem *item, JOBTYPE jobType, CLIPJOBSTATUS { if (item == NULL || (m_abortAllJobs && m_closing)) return; monitorItemEditing(false); - item->setJobStatus(jobType, status, progress); + item->setJobStatus(jobType, status, progress, statusMessage); if (status == JOBCRASHED) { DocClipBase *clip = item->referencedClip(); if (!clip) { diff --git a/src/projectlist.h b/src/projectlist.h index abadd2e0..28588907 100644 --- a/src/projectlist.h +++ b/src/projectlist.h @@ -434,7 +434,7 @@ private slots: /** @brief Discard a running clip jobs. */ void slotCancelRunningJob(const QString id, stringMap); /** @brief Update a clip's job status. */ - void slotProcessLog(const QString, int progress, int); + void slotProcessLog(const QString, int progress, int, const QString = QString()); /** @brief A clip job crashed, inform user. */ void slotUpdateJobStatus(const QString &id, int type, int status, const QString &label, const QString &actionName, const QString details); void slotUpdateJobStatus(ProjectItem *item, int type, int status, const QString &label, const QString &actionName = QString(), const QString details = QString()); @@ -468,7 +468,7 @@ signals: /** @brief Set number of running jobs. */ void jobCount(int); void cancelRunningJob(const QString, stringMap); - void processLog(const QString, int , int); + void processLog(const QString, int , int, const QString = QString()); void addClip(const QString, const QString &, const QString &); void updateJobStatus(const QString, int, int, const QString &label = QString(), const QString &actionName = QString(), const QString details = QString()); void checkJobProcess(); -- 2.39.2