if (job->addClipToProject) {
emit addClip(destination, QString(), QString());
}
- }
- else if (job->jobStatus == JOBCRASHED) {
- emit updateJobStatus(job->clipId(), job->jobType, JOBCRASHED, job->errorMessage());
+ } else if (job->jobStatus == JOBCRASHED || job->jobStatus == JOBABORTED) {
+ emit updateJobStatus(job->clipId(), job->jobType, job->jobStatus, job->errorMessage());
}
}
// Thread finished, cleanup & update count
QRectF bounding;
painter->drawText(r2, Qt::AlignLeft | Qt::AlignVCenter , subText, &bounding);
- int proxy = index.data(Qt::UserRole + 5).toInt();
- if (proxy != 0 && proxy != JOBDONE) {
- QString proxyText;
- QColor color;
- if (proxy != JOBCRASHED) {
- // Draw proxy progress bar
- color = option.palette.alternateBase().color();
+ int jobProgress = index.data(Qt::UserRole + 5).toInt();
+ if (jobProgress != 0 && jobProgress != JOBDONE && jobProgress != JOBABORTED) {
+ if (jobProgress != JOBCRASHED) {
+ // Draw job progress bar
+ QColor color = option.palette.alternateBase().color();
painter->setPen(Qt::NoPen);
color.setAlpha(180);
painter->setBrush(QBrush(color));
QRect progress(pixmapPoint.x() + 1, pixmapPoint.y() + pixmap.height() - 5, pixmap.width() - 2, 4);
painter->drawRect(progress);
painter->setBrush(option.palette.text());
- if (proxy > 0) {
+ if (jobProgress > 0) {
progress.adjust(1, 1, 0, -1);
- progress.setWidth((pixmap.width() - 4) * proxy / 100);
+ progress.setWidth((pixmap.width() - 4) * jobProgress / 100);
painter->drawRect(progress);
- }
- else if (proxy == JOBWAITING) {
+ } else if (jobProgress == JOBWAITING) {
// Draw kind of a pause icon
progress.adjust(1, 1, 0, -1);
progress.setWidth(2);
progress.moveLeft(progress.right() + 2);
painter->drawRect(progress);
}
- }
- else if (proxy == JOBCRASHED) {
- proxyText = index.data(Qt::UserRole + 7).toString();
- if (!proxyText.isEmpty()) {
- QRectF txtBounding = painter->boundingRect(r2, Qt::AlignRight | Qt::AlignVCenter, " " + proxyText + " ");
+ } else if (jobProgress == JOBCRASHED) {
+ QString jobText = index.data(Qt::UserRole + 7).toString();
+ if (!jobText.isEmpty()) {
+ QRectF txtBounding = painter->boundingRect(r2, Qt::AlignRight | Qt::AlignVCenter, " " + jobText + " ");
painter->setPen(Qt::NoPen);
painter->setBrush(option.palette.highlight());
painter->drawRoundedRect(txtBounding, 2, 2);
painter->setPen(option.palette.highlightedText().color());
- painter->drawText(txtBounding, Qt::AlignHCenter | Qt::AlignVCenter , proxyText);
+ painter->drawText(txtBounding, Qt::AlignHCenter | Qt::AlignVCenter , jobText);
}
}
}
if (m_start.isEmpty()) {
// this is a transcoding job
description = i18n("Transcode clip");
+ } else {
+ description = i18n("Cut clip");
}
- else description = i18n("Cut clip");
m_jobDuration = parameters.at(4).toInt();
addClipToProject = parameters.at(5).toInt();
replaceClip = false;
{
// Special case: playlist clips (.mlt or .kdenlive project files)
if (clipType == AV || clipType == AUDIO || clipType == VIDEO) {
- QStringList parameters;
+ QStringList parameters;
parameters << "-i" << m_src;
if (!m_start.isEmpty())
parameters << "-ss" << m_start <<"-t" << m_end;
parameters << m_dest;
m_jobProcess = new QProcess;
m_jobProcess->setProcessChannelMode(QProcess::MergedChannels);
- kDebug()<<"// STARTING CIUT JOS: "<<parameters;
+ // kDebug()<<"// STARTING CUT JOB: "<<parameters;
m_jobProcess->start("ffmpeg", parameters);
m_jobProcess->waitForStarted();
while (m_jobProcess->state() != QProcess::NotRunning) {
processLogInfo();
m_errorMessage.append(i18n("Failed to create file."));
setStatus(JOBCRASHED);
+ } else {
+ setStatus(JOBDONE);
}
- else setStatus(JOBDONE);
- }
- else if (result == QProcess::CrashExit) {
+ } else if (result == QProcess::CrashExit) {
// Proxy process crashed
QFile::remove(m_dest);
setStatus(JOBCRASHED);
}
}
- delete m_jobProcess;
+ delete m_jobProcess;
return;
+ } else {
+ m_errorMessage = i18n("Cannot process this clip type.");
}
- else m_errorMessage = i18n("Cannot process this clip type.");
setStatus(JOBCRASHED);
return;
}