diff options
author | sr | 2013-02-05 19:11:10 +0100 |
---|---|---|
committer | sr | 2013-02-05 19:11:10 +0100 |
commit | e8b54c512720f4b5fd4490f429c020323cd38904 (patch) | |
tree | f9ea255f2bc8064cfa08220f0e9911376029a65d | |
parent | [SERVER/CLIENT] Wait for connection to close properly before deleting socket ... (diff) | |
download | pvs2-e8b54c512720f4b5fd4490f429c020323cd38904.tar.gz pvs2-e8b54c512720f4b5fd4490f429c020323cd38904.tar.xz pvs2-e8b54c512720f4b5fd4490f429c020323cd38904.zip |
...
-rw-r--r-- | i18n/server/pvsmgr_ar_JO.ts | 36 | ||||
-rw-r--r-- | i18n/server/pvsmgr_de_DE.ts | 36 | ||||
-rw-r--r-- | i18n/server/pvsmgr_es_MX.ts | 36 | ||||
-rw-r--r-- | i18n/server/pvsmgr_fr_FR.ts | 36 | ||||
-rw-r--r-- | i18n/server/pvsmgr_pl_PL.ts | 36 | ||||
-rw-r--r-- | src/server/mainwindow/mainwindow.cpp | 19 | ||||
-rw-r--r-- | src/server/mainwindow/mainwindow.h | 1 |
7 files changed, 108 insertions, 92 deletions
diff --git a/i18n/server/pvsmgr_ar_JO.ts b/i18n/server/pvsmgr_ar_JO.ts index a897589..19ae5ef 100644 --- a/i18n/server/pvsmgr_ar_JO.ts +++ b/i18n/server/pvsmgr_ar_JO.ts @@ -15,48 +15,48 @@ <translation type="unfinished"></translation> </message> <message> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="442"/> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="470"/> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="475"/> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="480"/> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="507"/> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="535"/> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="540"/> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="545"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="453"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="481"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="486"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="491"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="518"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="546"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="551"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="556"/> <source>Projection</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="443"/> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="471"/> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="536"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="454"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="482"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="547"/> <source>No projection source selected.</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="476"/> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="508"/> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="541"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="487"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="519"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="552"/> <source>No tutor defined, or tutor is offline.</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="481"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="492"/> <source>Selected projection target is tutor.</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="546"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="557"/> <source>Selected projection source is tutor.</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="757"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="770"/> <source>Projection Error</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="758"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="771"/> <source>Could not send screen contents of %1 to other clients: VNC Startup failed.</source> <translation type="unfinished"></translation> </message> diff --git a/i18n/server/pvsmgr_de_DE.ts b/i18n/server/pvsmgr_de_DE.ts index 326374f..216f223 100644 --- a/i18n/server/pvsmgr_de_DE.ts +++ b/i18n/server/pvsmgr_de_DE.ts @@ -68,48 +68,48 @@ <translation type="unfinished"></translation> </message> <message> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="442"/> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="470"/> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="475"/> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="480"/> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="507"/> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="535"/> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="540"/> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="545"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="453"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="481"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="486"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="491"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="518"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="546"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="551"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="556"/> <source>Projection</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="443"/> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="471"/> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="536"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="454"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="482"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="547"/> <source>No projection source selected.</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="476"/> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="508"/> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="541"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="487"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="519"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="552"/> <source>No tutor defined, or tutor is offline.</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="481"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="492"/> <source>Selected projection target is tutor.</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="546"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="557"/> <source>Selected projection source is tutor.</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="757"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="770"/> <source>Projection Error</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="758"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="771"/> <source>Could not send screen contents of %1 to other clients: VNC Startup failed.</source> <translation type="unfinished"></translation> </message> diff --git a/i18n/server/pvsmgr_es_MX.ts b/i18n/server/pvsmgr_es_MX.ts index 09b67f8..69a7c0d 100644 --- a/i18n/server/pvsmgr_es_MX.ts +++ b/i18n/server/pvsmgr_es_MX.ts @@ -271,48 +271,48 @@ Perform an unprojection or remove remote help to get a target.</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="442"/> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="470"/> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="475"/> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="480"/> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="507"/> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="535"/> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="540"/> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="545"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="453"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="481"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="486"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="491"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="518"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="546"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="551"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="556"/> <source>Projection</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="443"/> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="471"/> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="536"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="454"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="482"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="547"/> <source>No projection source selected.</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="476"/> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="508"/> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="541"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="487"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="519"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="552"/> <source>No tutor defined, or tutor is offline.</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="481"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="492"/> <source>Selected projection target is tutor.</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="546"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="557"/> <source>Selected projection source is tutor.</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="757"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="770"/> <source>Projection Error</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="758"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="771"/> <source>Could not send screen contents of %1 to other clients: VNC Startup failed.</source> <translation type="unfinished"></translation> </message> diff --git a/i18n/server/pvsmgr_fr_FR.ts b/i18n/server/pvsmgr_fr_FR.ts index a897589..19ae5ef 100644 --- a/i18n/server/pvsmgr_fr_FR.ts +++ b/i18n/server/pvsmgr_fr_FR.ts @@ -15,48 +15,48 @@ <translation type="unfinished"></translation> </message> <message> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="442"/> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="470"/> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="475"/> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="480"/> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="507"/> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="535"/> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="540"/> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="545"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="453"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="481"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="486"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="491"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="518"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="546"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="551"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="556"/> <source>Projection</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="443"/> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="471"/> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="536"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="454"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="482"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="547"/> <source>No projection source selected.</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="476"/> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="508"/> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="541"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="487"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="519"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="552"/> <source>No tutor defined, or tutor is offline.</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="481"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="492"/> <source>Selected projection target is tutor.</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="546"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="557"/> <source>Selected projection source is tutor.</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="757"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="770"/> <source>Projection Error</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="758"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="771"/> <source>Could not send screen contents of %1 to other clients: VNC Startup failed.</source> <translation type="unfinished"></translation> </message> diff --git a/i18n/server/pvsmgr_pl_PL.ts b/i18n/server/pvsmgr_pl_PL.ts index a897589..19ae5ef 100644 --- a/i18n/server/pvsmgr_pl_PL.ts +++ b/i18n/server/pvsmgr_pl_PL.ts @@ -15,48 +15,48 @@ <translation type="unfinished"></translation> </message> <message> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="442"/> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="470"/> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="475"/> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="480"/> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="507"/> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="535"/> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="540"/> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="545"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="453"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="481"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="486"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="491"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="518"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="546"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="551"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="556"/> <source>Projection</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="443"/> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="471"/> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="536"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="454"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="482"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="547"/> <source>No projection source selected.</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="476"/> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="508"/> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="541"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="487"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="519"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="552"/> <source>No tutor defined, or tutor is offline.</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="481"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="492"/> <source>Selected projection target is tutor.</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="546"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="557"/> <source>Selected projection source is tutor.</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="757"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="770"/> <source>Projection Error</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../../src/server/mainwindow/mainwindow.cpp" line="758"/> + <location filename="../../src/server/mainwindow/mainwindow.cpp" line="771"/> <source>Could not send screen contents of %1 to other clients: VNC Startup failed.</source> <translation type="unfinished"></translation> </message> diff --git a/src/server/mainwindow/mainwindow.cpp b/src/server/mainwindow/mainwindow.cpp index 9e89baa..0441f1d 100644 --- a/src/server/mainwindow/mainwindow.cpp +++ b/src/server/mainwindow/mainwindow.cpp @@ -353,6 +353,17 @@ void MainWindow::onButtonChat() */ } +bool MainWindow::isValidClient(Client* client) +{ + for (QList<ConnectionFrame*>::iterator it(_clientFrames.begin()); it != _clientFrames.end(); ++it) + { + Client *c = (**it).client(); + if (c == client) + return true; + } + return false; +} + void MainWindow::prepareForProjection(Client * const from, Client * const to) { // Projection source is never allowed to be an active VNC viewer @@ -576,7 +587,6 @@ void MainWindow::onClientConnected(Client* client) qDebug("ListenServer told MainWindow about new connection"); connect(client, SIGNAL(authenticating(Client*, ClientLogin*)), this, SLOT(onClientAuthenticating(Client*, ClientLogin*))); connect(client, SIGNAL(authenticated(Client*)), this, SLOT(onClientAuthenticated(Client*))); - connect(client, SIGNAL(vncClientStateChange(Client*)), this, SLOT(onVncClientStateChange(Client*))); } void MainWindow::onClientAuthenticating(Client* client, ClientLogin* request) @@ -619,7 +629,8 @@ void MainWindow::onClientAuthenticating(Client* client, ClientLogin* request) void MainWindow::onClientAuthenticated(Client* client) { disconnect(client, SIGNAL(authenticated(Client*)), this, SLOT(onClientAuthenticated(Client*))); - connect(client, SIGNAL(vncServerStateChange(Client*)), this, SLOT(onVncServerStateChange(Client*))); + connect(client, SIGNAL(vncServerStateChange(Client*)), this, SLOT(onVncServerStateChange(Client*)), Qt::QueuedConnection); + connect(client, SIGNAL(vncClientStateChange(Client*)), this, SLOT(onVncClientStateChange(Client*)), Qt::QueuedConnection); bool hasActiveTutor = false; ConnectionFrame *deadTutor = NULL; bool anyClient = false; @@ -711,6 +722,8 @@ void MainWindow::onClientAuthenticated(Client* client) void MainWindow::onVncServerStateChange(Client* client) { + if (!isValidClient(client)) // Check here because this slot is connected queued + return; if (client->vncPort() > 0) { // VNC Server started on some client - start projection on all clients interested in that client's screen @@ -763,6 +776,8 @@ void MainWindow::onVncServerStateChange(Client* client) void MainWindow::onVncClientStateChange(Client* client) { + 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) diff --git a/src/server/mainwindow/mainwindow.h b/src/server/mainwindow/mainwindow.h index 5905cf5..4ff41dc 100644 --- a/src/server/mainwindow/mainwindow.h +++ b/src/server/mainwindow/mainwindow.h @@ -39,6 +39,7 @@ private: bool loadPosition(QSettings& settings, const QString& id, int& x, int& y); void savePosition(ConnectionFrame *cf); void prepareForProjection(Client * const from, Client * const to); + bool isValidClient(Client* client); public: MainWindow(QWidget *parent = 0); |