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. --- src/server/mainwindow/mainwindow.cpp | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'src/server/mainwindow/mainwindow.cpp') 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