summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2016-10-21 18:48:31 +0200
committerSimon Rettberg2016-10-21 18:48:31 +0200
commitcc3d9f5c379c70e4f16f60afc493d82db962db2b (patch)
treee40385171fb436c85963a1603fae2b591c8af949
parentMerge branch 'master' of openslx.org:pvs2 (diff)
downloadpvs2-cc3d9f5c379c70e4f16f60afc493d82db962db2b.tar.gz
pvs2-cc3d9f5c379c70e4f16f60afc493d82db962db2b.tar.xz
pvs2-cc3d9f5c379c70e4f16f60afc493d82db962db2b.zip
[client] Add icon to attention button, hide button when disconnected
-rw-r--r--CMakeLists.txt1
-rw-r--r--gui/client/toolbar.ui76
-rw-r--r--icons/hand-raise-red.svg37
-rw-r--r--icons/hand-raise.svg36
-rw-r--r--pvsclient.qrc2
-rw-r--r--src/client/toolbar/toolbar.cpp9
6 files changed, 153 insertions, 8 deletions
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 @@
<rect>
<x>0</x>
<y>0</y>
- <width>513</width>
- <height>39</height>
+ <width>440</width>
+ <height>30</height>
</rect>
</property>
<property name="windowTitle">
@@ -79,12 +79,15 @@ QCheckBox::indicator:checked:pressed {
<enum>QFrame::Raised</enum>
</property>
<layout class="QHBoxLayout" name="horizontalLayout2">
+ <property name="margin">
+ <number>3</number>
+ </property>
<item>
<widget class="QPushButton" name="cmdMenu">
<property name="minimumSize">
<size>
<width>84</width>
- <height>0</height>
+ <height>24</height>
</size>
</property>
<property name="toolTip">
@@ -179,6 +182,12 @@ p, li { white-space: pre-wrap; }
</item>
<item>
<widget class="QPushButton" name="btnLockDesktop">
+ <property name="minimumSize">
+ <size>
+ <width>84</width>
+ <height>24</height>
+ </size>
+ </property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Lock this workstation&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
@@ -189,6 +198,12 @@ p, li { white-space: pre-wrap; }
</item>
<item>
<widget class="QPushButton" name="btnManager">
+ <property name="minimumSize">
+ <size>
+ <width>84</width>
+ <height>24</height>
+ </size>
+ </property>
<property name="text">
<string>Switch</string>
</property>
@@ -198,13 +213,60 @@ p, li { white-space: pre-wrap; }
</widget>
</item>
<item>
- <widget class="QPushButton" name="btnAttention">
+ <widget class="QToolButton" name="btnAttention">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>30</width>
+ <height>24</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>30</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="sizeIncrement">
+ <size>
+ <width>30</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="baseSize">
+ <size>
+ <width>30</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="styleSheet">
+ <string notr="true"/>
+ </property>
<property name="text">
- <string>*meld*</string>
+ <string notr="true"/>
+ </property>
+ <property name="icon">
+ <iconset resource="../../pvsclient.qrc">
+ <normaloff>:/hand-raise</normaloff>
+ <normalon>:/hand-raise-red</normalon>:/hand-raise</iconset>
+ </property>
+ <property name="iconSize">
+ <size>
+ <width>22</width>
+ <height>22</height>
+ </size>
</property>
<property name="checkable">
<bool>true</bool>
</property>
+ <property name="checked">
+ <bool>false</bool>
+ </property>
</widget>
</item>
</layout>
@@ -212,6 +274,8 @@ p, li { white-space: pre-wrap; }
</item>
</layout>
</widget>
- <resources/>
+ <resources>
+ <include location="../../pvsclient.qrc"/>
+ </resources>
<connections/>
</ui>
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 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ version="1.1"
+ width="59.397911"
+ height="85.100357"
+ id="svg2">
+ <defs
+ id="defs4" />
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ transform="translate(-278.71286,-351.7736)"
+ id="layer1"
+ style="fill:#ff0000">
+ <path
+ d="m 278.72902,436.41974 0.26318,-12.86815 -0.27253,-56.22108 7.52253,0 7.52253,0 0,4.01652 c 0,5.62922 -0.54889,10.19155 -1.5,12.46788 -1.91428,4.5815 -1.91428,10.72698 0,15.30848 0.825,1.97451 1.5,5.12119 1.5,6.99264 0,4.27737 -0.0877,4.24533 21.5,7.85839 9.35,1.56488 18.00932,3.49104 19.24293,4.28036 3.92217,2.50958 3.68885,-1.80384 3.53478,18.61918 -27.27215,-0.14709 -29.39606,-0.29408 -59.31342,-0.45422 z m 26.18087,-27.02054 c -12.57357,-5.03602 -16.28916,-21.01602 -7.27457,-31.28646 4.30078,-4.89994 14.20146,-7.07848 20.81431,-4.57997 6.42412,2.4272 12.27118,10.97365 12.27118,17.93638 0,4.28771 -2.8675,10.74181 -6.08781,13.70227 -5.05676,4.64874 -13.92559,6.54984 -19.72311,4.22778 z m -26.17298,-43.4039 c -0.0797,-1.37399 -0.049,-9.66058 1.5224,-11.12484 3.72069,-3.46701 5.98785,-4.20425 10.36641,-1.28465 1.07929,0.71966 1.74201,0.38584 3.17058,5.78571 l 0,6.92742 -6.83334,0 c -3.75833,0 -8.19601,0.21403 -8.22605,-0.30364 z"
+ id="path2998"
+ style="fill:#ff0000" />
+ </g>
+</svg>
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 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ version="1.1"
+ width="59.397911"
+ height="85.100357"
+ id="svg2">
+ <defs
+ id="defs4" />
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ transform="translate(-278.71286,-351.7736)"
+ id="layer1">
+ <path
+ d="m 278.72902,436.41974 0.26318,-12.86815 -0.27253,-56.22108 7.52253,0 7.52253,0 0,4.01652 c 0,5.62922 -0.54889,10.19155 -1.5,12.46788 -1.91428,4.5815 -1.91428,10.72698 0,15.30848 0.825,1.97451 1.5,5.12119 1.5,6.99264 0,4.27737 -0.0877,4.24533 21.5,7.85839 9.35,1.56488 18.00932,3.49104 19.24293,4.28036 3.92217,2.50958 3.68885,-1.80384 3.53478,18.61918 -27.27215,-0.14709 -29.39606,-0.29408 -59.31342,-0.45422 z m 26.18087,-27.02054 c -12.57357,-5.03602 -16.28916,-21.01602 -7.27457,-31.28646 4.30078,-4.89994 14.20146,-7.07848 20.81431,-4.57997 6.42412,2.4272 12.27118,10.97365 12.27118,17.93638 0,4.28771 -2.8675,10.74181 -6.08781,13.70227 -5.05676,4.64874 -13.92559,6.54984 -19.72311,4.22778 z m -26.17298,-43.4039 c -0.0797,-1.37399 -0.049,-9.66058 1.5224,-11.12484 3.72069,-3.46701 5.98785,-4.20425 10.36641,-1.28465 1.07929,0.71966 1.74201,0.38584 3.17058,5.78571 l 0,6.92742 -6.83334,0 c -3.75833,0 -8.19601,0.21403 -8.22605,-0.30364 z"
+ id="path2998"
+ style="fill:#000000" />
+ </g>
+</svg>
diff --git a/pvsclient.qrc b/pvsclient.qrc
index 4b1f400..e47a275 100644
--- a/pvsclient.qrc
+++ b/pvsclient.qrc
@@ -9,6 +9,8 @@
<file alias="reset">icons/keyboard_key.svg</file>
<file alias="space">icons/space.svg</file>
<file alias="help">icons/help.svg</file>
+ <file alias="hand-raise">icons/hand-raise.svg</file>
+ <file alias="hand-raise-red">icons/hand-raise-red.svg</file>
<file alias="AUTHORS">AUTHORS</file>
</qresource>
<qresource lang="de_DE" prefix="/">
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 */