summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gui/server_normal/mainwindow.ui33
-rw-r--r--src/server/connectionframe/connectionframe.cpp5
-rw-r--r--src/server/mainwindow/mainwindow.cpp22
-rw-r--r--src/server/util/global.cpp1
-rw-r--r--src/server/util/global.h4
5 files changed, 54 insertions, 11 deletions
diff --git a/gui/server_normal/mainwindow.ui b/gui/server_normal/mainwindow.ui
index e8ef22e..5b4b70b 100644
--- a/gui/server_normal/mainwindow.ui
+++ b/gui/server_normal/mainwindow.ui
@@ -13,6 +13,29 @@
<property name="windowTitle">
<string>PVS2 Manager</string>
</property>
+ <property name="styleSheet">
+ <string notr="true">QToolButton {
+ border: 1px solid #555;
+ border-radius: 8px;
+ padding: 2px;
+ margin: 5px;
+
+}
+QToolButton:enabled {
+background-color: rgb(241, 241, 241)
+}
+QToolButton:enabled:hover {
+ background-color: white;
+ border-style: outset;
+}
+QLabel#examModeLabel {
+ width: 71px;
+ margin: 5px;
+ border-radius: 8px;
+ background-color: rgb(170, 170, 170);
+}
+</string>
+ </property>
<widget class="QWidget" name="centralWidget">
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
@@ -92,27 +115,17 @@
<attribute name="toolBarBreak">
<bool>false</bool>
</attribute>
- <addaction name="separator"/>
<addaction name="actionReload_Room_Configuration"/>
- <addaction name="separator"/>
<addaction name="action_Lock"/>
- <addaction name="separator"/>
<addaction name="action_TutorToAll"/>
- <addaction name="separator"/>
<addaction name="action_TutorToStudent"/>
- <addaction name="separator"/>
<addaction name="action_StudentToTutor"/>
- <addaction name="separator"/>
<addaction name="action_StudentToTutorExclusive"/>
- <addaction name="separator"/>
<addaction name="action_SetAsTutor"/>
- <addaction name="separator"/>
<addaction name="action_DeleteClient"/>
- <addaction name="separator"/>
<addaction name="action_StopProjection"/>
<addaction name="separator"/>
<addaction name="action_Help"/>
- <addaction name="separator"/>
<addaction name="action_Exit"/>
</widget>
<action name="action_Exit">
diff --git a/src/server/connectionframe/connectionframe.cpp b/src/server/connectionframe/connectionframe.cpp
index 68160b5..e274bd5 100644
--- a/src/server/connectionframe/connectionframe.cpp
+++ b/src/server/connectionframe/connectionframe.cpp
@@ -16,6 +16,7 @@
#include "connectionframe.h"
#include "../net/client.h"
+#include "../util/global.h"
#include <QPixmap>
#include <QImage>
#include <cassert>
@@ -270,8 +271,10 @@ void ConnectionFrame::mouseDoubleClickEvent(QMouseEvent* event)
void ConnectionFrame::paintEvent(QPaintEvent *event)
{
QGroupBox::paintEvent(event);
- if (_remoteScreen.isNull())
+ if (_remoteScreen.isNull() || Global::isExam()) {
return;
+ }
+
QPainter painter(this);
painter.drawPixmap((this->width() - _remoteScreen.width()) / 2, 4, _remoteScreen);
event->accept();
diff --git a/src/server/mainwindow/mainwindow.cpp b/src/server/mainwindow/mainwindow.cpp
index c834957..28bf268 100644
--- a/src/server/mainwindow/mainwindow.cpp
+++ b/src/server/mainwindow/mainwindow.cpp
@@ -117,6 +117,28 @@ MainWindow::MainWindow(QWidget* parent) :
connect(ui->actionReload_Room_Configuration, SIGNAL(triggered()), this, SLOT(onButtonReloadRoomConfig()));
connect(ui->action_DeleteClient, SIGNAL(triggered()), this, SLOT(onDeleteClient()));
+ /* In exam-mode: disable most features */
+ SYSTEM_SETTINGS(conf);
+ if (conf.contains("examMode")) {
+ Global::setExam(conf.value("examMode").toBool());
+ }
+
+ if (Global::isExam()) {
+ qDebug() << "Exam-Mode!";
+ ui->action_TutorToAll->setVisible(false);
+ ui->action_StudentToTutor->setVisible(false);
+ ui->action_StudentToTutorExclusive->setVisible(false);
+ ui->action_TutorToStudent->setVisible(false);
+ ui->action_StopProjection->setVisible(false);
+
+ QLabel* examModeLabel = new QLabel("Klausur-\nModus");
+ examModeLabel->setObjectName("examModeLabel");
+ examModeLabel->setAlignment(Qt::AlignCenter);
+ examModeLabel->setFixedHeight(400);
+ ui->toolBar->insertWidget(ui->action_TutorToStudent, examModeLabel);
+ }
+
+
/* disable context-sensitive buttons by default */
_contextButtons
<< ui->action_DeleteClient
diff --git a/src/server/util/global.cpp b/src/server/util/global.cpp
index 39e72fb..bdb462f 100644
--- a/src/server/util/global.cpp
+++ b/src/server/util/global.cpp
@@ -48,3 +48,4 @@ const Room* Global::getCurrentRoom() {
}
}
bool Global::manager_only = false;
+bool Global::_isExam = false;
diff --git a/src/server/util/global.h b/src/server/util/global.h
index 4a71348..08ec00a 100644
--- a/src/server/util/global.h
+++ b/src/server/util/global.h
@@ -40,6 +40,8 @@ private:
static QMap<QString, Room*> _rooms;
static QString _currentRoom;
+ static bool _isExam;
+
public:
static const QString& sessionName() { return Global::_sessionName; }
static const QByteArray& sessionNameArray() { return Global::_sessionNameArray; }
@@ -53,6 +55,8 @@ public:
return _rooms;
}
+ static bool isExam() { return _isExam; }
+ static void setExam(bool b) { _isExam = b; }
static void setCurrentRoom(QString room);
static const QString& getCurrentRoomName() { return _currentRoom; }