diff options
author | Björn Hagemeister | 2014-07-29 16:15:23 +0200 |
---|---|---|
committer | Björn Hagemeister | 2014-07-29 16:15:23 +0200 |
commit | 7e47620ad777576b938f0fb8c0498ba0982e3bd9 (patch) | |
tree | c94c88ffe017b554e30f9c016e2a3d6856f8c75d /src/server/mainwindow/mainwindow.cpp | |
parent | Fixed, deleting clients after SessionNameUpdate. (diff) | |
download | pvs2-7e47620ad777576b938f0fb8c0498ba0982e3bd9.tar.gz pvs2-7e47620ad777576b938f0fb8c0498ba0982e3bd9.tar.xz pvs2-7e47620ad777576b938f0fb8c0498ba0982e3bd9.zip |
Added user warning before second or more change of sessionName.
Diffstat (limited to 'src/server/mainwindow/mainwindow.cpp')
-rw-r--r-- | src/server/mainwindow/mainwindow.cpp | 24 |
1 files changed, 18 insertions, 6 deletions
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())); } |