blob: 8f425fd5b3dddd538867dd68c9937d0df3a818c6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
#ifndef DAEMONMANAGER_H
#define DAEMONMANAGER_H
#include <QObject>
#include <QUrl>
#include <QProcess>
class DaemonManager : public QObject
{
Q_OBJECT
public:
static DaemonManager * instance(const QStringList *args);
Q_INVOKABLE bool start();
Q_INVOKABLE bool stop();
// return true if daemon process is started
Q_INVOKABLE bool running() const;
signals:
void daemonStarted();
void daemonStopped();
void daemonConsoleUpdated(QString message);
public slots:
void printOutput();
void printError();
void closing();
void stateChanged(QProcess::ProcessState state);
private:
explicit DaemonManager(QObject *parent = 0);
static DaemonManager * m_instance;
static QStringList m_clArgs;
QProcess *m_daemon;
bool initialized = false;
};
#endif // DAEMONMANAGER_H
|