From 2343bf5fa8642d33579baadf2ab8348c781a64bc Mon Sep 17 00:00:00 2001 From: Manuel Schneider Date: Tue, 22 Jul 2014 19:53:51 +0200 Subject: Fix TutorToStudent can't toggle bug. --- src/server/mainwindow/mainwindow.cpp | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) (limited to 'src/server/mainwindow/mainwindow.cpp') 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::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 -- cgit v1.2.3-55-g7522