diff options
author | Manuel Schneider | 2014-05-28 17:44:35 +0200 |
---|---|---|
committer | Manuel Schneider | 2014-05-28 17:44:35 +0200 |
commit | 92e7d3f1a52c4ba75ef93d88181ff6fa6f3d4e69 (patch) | |
tree | 96c9faca319bed92ca3f55082cd04bc563532c79 /src | |
parent | Give Exclusive student to tutor correct funtion. Kill all projections on lock. (diff) | |
download | pvs2-92e7d3f1a52c4ba75ef93d88181ff6fa6f3d4e69.tar.gz pvs2-92e7d3f1a52c4ba75ef93d88181ff6fa6f3d4e69.tar.xz pvs2-92e7d3f1a52c4ba75ef93d88181ff6fa6f3d4e69.zip |
Uncheck lock if any action is performed.
Diffstat (limited to 'src')
-rw-r--r-- | src/server/mainwindow/mainwindow.cpp | 38 | ||||
-rw-r--r-- | src/server/mainwindow/mainwindow.h | 1 |
2 files changed, 30 insertions, 9 deletions
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<ConnectionFrame*>::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<ConnectionFrame*>::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<ConnectionFrame*>::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) { diff --git a/src/server/mainwindow/mainwindow.h b/src/server/mainwindow/mainwindow.h index 25eb9aa..89361c9 100644 --- a/src/server/mainwindow/mainwindow.h +++ b/src/server/mainwindow/mainwindow.h @@ -78,6 +78,7 @@ private: bool isValidClient(Client* client); void changeProjection(Client *from, Mode mode = Mode::Broadcast, Client *to = NULL); void tellClientCurrentSituation(Client* client); + void reset(); void closeEvent(QCloseEvent *e); void changeEvent(QEvent *e); |