From 92e7d3f1a52c4ba75ef93d88181ff6fa6f3d4e69 Mon Sep 17 00:00:00 2001 From: Manuel Schneider Date: Wed, 28 May 2014 17:44:35 +0200 Subject: Uncheck lock if any action is performed. --- src/server/mainwindow/mainwindow.cpp | 38 +++++++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 9 deletions(-) (limited to 'src/server/mainwindow/mainwindow.cpp') diff --git a/src/server/mainwindow/mainwindow.cpp b/src/server/mainwindow/mainwindow.cpp index b25f416..6afa608 100644 --- a/src/server/mainwindow/mainwindow.cpp +++ b/src/server/mainwindow/mainwindow.cpp @@ -349,6 +349,20 @@ void MainWindow::mouseReleaseEvent(QMouseEvent* e) } } +/***************************************************************************//** + * @brief reset + */ +void MainWindow::reset() +{ + // Unlock all clients + for (QList::iterator it(_clientFrames.begin()); it != _clientFrames.end(); ++it) + if ((*it)->client() != NULL) + (*it)->client()->lockScreen(false); + + // Stop server (Clients get stopped on ACK) + if (_streamingSource != NULL) + _streamingSource->stopVncServer(); +} /* * Slots @@ -514,6 +528,8 @@ void MainWindow::onButtonHelp() */ void MainWindow::onButtonTutorToAll() { + ui->action_Lock->setChecked(false); + if (_tutorFrame == NULL) QMessageBox::critical(this, tr("Projection"), sStrTutorNdef); else if (_tutorFrame->client() == NULL) @@ -529,6 +545,8 @@ void MainWindow::onButtonTutorToAll() */ void MainWindow::onButtonStudentToAll() { + ui->action_Lock->setChecked(false); + if (_selectedFrame == NULL) QMessageBox::critical(this, tr("Projection"), sStrSourceNdef); if (_selectedFrame->client() == NULL) @@ -543,6 +561,8 @@ void MainWindow::onButtonStudentToAll() */ void MainWindow::onButtonTutorToStudent() { + ui->action_Lock->setChecked(false); + if (_selectedFrame == NULL) QMessageBox::critical(this, tr("Projection"), sStrDestNdef); else if (_tutorFrame == NULL) @@ -563,6 +583,8 @@ void MainWindow::onButtonTutorToStudent() */ void MainWindow::onButtonStudentToTutor() { + ui->action_Lock->setChecked(false); + if (_selectedFrame == NULL) QMessageBox::critical(this, tr("Projection"), sStrSourceNdef); else if (_tutorFrame == NULL) @@ -583,6 +605,8 @@ void MainWindow::onButtonStudentToTutor() */ void MainWindow::onButtonStudentToTutorExclusive() { + ui->action_Lock->setChecked(false); + if (_selectedFrame == NULL) QMessageBox::critical(this, tr("Projection"), sStrSourceNdef); else if (_tutorFrame == NULL) @@ -605,14 +629,8 @@ void MainWindow::onButtonStudentToTutorExclusive() */ void MainWindow::onButtonStopProjection() { - // Unlock all clients - for (QList::iterator it(_clientFrames.begin()); it != _clientFrames.end(); ++it) - if ((*it)->client() != NULL) - (*it)->client()->lockScreen(false); - - // Stop server (Clients get stopped on ACK) - if (_streamingSource != NULL) - _streamingSource->startVncServer(); + ui->action_Lock->setChecked(false); + reset(); } /***************************************************************************//** @@ -624,7 +642,7 @@ void MainWindow::onButtonStopProjection() void MainWindow::onButtonLock(bool checked) { // Stop all projections - onButtonStopProjection(); + reset(); for (QList::iterator it(_clientFrames.begin()); it != _clientFrames.end(); ++it) { @@ -656,6 +674,8 @@ void MainWindow::onButtonExit() */ void MainWindow::onButtonSetAsTutor() { + ui->action_Lock->setChecked(false); + // If no frame is selected, warning. if (_selectedFrame == NULL) { -- cgit v1.2.3-55-g7522