aboutsummaryrefslogtreecommitdiff
path: root/src/daemon/DaemonManager.cpp
diff options
context:
space:
mode:
authorxiphon <xiphon@protonmail.com>2020-02-16 15:01:17 +0000
committerxiphon <xiphon@protonmail.com>2020-02-16 15:01:17 +0000
commit636ca1c41dc5fb56b9af4140f4896508de779e64 (patch)
tree49215c4bde3301f33fcc9c23998078502cd4e15b /src/daemon/DaemonManager.cpp
parenteb7fae92ef0ed01a1d17e56fac217c6450716ccc (diff)
downloadmonzero-gui-636ca1c41dc5fb56b9af4140f4896508de779e64.tar.gz
monzero-gui-636ca1c41dc5fb56b9af4140f4896508de779e64.tar.xz
monzero-gui-636ca1c41dc5fb56b9af4140f4896508de779e64.zip
DaemonManager: async stop, simple mode wizard - show splash on stop
Diffstat (limited to 'src/daemon/DaemonManager.cpp')
-rw-r--r--src/daemon/DaemonManager.cpp22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/daemon/DaemonManager.cpp b/src/daemon/DaemonManager.cpp
index 8d995458..40cf4d2b 100644
--- a/src/daemon/DaemonManager.cpp
+++ b/src/daemon/DaemonManager.cpp
@@ -153,21 +153,19 @@ bool DaemonManager::start(const QString &flags, NetworkType::Type nettype, const
return true;
}
-bool DaemonManager::stop(NetworkType::Type nettype)
+void DaemonManager::stopAsync(NetworkType::Type nettype, const QJSValue& callback)
{
- QString message;
- sendCommand({"exit"}, nettype, message);
- qDebug() << message;
+ const auto feature = m_scheduler.run([this, nettype] {
+ QString message;
+ sendCommand({"exit"}, nettype, message);
- // Start stop watcher - Will kill if not shutting down
- m_scheduler.run([this, nettype] {
- if (stopWatcher(nettype))
- {
- emit daemonStopped();
- }
- });
+ return QJSValueList({stopWatcher(nettype)});
+ }, callback);
- return true;
+ if (!feature.first)
+ {
+ QJSValue(callback).call(QJSValueList({false}));
+ }
}
bool DaemonManager::startWatcher(NetworkType::Type nettype) const