From b5cc655b555d729a25de54d4edffba5e214d937e Mon Sep 17 00:00:00 2001 From: Christian Klinger Date: Mon, 30 May 2016 11:55:35 +0200 Subject: Added examMode to server (this also changes the style of the toolbar) --- src/server/mainwindow/mainwindow.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/server/mainwindow/mainwindow.cpp') 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 -- cgit v1.2.3-55-g7522