From 839b04014e8152f136943a2ba1cc474a9c43abef Mon Sep 17 00:00:00 2001 From: sowens99 Date: Sat, 9 Oct 2021 22:28:59 -0400 Subject: Add wrapper function to disable hotkeys for QFileDialog Previously, if you have "Hotkeys Require Window Focus" disabled, you could repeatedly use the "Open" hotkey, for example, to stack File Open windows over top of each other over and over. This commit allows the hotkey manager to disable/enable on QFileDialog creation and destruction. --- Source/Core/DolphinQt/Config/FilesystemWidget.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'Source/Core/DolphinQt/Config/FilesystemWidget.cpp') diff --git a/Source/Core/DolphinQt/Config/FilesystemWidget.cpp b/Source/Core/DolphinQt/Config/FilesystemWidget.cpp index b830a2e015..d9d053f0b1 100644 --- a/Source/Core/DolphinQt/Config/FilesystemWidget.cpp +++ b/Source/Core/DolphinQt/Config/FilesystemWidget.cpp @@ -5,7 +5,6 @@ #include #include -#include #include #include #include @@ -23,6 +22,7 @@ #include "DiscIO/Filesystem.h" #include "DiscIO/Volume.h" +#include "DolphinQt/QtUtils/DolphinFileDialog.h" #include "DolphinQt/QtUtils/ModalMessageBox.h" #include "DolphinQt/QtUtils/ParallelProgressDialog.h" #include "DolphinQt/Resources.h" @@ -211,7 +211,8 @@ void FilesystemWidget::PopulateDirectory(int partition_id, QStandardItem* root, QString FilesystemWidget::SelectFolder() { - return QFileDialog::getExistingDirectory(this, QObject::tr("Choose the folder to extract to")); + return DolphinFileDialog::getExistingDirectory(this, + QObject::tr("Choose the folder to extract to")); } void FilesystemWidget::ShowContextMenu(const QPoint&) @@ -296,7 +297,7 @@ void FilesystemWidget::ShowContextMenu(const QPoint&) case EntryType::File: menu->addAction(tr("Extract File..."), this, [this, partition, path] { auto dest = - QFileDialog::getSaveFileName(this, tr("Save File to"), QFileInfo(path).fileName()); + DolphinFileDialog::getSaveFileName(this, tr("Save File to"), QFileInfo(path).fileName()); if (!dest.isEmpty()) ExtractFile(partition, path, dest); -- cgit v1.2.3