summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinQt/Settings/USBDeviceAddToWhitelistDialog.cpp
diff options
context:
space:
mode:
authorMat M <mathew1800@gmail.com>2019-03-04 17:40:27 -0500
committerGitHub <noreply@github.com>2019-03-04 17:40:27 -0500
commit147f7ca3213aef22dfe45bfab86e2d221aa248bf (patch)
treeb32f19c11585ea4e1b205eb2e959e695636e5a19 /Source/Core/DolphinQt/Settings/USBDeviceAddToWhitelistDialog.cpp
parenta59010fa29ab10ca031bea87fc5df165e70e2dff (diff)
parent70da86f1c3c933ce28d122f95f34ff6c24f89d80 (diff)
Merge pull request #7849 from spycrab/qt_modal_again
Qt: Make every messagebox modal
Diffstat (limited to 'Source/Core/DolphinQt/Settings/USBDeviceAddToWhitelistDialog.cpp')
-rw-r--r--Source/Core/DolphinQt/Settings/USBDeviceAddToWhitelistDialog.cpp15
1 files changed, 4 insertions, 11 deletions
diff --git a/Source/Core/DolphinQt/Settings/USBDeviceAddToWhitelistDialog.cpp b/Source/Core/DolphinQt/Settings/USBDeviceAddToWhitelistDialog.cpp
index 05811bc34b..1340fccb14 100644
--- a/Source/Core/DolphinQt/Settings/USBDeviceAddToWhitelistDialog.cpp
+++ b/Source/Core/DolphinQt/Settings/USBDeviceAddToWhitelistDialog.cpp
@@ -13,7 +13,6 @@
#include <QLabel>
#include <QLineEdit>
#include <QListWidget>
-#include <QMessageBox>
#include <QPushButton>
#include <QTimer>
#include <QVBoxLayout>
@@ -23,6 +22,7 @@
#include "Core/ConfigManager.h"
+#include "DolphinQt/QtUtils/ModalMessageBox.h"
#include "DolphinQt/Settings/WiiPane.h"
#include "UICommon/USBUtils.h"
@@ -129,9 +129,8 @@ void USBDeviceAddToWhitelistDialog::AddUSBDeviceToWhitelist()
if (!IsValidUSBIDString(vid_string))
{
// i18n: Here, VID means Vendor ID (for a USB device).
- QMessageBox vid_warning_box(this);
+ ModalMessageBox vid_warning_box(this);
vid_warning_box.setIcon(QMessageBox::Warning);
- vid_warning_box.setWindowModality(Qt::WindowModal);
vid_warning_box.setWindowTitle(tr("USB Whitelist Error"));
// i18n: Here, VID means Vendor ID (for a USB device).
vid_warning_box.setText(tr("The entered VID is invalid."));
@@ -142,9 +141,8 @@ void USBDeviceAddToWhitelistDialog::AddUSBDeviceToWhitelist()
if (!IsValidUSBIDString(pid_string))
{
// i18n: Here, PID means Product ID (for a USB device).
- QMessageBox pid_warning_box(this);
+ ModalMessageBox pid_warning_box(this);
pid_warning_box.setIcon(QMessageBox::Warning);
- pid_warning_box.setWindowModality(Qt::WindowModal);
pid_warning_box.setWindowTitle(tr("USB Whitelist Error"));
// i18n: Here, PID means Product ID (for a USB device).
pid_warning_box.setText(tr("The entered PID is invalid."));
@@ -158,12 +156,7 @@ void USBDeviceAddToWhitelistDialog::AddUSBDeviceToWhitelist()
if (SConfig::GetInstance().IsUSBDeviceWhitelisted({vid, pid}))
{
- QMessageBox error_box(this);
- error_box.setIcon(QMessageBox::Warning);
- error_box.setWindowModality(Qt::WindowModal);
- error_box.setWindowTitle(tr("USB Whitelist Error"));
- error_box.setText(tr("This USB device is already whitelisted."));
- error_box.exec();
+ ModalMessageBox::critical(this, tr("Error"), tr("This USB device is already whitelisted."));
return;
}
SConfig::GetInstance().m_usb_passthrough_devices.emplace(vid, pid);