summaryrefslogtreecommitdiffstats
path: root/src/server/mainwindow/mainwindow.cpp
diff options
context:
space:
mode:
authorsr2013-02-06 20:07:27 +0100
committersr2013-02-06 20:07:27 +0100
commit27468a81da8c2d3c8c7fa5d1d3933b819ec81267 (patch)
tree95328c51a3e0d101defc520673c1ad9daa75b330 /src/server/mainwindow/mainwindow.cpp
parent[SERVER] Add "stop projection" button (diff)
downloadpvs2-27468a81da8c2d3c8c7fa5d1d3933b819ec81267.tar.gz
pvs2-27468a81da8c2d3c8c7fa5d1d3933b819ec81267.tar.xz
pvs2-27468a81da8c2d3c8c7fa5d1d3933b819ec81267.zip
[SERVER] Get "stop projection" right
[CLIENT] Redraw whole screen on projection start
Diffstat (limited to 'src/server/mainwindow/mainwindow.cpp')
-rw-r--r--src/server/mainwindow/mainwindow.cpp20
1 files changed, 15 insertions, 5 deletions
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<ConnectionFrame*>::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<ConnectionFrame*>::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<ConnectionFrame*>::iterator it(_clientFrames.begin()); it != _clientFrames.end(); ++it)
{
Client *c = (**it).client();