diff --git a/ChangeLog b/ChangeLog index 501be99d2..a32720f52 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2015-06-01 Moritz Bunkus + * MKVToolNix GUI: bug fix: running jobs cannot be removed from the + job queue anymore. Fixes #1220. + * MKVToolNix GUI: bug fix: when starting the GUI old jobs from the queue were silently discarded if they included additional parts (e.g. VOBs). diff --git a/src/mkvtoolnix-gui/jobs/tool.cpp b/src/mkvtoolnix-gui/jobs/tool.cpp index a9e370531..05fdf46c0 100644 --- a/src/mkvtoolnix-gui/jobs/tool.cpp +++ b/src/mkvtoolnix-gui/jobs/tool.cpp @@ -125,11 +125,23 @@ Tool::onStart() { void Tool::onRemove() { - auto idsToRemove = QMap{}; + auto idsToRemove = QMap{}; + auto emitRunningWarning = false; m_model->withSelectedJobs(ui->jobs, [&idsToRemove](Job &job) { idsToRemove[job.m_id] = true; }); - m_model->removeJobsIf([&](Job const &job) { return idsToRemove[job.m_id]; }); + m_model->removeJobsIf([&idsToRemove, &emitRunningWarning](Job const &job) -> bool { + if (!idsToRemove[job.m_id]) + return false; + if (Job::Running != job.m_status) + return true; + + emitRunningWarning = true; + return false; + }); + + if (emitRunningWarning) + MainWindow::get()->setStatusBarMessage(QY("Running jobs cannot be removed.")); } void @@ -149,7 +161,18 @@ Tool::onRemoveDoneOk() { void Tool::onRemoveAll() { - m_model->removeJobsIf([this](Job const &) { return true; }); + auto emitRunningWarning = false; + + m_model->removeJobsIf([&emitRunningWarning](Job const &job) -> bool { + if (Job::Running != job.m_status) + return true; + + emitRunningWarning = true; + return false; + }); + + if (emitRunningWarning) + MainWindow::get()->setStatusBarMessage(QY("Running jobs cannot be removed.")); } void