diff options
Diffstat (limited to 'src/server/mainwindow/mainwindow.cpp')
-rw-r--r-- | src/server/mainwindow/mainwindow.cpp | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/src/server/mainwindow/mainwindow.cpp b/src/server/mainwindow/mainwindow.cpp index a3f77e4..99339ba 100644 --- a/src/server/mainwindow/mainwindow.cpp +++ b/src/server/mainwindow/mainwindow.cpp @@ -257,6 +257,25 @@ void MainWindow::savePosition(ConnectionFrame *cf) settings.endGroup(); } +/***************************************************************************//** + * Tells the new client the current situation in class room. + * Set the specific parameters like projection source or lock screen. + * @param client + */ +void MainWindow::tellClientCurrentSituation(Client* client) +{ + // If clients are currently locked, tell this new client + if (ui->action_Lock->isChecked()) + client->lockScreen(true); + + if (_mode == Mode::Broadcast){ + _watchers.insert(client->id(), client); + client->startVncClient(_streamingSource); + } + else if (_mode == Mode::LockedMulticast) + client->lockScreen(true); +} + /* * Overridden methods */ @@ -792,6 +811,7 @@ void MainWindow::onClientAuthenticated(Client* client) { existing->setTutor(isTutor); existing->assignClient(client); + tellClientCurrentSituation(client); return; } // New one, create @@ -828,16 +848,7 @@ void MainWindow::onClientAuthenticated(Client* client) // Assign client instance cf->assignClient(client); - // If clients are currently locked, tell this new client - if (ui->action_Lock->isChecked()) - client->lockScreen(true); - - if (_mode == Mode::Broadcast){ - _watchers.insert(client->id(), client); - client->startVncClient(_streamingSource); - } - else if (_mode == Mode::LockedMulticast) - client->lockScreen(true); + tellClientCurrentSituation(client); } /***************************************************************************//** |