This commit is contained in:
stoffu
2018-03-06 01:19:45 +09:00
parent c5363da1e8
commit c8f0cf3543
22 changed files with 161 additions and 112 deletions

View File

@@ -5,6 +5,7 @@
#include <QUrl>
#include <QProcess>
#include <QVariantMap>
#include "NetworkType.h"
class DaemonManager : public QObject
{
@@ -14,21 +15,21 @@ public:
static DaemonManager * instance(const QStringList *args);
Q_INVOKABLE bool start(const QString &flags, bool testnet, const QString &dataDir = "", const QString &bootstrapNodeAddress = "");
Q_INVOKABLE bool stop(bool testnet);
Q_INVOKABLE bool start(const QString &flags, NetworkType::Type nettype, const QString &dataDir = "", const QString &bootstrapNodeAddress = "");
Q_INVOKABLE bool stop(NetworkType::Type nettype);
// return true if daemon process is started
Q_INVOKABLE bool running(bool testnet) const;
Q_INVOKABLE bool running(NetworkType::Type nettype) const;
// Send daemon command from qml and prints output in console window.
Q_INVOKABLE bool sendCommand(const QString &cmd, bool testnet) const;
Q_INVOKABLE bool sendCommand(const QString &cmd, NetworkType::Type nettype) const;
Q_INVOKABLE void exit();
Q_INVOKABLE QVariantMap validateDataDir(const QString &dataDir) const;
private:
bool sendCommand(const QString &cmd, bool testnet, QString &message) const;
bool startWatcher(bool testnet) const;
bool stopWatcher(bool testnet) const;
bool sendCommand(const QString &cmd, NetworkType::Type nettype, QString &message) const;
bool startWatcher(NetworkType::Type nettype) const;
bool stopWatcher(NetworkType::Type nettype) const;
signals:
void daemonStarted() const;
void daemonStopped() const;