summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/server/mainwindow/mainwindow.cpp35
-rw-r--r--src/server/mainwindow/mainwindow.h1
2 files changed, 24 insertions, 12 deletions
diff --git a/src/server/mainwindow/mainwindow.cpp b/src/server/mainwindow/mainwindow.cpp
index 421cd5f..b66cbfd 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
*/
@@ -582,7 +601,7 @@ void MainWindow::onButtonStudentToTutorExclusive()
/***************************************************************************//**
* Handle Button StopProjection.
* Set ProjectionSource of each client to false, stop the active VNC Server
- * and the active VNC Client(s).
+ * and the active VNC Client(s) and unlock all screens.
*/
void MainWindow::onButtonStopProjection()
{
@@ -599,7 +618,7 @@ void MainWindow::onButtonStopProjection()
/***************************************************************************//**
* Handle button to lock or unlock screens of client(s).
* If already locked, do nothing, else lock or unlock the clients, except the
- * tutor.
+ * tutor and the manager running machine.
* @param checked
*/
void MainWindow::onButtonLock(bool checked)
@@ -757,6 +776,7 @@ void MainWindow::onClientAuthenticated(Client* client)
{
existing->setTutor(isTutor);
existing->assignClient(client);
+ tellClientCurrentSituation(client);
return;
}
// New one, create
@@ -793,16 +813,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);
}
/***************************************************************************//**
diff --git a/src/server/mainwindow/mainwindow.h b/src/server/mainwindow/mainwindow.h
index 6245155..25eb9aa 100644
--- a/src/server/mainwindow/mainwindow.h
+++ b/src/server/mainwindow/mainwindow.h
@@ -77,6 +77,7 @@ private:
void savePosition(ConnectionFrame *cf);
bool isValidClient(Client* client);
void changeProjection(Client *from, Mode mode = Mode::Broadcast, Client *to = NULL);
+ void tellClientCurrentSituation(Client* client);
void closeEvent(QCloseEvent *e);
void changeEvent(QEvent *e);