DaemonManager: implement async sendCommand

This commit is contained in:
xiphon
2019-09-27 10:56:42 +00:00
parent d3b81cb6f8
commit 32257c8fab
4 changed files with 24 additions and 15 deletions

View File

@@ -51,14 +51,14 @@ public:
// return true if daemon process is started
Q_INVOKABLE void runningAsync(NetworkType::Type nettype, const QJSValue& callback) const;
// Send daemon command from qml and prints output in console window.
Q_INVOKABLE bool sendCommand(const QString &cmd, NetworkType::Type nettype) const;
Q_INVOKABLE void sendCommandAsync(const QStringList &cmd, NetworkType::Type nettype, const QJSValue& callback) const;
Q_INVOKABLE void exit();
Q_INVOKABLE QVariantMap validateDataDir(const QString &dataDir) const;
private:
bool running(NetworkType::Type nettype) const;
bool sendCommand(const QString &cmd, NetworkType::Type nettype, QString &message) const;
bool sendCommand(const QStringList &cmd, NetworkType::Type nettype, QString &message) const;
bool startWatcher(NetworkType::Type nettype) const;
bool stopWatcher(NetworkType::Type nettype) const;
signals: