diff options
-rw-r--r-- | TODO | 2 | ||||
-rw-r--r-- | gui/server_normal/mainwindow.ui | 13 | ||||
-rw-r--r-- | gui/server_normal/reloadroom.ui | 61 | ||||
-rw-r--r-- | icons/refresh.svg | bin | 0 -> 8103 bytes | |||
-rw-r--r-- | pvsmgr.qrc | 1 | ||||
-rw-r--r-- | src/server/mainwindow/mainwindow.cpp | 11 | ||||
-rw-r--r-- | src/server/mainwindow/mainwindow.h | 4 | ||||
-rw-r--r-- | src/server/reloadroomwindow/reloadroomwindow.cpp | 29 | ||||
-rw-r--r-- | src/server/reloadroomwindow/reloadroomwindow.h | 29 |
9 files changed, 150 insertions, 0 deletions
@@ -10,6 +10,8 @@ zu kompliziert für Nutzer? --------------------------- P V S M G R ---------------------------------------- +[ ] Button plus Auswahlmenü für Räume. Idee: falls alles durcheinander, neue + Raumauswahl --> Startconfig wird geladen. [ ] ConnectionFrame -> ComputerID ist schwachsinn. Wirklich sinnvoll wären 'int IDs' welche dann auch die 1 Million (*it)->client->id() zu (*it)->id() diff --git a/gui/server_normal/mainwindow.ui b/gui/server_normal/mainwindow.ui index fe8ff10..fe87433 100644 --- a/gui/server_normal/mainwindow.ui +++ b/gui/server_normal/mainwindow.ui @@ -113,6 +113,7 @@ <addaction name="separator"/> <addaction name="action_SetAsTutor"/> <addaction name="separator"/> + <addaction name="actionReload_Room_Configuration"/> <addaction name="action_Help"/> </widget> <action name="action_Exit"> @@ -221,6 +222,18 @@ <bool>true</bool> </property> </action> + <action name="actionReload_Room_Configuration"> + <property name="icon"> + <iconset resource="../../pvsmgr.qrc"> + <normaloff>:/refresh</normaloff>:/refresh</iconset> + </property> + <property name="text"> + <string>Reload Room Configuration</string> + </property> + <property name="toolTip"> + <string>Reload Room Configuration</string> + </property> + </action> </widget> <layoutdefault spacing="6" margin="11"/> <resources> diff --git a/gui/server_normal/reloadroom.ui b/gui/server_normal/reloadroom.ui new file mode 100644 index 0000000..ab120a7 --- /dev/null +++ b/gui/server_normal/reloadroom.ui @@ -0,0 +1,61 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>ScrollArea</class> + <widget class="QScrollArea" name="ScrollArea"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>400</width> + <height>300</height> + </rect> + </property> + <property name="windowTitle"> + <string>ScrollArea</string> + </property> + <property name="widgetResizable"> + <bool>true</bool> + </property> + <widget class="QWidget" name="scrollAreaWidgetContents"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>398</width> + <height>298</height> + </rect> + </property> + <widget class="QLabel" name="label"> + <property name="geometry"> + <rect> + <x>60</x> + <y>10</y> + <width>281</width> + <height>20</height> + </rect> + </property> + <property name="text"> + <string>Choose room configuration to reload:</string> + </property> + </widget> + <widget class="QDialogButtonBox" name="buttonBox"> + <property name="geometry"> + <rect> + <x>210</x> + <y>260</y> + <width>181</width> + <height>27</height> + </rect> + </property> + <property name="standardButtons"> + <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> + </property> + <property name="centerButtons"> + <bool>true</bool> + </property> + </widget> + </widget> + </widget> + <resources/> + <connections/> +</ui> diff --git a/icons/refresh.svg b/icons/refresh.svg Binary files differnew file mode 100644 index 0000000..e499882 --- /dev/null +++ b/icons/refresh.svg @@ -16,6 +16,7 @@ <file alias="student2tutorextension">icons/student2tutor_extension.svg</file> <file alias="helpme">icons/help.svg</file> <file alias="trash">icons/trash.svg</file> + <file alias="refresh">icons/refresh.svg</file> <file alias="AUTHORS">AUTHORS</file> <file alias="TRANSLATION">TRANSLATION</file> <file alias="pvsmgr.qm">build/pvsmgr_de_DE.qm</file> diff --git a/src/server/mainwindow/mainwindow.cpp b/src/server/mainwindow/mainwindow.cpp index 48c29ac..7c9d210 100644 --- a/src/server/mainwindow/mainwindow.cpp +++ b/src/server/mainwindow/mainwindow.cpp @@ -98,6 +98,7 @@ MainWindow::MainWindow(QString ipListUrl, QWidget* parent) : connect(ui->action_SetAsTutor, SIGNAL(triggered()), this, SLOT(onButtonStopProjection())); connect(ui->action_Lock, SIGNAL(toggled(bool)), this, SLOT(onButtonLock(bool))); connect(ui->action_Help, SIGNAL(triggered()), this, SLOT(onButtonHelp())); + connect(ui->actionReload_Room_Configuration, SIGNAL(triggered()), this, SLOT(onButtonReloadRoomConfig())); /* Stuff for the button lock */ //Setup a timeout @@ -311,6 +312,10 @@ void MainWindow::tryToUseRoomTemplate() for (auto i : rooms) { + if (!_rooms.contains(i)) { + QList<QPair<QString, QPoint>> posIpConfig; + _rooms.insert(i, posIpConfig); + } conf.beginGroup(i); if (!conf.contains("mgrIP")) { qDebug() << "Invalid config file!"; @@ -338,6 +343,7 @@ void MainWindow::tryToUseRoomTemplate() // Position is given in grid coordinates, createFrame take pixels QString computerId = conf.value("ip").toString(); QPoint coord = conf.value("pos").toPoint(); + _rooms[i].append(qMakePair(computerId, coord)); qDebug() << computerId; qDebug() << coord; qDebug() << _tileWidth ; @@ -677,6 +683,11 @@ void MainWindow::startVncServerIfNecessary(int from) } } +void MainWindow::onButtonReloadRoomConfig() +{ + _reloadWindow->show(); +} + /***************************************************************************//** * Display popup which explains possible actions about the buttons. */ diff --git a/src/server/mainwindow/mainwindow.h b/src/server/mainwindow/mainwindow.h index 924738c..5349903 100644 --- a/src/server/mainwindow/mainwindow.h +++ b/src/server/mainwindow/mainwindow.h @@ -11,6 +11,7 @@ class ConnectionFrame; class ListenServer; class DiscoveryListener; class HelpWindow; +class ReloadWindow; namespace Ui{ class MainWindow; @@ -35,6 +36,7 @@ private: Ui::MainWindow *ui; SessionNameWindow *_sessionNameWindow; HelpWindow *_helpWindow; + ReloadWindow *_reloadWindow; QLabel *_sessionNameLabel; int _tbIconSize; Qt::ToolBarArea _tbArea; @@ -63,6 +65,7 @@ private: DiscoveryListener *_discoveryListener; FileDownloader _fileDownloader; QStringList _tutorList; + QMap<QString, QList<QPair<QString, QPoint> > > _rooms; static const QString sStrTutorNdef; static const QString sStrTutorOffline; @@ -106,6 +109,7 @@ protected slots: void onButtonStopProjection(); void onButtonSetAsTutor(); + void onButtonReloadRoomConfig(); void onButtonExit(); void onButtonHelp(); diff --git a/src/server/reloadroomwindow/reloadroomwindow.cpp b/src/server/reloadroomwindow/reloadroomwindow.cpp new file mode 100644 index 0000000..77219a7 --- /dev/null +++ b/src/server/reloadroomwindow/reloadroomwindow.cpp @@ -0,0 +1,29 @@ +#include "reloadroomwindow.h" +#include "ui_reloadroom.h" + +ReloadRoomWindow::ReloadRoomWindow(QWidget *parent) : + QDialog(parent), ui(new Ui::ReloadRoom) +{ + ui->setupUi(this); + connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(onButtonOk())); + connect(ui->buttonBox, SIGNAL(rejected()), this, SLOT(onButtonCancel())); +} + +ReloadRoomWindow::~ReloadRoomWindow() +{ + delete ui; +} + +/* + * Slots + */ + +void ReloadRoomWindow::onButtonOk() +{ + +} + +void ReloadRoomWindow::onButtonCancel() +{ + this->hide(); +} diff --git a/src/server/reloadroomwindow/reloadroomwindow.h b/src/server/reloadroomwindow/reloadroomwindow.h new file mode 100644 index 0000000..e918736 --- /dev/null +++ b/src/server/reloadroomwindow/reloadroomwindow.h @@ -0,0 +1,29 @@ +#ifndef RELOADROOMWINDOW_H +#define RELOADROOMWINDOW_H + +#include <QDialog> + +namespace Ui { +class ReloadRoom; +} + +class ReloadRoomWindow : public QDialog +{ + Q_OBJECT + +public: + explicit ReloadRoomWindow(QWidget *parent = 0); + ~ReloadRoomWindow(); + + // void show(); + +private: + Ui::ReloadRoom *ui; + + +private slots: + void onButtonCancel(); + void onButtonOk(); + +}; +#endif |