diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/server/mainwindow/mainwindow.cpp | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/src/server/mainwindow/mainwindow.cpp b/src/server/mainwindow/mainwindow.cpp index 3365473..d62336d 100644 --- a/src/server/mainwindow/mainwindow.cpp +++ b/src/server/mainwindow/mainwindow.cpp @@ -650,27 +650,19 @@ void MainWindow::onButtonTutorToAll() QMessageBox::critical(this, tr("Projection"), sStrNoDestAv); else { - DisableButtons(); - - if (_mode != Mode::Broadcast) + if (_mode == Mode::Broadcast) { - // Set all clients as watchers - for (QList<ConnectionFrame*>::iterator it(_clientFrames.begin()); it != _clientFrames.end(); ++it) - { - if ((*it)->client() != NULL && (*it)->client() != getClientFromId(_streamingSource)){ - (*it)->client()->setDesiredProjectionSource(getTutorFrame()->client()->id()); - } - - } - } - else // If this mode is already active - { - // Stop reset everything + // If this mode is already active, reset everything reset(); - _mode = Mode::None; return; } + // Set all clients as watchers of tutor. Except for the tutors desired source, which hase to be none + for (QList<ConnectionFrame*>::iterator it(_clientFrames.begin()); it != _clientFrames.end(); ++it) + if ((*it)->client() != NULL) + (*it)->client()->setDesiredProjectionSource((*it)->client() == getTutorFrame()->client() ? NO_SOURCE : getTutorFrame()->client()->id()); + + DisableButtons(); _mode = Mode::Broadcast; startVncServerIfNecessary(getTutorFrame()->client()->id()); } |