From 9bacddf36631572b610f042e17b5ee631dfebbca Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Sun, 30 Oct 2022 12:03:43 +0100 Subject: Modernize cmake file and project structure a bit --- src/server/mainwindow/mainwindow.cpp | 23 ++- src/server/mainwindow/mainwindow.ui | 339 +++++++++++++++++++++++++++++++++++ 2 files changed, 350 insertions(+), 12 deletions(-) create mode 100644 src/server/mainwindow/mainwindow.ui (limited to 'src/server/mainwindow') diff --git a/src/server/mainwindow/mainwindow.cpp b/src/server/mainwindow/mainwindow.cpp index f6ff566..b63545f 100644 --- a/src/server/mainwindow/mainwindow.cpp +++ b/src/server/mainwindow/mainwindow.cpp @@ -38,7 +38,6 @@ #include "../util/platform/screensaver.h" // Auto-generated ui class #include "ui_mainwindow.h" -#include "ui_reloadroom.h" #include #include @@ -711,20 +710,20 @@ void MainWindow::startVncServerIfNecessary(int from) void MainWindow::onButtonReloadRoomConfig() { - connect(_reloadWindow->ui->buttonBox, SIGNAL(accepted()), this, SLOT(onReloadRoomOk())); - connect(_reloadWindow->ui->buttonBox, SIGNAL(rejected()), this, SLOT(onReloadRoomCancel())); + connect(_reloadWindow->buttonBox(), SIGNAL(accepted()), this, SLOT(onReloadRoomOk())); + connect(_reloadWindow->buttonBox(), SIGNAL(rejected()), this, SLOT(onReloadRoomCancel())); QList keyList = serverApp->getRooms().keys(); for (QList::iterator it = keyList.begin(); it != keyList.end() ; it++) { - _reloadWindow->ui->roomList->addItem(*it); + _reloadWindow->addRoom(*it); } _reloadWindow->show(); } void MainWindow::onReloadRoomCancel() { - disconnect(_reloadWindow->ui->buttonBox, SIGNAL(accepted()), this, SLOT(onReloadRoomOk())); - disconnect(_reloadWindow->ui->buttonBox, SIGNAL(rejected()), this, SLOT(onReloadRoomCancel())); - _reloadWindow->ui->roomList->clear(); + disconnect(_reloadWindow->buttonBox(), SIGNAL(accepted()), this, SLOT(onReloadRoomOk())); + disconnect(_reloadWindow->buttonBox(), SIGNAL(rejected()), this, SLOT(onReloadRoomCancel())); + _reloadWindow->clearRoomList(); _reloadWindow->hide(); } @@ -785,7 +784,8 @@ void MainWindow::reloadCurrentRoom() void MainWindow::onReloadRoomOk() { - if (_reloadWindow->ui->roomList->currentItem() == nullptr) { + QString roomToReload = _reloadWindow->currentRoom(); + if (roomToReload.isEmpty()) { QMessageBox::critical(this, "Warning", tr("No item selected, please select room!"), 0, 1); return; } @@ -794,8 +794,8 @@ void MainWindow::onReloadRoomOk() "Note that all clients will be deleted."), QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes); if (ret == QMessageBox::Yes) { - disconnect(_reloadWindow->ui->buttonBox, SIGNAL(accepted()), this, SLOT(onReloadRoomOk())); - disconnect(_reloadWindow->ui->buttonBox, SIGNAL(rejected()), this, SLOT(onReloadRoomCancel())); + disconnect(_reloadWindow->buttonBox(), SIGNAL(accepted()), this, SLOT(onReloadRoomOk())); + disconnect(_reloadWindow->buttonBox(), SIGNAL(rejected()), this, SLOT(onReloadRoomCancel())); // Delete all clients. for (QList::iterator it = _clientFrames.begin(); it != _clientFrames.end(); it++) { (*it)->hide(); @@ -804,11 +804,10 @@ void MainWindow::onReloadRoomOk() _clientFrames.clear(); // Load new room configuration. - QString roomToReload = _reloadWindow->ui->roomList->currentItem()->data(0).toString(); serverApp->setCurrentRoom(roomToReload); reloadCurrentRoom(); - _reloadWindow->ui->roomList->clear(); + _reloadWindow->clearRoomList(); _reloadWindow->hide(); } diff --git a/src/server/mainwindow/mainwindow.ui b/src/server/mainwindow/mainwindow.ui new file mode 100644 index 0000000..62b92f7 --- /dev/null +++ b/src/server/mainwindow/mainwindow.ui @@ -0,0 +1,339 @@ + + + MainWindow + + + + 0 + 0 + 846 + 801 + + + + PVS2 Manager + + + QToolButton { + border-radius: 8px; + padding: 4px; + margin: 5px; + border: 1px solid #777; +} +QToolButton:enabled { +background-color: #f8f8f8; +border: 1px solid #555; +} +QToolButton:enabled:hover { + background: qradialgradient(cx: 0.4, cy: -0.1, +fx: 0.4, fy: -0.1, +radius: 1.35, stop: 0 #fff, stop: 1 #ddd); +} + +QToolButton:enabled:checked, +QToolButton:enabled:pressed { +background: qradialgradient(cx: 0.4, cy: -0.1, +fx: 0.4, fy: -0.1, +radius: 1.35, stop: 0 #888, stop: 1 #aaa); +} +QLabel#examModeLabel { + width: 71px; + margin: 5px; + border-radius: 8px; + background-color: rgb(170, 170, 170); +} + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 3 + + + + + QFrame::StyledPanel + + + QFrame::Sunken + + + 2 + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 1 + 1 + + + + 0 + + + + + + + + + + + + + + + + toolBar + + + Qt::LeftToRight + + + true + + + false + + + + 48 + 48 + + + + LeftToolBarArea + + + false + + + + + + + + + + + + + + + + + + + :/exit + :/exit:/exit + + + Exit + + + Exit + + + Ctrl+Q + + + + + true + + + + :/lock:/lock + + + This will show a black screen on all connected clients, except the tutor's client. + + + Lock/Unlock all clients + + + Ctrl+A + + + + + + :/student2tutor:/student2tutor + + + Stream currently selected client's screen content to the tutor's client. + + + Student's Screen to Tutor + + + + + + :/student2tutorextension:/student2tutorextension + + + Stream currently selected client's screen content to the tutor's client while showing a locked black screen on all other clients. + + + Student's Screen to Tutor, others blanked + + + + + + :/tutor2student:/tutor2student + + + Stream the tutor's screen contents to the currently selected client. + + + Tutor's Screen to Student + + + + + + :/tutor2all:/tutor2all + + + Stream the tutor's screen contents to everyone. + + + Tutor's Screen to Everyone + + + + + + :/reset:/reset + + + Unlock all clients, stop any running screen content streaming. + + + Reset + + + R + + + + + + :/dozent:/dozent + + + Declare the currently selected client as tutor. The tutor will be excluded from screen locking and can be used as a fixed source/target for screen content streaming. + + + Declare tutor + + + T + + + + + + :/trash:/trash + + + Delete currently selected client. Only allowed for disconnected clients. + + + Delete Client + + + Del + + + true + + + + + + :/helpme:/helpme + + + Show this help text. + + + Help + + + F1 + + + true + + + + + + :/reloadClassroom:/reloadClassroom + + + This shows a list of preconfigured rooms which you can load. This will reset the currently shown layout and disconnect all clients. + + + Load a new room layout + + + + + + :/lock-single:/lock-single + + + Lock or unlock the selected client only. + + + Lock/Unlock single client + + + L + + + + + + + + + + -- cgit v1.2.3-55-g7522