diff options
author | Simon Rettberg | 2022-10-30 12:03:43 +0100 |
---|---|---|
committer | Simon Rettberg | 2022-10-30 12:03:43 +0100 |
commit | 9bacddf36631572b610f042e17b5ee631dfebbca (patch) | |
tree | b7537d8a5293f28e7d02d41545f609bfa10921c1 /src/server/mainwindow | |
parent | Fix Qt fix (diff) | |
download | pvs2-9bacddf36631572b610f042e17b5ee631dfebbca.tar.gz pvs2-9bacddf36631572b610f042e17b5ee631dfebbca.tar.xz pvs2-9bacddf36631572b610f042e17b5ee631dfebbca.zip |
Modernize cmake file and project structure a bit
Diffstat (limited to 'src/server/mainwindow')
-rw-r--r-- | src/server/mainwindow/mainwindow.cpp | 23 | ||||
-rw-r--r-- | src/server/mainwindow/mainwindow.ui | 339 |
2 files changed, 350 insertions, 12 deletions
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 <iostream> #include <vector> @@ -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<QString> keyList = serverApp->getRooms().keys(); for (QList<QString>::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<ConnectionFrame*>::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 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>MainWindow</class> + <widget class="QMainWindow" name="MainWindow"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>846</width> + <height>801</height> + </rect> + </property> + <property name="windowTitle"> + <string notr="true">PVS2 Manager</string> + </property> + <property name="styleSheet"> + <string notr="true">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); +}</string> + </property> + <widget class="QWidget" name="centralWidget"> + <layout class="QVBoxLayout" name="verticalLayout"> + <property name="spacing"> + <number>0</number> + </property> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <layout class="QVBoxLayout" name="mainLayout"> + <property name="spacing"> + <number>3</number> + </property> + <item> + <widget class="QFrame" name="frmRoom"> + <property name="frameShape"> + <enum>QFrame::StyledPanel</enum> + </property> + <property name="frameShadow"> + <enum>QFrame::Sunken</enum> + </property> + <property name="lineWidth"> + <number>2</number> + </property> + <layout class="QHBoxLayout" name="horizontalLayout"> + <property name="spacing"> + <number>0</number> + </property> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="QLabel" name="imageLabel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Maximum" vsizetype="Expanding"> + <horstretch>1</horstretch> + <verstretch>1</verstretch> + </sizepolicy> + </property> + <property name="lineWidth"> + <number>0</number> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + </item> + </layout> + </widget> + <widget class="QToolBar" name="toolBar"> + <property name="windowTitle"> + <string>toolBar</string> + </property> + <property name="layoutDirection"> + <enum>Qt::LeftToRight</enum> + </property> + <property name="autoFillBackground"> + <bool>true</bool> + </property> + <property name="movable"> + <bool>false</bool> + </property> + <property name="iconSize"> + <size> + <width>48</width> + <height>48</height> + </size> + </property> + <attribute name="toolBarArea"> + <enum>LeftToolBarArea</enum> + </attribute> + <attribute name="toolBarBreak"> + <bool>false</bool> + </attribute> + <addaction name="actionReload_Room_Configuration"/> + <addaction name="action_Lock"/> + <addaction name="action_LockSingle"/> + <addaction name="action_TutorToAll"/> + <addaction name="action_TutorToStudent"/> + <addaction name="action_StudentToTutor"/> + <addaction name="action_StudentToTutorExclusive"/> + <addaction name="action_SetAsTutor"/> + <addaction name="action_DeleteClient"/> + <addaction name="action_StopProjection"/> + <addaction name="separator"/> + <addaction name="action_Help"/> + <addaction name="action_Exit"/> + </widget> + <action name="action_Exit"> + <property name="icon"> + <iconset resource="../../pvsmgr.qrc"> + <normaloff>:/exit</normaloff> + <normalon>:/exit</normalon>:/exit</iconset> + </property> + <property name="text"> + <string>Exit</string> + </property> + <property name="toolTip"> + <string>Exit</string> + </property> + <property name="shortcut"> + <string>Ctrl+Q</string> + </property> + </action> + <action name="action_Lock"> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="icon"> + <iconset resource="../../pvsmgr.qrc"> + <normaloff>:/lock</normaloff>:/lock</iconset> + </property> + <property name="text"> + <string>This will show a black screen on all connected clients, except the tutor's client.</string> + </property> + <property name="toolTip"> + <string>Lock/Unlock all clients</string> + </property> + <property name="shortcut"> + <string>Ctrl+A</string> + </property> + </action> + <action name="action_StudentToTutor"> + <property name="icon"> + <iconset resource="../../pvsmgr.qrc"> + <normaloff>:/student2tutor</normaloff>:/student2tutor</iconset> + </property> + <property name="text"> + <string>Stream currently selected client's screen content to the tutor's client.</string> + </property> + <property name="toolTip"> + <string>Student's Screen to Tutor</string> + </property> + </action> + <action name="action_StudentToTutorExclusive"> + <property name="icon"> + <iconset resource="../../pvsmgr.qrc"> + <normaloff>:/student2tutorextension</normaloff>:/student2tutorextension</iconset> + </property> + <property name="text"> + <string>Stream currently selected client's screen content to the tutor's client while showing a locked black screen on all other clients.</string> + </property> + <property name="toolTip"> + <string>Student's Screen to Tutor, others blanked</string> + </property> + </action> + <action name="action_TutorToStudent"> + <property name="icon"> + <iconset resource="../../pvsmgr.qrc"> + <normaloff>:/tutor2student</normaloff>:/tutor2student</iconset> + </property> + <property name="text"> + <string>Stream the tutor's screen contents to the currently selected client.</string> + </property> + <property name="toolTip"> + <string>Tutor's Screen to Student</string> + </property> + </action> + <action name="action_TutorToAll"> + <property name="icon"> + <iconset resource="../../pvsmgr.qrc"> + <normaloff>:/tutor2all</normaloff>:/tutor2all</iconset> + </property> + <property name="text"> + <string>Stream the tutor's screen contents to everyone.</string> + </property> + <property name="toolTip"> + <string>Tutor's Screen to Everyone</string> + </property> + </action> + <action name="action_StopProjection"> + <property name="icon"> + <iconset resource="../../pvsclient.qrc"> + <normaloff>:/reset</normaloff>:/reset</iconset> + </property> + <property name="text"> + <string>Unlock all clients, stop any running screen content streaming.</string> + </property> + <property name="toolTip"> + <string>Reset</string> + </property> + <property name="shortcut"> + <string>R</string> + </property> + </action> + <action name="action_SetAsTutor"> + <property name="icon"> + <iconset resource="../../pvsmgr.qrc"> + <normaloff>:/dozent</normaloff>:/dozent</iconset> + </property> + <property name="text"> + <string>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.</string> + </property> + <property name="toolTip"> + <string>Declare tutor</string> + </property> + <property name="shortcut"> + <string>T</string> + </property> + </action> + <action name="action_DeleteClient"> + <property name="icon"> + <iconset resource="../../pvsmgr.qrc"> + <normaloff>:/trash</normaloff>:/trash</iconset> + </property> + <property name="text"> + <string>Delete currently selected client. Only allowed for disconnected clients.</string> + </property> + <property name="toolTip"> + <string>Delete Client</string> + </property> + <property name="shortcut"> + <string>Del</string> + </property> + <property name="visible"> + <bool>true</bool> + </property> + </action> + <action name="action_Help"> + <property name="icon"> + <iconset resource="../../pvsmgr.qrc"> + <normaloff>:/helpme</normaloff>:/helpme</iconset> + </property> + <property name="text"> + <string>Show this help text.</string> + </property> + <property name="toolTip"> + <string>Help</string> + </property> + <property name="shortcut"> + <string>F1</string> + </property> + <property name="visible"> + <bool>true</bool> + </property> + </action> + <action name="actionReload_Room_Configuration"> + <property name="icon"> + <iconset resource="../../pvsmgr.qrc"> + <normaloff>:/reloadClassroom</normaloff>:/reloadClassroom</iconset> + </property> + <property name="text"> + <string>This shows a list of preconfigured rooms which you can load. This will reset the currently shown layout and disconnect all clients.</string> + </property> + <property name="toolTip"> + <string>Load a new room layout</string> + </property> + </action> + <action name="action_LockSingle"> + <property name="icon"> + <iconset resource="../../pvsmgr.qrc"> + <normaloff>:/lock-single</normaloff>:/lock-single</iconset> + </property> + <property name="text"> + <string>Lock or unlock the selected client only.</string> + </property> + <property name="toolTip"> + <string>Lock/Unlock single client</string> + </property> + <property name="shortcut"> + <string>L</string> + </property> + </action> + </widget> + <layoutdefault spacing="6" margin="11"/> + <resources> + <include location="../../pvsclient.qrc"/> + <include location="../../pvsmgr.qrc"/> + </resources> + <connections/> +</ui> |