summaryrefslogtreecommitdiffstats
path: root/src/server/mainwindow/mainwindow.cpp
diff options
context:
space:
mode:
authorManuel Schneider2014-07-22 19:53:51 +0200
committerManuel Schneider2014-07-22 19:53:51 +0200
commit2343bf5fa8642d33579baadf2ab8348c781a64bc (patch)
tree9254812285903ec1563b350ab460cde4295af0a5 /src/server/mainwindow/mainwindow.cpp
parentFix broadcast bug. (diff)
downloadpvs2-2343bf5fa8642d33579baadf2ab8348c781a64bc.tar.gz
pvs2-2343bf5fa8642d33579baadf2ab8348c781a64bc.tar.xz
pvs2-2343bf5fa8642d33579baadf2ab8348c781a64bc.zip
Fix TutorToStudent can't toggle bug.
Diffstat (limited to 'src/server/mainwindow/mainwindow.cpp')
-rw-r--r--src/server/mainwindow/mainwindow.cpp22
1 files changed, 8 insertions, 14 deletions
diff --git a/src/server/mainwindow/mainwindow.cpp b/src/server/mainwindow/mainwindow.cpp
index d62336d..7fb8674 100644
--- a/src/server/mainwindow/mainwindow.cpp
+++ b/src/server/mainwindow/mainwindow.cpp
@@ -650,9 +650,8 @@ void MainWindow::onButtonTutorToAll()
QMessageBox::critical(this, tr("Projection"), sStrNoDestAv);
else
{
- if (_mode == Mode::Broadcast)
- {
- // If this mode is already active, reset everything
+ // If this mode is already active, reset everything
+ if (_mode == Mode::Broadcast) {
reset();
return;
}
@@ -688,28 +687,20 @@ void MainWindow::onButtonTutorToStudent()
QMessageBox::critical(this, tr("Projection"), sStrTutorOffline);
else
{
- DisableButtons();
-
// If this is the first call in this mode clear the watchers
- if (_mode != Mode::Multicast)
- {
+ if (_mode != Mode::Multicast) {
for (QList<ConnectionFrame*>::iterator it(_clientFrames.begin()); it != _clientFrames.end(); ++it)
- {
if ((*it)->client() != NULL)
(*it)->client()->setDesiredProjectionSource(NO_SOURCE);
- }
}
// If "to" already watches "from" stop it
if (getSelectedFrame()->client()->desiredProjectionSource() == getTutorFrame()->client()->id() )
- {
getSelectedFrame()->client()->setDesiredProjectionSource(NO_SOURCE);
- }
- else // list "to" as watcher
- {
+ else
getSelectedFrame()->client()->setDesiredProjectionSource(getTutorFrame()->client()->id());
- }
+ DisableButtons();
_mode = Mode::Multicast;
startVncServerIfNecessary(getTutorFrame()->client()->id());
}
@@ -1050,6 +1041,9 @@ void MainWindow::onVncServerStateChange(Client* client)
{
if ( (*it)->client()->desiredProjectionSource() == client->id() )
(*it)->client()->startVncClient(client);
+ else
+ (*it)->client()->stopVncClient();
+
(*it)->client()->lockScreen((*it)->client()->desiredProjectionSource() == NO_SOURCE && _mode == Mode::LockedUnicast);
}
// Dont forget to unlock the vnc server