summaryrefslogtreecommitdiffstats
path: root/src/client/vnc
diff options
context:
space:
mode:
authorsr2013-02-06 19:21:04 +0100
committersr2013-02-06 19:21:04 +0100
commit49f3903f316ab7363b4543615d3231e1407a67ab (patch)
tree9f6ec082403f388c0e791de68b1743000a12bc49 /src/client/vnc
parent... (diff)
downloadpvs2-49f3903f316ab7363b4543615d3231e1407a67ab.tar.gz
pvs2-49f3903f316ab7363b4543615d3231e1407a67ab.tar.xz
pvs2-49f3903f316ab7363b4543615d3231e1407a67ab.zip
[SERVER] Add "stop projection" button
[SERVER] Don't show error message when VNC server stops as expected [SERVER/CLIENT] Implement connection timeout of 15 seconds
Diffstat (limited to 'src/client/vnc')
-rw-r--r--src/client/vnc/vncwindow.cpp15
-rw-r--r--src/client/vnc/vncwindow.h2
2 files changed, 16 insertions, 1 deletions
diff --git a/src/client/vnc/vncwindow.cpp b/src/client/vnc/vncwindow.cpp
index d4f6d40..aea2362 100644
--- a/src/client/vnc/vncwindow.cpp
+++ b/src/client/vnc/vncwindow.cpp
@@ -19,7 +19,7 @@
#include "vncthread.h"
VncWindow::VncWindow(QWidget *parent) :
- QDialog(parent), _vncWorker(NULL), _viewOnly(true), _buttonMask(0), _clientId(0)
+ QDialog(parent), _vncWorker(NULL), _viewOnly(true), _buttonMask(0), _clientId(0), _redrawTimer(0)
{
//
}
@@ -108,11 +108,23 @@ void VncWindow::onThreadFinished()
void VncWindow::onProjectionStarted()
{
emit running(true, _clientId);
+ _redrawTimer = startTimer(200);
}
////////////////////////////////////////////////////////////////////////////////
// Protected
+void VncWindow::timerEvent(QTimerEvent *event)
+{
+ killTimer(event->timerId());
+ if (event->timerId() == _redrawTimer)
+ {
+ _redrawTimer = 0;
+ if (this->isVisible())
+ this->repaint();
+ }
+}
+
void VncWindow::paintEvent(QPaintEvent *event)
{
const QRect &r = event->rect();
@@ -123,6 +135,7 @@ void VncWindow::paintEvent(QPaintEvent *event)
void VncWindow::resizeEvent(QResizeEvent* event)
{
_vncWorker->setTargetSize(event->size());
+ this->repaint();
}
void VncWindow::draw(const int x, const int y, const int w, const int h)
diff --git a/src/client/vnc/vncwindow.h b/src/client/vnc/vncwindow.h
index 3a73a8e..396e2de 100644
--- a/src/client/vnc/vncwindow.h
+++ b/src/client/vnc/vncwindow.h
@@ -51,6 +51,7 @@ protected:
void paintEvent(QPaintEvent *event);
void resizeEvent(QResizeEvent* event);
void closeEvent(QCloseEvent *e);
+ void timerEvent(QTimerEvent *event);
//bool event(QEvent *event);
//bool eventFilter(QObject *obj, QEvent *event);
@@ -60,6 +61,7 @@ private:
int _buttonMask;
QMap<unsigned int, bool> _modkeys;
int _clientId;
+ int _redrawTimer;
bool eventFilter(QObject *obj, QEvent *event);
void keyPressEvent(QKeyEvent* event);