From 61b4ee3b8f1d4c5d85b7a561551167fa41b12400 Mon Sep 17 00:00:00 2001 From: Daniel Teichmann Date: Tue, 6 Jul 2021 20:04:48 +0200 Subject: Tidy up some debug statements or long strings --- src/session.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'src/session.cpp') diff --git a/src/session.cpp b/src/session.cpp index 4640786..14b6575 100644 --- a/src/session.cpp +++ b/src/session.cpp @@ -158,7 +158,8 @@ void Session::setStatus(QString status) { emit _main_gui->showWindow(); - _main_gui->showToast(tr("Remote Support session was stopped ungracefully"), 5000); + _main_gui->showToast(tr("Remote Support session was " + "stopped ungracefully"), 5000); } else if (status == "stopped") { /* Session is stopped */ guiString = tr("Remote Support session was stopped"); @@ -183,24 +184,29 @@ void Session::setStatus(QString status) { guiString = tr("Remote Support session couldn't be started!"); _main_gui->setStatusIndicator(true, QColor(255, 0, 0, 127)); - _main_gui->showToast(tr("An error occured while trying to start a session!"), 5000); + _main_gui->showToast(tr("An error occured while trying " + "to start a session!"), 5000); } else if (status == "start_session_success") { /* Session successfully started */ guiString = tr("Remote Support session successfully started!"); _main_gui->setStatusIndicator(true, QColor(255, 255, 0, 127)); - _main_gui->showToast(tr("Session was started successfully")); + _main_gui->showToast(QString(tr("Session was started " + "on '%0' successfully")) + .arg(_host->alias())); } else if (status == "status_session_error") { /* Session's status couldn't be refreshed */ _main_gui->showToast(tr("Session status could not be refreshed!"), 5000); - guiString = tr("Session status could not be refreshed!") + "\n" + tr("remote support partner could still be connected!"); + guiString = tr("Session status could not be refreshed!") + "\n" + + tr("remote support partner could still be connected!"); _main_gui->setStatusIndicator(true, QColor(255, 0, 0, 127)); emit _main_gui->showWindow(); } else if (status == "stop_session_error") { /* Session couldn't be stopped */ _main_gui->showToast(tr("Session could not be stopped!"), 5000); - guiString = tr("Session could not be stopped!") + "\n" + tr("remote support partner could still be connected!"); + guiString = tr("Session could not be stopped!") + "\n" + + tr("remote support partner could still be connected!"); _main_gui->setStatusIndicator(true, QColor(255, 0, 0, 127)); emit _main_gui->showWindow(); @@ -353,6 +359,8 @@ void Session::status_response(QJsonDocument *doc) { this->setStatus(new_status); if (this->isSessionAliveOrRunning(new_status)) { + qDebug() << "Session is still alive or running. -> Restarting the status timer."; + // Ask status every 1000 millisecond QTimer::singleShot(1000, this, &Session::statusTimerEvent); } -- cgit v1.2.3