From 2b99384efd2926f6dc2abe29c793113bbb9f804f Mon Sep 17 00:00:00 2001 From: Björn Hagemeister Date: Tue, 27 May 2014 14:34:38 +0200 Subject: Put the clients adaption to current class room situation into method. Now clients who where just inactive also follow immediatly the actual actions. --- src/server/mainwindow/mainwindow.cpp | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) (limited to 'src/server/mainwindow/mainwindow.cpp') 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); } /***************************************************************************//** -- cgit v1.2.3-55-g7522