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 --- src/client/toolbar/toolbar.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/client') 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