From 254c7fb41a96f42ef4049d5a495e47fad2e3e983 Mon Sep 17 00:00:00 2001 From: Björn Hagemeister Date: Tue, 29 Jul 2014 15:31:56 +0200 Subject: Fixed bug, that frame moved on (0,0) is asked to be deleted. --- TODO | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'TODO') diff --git a/TODO b/TODO index df8c6ca..22a982f 100644 --- a/TODO +++ b/TODO @@ -1,5 +1,5 @@ ----------------------------------- B U G S ------------------------------------- -[ ] Frame auf 0,0 gemoved will gelöscht werden. sollte nicht sein. +[x] Frame auf 0,0 gemoved will gelöscht werden. sollte nicht sein. --------------------------- P V S M G R ---------------------------------------- -- cgit v1.2.3-55-g7522 From 3464aa7e56f900ab37772e7c1bb4dade1ae7d7a9 Mon Sep 17 00:00:00 2001 From: Björn Hagemeister Date: Tue, 29 Jul 2014 16:00:03 +0200 Subject: Fixed, deleting clients after SessionNameUpdate. Using Counter, change for the first time --> do nothing change for the second time --> delete clients. Maybe too complicated for user? --- TODO | 10 ++++++++-- src/server/mainwindow/mainwindow.cpp | 16 +++++++++++----- src/server/mainwindow/mainwindow.h | 1 + 3 files changed, 20 insertions(+), 7 deletions(-) (limited to 'TODO') diff --git a/TODO b/TODO index 22a982f..d3518cf 100644 --- a/TODO +++ b/TODO @@ -1,6 +1,12 @@ ----------------------------------- B U G S ------------------------------------- [x] Frame auf 0,0 gemoved will gelöscht werden. sollte nicht sein. - +[ ] Bei setzen des Session Name werden wieder alle Frames geschmissen, d.h. + die Raumbelegungsaufteilung ist hinüber. + [ ]--> Lösung: Clienten und Frames nicht löschen bei SessionName + aktualisierung --> sinnvoll? oder zu allgemein? + [x]--> Möglichkeit mit Counter: bei erster Änderung --> nicht löschen + bei weiteren Änderungen --> löschen + --> zu kompliziert für Nutzer? --------------------------- P V S M G R ---------------------------------------- @@ -63,7 +69,7 @@ anmelden, in der Zwischenzeit kann das System auf den default resetten....> --------------------------- P V S C L I E N T ---------------------------------- -[funktioniert bei mir] +[funktioniert bei mir(manuel), bei mir(bjoern) auch] Beim Client: Wenn Session-ID im laufenden betrieb geändert wird, fliegt der Client raus. Man kann als Client (dann) keine neue Session-ID setzen. diff --git a/src/server/mainwindow/mainwindow.cpp b/src/server/mainwindow/mainwindow.cpp index 82981b1..71ee8a6 100644 --- a/src/server/mainwindow/mainwindow.cpp +++ b/src/server/mainwindow/mainwindow.cpp @@ -129,7 +129,9 @@ MainWindow::MainWindow(QString ipListUrl, QWidget* parent) : _discoveryListener = new DiscoveryListener(); // Finally -// this->onSessionNameUpdate(); + _countSessionNameUpdate = 0; + this->onSessionNameUpdate(); // Just make lable visible. + _countSessionNameUpdate = 0; _tileWidth = ui->frmRoom->size().width() / _tilesX; _tileHeight = ui->frmRoom->size().height() / _tilesY; @@ -622,14 +624,18 @@ void MainWindow::onSessionNameClick() */ void MainWindow::onSessionNameUpdate() { + _countSessionNameUpdate++; // Stop all projections and clear all clients, which where connected to old sessionName. reset(); - for (QList::iterator it(_clientFrames.begin()); it != _clientFrames.end(); ++it) + if (_countSessionNameUpdate > 1) { - (*it)->hide(); - (*it)->deleteLater(); + for (QList::iterator it(_clientFrames.begin()); it != _clientFrames.end(); ++it) + { + (*it)->hide(); + (*it)->deleteLater(); + } + _clientFrames.clear(); } - _clientFrames.clear(); _sessionNameLabel->setText(tr("Session Name: %1 [click to edit]").arg(Global::sessionName())); } diff --git a/src/server/mainwindow/mainwindow.h b/src/server/mainwindow/mainwindow.h index 1990fe6..924738c 100644 --- a/src/server/mainwindow/mainwindow.h +++ b/src/server/mainwindow/mainwindow.h @@ -56,6 +56,7 @@ private: None } _mode; int _streamingSource; + int _countSessionNameUpdate; QList _clientFrames; ListenServer *_listenServer; -- cgit v1.2.3-55-g7522 From 7e47620ad777576b938f0fb8c0498ba0982e3bd9 Mon Sep 17 00:00:00 2001 From: Björn Hagemeister Date: Tue, 29 Jul 2014 16:15:23 +0200 Subject: Added user warning before second or more change of sessionName. --- TODO | 3 ++- src/server/mainwindow/mainwindow.cpp | 24 ++++++++++++++++++------ 2 files changed, 20 insertions(+), 7 deletions(-) (limited to 'TODO') diff --git a/TODO b/TODO index d3518cf..e9ac78e 100644 --- a/TODO +++ b/TODO @@ -6,7 +6,8 @@ aktualisierung --> sinnvoll? oder zu allgemein? [x]--> Möglichkeit mit Counter: bei erster Änderung --> nicht löschen bei weiteren Änderungen --> löschen - --> zu kompliziert für Nutzer? + --> evtl. auch mit jetziger Nutzerwarunung + zu kompliziert für Nutzer? --------------------------- P V S M G R ---------------------------------------- diff --git a/src/server/mainwindow/mainwindow.cpp b/src/server/mainwindow/mainwindow.cpp index 71ee8a6..51da124 100644 --- a/src/server/mainwindow/mainwindow.cpp +++ b/src/server/mainwindow/mainwindow.cpp @@ -616,7 +616,18 @@ void MainWindow::onFrameClicked(ConnectionFrame* frame) */ void MainWindow::onSessionNameClick() { - _sessionNameWindow->show(Global::sessionName()); + _countSessionNameUpdate++; + if (_countSessionNameUpdate > 1) + { + int ret = QMessageBox::question(this, "Warning", "Sure, You want to change SessionName again?\n" + "All Clients will be deleted afterwards.", 0, 1, 2); + if (ret == 1) + { + _sessionNameWindow->show(Global::sessionName()); + } + } + else + _sessionNameWindow->show((Global::sessionName())); } /***************************************************************************//** @@ -624,17 +635,18 @@ void MainWindow::onSessionNameClick() */ void MainWindow::onSessionNameUpdate() { - _countSessionNameUpdate++; // Stop all projections and clear all clients, which where connected to old sessionName. reset(); if (_countSessionNameUpdate > 1) { - for (QList::iterator it(_clientFrames.begin()); it != _clientFrames.end(); ++it) { - (*it)->hide(); - (*it)->deleteLater(); + for (QList::iterator it(_clientFrames.begin()); it != _clientFrames.end(); ++it) + { + (*it)->hide(); + (*it)->deleteLater(); + } + _clientFrames.clear(); } - _clientFrames.clear(); } _sessionNameLabel->setText(tr("Session Name: %1 [click to edit]").arg(Global::sessionName())); } -- cgit v1.2.3-55-g7522 From 18564ae28f17b447ccd14a98743ebcb195138dae Mon Sep 17 00:00:00 2001 From: Björn Hagemeister Date: Tue, 5 Aug 2014 15:36:12 +0200 Subject: Started including button for reloading room configuration by choosing your own room first. Is not working right now. --- TODO | 2 + gui/server_normal/mainwindow.ui | 13 +++++ gui/server_normal/reloadroom.ui | 61 +++++++++++++++++++++++ icons/refresh.svg | Bin 0 -> 8103 bytes pvsmgr.qrc | 1 + src/server/mainwindow/mainwindow.cpp | 11 ++++ src/server/mainwindow/mainwindow.h | 4 ++ src/server/reloadroomwindow/reloadroomwindow.cpp | 29 +++++++++++ src/server/reloadroomwindow/reloadroomwindow.h | 29 +++++++++++ 9 files changed, 150 insertions(+) create mode 100644 gui/server_normal/reloadroom.ui create mode 100644 icons/refresh.svg create mode 100644 src/server/reloadroomwindow/reloadroomwindow.cpp create mode 100644 src/server/reloadroomwindow/reloadroomwindow.h (limited to 'TODO') diff --git a/TODO b/TODO index e9ac78e..04d93a8 100644 --- a/TODO +++ b/TODO @@ -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 @@ + @@ -221,6 +222,18 @@ true + + + + :/refresh:/refresh + + + Reload Room Configuration + + + Reload Room Configuration + + 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 @@ + + + ScrollArea + + + + 0 + 0 + 400 + 300 + + + + ScrollArea + + + true + + + + + 0 + 0 + 398 + 298 + + + + + + 60 + 10 + 281 + 20 + + + + Choose room configuration to reload: + + + + + + 210 + 260 + 181 + 27 + + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + true + + + + + + + diff --git a/icons/refresh.svg b/icons/refresh.svg new file mode 100644 index 0000000..e499882 Binary files /dev/null and b/icons/refresh.svg differ diff --git a/pvsmgr.qrc b/pvsmgr.qrc index 40df258..ad2f845 100644 --- a/pvsmgr.qrc +++ b/pvsmgr.qrc @@ -16,6 +16,7 @@ icons/student2tutor_extension.svg icons/help.svg icons/trash.svg + icons/refresh.svg AUTHORS TRANSLATION build/pvsmgr_de_DE.qm 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> 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 > > _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 + +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 -- cgit v1.2.3-55-g7522 From 174320e9571e02bc9173c73d063043dcc1a9c73d Mon Sep 17 00:00:00 2001 From: Björn Hagemeister Date: Tue, 26 Aug 2014 14:44:27 +0200 Subject: Updated TODO - List. --- TODO | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'TODO') diff --git a/TODO b/TODO index 04d93a8..359ce02 100644 --- a/TODO +++ b/TODO @@ -10,7 +10,7 @@ zu kompliziert für Nutzer? --------------------------- P V S M G R ---------------------------------------- -[ ] Button plus Auswahlmenü für Räume. Idee: falls alles durcheinander, neue +[x] Button plus Auswahlmenü für Räume. Idee: falls alles durcheinander, neue Raumauswahl --> Startconfig wird geladen. [ ] ConnectionFrame -> ComputerID ist schwachsinn. Wirklich sinnvoll wären -- cgit v1.2.3-55-g7522