]> git.sesse.net Git - kdenlive/blobdiff - src/projectlist.cpp
Display job status in clip tooltip
[kdenlive] / src / projectlist.cpp
index 38391bd26143cb9c693d71b50478c80978759faa..5c3458bc6e71a471aac832ed11d55b93084b59df 100644 (file)
@@ -21,6 +21,7 @@
 #include "projectitem.h"
 #include "commands/addfoldercommand.h"
 #include "projecttree/proxyclipjob.h"
+#include "projecttree/cutclipjob.h"
 #include "kdenlivesettings.h"
 #include "slideshowclip.h"
 #include "ui_colorclip_ui.h"
@@ -40,6 +41,7 @@
 #include "commands/addclipcutcommand.h"
 
 #include "ui_templateclip_ui.h"
+#include "ui_cutjobdialog_ui.h"
 
 #include <KDebug>
 #include <KAction>
@@ -52,6 +54,8 @@
 #include <KApplication>
 #include <KStandardDirs>
 #include <KColorScheme>
+#include <KActionCollection>
+#include <KUrlRequester>
 
 #ifdef NEPOMUK
 #include <nepomuk/global.h>
@@ -233,7 +237,7 @@ ProjectList::ProjectList(QWidget *parent) :
     m_jobsMenu->addAction(cancelJobs);
     m_infoLabel->setMenu(m_jobsMenu);
     box->addWidget(m_infoLabel);
-    
+       
     int size = style()->pixelMetric(QStyle::PM_SmallIconSize);
     QSize iconSize(size, size);
 
@@ -257,6 +261,18 @@ ProjectList::ProjectList(QWidget *parent) :
 
     m_listView = new ProjectListView;
     layout->addWidget(m_listView);
+    
+#if KDE_IS_VERSION(4,7,0)    
+    m_infoMessage = new KMessageWidget;
+    layout->addWidget(m_infoMessage);
+    m_infoMessage->setCloseButtonVisible(true);
+    //m_infoMessage->setWordWrap(true);
+    m_infoMessage->hide();
+    m_logAction = new QAction(i18n("Show Log"), this);
+    m_logAction->setCheckable(false);
+    connect(m_logAction, SIGNAL(triggered()), this, SLOT(slotShowJobLog()));
+#endif
+
     setLayout(layout);
     searchView->setTreeWidget(m_listView);
 
@@ -268,11 +284,15 @@ ProjectList::ProjectList(QWidget *parent) :
     connect(m_listView, SIGNAL(requestMenu(const QPoint &, QTreeWidgetItem *)), this, SLOT(slotContextMenu(const QPoint &, QTreeWidgetItem *)));
     connect(m_listView, SIGNAL(addClip()), this, SLOT(slotAddClip()));
     connect(m_listView, SIGNAL(addClip(const QList <QUrl>, const QString &, const QString &)), this, SLOT(slotAddClip(const QList <QUrl>, const QString &, const QString &)));
+    connect(this, SIGNAL(addClip(const QString, const QString &, const QString &)), this, SLOT(slotAddClip(const QString, const QString &, const QString &)));
     connect(m_listView, SIGNAL(addClipCut(const QString &, int, int)), this, SLOT(slotAddClipCut(const QString &, int, int)));
     connect(m_listView, SIGNAL(itemChanged(QTreeWidgetItem *, int)), this, SLOT(slotItemEdited(QTreeWidgetItem *, int)));
     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(ProjectItem *, int , int)), this, SLOT(slotProcessLog(ProjectItem *, int , int)));
+    
+    connect(this, SIGNAL(jobCrashed(ProjectItem *, const QString &, const QString &, const QString)), this, SLOT(slotJobCrashed(ProjectItem *, const QString &, const QString &, const QString)));
 
     m_listViewDelegate = new ItemDelegate(m_listView);
     m_listView->setItemDelegate(m_listViewDelegate);
@@ -298,6 +318,9 @@ ProjectList::~ProjectList()
     m_listView->blockSignals(true);
     m_listView->clear();
     delete m_listViewDelegate;
+#if KDE_IS_VERSION(4,7,0)
+    delete m_infoMessage;
+#endif
 }
 
 void ProjectList::focusTree() const
