From cc3d9f5c379c70e4f16f60afc493d82db962db2b Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 21 Oct 2016 18:48:31 +0200 Subject: [client] Add icon to attention button, hide button when disconnected --- CMakeLists.txt | 1 + gui/client/toolbar.ui | 76 ++++++++++++++++++++++++++++++++++++++---- icons/hand-raise-red.svg | 37 ++++++++++++++++++++ icons/hand-raise.svg | 36 ++++++++++++++++++++ pvsclient.qrc | 2 ++ src/client/toolbar/toolbar.cpp | 9 +++-- 6 files changed, 153 insertions(+), 8 deletions(-) create mode 100644 icons/hand-raise-red.svg create mode 100644 icons/hand-raise.svg diff --git a/CMakeLists.txt b/CMakeLists.txt index 3245a03..1cb8cb3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -82,6 +82,7 @@ FILE(GLOB PVSMGR_MOC_HDRS ) FILE(GLOB PVSCLIENT_MOC_HDRS + src/client/*.h src/client/*/*.h src/client/*/*/*.h ) diff --git a/gui/client/toolbar.ui b/gui/client/toolbar.ui index bbaf2ca..062d0e8 100644 --- a/gui/client/toolbar.ui +++ b/gui/client/toolbar.ui @@ -6,8 +6,8 @@ 0 0 - 513 - 39 + 440 + 30 @@ -79,12 +79,15 @@ QCheckBox::indicator:checked:pressed { QFrame::Raised + + 3 + 84 - 0 + 24 @@ -179,6 +182,12 @@ p, li { white-space: pre-wrap; } + + + 84 + 24 + + <html><head/><body><p>Lock this workstation</p></body></html> @@ -189,6 +198,12 @@ p, li { white-space: pre-wrap; } + + + 84 + 24 + + Switch @@ -198,13 +213,60 @@ p, li { white-space: pre-wrap; } - + + + + 0 + 0 + + + + + 30 + 24 + + + + + 30 + 16777215 + + + + + 30 + 0 + + + + + 30 + 0 + + + + + - *meld* + + + + + :/hand-raise + :/hand-raise-red:/hand-raise + + + + 22 + 22 + true + + false + @@ -212,6 +274,8 @@ p, li { white-space: pre-wrap; } - + + + diff --git a/icons/hand-raise-red.svg b/icons/hand-raise-red.svg new file mode 100644 index 0000000..1391d3e --- /dev/null +++ b/icons/hand-raise-red.svg @@ -0,0 +1,37 @@ + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/icons/hand-raise.svg b/icons/hand-raise.svg new file mode 100644 index 0000000..8dcbab1 --- /dev/null +++ b/icons/hand-raise.svg @@ -0,0 +1,36 @@ + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/pvsclient.qrc b/pvsclient.qrc index 4b1f400..e47a275 100644 --- a/pvsclient.qrc +++ b/pvsclient.qrc @@ -9,6 +9,8 @@ icons/keyboard_key.svg icons/space.svg icons/help.svg + icons/hand-raise.svg + icons/hand-raise-red.svg AUTHORS diff --git a/src/client/toolbar/toolbar.cpp b/src/client/toolbar/toolbar.cpp index 10f9d22..c1b5b7a 100644 --- a/src/client/toolbar/toolbar.cpp +++ b/src/client/toolbar/toolbar.cpp @@ -18,7 +18,6 @@ #include "toolbar.h" #include "ui_toolbar.h" - /***************************************************************************//** * @brief * @@ -128,7 +127,11 @@ void Toolbar::init() _ui->btnLockDesktop->setVisible(false); } + /* hide attention button while disconnected */ + _ui->btnAttention->setVisible(false); + connect(_ui->btnAttention, SIGNAL(toggled(bool)), this, SLOT(onBtnAttention())); + _ui->btnAttention->setMaximumWidth(30); /* Connect the signals from vnc server */ connect(VncServer::instance(), SIGNAL(started(int, QString&, QString&)), this, SLOT(onVncServerIsRunning(int))); @@ -379,6 +382,7 @@ void Toolbar::onDisconnected() this->_acnConnect->setEnabled(true); this->_acnDisconnect->setEnabled(false); + _ui->btnAttention->setVisible(false); onBtnAttention(); _hideTimer.start(); } @@ -397,6 +401,8 @@ void Toolbar::onConnected(ServerConnection* connection) _ui->btnAttention->setChecked(false); _ui->lblStatus->setStyleSheet("color:green"); _ui->lblStatus->setText(tr("Online")); + /* connected, show button */ + _ui->btnAttention->setVisible(true); // if (_connection != NULL) { disconnect(_connection, SIGNAL(disconnected()), this, SLOT(onDisconnected())); @@ -489,7 +495,6 @@ void Toolbar::onBtnAttention() if (_connection != NULL) { _connection->sendAttention(on); } - _ui->btnAttention->setStyleSheet(on ? "color:red" : ""); } /** call script to switch to workspace of the manager */ -- cgit v1.2.3-55-g7522