]> git.sesse.net Git - kdenlive/commitdiff
Fix clip job tooltip info
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Thu, 22 Dec 2011 18:43:35 +0000 (19:43 +0100)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Thu, 22 Dec 2011 18:43:35 +0000 (19:43 +0100)
src/projectitem.cpp
src/projectitem.h
src/projectlist.cpp
src/projectlist.h

index df355f9c28fe16bcf274523a7c1a4ae14afd1e9e..3e78ae06bd8c22926c78c88162ca3c426b2fbb8d 100644 (file)
@@ -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) {
index ac02e0d41938e1f47991560b2a1934d48a15fa8b..6b29fb76b4509f3475fbc19c5c8bc7f03d7b1346 100644 (file)
@@ -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). */
index 40ad435c10885577717364d1cc39e6b447be32db..516e60ad975532984b3015270a13548eefc03227 100644 (file)
@@ -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) {
index abadd2e09d8c50512298af2d27250b97ed9d9940..285889074be4ec2bffc22b4dee301ce252ef343a 100644 (file)
@@ -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();