diff options
author | Christian Klinger | 2016-09-27 15:38:39 +0200 |
---|---|---|
committer | Christian Klinger | 2016-09-27 15:38:39 +0200 |
commit | 1f6493e319016f8c375b62f2109ee57f5cea828d (patch) | |
tree | ac1635d23eaaf7090f6cc21767536ddcc9c76dae /src/server/connectionframe/connectionframe.cpp | |
parent | clients in exam-mode no longer send a screenshot. Also some refactoring. (diff) | |
download | pvs2-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/connectionframe.cpp')
-rw-r--r-- | src/server/connectionframe/connectionframe.cpp | 31 |
1 files changed, 26 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); - } } |