summaryrefslogtreecommitdiffstats
path: root/src/server
diff options
context:
space:
mode:
authorManuel Schneider2014-05-27 15:06:04 +0200
committerManuel Schneider2014-05-27 15:06:04 +0200
commitdf4daf91addf43aa5a4b613790cac0a5f362ec45 (patch)
treebc44c751bbdf2cf53ac604700527b7c1a7b7f25e /src/server
parentAdjust stopProjection (diff)
parentPut the clients adaption to current class room situation into method. (diff)
downloadpvs2-df4daf91addf43aa5a4b613790cac0a5f362ec45.tar.gz
pvs2-df4daf91addf43aa5a4b613790cac0a5f362ec45.tar.xz
pvs2-df4daf91addf43aa5a4b613790cac0a5f362ec45.zip
Manual merge
Diffstat (limited to 'src/server')
-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);