diff options
author | sr | 2013-02-05 19:22:13 +0100 |
---|---|---|
committer | sr | 2013-02-05 19:22:13 +0100 |
commit | b2163a15224b91866d394cf310c393cc49b7f5b4 (patch) | |
tree | b64ef69bdfec663e6374c1a8ce4cb920bbb64b70 /src | |
parent | ... (diff) | |
download | pvs2-b2163a15224b91866d394cf310c393cc49b7f5b4.tar.gz pvs2-b2163a15224b91866d394cf310c393cc49b7f5b4.tar.xz pvs2-b2163a15224b91866d394cf310c393cc49b7f5b4.zip |
...
Diffstat (limited to 'src')
-rw-r--r-- | src/server/mainwindow/mainwindow.cpp | 13 | ||||
-rw-r--r-- | src/server/mainwindow/mainwindow.h | 5 | ||||
-rw-r--r-- | src/server/net/client.cpp | 2 | ||||
-rw-r--r-- | src/server/net/client.h | 2 |
4 files changed, 10 insertions, 12 deletions
diff --git a/src/server/mainwindow/mainwindow.cpp b/src/server/mainwindow/mainwindow.cpp index 0441f1d..6e312e6 100644 --- a/src/server/mainwindow/mainwindow.cpp +++ b/src/server/mainwindow/mainwindow.cpp @@ -630,7 +630,7 @@ void MainWindow::onClientAuthenticated(Client* client) { disconnect(client, SIGNAL(authenticated(Client*)), this, SLOT(onClientAuthenticated(Client*))); connect(client, SIGNAL(vncServerStateChange(Client*)), this, SLOT(onVncServerStateChange(Client*)), Qt::QueuedConnection); - connect(client, SIGNAL(vncClientStateChange(Client*)), this, SLOT(onVncClientStateChange(Client*)), Qt::QueuedConnection); + connect(client, SIGNAL(vncClientStateChange(Client*, ClientId)), this, SLOT(onVncClientStateChange(Client*, ClientId)), Qt::QueuedConnection); bool hasActiveTutor = false; ConnectionFrame *deadTutor = NULL; bool anyClient = false; @@ -774,13 +774,12 @@ void MainWindow::onVncServerStateChange(Client* client) } } -void MainWindow::onVncClientStateChange(Client* client) +void MainWindow::onVncClientStateChange(Client* client, ClientId lastProjectionSource) { if (!isValidClient(client)) // Check here because this slot is connected queued return; - // If the client started projection, ignore event. Also if - // the source is not known (anymore), we cannot do anything meaningful here - if (client->isActiveVncClient() || client->currentProjectionSource() == 0) + // If last source is not known or not existent, we cannot do anything meaningful here + if (lastProjectionSource == 0) return; // Client is not a vnc client anymore. Check if the VNC server it was (supposedly) connected // to is still running, and kill it if there are no more clients connected to it. @@ -794,9 +793,9 @@ void MainWindow::onVncClientStateChange(Client* client) Client *c = (**it).client(); if (c == NULL) continue; - if (c->id() == client->currentProjectionSource()) + if (c->id() == lastProjectionSource) server = c; - if (c != client && c->currentProjectionSource() == client->currentProjectionSource()) + if (c != client && c->currentProjectionSource() == lastProjectionSource) { inUse = true; break; diff --git a/src/server/mainwindow/mainwindow.h b/src/server/mainwindow/mainwindow.h index 4ff41dc..076da3f 100644 --- a/src/server/mainwindow/mainwindow.h +++ b/src/server/mainwindow/mainwindow.h @@ -3,13 +3,12 @@ #include <QtGui> #include <QMainWindow> +#include "../net/client.h" class SessionNameWindow; class ConnectionFrame; class ListenServer; class DiscoveryListener; -class Client; -class ClientLogin; namespace Ui { @@ -73,7 +72,7 @@ protected slots: void onClientAuthenticating(Client* client, ClientLogin* request); void onClientAuthenticated(Client* client); void onVncServerStateChange(Client* client); - void onVncClientStateChange(Client* client); + void onVncClientStateChange(Client* client, ClientId lastProjectionSource); }; diff --git a/src/server/net/client.cpp b/src/server/net/client.cpp index 12b28a0..95139a9 100644 --- a/src/server/net/client.cpp +++ b/src/server/net/client.cpp @@ -203,7 +203,7 @@ void Client::handleMsg() if (!_activeVncClient && other == 0) _desiredProjectionSource = 0; - emit vncClientStateChange(this); + emit vncClientStateChange(this, _currentProjectionSource); if (!_activeVncClient) _currentProjectionSource = 0; diff --git a/src/server/net/client.h b/src/server/net/client.h index d058398..08cac71 100644 --- a/src/server/net/client.h +++ b/src/server/net/client.h @@ -93,7 +93,7 @@ signals: void authenticated(Client* client); void thumbUpdated(Client* client, const QPixmap& thumb); void vncServerStateChange(Client* client); - void vncClientStateChange(Client* client); + void vncClientStateChange(Client* client, ClientId lastProjectionSource); void disconnected(); private slots: |