From 76023ce8e99517ee47e5547d7f673a7c1300ddb8 Mon Sep 17 00:00:00 2001 From: Manuel Schneider Date: Tue, 22 Jul 2014 19:27:30 +0200 Subject: Fix broadcast bug. --- src/server/mainwindow/mainwindow.cpp | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) (limited to 'src') 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::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::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()); } -- cgit v1.2.3-55-g7522