00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #include "urpojob.h"
00024
00025 #include "urpoconnection.h"
00026
00027 UrpoJob::UrpoJob(UrpoConnection* connection) :
00028 QObject(0)
00029 {
00030 connection_=connection;
00031
00032 if( connection_->getDebugMonitor())
00033 connect(this,SIGNAL(debugMessage(QString)),connection_->getDebugMonitor(),SLOT(debugMessage(QString)));
00034
00035 status_ = Ready;
00036 }
00037
00038
00039 void UrpoJob::sendDebugMessage(QString message)
00040 {
00041 emit debugMessage(message);
00042 }
00043
00044 UrpoProcess* UrpoJob::newProcess()
00045 {
00046 UrpoProcess* process = new UrpoProcess( this );
00047
00048 connect( process, SIGNAL(debugMessage(QString)), connection_->getDebugMonitor(), SLOT(debugMessage(QString)));
00049 return process;
00050 }
00051
00052 void UrpoJob::finish(JobStatus status)
00053 {
00054 setStatus( status );
00055 if( status == Successed )
00056 emit finished(true);
00057 else
00058 emit finished(false);
00059 }
00060
00061 void UrpoJob::fail(QString errorString)
00062 {
00063 setStatus( Failed );
00064 emit finished(false, errorString);
00065 }