Corrected: urpo_id.pub in help file for public key file name
[urpo] / src / urpojob.cpp
1 /**************************************************************************
2
3     URPO
4
5     Unix Remote Printing Operation
6     Copyright (c) Arto Hyvättinen 2010
7
8     This file is part of URPO.
9
10     URPO is free software: you can redistribute it and/or modify
11     it under the terms of the GNU General Public License as published by
12     the Free Software Foundation, either version 3 of the License, or
13     (at your option) any later version.
14
15     URPO is distributed in the hope that it will be useful,
16     but WITHOUT ANY WARRANTY; without even the implied warranty of
17     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18     GNU General Public License for more details.
19
20
21 **************************************************************************/
22
23 #include "urpojob.h"
24
25 #include "urpoconnection.h"
26
27 UrpoJob::UrpoJob(UrpoConnection* connection) :
28     QObject(0)
29 {
30        connection_=connection;
31        // Connect debug monitor
32        if( connection_->getDebugMonitor())
33            connect(this,SIGNAL(debugMessage(QString)),connection_->getDebugMonitor(),SLOT(debugMessage(QString)));
34
35        status_ = Ready;
36 }
37
38
39 void UrpoJob::sendDebugMessage(QString message)
40 {
41     emit debugMessage(message);
42 }
43
44 UrpoProcess* UrpoJob::newProcess()
45 {
46     UrpoProcess* process = new UrpoProcess( this );
47     // Connect debug monitor
48     connect( process, SIGNAL(debugMessage(QString)), connection_->getDebugMonitor(), SLOT(debugMessage(QString)));
49     return process;
50 }
51
52 void UrpoJob::finish(JobStatus status)
53 {
54     setStatus( status );
55     if( status == Successed )
56         emit finished(true);
57     else
58         emit finished(false);
59 }
60
61 void UrpoJob::fail(QString errorString)
62 {
63     setStatus( Failed );
64     emit finished(false, errorString);
65 }