From 27468a81da8c2d3c8c7fa5d1d3933b819ec81267 Mon Sep 17 00:00:00 2001 From: sr Date: Wed, 6 Feb 2013 20:07:27 +0100 Subject: [SERVER] Get "stop projection" right [CLIENT] Redraw whole screen on projection start --- src/server/mainwindow/mainwindow.cpp | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'src/server/mainwindow/mainwindow.cpp') diff --git a/src/server/mainwindow/mainwindow.cpp b/src/server/mainwindow/mainwindow.cpp index 74e1e7d..50f70cc 100644 --- a/src/server/mainwindow/mainwindow.cpp +++ b/src/server/mainwindow/mainwindow.cpp @@ -373,6 +373,7 @@ void MainWindow::prepareForProjection(Client * const from, Client * const to) qDebug("From is active client, stopping..."); from->stopVncClient(); } + from->setDesiredProjectionSource(0); if (to == NULL) { @@ -495,7 +496,7 @@ void MainWindow::onButtonStudentToTutor() else if (to == from) QMessageBox::critical(this, tr("Projection"), - tr("Selected projection target is tutor.") + tr("Selected projection source is tutor.") ); else prepareForProjection(from, to); @@ -547,12 +548,12 @@ void MainWindow::onButtonTutorToStudent() else if ((**it).isTutor()) from = c; } - if (from == NULL) + if (to == NULL) QMessageBox::critical(this, tr("Projection"), tr("No projection source selected.") ); - else if (to == NULL) + else if (from == NULL) QMessageBox::critical(this, tr("Projection"), tr("No tutor defined, or tutor is offline.") @@ -560,7 +561,7 @@ void MainWindow::onButtonTutorToStudent() else if (to == from) QMessageBox::critical(this, tr("Projection"), - tr("Selected projection source is tutor.") + tr("Selected projection target is tutor.") ); else prepareForProjection(from, to); @@ -573,6 +574,14 @@ void MainWindow::onButtonStopProjection() return; _buttonBlockTime = now + 3000; // + for (QList::iterator it(_clientFrames.begin()); it != _clientFrames.end(); ++it) + { + Client *c = (**it).client(); + if (c == NULL) + continue; + c->setDesiredProjectionSource(0); + c->setProjectionSource(false); + } NetworkMessage msg; msg.setField(_ID, _VNCCLIENT); for (QList::iterator it(_clientFrames.begin()); it != _clientFrames.end(); ++it) @@ -776,7 +785,8 @@ void MainWindow::onVncServerStateChange(Client* client) // If at least one other client seemed to be waiting for this client's screen, pop up a message // on the console bool wasInterested = client->isProjectionSource(); - client->setProjectionSource(true); + //qDebug() << "On VNC stop:" << client->ip() << "was projection source:" << wasInterested; + client->setProjectionSource(false); for (QList::iterator it(_clientFrames.begin()); it != _clientFrames.end(); ++it) { Client *c = (**it).client(); -- cgit v1.2.3-55-g7522