summaryrefslogtreecommitdiffstats
path: root/src/server/mainwindow/mainwindow.cpp
diff options
context:
space:
mode:
authorManuel Schneider2014-05-28 17:44:35 +0200
committerManuel Schneider2014-05-28 17:44:35 +0200
commit92e7d3f1a52c4ba75ef93d88181ff6fa6f3d4e69 (patch)
tree96c9faca319bed92ca3f55082cd04bc563532c79 /src/server/mainwindow/mainwindow.cpp
parentGive Exclusive student to tutor correct funtion. Kill all projections on lock. (diff)
downloadpvs2-92e7d3f1a52c4ba75ef93d88181ff6fa6f3d4e69.tar.gz
pvs2-92e7d3f1a52c4ba75ef93d88181ff6fa6f3d4e69.tar.xz
pvs2-92e7d3f1a52c4ba75ef93d88181ff6fa6f3d4e69.zip
Uncheck lock if any action is performed.
Diffstat (limited to 'src/server/mainwindow/mainwindow.cpp')
-rw-r--r--src/server/mainwindow/mainwindow.cpp38
1 files changed, 29 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)
{