From 2d5669c4974feedbc2beaec90bf42c37c2dbd773 Mon Sep 17 00:00:00 2001
From: Manuel Schneider
Date: Tue, 27 May 2014 13:12:00 +0200
Subject: Add icon for locked screen. Add monochrome and stylized
connectionframe icons.
---
icons/cf_icon_cam.svg | 134 +++++++++++++++++++++++++
icons/cf_icon_eye.svg | 58 +++++++++++
icons/cf_icon_lock.svg | 60 +++++++++++
pvsmgr.qrc | 3 +
src/server/connectionframe/connectionframe.cpp | 12 ++-
src/server/connectionframe/connectionframe.h | 2 +-
src/server/net/client.cpp | 5 +-
src/server/net/client.h | 2 +
8 files changed, 270 insertions(+), 6 deletions(-)
create mode 100644 icons/cf_icon_cam.svg
create mode 100644 icons/cf_icon_eye.svg
create mode 100644 icons/cf_icon_lock.svg
diff --git a/icons/cf_icon_cam.svg b/icons/cf_icon_cam.svg
new file mode 100644
index 0000000..cd1599d
--- /dev/null
+++ b/icons/cf_icon_cam.svg
@@ -0,0 +1,134 @@
+
+
+
+
diff --git a/icons/cf_icon_eye.svg b/icons/cf_icon_eye.svg
new file mode 100644
index 0000000..06d6f85
--- /dev/null
+++ b/icons/cf_icon_eye.svg
@@ -0,0 +1,58 @@
+
+
diff --git a/icons/cf_icon_lock.svg b/icons/cf_icon_lock.svg
new file mode 100644
index 0000000..40eac88
--- /dev/null
+++ b/icons/cf_icon_lock.svg
@@ -0,0 +1,60 @@
+
+
diff --git a/pvsmgr.qrc b/pvsmgr.qrc
index b5269b0..3837cee 100644
--- a/pvsmgr.qrc
+++ b/pvsmgr.qrc
@@ -27,5 +27,8 @@
build/pvsmgr_ar_JO.qm
build/pvsmgr_pl_PL.qm
build/pvsmgr_pl_PL.qm
+ icons/cf_icon_cam.svg
+ icons/cf_icon_eye.svg
+ icons/cf_icon_lock.svg
diff --git a/src/server/connectionframe/connectionframe.cpp b/src/server/connectionframe/connectionframe.cpp
index 444902e..b09139c 100644
--- a/src/server/connectionframe/connectionframe.cpp
+++ b/src/server/connectionframe/connectionframe.cpp
@@ -41,7 +41,7 @@ static QString style_disconnected(
QGroupBox { background-color: #7F7F7F; margin: 1px; border-radius: 4px}"
);
-static QIcon *term = NULL, *cam = NULL, *eye = NULL;
+static QIcon *term = NULL, *cam = NULL, *eye = NULL, *lock = NULL;
/**
* Initialize frame for connected client.
@@ -58,8 +58,9 @@ ConnectionFrame::ConnectionFrame(QWidget *parent, int width, int height) :
if (term == NULL)
{
term = new QIcon(":terminal");
- cam = new QIcon(":cam32");
- eye = new QIcon(":eye");
+ cam = new QIcon(":cf_cam");
+ eye = new QIcon(":cf_eye");
+ lock = new QIcon(":cf_lock");
}
//this->setAttribute(Qt::WA_OpaquePaintEvent);
@@ -82,12 +83,13 @@ ConnectionFrame::ConnectionFrame(QWidget *parent, int width, int height) :
_icoCam = addIcon(cam);
_icoEye = addIcon(eye);
+ _icoLock = addIcon(lock);
_iconLayout->addWidget(_icoCam);
_iconLayout->addWidget(_icoEye);
+ _iconLayout->addWidget(_icoLock);
_iconLayout->addStretch();
- //_layout->addWidget(_imgScreen);
_mainLayout->addLayout(_iconLayout);
_mainLayout->addStretch();
_mainLayout->addWidget(_lblUserName);
@@ -141,6 +143,7 @@ void ConnectionFrame::assignClient(Client* client)
connect( client, SIGNAL(thumbUpdated(Client*, const QPixmap&)), this, SLOT(onThumbUpdated(Client*, const QPixmap&)) );
connect( client, SIGNAL(vncServerStateChange(Client*)), this, SLOT(updateAppearance()));
connect( client, SIGNAL(vncClientStateChange(Client*)), this, SLOT(updateAppearance()));
+ connect( client, SIGNAL(stateChanged()), this, SLOT(updateAppearance()));
_client = client;
_computerId = client->ip();
_lblHostName->setText(client->ip());
@@ -329,6 +332,7 @@ void ConnectionFrame::updateAppearance()
}
_icoCam->setVisible(_client->isActiveVncServer());
_icoEye->setVisible(_client->isActiveVncClient());
+ _icoLock->setVisible(_client->isLocked());
// Normal client, no special stuff active
diff --git a/src/server/connectionframe/connectionframe.h b/src/server/connectionframe/connectionframe.h
index cfb7fa3..72f641d 100644
--- a/src/server/connectionframe/connectionframe.h
+++ b/src/server/connectionframe/connectionframe.h
@@ -21,7 +21,7 @@ private:
QLabel *_lblUserName;
QLabel *_lblHostName;
- QLabel *_icoCam, *_icoEye;
+ QLabel *_icoCam, *_icoEye, *_icoLock;
QList _icons;
QPixmap _remoteScreen;
diff --git a/src/server/net/client.cpp b/src/server/net/client.cpp
index 97d3ed3..abd739d 100644
--- a/src/server/net/client.cpp
+++ b/src/server/net/client.cpp
@@ -23,6 +23,7 @@ Client::Client(QSslSocket* socket) : _socket(socket)
_currentProjectionSource = 0;
_vncPort = 0;
_isTutor = false;
+ _locked = false;
_id = ++_clientIdCounter;
//_ip = _socket->peerAddress().toString();
@@ -183,6 +184,7 @@ void Client::handleMsg()
}
_vncPort = port;
emit vncServerStateChange(this);
+ emit stateChanged();
}
else if (id == _VNCCLIENT)
{
@@ -200,7 +202,7 @@ void Client::handleMsg()
_currentProjectionSource = 0;
emit vncClientStateChange(this);
}
-
+ emit stateChanged();
}
return;
}
@@ -319,6 +321,7 @@ void Client::lockScreen(bool lock)
msg.setField(_ENABLE, lock ? __TRUE : __FALSE);
sendMessage(msg);
}
+ emit stateChanged();
}
/******************************************************************************/
diff --git a/src/server/net/client.h b/src/server/net/client.h
index 61d1740..d5942e8 100644
--- a/src/server/net/client.h
+++ b/src/server/net/client.h
@@ -36,6 +36,7 @@ public:
inline const int currentProjectionSource() const { return _currentProjectionSource; }
inline const bool isActiveVncClient() const { return _currentProjectionSource > 0; }
inline const bool isActiveVncServer() const { return _vncPort > 0; }
+ inline const bool isLocked() const { return _locked; }
// Setters
inline void setTutor(bool enable){ _isTutor = enable; }
@@ -79,6 +80,7 @@ signals:
void thumbUpdated(Client* client, const QPixmap& thumb);
void vncServerStateChange(Client* client);
void vncClientStateChange(Client* client);
+ void stateChanged();
void disconnected();
private slots:
--
cgit v1.2.3-55-g7522