summaryrefslogtreecommitdiffstats
path: root/src/server/connectionframe
diff options
context:
space:
mode:
authorChristian Klinger2016-09-27 15:38:39 +0200
committerChristian Klinger2016-09-27 15:38:39 +0200
commit1f6493e319016f8c375b62f2109ee57f5cea828d (patch)
treeac1635d23eaaf7090f6cc21767536ddcc9c76dae /src/server/connectionframe
parentclients in exam-mode no longer send a screenshot. Also some refactoring. (diff)
downloadpvs2-1f6493e319016f8c375b62f2109ee57f5cea828d.tar.gz
pvs2-1f6493e319016f8c375b62f2109ee57f5cea828d.tar.xz
pvs2-1f6493e319016f8c375b62f2109ee57f5cea828d.zip
Implemented 'majority vote' to determine the toolbar options.
clients in exam-mode are also displayed differently.
Diffstat (limited to 'src/server/connectionframe')
-rw-r--r--src/server/connectionframe/connectionframe.cpp31
-rw-r--r--src/server/connectionframe/connectionframe.h1
2 files changed, 27 insertions, 5 deletions
diff --git a/src/server/connectionframe/connectionframe.cpp b/src/server/connectionframe/connectionframe.cpp
index e962e39..3278e04 100644
--- a/src/server/connectionframe/connectionframe.cpp
+++ b/src/server/connectionframe/connectionframe.cpp
@@ -37,6 +37,14 @@ static QString style_selectedTutor(
"QLabel{ background-color: #FFF; border-radius: 2px; color: black;} \
QGroupBox { background-color: #99ff99; margin: 0px; border-radius: 4px; border: 4px solid #6C8CF0;}"
);
+static QString style_exam (
+ "QLabel{ background-color: #919191; color: black; } \
+ QGroupBox { background-color: #d35400; margin: 1px; border-radius: 4px}"
+);
+static QString style_exam_selected (
+ "QLabel{ background-color: #919191; color: black; } \
+ QGroupBox { background-color: #cc743a; margin: 1px; border-radius: 4px}"
+);
static QString style_disconnected(
"QLabel{ background-color: #919191; color: black; } \
QGroupBox { background-color: #7F7F7F; margin: 1px; border-radius: 4px}"
@@ -82,6 +90,10 @@ ConnectionFrame::ConnectionFrame(QWidget *parent, int width, int height) :
_lblHostName = new QLabel("PC", this);
_lblHostName->setAlignment(Qt::AlignHCenter);
+ _lblExamMode = new QLabel(tr("EXAM-MODE"), this);
+ _lblExamMode->setAlignment(Qt::AlignHCenter);
+ _lblExamMode->setVisible(false);
+
_icoCam = addIcon(cam);
_icoEye = addIcon(eye);
_icoLock = addIcon(lock);
@@ -93,6 +105,8 @@ ConnectionFrame::ConnectionFrame(QWidget *parent, int width, int height) :
_mainLayout->addLayout(_iconLayout);
_mainLayout->addStretch();
+ _mainLayout->addWidget(_lblExamMode);
+ _mainLayout->addStretch();
_mainLayout->addWidget(_lblUserName);
_mainLayout->addWidget(_lblHostName);
this->setLayout(_mainLayout);
@@ -270,7 +284,7 @@ void ConnectionFrame::mouseDoubleClickEvent(QMouseEvent* event)
void ConnectionFrame::paintEvent(QPaintEvent *event)
{
QGroupBox::paintEvent(event);
- if (_remoteScreen.isNull() || Global::isExam()) {
+ if (_remoteScreen.isNull()) {
return;
}
@@ -344,6 +358,8 @@ void ConnectionFrame::updateAppearance()
_icoEye->setVisible(_client->isActiveVncClient());
_icoLock->setVisible(_client->isLocked());
+
+ _lblExamMode->setVisible(_client->isExamMode());
// Normal client, no special stuff active
if (_isSelected && _isTutor){
@@ -352,13 +368,18 @@ void ConnectionFrame::updateAppearance()
else if (_isTutor){
this->setStyleSheet(style_tutor);
}
- else if (_isSelected){
+ else if (_client->isExamMode()) {
+ if (_isSelected) {
+ this->setStyleSheet(style_exam_selected);
+ } else {
+ this->setStyleSheet(style_exam);
+ }
+ }
+ else if (_isSelected) {
this->setStyleSheet(style_selectedStudent);
-
}
- else{
+ else {
this->setStyleSheet(style_student);
-
}
}
diff --git a/src/server/connectionframe/connectionframe.h b/src/server/connectionframe/connectionframe.h
index d5551cb..9ac71c0 100644
--- a/src/server/connectionframe/connectionframe.h
+++ b/src/server/connectionframe/connectionframe.h
@@ -20,6 +20,7 @@ private:
QBoxLayout *_iconLayout;
QLabel *_lblUserName;
QLabel *_lblHostName;
+ QLabel *_lblExamMode;
QLabel *_icoCam, *_icoEye, *_icoLock;
QList<QLabel*> _icons;