@@ -627,7 +650,7 @@ void ProjectList::slotReloadClip(const QString &id)
             continue;
         }
         item = static_cast <ProjectItem *>(selected.at(i));
-        if (item && !item->isProxyRunning()) {
+        if (item && !hasPendingProxy(item)) {
             DocClipBase *clip = item->referencedClip();
             if (!clip || !clip->isClean() || m_render->isProcessing(item->clipId())) {
                 kDebug()<<"//// TRYING TO RELOAD: "<<item->clipId()<<", but it is busy";
@@ -893,7 +916,7 @@ void ProjectList::slotUpdateClipProperties(ProjectItem *clip, QMap <QString, QSt
     clip->setProperties(properties);
     if (properties.contains("proxy")) {
         if (properties.value("proxy") == "-" || properties.value("proxy").isEmpty())
-            clip->setProxyStatus(NOJOB);
+            clip->setJobStatus(NOJOB);
     }
     if (properties.contains("name")) {
         monitorItemEditing(false);
@@ -1114,6 +1137,7 @@ void ProjectList::slotDeleteClip(const QString &clipId)
         kDebug() << "/// Cannot find clip to delete";
         return;
     }
+    deleteJobsForClip(clipId);
     if (item->isProxyRunning()) m_abortProxy.append(item->referencedClip()->getProperty("proxy"));
     m_listView->blockSignals(true);
     QTreeWidgetItem *newSelectedItem = m_listView->itemAbove(item);
@@ -1241,7 +1265,7 @@ void ProjectList::slotAddClip(DocClipBase *clip, bool getProperties)
         m_render->getFileProperties(e, clip->getId(), m_listView->iconSize().height(), true);
     }
     // WARNING: code below triggers unnecessary reload of all proxy clips on document loading... is it useful in some cases?
-    /*else if (item->hasProxy() && !item->isProxyRunning()) {
+    /*else if (item->hasProxy() && !item->isJobRunning()) {
         slotCreateProxy(clip->getId());
     }*/
     
@@ -1439,11 +1463,11 @@ void ProjectList::updateAllClips(bool displayRatioChanged, bool fpsChanged, QStr
                 bool replace = false;
                 if (brokenClips.contains(item->clipId())) {
                     // if this is a proxy clip, disable proxy
-                    item->setProxyStatus(NOJOB);
+                    item->setJobStatus(NOJOB);
                     clip->setProperty("proxy", "-");
                     replace = true;
                 }
-                if (clip->isPlaceHolder() == false && !item->isProxyRunning()) {
+                if (clip->isPlaceHolder() == false && !hasPendingProxy(item)) {
                     QDomElement xml = clip->toXML();
                     if (fpsChanged) {
                         xml.removeAttribute("out");
@@ -1524,6 +1548,14 @@ QString ProjectList::getExtensions()
     return allExtensions.simplified();
 }
 
+void ProjectList::slotAddClip(const QString url, const QString &groupName, const QString &groupId)
+{
+    kDebug()<<"// Adding clip: "<<url;
+    QList <QUrl> list;
+    list.append(url);
+    slotAddClip(list, groupName, groupId);
+}
+
 void ProjectList::slotAddClip(const QList <QUrl> givenList, const QString &groupName, const QString &groupId)
 {
     if (!m_commandStack)
@@ -1651,7 +1683,7 @@ void ProjectList::slotRemoveInvalidProxy(const QString &id, bool durationError)
             kDebug() << "Proxy duration is wrong, try changing transcoding parameters.";
             emit displayMessage(i18n("Proxy clip unusable (duration is different from original)."), -2);
         }
-        item->setProxyStatus(JOBCRASHED);
+        slotJobCrashed(item, i18n("Failed to create proxy for %1. check parameters", item->text(0)), "project_settings");
         QString path = item->referencedClip()->getProperty("proxy");
         KUrl proxyFolder(m_doc->projectFolder().path( KUrl::AddTrailingSlash) + "proxy/");
 
@@ -1983,9 +2015,9 @@ void ProjectList::slotReplyGetFileProperties(const QString &clipId, Mlt::Produce
 
         // Proxy stuff
         QString size = properties.value("frame_size");
-        if (!useProxy() && clip->getProperty("proxy").isEmpty()) setProxyStatus(item, NOJOB);
-        if (useProxy() && generateProxy() && clip->getProperty("proxy") == "-") setProxyStatus(item, NOJOB);
-        else if (useProxy() && !item->hasProxy() && !item->isProxyRunning()) {
+        if (!useProxy() && clip->getProperty("proxy").isEmpty()) setJobStatus(item, NOJOB);
+        if (useProxy() && generateProxy() && clip->getProperty("proxy") == "-") setJobStatus(item, NOJOB);
+        else if (useProxy() && !item->hasProxy() && !hasPendingProxy(item)) {
             // proxy video and image clips
             int maxSize;
             CLIPTYPE t = item->clipType();
@@ -2474,13 +2506,13 @@ QMap <QString, QString> ProjectList::getProxies()
 void ProjectList::slotCreateProxy(const QString id)
 {
     ProjectItem *item = getItemById(id);
-    if (!item || item->isProxyRunning() || item->referencedClip()->isPlaceHolder()) return;
+    if (!item || hasPendingProxy(item) || item->referencedClip()->isPlaceHolder()) return;
     QString path = item->referencedClip()->getProperty("proxy");
     if (path.isEmpty()) {
-        setProxyStatus(item, JOBCRASHED);
+        jobCrashed(item, i18n("Failed to create proxy, empty path."));
         return;
     }
-    setProxyStatus(item, JOBWAITING);
+
     if (m_abortProxy.contains(path)) m_abortProxy.removeAll(path);
     if (m_processingProxy.contains(path)) {
         // Proxy is already being generated
@@ -2488,19 +2520,89 @@ void ProjectList::slotCreateProxy(const QString id)
     }
     if (QFileInfo(path).size() > 0) {
         // Proxy already created
-        setProxyStatus(item, JOBDONE);
+        setJobStatus(item, JOBDONE);
         slotGotProxy(path);
         return;
     }
     m_processingProxy.append(path);
 
-    /*PROXYINFO info;
-    info.dest = path;
-    info.src = item->clipUrl().path();
-    info.type = item->clipType();
-    info.exif = QString(item->referencedClip()->producerProperty("_exif_orientation")).toInt();*/
-    ProxyJob *job = new ProxyJob(PROXYJOB, item->clipType(), item->clipId(), 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()));
+    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);
+    if (!item->isJobRunning()) setJobStatus(item, JOBWAITING, 0, job->jobType, job->statusMessage(JOBWAITING));
+    
+    startJobProcess();
+}
+
+void ProjectList::slotCutClipJob(const QString &id, QPoint zone)
+{
+    ProjectItem *item = getItemById(id);
+    if (!item|| item->referencedClip()->isPlaceHolder()) return;
+    QString source = item->clipUrl().path();
+    QString ext = source.section('.', -1);
+    QString dest = source.section('.', 0, -2) + "_" + QString::number(zone.x()) + "." + ext;
+    
+    double clipFps = item->referencedClip()->getProperty("fps").toDouble();
+    if (clipFps == 0) clipFps = m_fps;
+    // if clip and project have different frame rate, adjust in and out
+    int in = zone.x();
+    int out = zone.y();
+    in = GenTime(in, m_timecode.fps()).frames(clipFps);
+    out = GenTime(out, m_timecode.fps()).frames(clipFps);
+    int max = GenTime(item->clipMaxDuration(), m_timecode.fps()).frames(clipFps);
+    int duration = out - in + 1;
+    QString timeIn = Timecode::getStringTimecode(in, clipFps, true);
+    QString timeOut = Timecode::getStringTimecode(duration, clipFps, true);
+    
+    QDialog *d = new QDialog(this);
+    Ui::CutJobDialog_UI ui;
+    ui.setupUi(d);
+    ui.add_clip->setChecked(KdenliveSettings::add_clip_cut());
+    ui.file_url->fileDialog()->setOperationMode(KFileDialog::Saving);
+    ui.file_url->setUrl(KUrl(dest));
+    QString mess = i18n("Extracting %1 out of %2", timeOut, Timecode::getStringTimecode(max, clipFps, true));
+    ui.info_label->setText(mess);
+    if (d->exec() != QDialog::Accepted) {
+        delete d;
+        return;
+    }
+    dest = ui.file_url->url().path();
+    bool acceptPath = dest != source;
+    if (acceptPath && QFileInfo(dest).size() > 0) {
+        // destination file olready exists, overwrite?
+        acceptPath = false;
+    }
+    while (!acceptPath) {
+        // Do not allow to save over original clip
+        if (dest == source) ui.info_label->setText("<b>" + i18n("You cannot overwrite original clip.") + "</b><br>" + mess);
+        else if (KMessageBox::questionYesNo(this, i18n("Overwrite file %1", dest)) == KMessageBox::Yes) break;
+        if (d->exec() != QDialog::Accepted) {
+            delete d;
+            return;
+        }
+        dest = ui.file_url->url().path();
+        acceptPath = dest != source;
+        if (acceptPath && QFileInfo(dest).size() > 0) {
+            acceptPath = false;
+        }
+    }
+    QString extraParams = ui.extra_params->toPlainText().simplified();
+    KdenliveSettings::setAdd_clip_cut(ui.add_clip->isChecked());
+    delete d;
+
+    m_processingProxy.append(dest);
+    QStringList jobParams;
+    jobParams << dest << item->clipUrl().path() << timeIn << timeOut << QString::number(duration) << QString::number(KdenliveSettings::add_clip_cut());
+    if (!extraParams.isEmpty()) jobParams << extraParams;
+    CutClipJob *job = new CutClipJob(item->clipType(), id, jobParams);
+    m_jobList.append(job);
+    if (!item->isJobRunning()) setJobStatus(item, JOBWAITING, 0, job->jobType, job->statusMessage(JOBWAITING));
+    
+    startJobProcess();
+}
+
+
+void ProjectList::startJobProcess()
+{
     int ct = 0;
     if (!m_proxyThreads.futures().isEmpty()) {
         // Remove inactive threads
@@ -2514,7 +2616,7 @@ void ProjectList::slotCreateProxy(const QString id)
     }
     emit jobCount(ct + m_jobList.count());
     
-    if (m_proxyThreads.futures().isEmpty() || m_proxyThreads.futures().count() < KdenliveSettings::proxythreads()) m_proxyThreads.addFuture(QtConcurrent::run(this, &ProjectList::slotGenerateProxy));
+    if (m_proxyThreads.futures().isEmpty() || m_proxyThreads.futures().count() < KdenliveSettings::proxythreads()) m_proxyThreads.addFuture(QtConcurrent::run(this, &ProjectList::slotProcessJobs));
 }
 
 void ProjectList::slotAbortProxy(const QString id, const QString path)
@@ -2531,7 +2633,7 @@ void ProjectList::slotAbortProxy(const QString id, const QString path)
     }
 }
 
-void ProjectList::slotGenerateProxy()
+void ProjectList::slotProcessJobs()
 {
     while (!m_jobList.isEmpty() && !m_abortAllJobs) {
         emit projectModified();
@@ -2558,10 +2660,11 @@ void ProjectList::slotGenerateProxy()
         }
         
         // Get the list of clips that will need to get progress info
-        QTreeWidgetItemIterator it(m_listView);
-        QList <ProjectItem *> processingItems;
-        ProjectItem *item = getItemById(job->clipId());
-        processingItems.append(item);
+        ProjectItem *processingItem = getItemById(job->clipId());
+        if (processingItem == NULL) {
+            delete job;
+            continue;
+        }
         
         /*while (*it && !m_abortAllJobs) {
             if ((*it)->type() == PROJECTCLIPTYPE) {
@@ -2573,11 +2676,10 @@ void ProjectList::slotGenerateProxy()
             ++it;
         }*/
 
-        // Make sure proxy path is writable
+        // Make sure destination path is writable
         QFile file(job->destination());
         if (!file.open(QIODevice::WriteOnly)) {
-            for (int i = 0; i < processingItems.count(); i++)
-                setProxyStatus(processingItems.at(i), JOBCRASHED);
+            emit jobCrashed(processingItem, i18n("Cannot write to path: %1", job->destination()));
             m_processingProxy.removeAll(job->destination());
             delete job;
             continue;
@@ -2585,21 +2687,23 @@ void ProjectList::slotGenerateProxy()
         file.close();
         QFile::remove(job->destination());
     
-        for (int i = 0; i < processingItems.count(); i++)
-            setProxyStatus(processingItems.at(i), CREATINGJOB, 0); //, job->description);
+        setJobStatus(processingItem, CREATINGJOB, 0, job->jobType, job->statusMessage(CREATINGJOB));
+
         bool success;
         QProcess *jobProcess = job->startJob(&success);
             
         int result = -1;
         if (jobProcess == NULL) {
             // job is finished
-            for (int i = 0; i < processingItems.count(); i++)
-                setProxyStatus(processingItems.at(i), success ? JOBDONE : JOBCRASHED);
             if (success) {
-                slotGotProxy(job->destination());
+                setJobStatus(processingItem, JOBDONE);
+                if (job->jobType == PROXYJOB) slotGotProxy(job->destination());
+                //TODO: set folder for transcoded clips
+                else if (job->jobType == CUTJOB) emit addClip(job->destination(), QString(), QString());
             }
             else {
                 QFile::remove(job->destination());
+                emit jobCrashed(processingItem, job->errorMessage());
             }
             m_abortProxy.removeAll(job->destination());
             m_processingProxy.removeAll(job->destination());
@@ -2617,14 +2721,14 @@ void ProjectList::slotGenerateProxy()
                 if (!m_closing) {
                     emit cancelRunningJob(job->clipId(), job->cancelProperties());
                     /*for (int i = 0; i < processingItems.count(); i++)
-                        setProxyStatus(processingItems.at(i), NOJOB);*/
+                        setJobStatus(processingItems.at(i), NOJOB);*/
                 }
                 else continue;
                 result = -2;
             }
             else {
                 int progress = job->processLogInfo();
-                if (progress > -1) processLogInfo(processingItems, progress);
+                if (progress > 0) emit processLog(processingItem, progress, job->jobType); 
             }
             jobProcess->waitForFinished(500);
         }
@@ -2633,20 +2737,25 @@ void ProjectList::slotGenerateProxy()
         if (result == -1) result = jobProcess->exitStatus();
         
         if (result != -2 && QFileInfo(job->destination()).size() == 0) {
-            result = QProcess::CrashExit;
+            job->processLogInfo();
+            emit jobCrashed(processingItem, i18n("Failed to create file"), QString(), job->errorMessage());
+            result = -2;
         }
         
         if (result == QProcess::NormalExit) {
             // proxy successfully created
-            for (int i = 0; i < processingItems.count(); i++)
-                setProxyStatus(processingItems.at(i), JOBDONE);
-            slotGotProxy(job->destination());
+            setJobStatus(processingItem, JOBDONE);
+            if (job->jobType == PROXYJOB) slotGotProxy(job->destination());
+            //TODO: set folder for transcoded clips
+            else if (job->jobType == CUTJOB) {
+                CutClipJob *cutJob = static_cast<CutClipJob *>(job);
+                if (cutJob->addClipToProject) emit addClip(job->destination(), QString(), QString());
+            }
         }
         else if (result == QProcess::CrashExit) {
             // Proxy process crashed
             QFile::remove(job->destination());
-            for (int i = 0; i < processingItems.count(); i++)
-                setProxyStatus(processingItems.at(i), JOBCRASHED);
+            emit jobCrashed(processingItem, i18n("Job crashed"), QString(), job->errorMessage());
         }
         delete job;
         continue;
@@ -2662,12 +2771,6 @@ void ProjectList::slotGenerateProxy()
 }
 
 
-void ProjectList::processLogInfo(QList <ProjectItem *>items, int progress)
-{
-    for (int i = 0; i < items.count(); i++)
-        setProxyStatus(items.at(i), CREATINGJOB, progress);
-}
-
 void ProjectList::updateProxyConfig()
 {
     ProjectItem *item;
@@ -2687,7 +2790,7 @@ void ProjectList::updateProxyConfig()
         }
         CLIPTYPE t = item->clipType();
         if ((t == VIDEO || t == AV || t == UNKNOWN) && item->referencedClip() != NULL) {
-            if  (generateProxy() && useProxy() && !item->isProxyRunning()) {
+            if  (generateProxy() && useProxy() && !hasPendingProxy(item)) {
                 DocClipBase *clip = item->referencedClip();
                 if (clip->getProperty("frame_size").section('x', 0, 0).toInt() > m_doc->getDocumentProperty("proxyminsize").toInt()) {
                     if (clip->getProperty("proxy").isEmpty()) {
@@ -2739,6 +2842,11 @@ void ProjectList::updateProxyConfig()
     else delete command;
 }
 
+void ProjectList::slotProcessLog(ProjectItem *item, int progress, int type)
+{
+    setJobStatus(item, CREATINGJOB, progress, (JOBTYPE) type);
+}
+
 void ProjectList::slotProxyCurrentItem(bool doProxy, ProjectItem *itemToProxy)
 {
     QList<QTreeWidgetItem *> list;
@@ -2846,11 +2954,11 @@ void ProjectList::slotDeleteProxy(const QString proxyPath)
     QFile::remove(proxyPath);
 }
 
-void ProjectList::setProxyStatus(ProjectItem *item, CLIPJOBSTATUS status, int progress)
+void ProjectList::setJobStatus(ProjectItem *item, CLIPJOBSTATUS status, int progress, JOBTYPE jobType, const QString &statusMessage)
 {
     if (item == NULL || m_abortAllJobs) return;
     monitorItemEditing(false);
-    item->setProxyStatus(status, progress);
+    item->setJobStatus(status, progress, jobType, statusMessage);
     if (status == JOBCRASHED) {
         DocClipBase *clip = item->referencedClip();
         if (!clip) {
@@ -2949,4 +3057,73 @@ void ProjectList::slotCancelRunningJob(const QString id, stringMap newProps)
     m_commandStack->push(command);    
 }
 
+bool ProjectList::hasPendingProxy(ProjectItem *item)
+{
+    if (!item || !item->referencedClip() || m_abortAllJobs) return false;
+    for (int i = 0; i < m_jobList.count(); i++) {
+        if (m_abortAllJobs) break;
+        if (m_jobList.at(i)->clipId() == item->clipId() && m_jobList.at(i)->jobType == PROXYJOB) return true;
+    }
+    if (item->isProxyRunning()) return true;
+    return false;
+}
+
+void ProjectList::deleteJobsForClip(const QString &clipId)
+{
+    QList <AbstractClipJob *> jobsToDelete;
+    for (int i = 0; i < m_jobList.count(); i++) {
+        if (m_abortAllJobs) break;
+        if (m_jobList.at(i)->clipId() == clipId) {
+            AbstractClipJob *job = m_jobList.takeAt(i);
+            delete job;
+            i--;
+        }
+    }
+}
+
+void ProjectList::slotJobCrashed(ProjectItem *item, const QString &label, const QString &actionName, const QString details)
+{
+#if KDE_IS_VERSION(4,7,0)
+    m_infoMessage->animatedHide();
+    item->setJobStatus(NOJOB);
+    m_errorLog.clear();
+    m_infoMessage->setText(label);
+    m_infoMessage->setWordWrap(label.length() > 35);
+    m_infoMessage->setMessageType(KMessageWidget::Warning);
+    QList<QAction *> actions = m_infoMessage->actions();
+    for (int i = 0; i < actions.count(); i++) {
+        m_infoMessage->removeAction(actions.at(i));
+    }
+    
+    if (!actionName.isEmpty()) {
+        QAction *action;
+        QList< KActionCollection * > collections = KActionCollection::allCollections();
+        for (int i = 0; i < collections.count(); i++) {
+            KActionCollection *coll = collections.at(i);
+            action = coll->action(actionName);
+            if (action) break;
+        }
+        if (action) m_infoMessage->addAction(action);
+    }
+    if (!details.isEmpty()) {
+        m_errorLog = details;
+        m_infoMessage->addAction(m_logAction);
+    }
+    m_infoMessage->animatedShow();
+#else 
+    item->setJobStatus(JOBCRASHED);
+#endif
+}
+
+void ProjectList::slotShowJobLog()
+{
+    KDialog d(this);
+    d.setButtons(KDialog::Close);
+    QTextEdit t(&d);
+    t.setPlainText(m_errorLog);
+    t.setReadOnly(true);
+    d.setMainWidget(&t);
+    d.exec();
+}
+
 #include "projectlist.moc"