summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn Hagemeister2014-07-29 16:15:23 +0200
committerBjörn Hagemeister2014-07-29 16:15:23 +0200
commit7e47620ad777576b938f0fb8c0498ba0982e3bd9 (patch)
treec94c88ffe017b554e30f9c016e2a3d6856f8c75d
parentFixed, deleting clients after SessionNameUpdate. (diff)
downloadpvs2-7e47620ad777576b938f0fb8c0498ba0982e3bd9.tar.gz
pvs2-7e47620ad777576b938f0fb8c0498ba0982e3bd9.tar.xz
pvs2-7e47620ad777576b938f0fb8c0498ba0982e3bd9.zip
Added user warning before second or more change of sessionName.
-rw-r--r--TODO3
-rw-r--r--src/server/mainwindow/mainwindow.cpp24
2 files changed, 20 insertions, 7 deletions
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<ConnectionFrame*>::iterator it(_clientFrames.begin()); it != _clientFrames.end(); ++it)
{
- (*it)->hide();
- (*it)->deleteLater();
+ for (QList<ConnectionFrame*>::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()));
}