summaryrefslogtreecommitdiffstats
path: root/src/server/mainwindow/mainwindow.cpp
diff options
context:
space:
mode:
authorChristian Klinger2016-04-27 17:54:11 +0200
committerChristian Klinger2016-04-27 17:54:11 +0200
commitb00f462eb861873feb78cae9a72ceb1fa796992a (patch)
treed21a0809bd41e0b666de2efb07a576fd4bc5a38b /src/server/mainwindow/mainwindow.cpp
parentremoved trashbin. (diff)
downloadpvs2-b00f462eb861873feb78cae9a72ceb1fa796992a.tar.gz
pvs2-b00f462eb861873feb78cae9a72ceb1fa796992a.tar.xz
pvs2-b00f462eb861873feb78cae9a72ceb1fa796992a.zip
delete button in the toolbar.
Diffstat (limited to 'src/server/mainwindow/mainwindow.cpp')
-rw-r--r--src/server/mainwindow/mainwindow.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/server/mainwindow/mainwindow.cpp b/src/server/mainwindow/mainwindow.cpp
index 7d27434..3719d2a 100644
--- a/src/server/mainwindow/mainwindow.cpp
+++ b/src/server/mainwindow/mainwindow.cpp
@@ -110,6 +110,7 @@ MainWindow::MainWindow(QString ipListUrl, QWidget* parent) :
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()));
+ connect(ui->action_DeleteClient, SIGNAL(triggered()), this, SLOT(onDeleteClient()));
/* Stuff for the button lock */
//Setup a timeout
@@ -1320,3 +1321,32 @@ void MainWindow::EnableButtons()
foreach (QAction* a, _lockingButtons)
a->setEnabled(true);
}
+
+
+void MainWindow::onDeleteClient() {
+ // If no frame is selected, warning.
+ ConnectionFrame* frame = getSelectedFrame();
+ if (frame == NULL) {
+ QMessageBox::critical(this, tr("Selection"), tr("No client is selected."));
+ return;
+ }
+ if (frame->client() != NULL) {
+ QMessageBox::critical(this, tr("Selection"), tr("This client is still connected."));
+ return;
+ } else {
+ qDebug() << "Now delete the client";
+ int ret = QMessageBox::question(this, "Warning", tr("Sure, You want to delete selected client?"), 0, 1, 2);
+ if (ret == 1) {
+ frame->hide();
+ frame->deleteLater();
+ _clientFrames.removeOne(frame);
+ return;
+ } else {
+ frame->move(frame->getPreviousPosition());
+ return;
+ }
+ }
+
+
+
+}