From d6f4b76157d658b5d5c18438d32f5121938f6864 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 1 Aug 2018 17:28:37 +0200 Subject: [server] Fix exit button confirmation MessageBox Just showing a single button called "Ok" is rather pointless... Closes #3398 --- src/server/mainwindow/mainwindow.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/server/mainwindow/mainwindow.cpp b/src/server/mainwindow/mainwindow.cpp index a74e449..5e703a1 100644 --- a/src/server/mainwindow/mainwindow.cpp +++ b/src/server/mainwindow/mainwindow.cpp @@ -435,11 +435,13 @@ ConnectionFrame* MainWindow::getSelectedFrame() */ void MainWindow::closeEvent(QCloseEvent* e) { - int ret = QMessageBox::question(this, "Question", "Are you sure you want to exit?", 0, 1, 2); - if (ret == 1) + QMessageBox::StandardButton ret = QMessageBox::question(this, tr("Question"), tr("Are you sure you want to exit?"), + QMessageBox::Yes | QMessageBox::No, QMessageBox::No); + if (ret == QMessageBox::Yes) { QApplication::exit(0); - else + } else { e->ignore(); + } } /***************************************************************************//** -- cgit v1.2.3-55-g7522