aboutsummaryrefslogtreecommitdiff
path: root/src/daemon/DaemonManager.cpp
diff options
context:
space:
mode:
authorJacob Brydolf <jacob@brydolf.net>2016-11-07 13:10:10 +0100
committerJaquee <jaquee.monero@gmail.com>2016-11-26 19:36:25 +0100
commit3a431543fab567d42f5981d82687c1c9a9244f68 (patch)
tree07adc94851103845cb6b981c6a3a1fe33efcd42b /src/daemon/DaemonManager.cpp
parent3df9e44849cfd0e086d33b79d4dacd03b99a5583 (diff)
downloadmonzero-gui-3a431543fab567d42f5981d82687c1c9a9244f68.tar.gz
monzero-gui-3a431543fab567d42f5981d82687c1c9a9244f68.tar.xz
monzero-gui-3a431543fab567d42f5981d82687c1c9a9244f68.zip
DaemonManager: added console updated signals
Diffstat (limited to 'src/daemon/DaemonManager.cpp')
-rw-r--r--src/daemon/DaemonManager.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/daemon/DaemonManager.cpp b/src/daemon/DaemonManager.cpp
index 80d7c8a4..1fdfcd52 100644
--- a/src/daemon/DaemonManager.cpp
+++ b/src/daemon/DaemonManager.cpp
@@ -41,6 +41,7 @@ bool DaemonManager::start()
QStringList arguments;
m_daemon = new QProcess();
+ initialized = true;
// Connect output slots
connect (m_daemon, SIGNAL(readyReadStandardOutput()), this, SLOT(printOutput()));
@@ -61,7 +62,7 @@ bool DaemonManager::start()
bool DaemonManager::stop()
{
- if(m_daemon){
+ if(initialized){
qDebug() << "stopping daemon";
m_daemon->terminate();
// Wait until stopped. Max 10 seconds
@@ -80,7 +81,8 @@ void DaemonManager::printOutput()
foreach (QString line, strLines){
// dConsole.append(line+"\n");
- qDebug() << "Daemon: " + line;
+ emit daemonConsoleUpdated(line);
+ // qDebug() << "Daemon: " + line;
}
}
@@ -91,13 +93,20 @@ void DaemonManager::printError()
foreach (QString line, strLines){
// dConsole.append(line+"\n");
- qDebug() << "Daemon ERROR: " + line;
+ emit daemonConsoleUpdated(line);
+ // qDebug() << "Daemon ERROR: " + line;
}
}
bool DaemonManager::running() const
{
- return m_daemon && m_daemon->state() > QProcess::NotRunning;
+ if(initialized){
+ qDebug() << m_daemon->state();
+ qDebug() << QProcess::NotRunning;
+
+ return m_daemon->state() > QProcess::NotRunning;
+ }
+ return false;
}
QString DaemonManager::console() const