diff options
Diffstat (limited to 'src/server/mainwindow/mainwindow.cpp')
-rw-r--r-- | src/server/mainwindow/mainwindow.cpp | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/src/server/mainwindow/mainwindow.cpp b/src/server/mainwindow/mainwindow.cpp index 8e260b4..97b4528 100644 --- a/src/server/mainwindow/mainwindow.cpp +++ b/src/server/mainwindow/mainwindow.cpp @@ -56,6 +56,8 @@ MainWindow::MainWindow(QString ipListUrl, QWidget* parent) : _tutorFrame = NULL; _selectedFrame = NULL; + _broadcast = false; + _lockOthers = false; _streamingSource = NULL; _sessionNameWindow = new SessionNameWindow(this); @@ -440,7 +442,8 @@ bool MainWindow::isValidClient(Client* client) */ void MainWindow::broadcast(Client *from) { - _state = State::Broadcast; + _broadcast = true; + _lockOthers = false; // if there is a server running which is not "from" stop it. if (_streamingSource != NULL && _streamingSource != from) @@ -472,7 +475,8 @@ void MainWindow::broadcast(Client *from) */ void MainWindow::multicast(Client *from, Client *to, bool blockOthers) { - _state = blockOthers ? State::ExclusiveUnicast : State::Unicast; + _broadcast = false; + _lockOthers = blockOthers; // if there is a server running which is not "from" stop it. if (_streamingSource != NULL && _streamingSource != from) @@ -615,8 +619,6 @@ void MainWindow::onButtonStudentToTutorExclusive() */ void MainWindow::onButtonStopProjection() { - _state = State::Idle; - for (QList<ConnectionFrame*>::iterator it(_clientFrames.begin()); it != _clientFrames.end(); ++it) { Client *c = (**it).client(); @@ -837,19 +839,12 @@ void MainWindow::onClientAuthenticated(Client* client) if (ui->action_Lock->isChecked()) client->lockScreen(true); - switch (_state) { - case State::Idle:break; - case State::Unicast:break; - case State::ExclusiveUnicast: - client->lockScreen(true); - break; - case State::Broadcast: + if (_broadcast){ client->setDesiredProjectionSource(_streamingSource->id()); client->startVncClient(_streamingSource); - break; - default:break; + } else if (_lockOthers) + client->lockScreen(true); } -} /***************************************************************************//** * Handle if VNC Server State has changed. |