summaryrefslogtreecommitdiffstats
path: root/src/server/mainwindow/mainwindow.cpp
diff options
context:
space:
mode:
authorBjörn Hagemeister2014-06-02 15:27:23 +0200
committerBjörn Hagemeister2014-06-02 15:27:23 +0200
commit4778d18cc1287e9a3fd2c3a7eec5f90e685c3f62 (patch)
treec798ea39460f49f6f6e34f7f909470923bf68e5f /src/server/mainwindow/mainwindow.cpp
parentPut Check if manager is running on machine into method. (diff)
parentUncheck lock if any action is performed. (diff)
downloadpvs2-4778d18cc1287e9a3fd2c3a7eec5f90e685c3f62.tar.gz
pvs2-4778d18cc1287e9a3fd2c3a7eec5f90e685c3f62.tar.xz
pvs2-4778d18cc1287e9a3fd2c3a7eec5f90e685c3f62.zip
Merge branch 'master' of git.openslx.org:pvs2
Conflicts: src/server/mainwindow/mainwindow.h
Diffstat (limited to 'src/server/mainwindow/mainwindow.cpp')
-rw-r--r--src/server/mainwindow/mainwindow.cpp41
1 files changed, 32 insertions, 9 deletions
diff --git a/src/server/mainwindow/mainwindow.cpp b/src/server/mainwindow/mainwindow.cpp
index 590d5ab..21cde86 100644
--- a/src/server/mainwindow/mainwindow.cpp
+++ b/src/server/mainwindow/mainwindow.cpp
@@ -364,6 +364,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
@@ -529,6 +543,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)
@@ -544,6 +560,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)
@@ -558,6 +576,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)
@@ -578,6 +598,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)
@@ -598,6 +620,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)
@@ -609,7 +633,7 @@ void MainWindow::onButtonStudentToTutorExclusive()
else if (_tutorFrame->client() == NULL)
QMessageBox::critical(this, tr("Projection"), sStrTutorOffline);
else
- changeProjection(_tutorFrame->client(), Mode::LockedMulticast, _selectedFrame->client());
+ changeProjection(_selectedFrame->client(), Mode::LockedMulticast, _tutorFrame->client());
}
@@ -620,14 +644,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();
}
/***************************************************************************//**
@@ -638,6 +656,9 @@ void MainWindow::onButtonStopProjection()
*/
void MainWindow::onButtonLock(bool checked)
{
+ // Stop all projections
+ reset();
+
for (QList<ConnectionFrame*>::iterator it(_clientFrames.begin()); it != _clientFrames.end(); ++it)
{
// Check if client is Tutor or the manager is also running on this machine.
@@ -662,6 +683,8 @@ void MainWindow::onButtonExit()
*/
void MainWindow::onButtonSetAsTutor()
{
+ ui->action_Lock->setChecked(false);
+
// If no frame is selected, warning.
if (_selectedFrame == NULL)
{