diff options
Diffstat (limited to 'src/server/mainwindow/mainwindow.cpp')
-rw-r--r-- | src/server/mainwindow/mainwindow.cpp | 22 |
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 |