From ad957e3c6d5050963e768a27ccd5da4f9092f89a Mon Sep 17 00:00:00 2001 From: Christoph Schulthess Date: Tue, 2 May 2017 09:56:50 +0200 Subject: test --- src/client/toolbar/toolbar.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/client/toolbar/toolbar.cpp b/src/client/toolbar/toolbar.cpp index 48e357b..af69ed1 100644 --- a/src/client/toolbar/toolbar.cpp +++ b/src/client/toolbar/toolbar.cpp @@ -110,6 +110,7 @@ void Toolbar::init() connect(_ui->btnManager, SIGNAL(toggled(bool)), this, SLOT(onBtnManager())); connect(_ui->btnAttention, SIGNAL(toggled(bool)), this, SLOT(onBtnAttention())); connect(_ui->btnCustom, SIGNAL(toggled(bool)), this, SLOT(onBtnCustom())); + connect(this->runDbg, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(onDbgFinished())); /* Setup menu */ initMenu(); @@ -499,18 +500,24 @@ void Toolbar::onBtnCustom() { const bool on = _ui->btnCustom->isChecked(); if (on) { - this->runDbg.startDetached("/bin/sh", QStringList() << "-c" << "/opt/openslx/remotedebug/startdebug_noxterm.sh"); + this->runDbg.start("/bin/sh", QStringList() << "-c" << "/opt/openslx/remotedebug/startdebug_noxterm.sh"); _ui->btnCustom->setStyleSheet("background-color: red; color: white; font: bold"); _ui->btnCustom->setText("Debug mode: ON"); } else { this->runDbg.terminate(); - _ui->btnCustom->setStyleSheet("background-color: grey; color: black; font: bold"); - _ui->btnCustom->setText("Debug mode: OFF"); + } qDebug() << "state: " << this->runDbg.state(); qDebug() << "error: " << this->runDbg.errorString(); } +void Toolbar::onDbgFinished() +{ + _ui->btnCustom->setChecked(false) + _ui->btnCustom->setStyleSheet("background-color: grey; color: black; font: bold"); + _ui->btnCustom->setText("Debug mode: OFF"); +} + void Toolbar::onBtnLockDesktop() { if (this->lockDesktopP.state() == QProcess::NotRunning) { -- cgit v1.2.3-55-g7522