mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
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.
This commit is contained in:
@ -51,6 +51,7 @@
|
||||
|
||||
#include "DolphinQt/AboutDialog.h"
|
||||
#include "DolphinQt/Host.h"
|
||||
#include "DolphinQt/QtUtils/DolphinFileDialog.h"
|
||||
#include "DolphinQt/QtUtils/ModalMessageBox.h"
|
||||
#include "DolphinQt/QtUtils/ParallelProgressDialog.h"
|
||||
#include "DolphinQt/Settings.h"
|
||||
@ -1029,8 +1030,8 @@ void MenuBar::UpdateToolsMenu(bool emulation_started)
|
||||
|
||||
void MenuBar::InstallWAD()
|
||||
{
|
||||
QString wad_file = QFileDialog::getOpenFileName(this, tr("Select a title to install to NAND"),
|
||||
QString(), tr("WAD files (*.wad)"));
|
||||
QString wad_file = DolphinFileDialog::getOpenFileName(
|
||||
this, tr("Select a title to install to NAND"), QString(), tr("WAD files (*.wad)"));
|
||||
|
||||
if (wad_file.isEmpty())
|
||||
return;
|
||||
@ -1049,9 +1050,10 @@ void MenuBar::InstallWAD()
|
||||
|
||||
void MenuBar::ImportWiiSave()
|
||||
{
|
||||
QString file = QFileDialog::getOpenFileName(this, tr("Select the save file"), QDir::currentPath(),
|
||||
tr("Wii save files (*.bin);;"
|
||||
"All Files (*)"));
|
||||
QString file =
|
||||
DolphinFileDialog::getOpenFileName(this, tr("Select the save file"), QDir::currentPath(),
|
||||
tr("Wii save files (*.bin);;"
|
||||
"All Files (*)"));
|
||||
|
||||
if (file.isEmpty())
|
||||
return;
|
||||
@ -1093,7 +1095,7 @@ void MenuBar::ImportWiiSave()
|
||||
|
||||
void MenuBar::ExportWiiSaves()
|
||||
{
|
||||
const QString export_dir = QFileDialog::getExistingDirectory(
|
||||
const QString export_dir = DolphinFileDialog::getExistingDirectory(
|
||||
this, tr("Select Export Directory"), QString::fromStdString(File::GetUserPath(D_USER_IDX)),
|
||||
QFileDialog::ShowDirsOnly);
|
||||
if (export_dir.isEmpty())
|
||||
@ -1482,7 +1484,7 @@ void MenuBar::SaveSymbolMap()
|
||||
|
||||
void MenuBar::LoadOtherSymbolMap()
|
||||
{
|
||||
const QString file = QFileDialog::getOpenFileName(
|
||||
const QString file = DolphinFileDialog::getOpenFileName(
|
||||
this, tr("Load map file"), QString::fromStdString(File::GetUserPath(D_MAPS_IDX)),
|
||||
tr("Dolphin Map File (*.map)"));
|
||||
|
||||
@ -1498,7 +1500,7 @@ void MenuBar::LoadOtherSymbolMap()
|
||||
|
||||
void MenuBar::LoadBadSymbolMap()
|
||||
{
|
||||
const QString file = QFileDialog::getOpenFileName(
|
||||
const QString file = DolphinFileDialog::getOpenFileName(
|
||||
this, tr("Load map file"), QString::fromStdString(File::GetUserPath(D_MAPS_IDX)),
|
||||
tr("Dolphin Map File (*.map)"));
|
||||
|
||||
@ -1515,7 +1517,7 @@ void MenuBar::LoadBadSymbolMap()
|
||||
void MenuBar::SaveSymbolMapAs()
|
||||
{
|
||||
const std::string& title_id_str = SConfig::GetInstance().m_debugger_game_id;
|
||||
const QString file = QFileDialog::getSaveFileName(
|
||||
const QString file = DolphinFileDialog::getSaveFileName(
|
||||
this, tr("Save map file"),
|
||||
QString::fromStdString(File::GetUserPath(D_MAPS_IDX) + "/" + title_id_str + ".map"),
|
||||
tr("Dolphin Map File (*.map)"));
|
||||
@ -1568,8 +1570,8 @@ void MenuBar::CreateSignatureFile()
|
||||
this, tr("Input"), tr("Only export symbols with prefix:\n(Blank for all symbols)"),
|
||||
QLineEdit::Normal, QString{}, nullptr, Qt::WindowCloseButtonHint);
|
||||
|
||||
const QString file = QFileDialog::getSaveFileName(this, tr("Save signature file"),
|
||||
QDir::homePath(), GetSignatureSelector());
|
||||
const QString file = DolphinFileDialog::getSaveFileName(this, tr("Save signature file"),
|
||||
QDir::homePath(), GetSignatureSelector());
|
||||
if (file.isEmpty())
|
||||
return;
|
||||
|
||||
@ -1593,8 +1595,8 @@ void MenuBar::AppendSignatureFile()
|
||||
this, tr("Input"), tr("Only append symbols with prefix:\n(Blank for all symbols)"),
|
||||
QLineEdit::Normal, QString{}, nullptr, Qt::WindowCloseButtonHint);
|
||||
|
||||
const QString file = QFileDialog::getSaveFileName(this, tr("Append signature to"),
|
||||
QDir::homePath(), GetSignatureSelector());
|
||||
const QString file = DolphinFileDialog::getSaveFileName(this, tr("Append signature to"),
|
||||
QDir::homePath(), GetSignatureSelector());
|
||||
if (file.isEmpty())
|
||||
return;
|
||||
|
||||
@ -1616,8 +1618,8 @@ void MenuBar::AppendSignatureFile()
|
||||
|
||||
void MenuBar::ApplySignatureFile()
|
||||
{
|
||||
const QString file = QFileDialog::getOpenFileName(this, tr("Apply signature file"),
|
||||
QDir::homePath(), GetSignatureSelector());
|
||||
const QString file = DolphinFileDialog::getOpenFileName(this, tr("Apply signature file"),
|
||||
QDir::homePath(), GetSignatureSelector());
|
||||
|
||||
if (file.isEmpty())
|
||||
return;
|
||||
@ -1633,18 +1635,18 @@ void MenuBar::ApplySignatureFile()
|
||||
|
||||
void MenuBar::CombineSignatureFiles()
|
||||
{
|
||||
const QString priorityFile = QFileDialog::getOpenFileName(
|
||||
const QString priorityFile = DolphinFileDialog::getOpenFileName(
|
||||
this, tr("Choose priority input file"), QDir::homePath(), GetSignatureSelector());
|
||||
if (priorityFile.isEmpty())
|
||||
return;
|
||||
|
||||
const QString secondaryFile = QFileDialog::getOpenFileName(
|
||||
const QString secondaryFile = DolphinFileDialog::getOpenFileName(
|
||||
this, tr("Choose secondary input file"), QDir::homePath(), GetSignatureSelector());
|
||||
if (secondaryFile.isEmpty())
|
||||
return;
|
||||
|
||||
const QString saveFile = QFileDialog::getSaveFileName(this, tr("Save combined output file as"),
|
||||
QDir::homePath(), GetSignatureSelector());
|
||||
const QString saveFile = DolphinFileDialog::getSaveFileName(
|
||||
this, tr("Save combined output file as"), QDir::homePath(), GetSignatureSelector());
|
||||
if (saveFile.isEmpty())
|
||||
return;
|
||||
|
||||
|
Reference in New Issue
Block a user