summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorSilent <zdanio95@gmail.com>2019-08-01 19:52:28 +0200
committerSilent <zdanio95@gmail.com>2019-08-01 22:27:36 +0200
commit3fe8ef4c1c430eef69a43a9561ba300a06aeca21 (patch)
tree472b90f1b7606f0abd2ed1f3fa4f5347743e0702 /Source
parentc70da390a76af650a44bdddd8f75083c54cebed6 (diff)
Make alert messages application modal and not window modal,
so assertions cannot be interrupted by terminating the application
Diffstat (limited to 'Source')
-rw-r--r--Source/Core/DolphinQt/Main.cpp2
-rw-r--r--Source/Core/DolphinQt/QtUtils/ModalMessageBox.cpp4
-rw-r--r--Source/Core/DolphinQt/QtUtils/ModalMessageBox.h2
3 files changed, 4 insertions, 4 deletions
diff --git a/Source/Core/DolphinQt/Main.cpp b/Source/Core/DolphinQt/Main.cpp
index ebbf53dd9e..e04832081c 100644
--- a/Source/Core/DolphinQt/Main.cpp
+++ b/Source/Core/DolphinQt/Main.cpp
@@ -39,7 +39,7 @@ static bool QtMsgAlertHandler(const char* caption, const char* text, bool yes_no
Common::MsgType style)
{
std::optional<bool> r = RunOnObject(QApplication::instance(), [&] {
- ModalMessageBox message_box(QApplication::activeWindow());
+ ModalMessageBox message_box(QApplication::activeWindow(), Qt::ApplicationModal);
message_box.setWindowTitle(QString::fromUtf8(caption));
message_box.setText(QString::fromUtf8(text));
diff --git a/Source/Core/DolphinQt/QtUtils/ModalMessageBox.cpp b/Source/Core/DolphinQt/QtUtils/ModalMessageBox.cpp
index a6b06bdf09..752cfb3af7 100644
--- a/Source/Core/DolphinQt/QtUtils/ModalMessageBox.cpp
+++ b/Source/Core/DolphinQt/QtUtils/ModalMessageBox.cpp
@@ -6,10 +6,10 @@
#include <QApplication>
-ModalMessageBox::ModalMessageBox(QWidget* parent)
+ModalMessageBox::ModalMessageBox(QWidget* parent, Qt::WindowModality modality)
: QMessageBox(parent != nullptr ? parent->window() : nullptr)
{
- setWindowModality(Qt::WindowModal);
+ setWindowModality(modality);
setWindowFlags(Qt::Sheet | Qt::WindowTitleHint | Qt::CustomizeWindowHint);
// No parent is still preferable to showing a hidden parent here.
diff --git a/Source/Core/DolphinQt/QtUtils/ModalMessageBox.h b/Source/Core/DolphinQt/QtUtils/ModalMessageBox.h
index 5eb3c597a3..14a7838968 100644
--- a/Source/Core/DolphinQt/QtUtils/ModalMessageBox.h
+++ b/Source/Core/DolphinQt/QtUtils/ModalMessageBox.h
@@ -10,7 +10,7 @@
class ModalMessageBox : public QMessageBox
{
public:
- explicit ModalMessageBox(QWidget* parent);
+ explicit ModalMessageBox(QWidget* parent, Qt::WindowModality modality = Qt::WindowModal);
static int critical(QWidget* parent, const QString& title, const QString& text,
StandardButtons buttons = Ok, StandardButton default_button = NoButton);