#include <QFile>
const int DurationRole = Qt::UserRole + 1;
-const int ProxyRole = Qt::UserRole + 5;
+const int JobProgressRole = Qt::UserRole + 5;
+const int JobTypeRole = Qt::UserRole + 6;
+const int JobCrasMessage = Qt::UserRole + 7;
const int itemHeight = 38;
ProjectItem::ProjectItem(QTreeWidget * parent, DocClipBase *clip) :
{
QString tip;
if (m_clip->isPlaceHolder()) tip.append(i18n("Missing") + " | ");
- int s = data(0, ProxyRole).toInt();
+ int s = data(0, JobProgressRole).toInt();
if (s == CREATINGJOB || s > 0) {
tip.append(i18n("Building proxy clip") + " | ");
}
}
}
-void ProjectItem::setProxyStatus(CLIPJOBSTATUS status, int progress)
+void ProjectItem::setJobStatus(CLIPJOBSTATUS status, int progress, JOBTYPE jobType)
{
- if (progress > 0) setData(0, ProxyRole, progress);
+ if (status == JOBCRASHED) {
+ if (jobType == PROXYJOB) setData(0, JobCrasMessage, i18n("Proxy crashed"));
+ else if (jobType == CUTJOB) setData(0, JobCrasMessage, i18n("Transcoding crashed"));
+ }
+ setData(0, JobTypeRole, jobType);
+ if (progress > 0) setData(0, JobProgressRole, progress);
else {
- setData(0, ProxyRole, status);
+ setData(0, JobProgressRole, status);
slotSetToolTip();
}
}
bool ProjectItem::hasProxy() const
{
if (m_clip == NULL) return false;
- if (m_clip->getProperty("proxy").isEmpty() || m_clip->getProperty("proxy") == "-" || data(0, ProxyRole).toInt() == JOBCRASHED) return false;
+ if (m_clip->getProperty("proxy").isEmpty() || m_clip->getProperty("proxy") == "-" || data(0, JobProgressRole).toInt() == JOBCRASHED) return false;
return true;
}
bool ProjectItem::isProxyReady() const
{
- return (data(0, ProxyRole).toInt() == JOBDONE);
+ return (data(0, JobProgressRole).toInt() == JOBDONE);
}
-bool ProjectItem::isProxyRunning() const
+bool ProjectItem::isJobRunning() const
{
- int s = data(0, ProxyRole).toInt();
+ int s = data(0, JobProgressRole).toInt();
if (s == JOBWAITING || s == CREATINGJOB || s > 0) return true;
return false;
}
+bool ProjectItem::isProxyRunning() const
+{
+ int s = data(0, JobProgressRole).toInt();
+ if ((s == CREATINGJOB || s > 0) && data(0, JobTypeRole).toInt() == (int) PROXYJOB) return true;
+ return false;
+}
+
bool ProjectItem::playlistHasProxies(const QString path)
{
kDebug()<<"// CHECKING FOR PROXIES";