Commit 044f017f authored by Jan Möbius's avatar Jan Möbius
Browse files

Martin Heistermann:

Patch to enable process support without GUI
closes #988

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@14979 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 4fd29369
......@@ -71,10 +71,12 @@ void Core::slotStartJob( QString _jobId, QString _description , int _min , int _
info->minSteps = _min;
info->maxSteps = _max;
info->blocking = _blocking;
info->blockingWidget = 0;
// Add job to local job list
currentJobs.push_back(info);
if (OpenFlipper::Options::gui()) {
// Don't show process status in process manager
// if blocking is enabled
if(_blocking) {
......@@ -112,6 +114,7 @@ void Core::slotStartJob( QString _jobId, QString _description , int _min , int _
// Show window
processManager_->show();
}
}
}
//-----------------------------------------------------------------------------
......@@ -138,6 +141,8 @@ void Core::slotSetJobState(QString _jobId, int _value ) {
if ( getJob(_jobId, id) ) {
currentJobs[id]->currentStep = _value;
if (!OpenFlipper::Options::gui())
return;
// Update gui
if(!currentJobs[id]->blocking)
processManager_->updateStatus(_jobId, _value);
......@@ -160,6 +165,8 @@ void Core::slotSetJobName(QString _jobId, QString _name ) {
if ( getJob(_jobId, id) ) {
currentJobs[id]->id = _name;
if (!OpenFlipper::Options::gui())
return;
// Update gui
if(!currentJobs[id]->blocking)
processManager_->setJobName(_jobId, _name);
......@@ -181,6 +188,8 @@ void Core::slotSetJobDescription(QString _jobId, QString _text ) {
if ( getJob(_jobId, id) ) {
currentJobs[id]->description = _text;
if (!OpenFlipper::Options::gui())
return;
// Update gui
if(!currentJobs[id]->blocking)
processManager_->setJobDescription(_jobId, _text);
......@@ -202,6 +211,7 @@ void Core::slotCancelJob(QString _jobId ) {
if ( getJob(_jobId, id) ) {
if (OpenFlipper::Options::gui()) {
// Update gui
if(!currentJobs[id]->blocking)
processManager_->removeJob(_jobId);
......@@ -213,6 +223,7 @@ void Core::slotCancelJob(QString _jobId ) {
delete w;
}
}
}
currentJobs.removeAt(id);
}
......@@ -226,6 +237,7 @@ void Core::slotFinishJob(QString _jobId ) {
if ( getJob(_jobId, id) ) {
if (OpenFlipper::Options::gui()) {
// Update gui
if(!currentJobs[id]->blocking) {
processManager_->removeJob(_jobId);
......@@ -241,6 +253,7 @@ void Core::slotFinishJob(QString _jobId ) {
delete w;
}
}
}
currentJobs.removeAt(id);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment