From faacd3d6a11efcb6dcf9a54ce55ed20e573b40f5 Mon Sep 17 00:00:00 2001 From: Jaquee Date: Thu, 23 Feb 2017 19:47:58 +0100 Subject: start daemon automatically and detached --- src/daemon/DaemonManager.h | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'src/daemon/DaemonManager.h') diff --git a/src/daemon/DaemonManager.h b/src/daemon/DaemonManager.h index 2a2b38df..bd13ef60 100644 --- a/src/daemon/DaemonManager.h +++ b/src/daemon/DaemonManager.h @@ -13,26 +13,27 @@ public: static DaemonManager * instance(const QStringList *args); - Q_INVOKABLE bool start(const QString &flags); - Q_INVOKABLE bool stop(); + Q_INVOKABLE bool start(const QString &flags, bool testnet); + Q_INVOKABLE bool stop(bool testnet); // return true if daemon process is started - Q_INVOKABLE bool running() const; - Q_INVOKABLE bool sendCommand(const QString &cmd, bool testnet); + Q_INVOKABLE bool running(bool testnet) const; + // Send daemon command from qml and prints output in console window. + Q_INVOKABLE bool sendCommand(const QString &cmd, bool testnet) const; +private: + bool sendCommand(const QString &cmd, bool testnet, QString &message) const; signals: - void daemonStarted(); - void daemonStopped(); - void daemonConsoleUpdated(QString message); + void daemonStarted() const; + void daemonStopped() const; + void daemonConsoleUpdated(QString message) const; 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; -- cgit v1.2.3