mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-15 05:47:56 -07:00
839b04014e
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.
41 lines
1.6 KiB
C++
41 lines
1.6 KiB
C++
// Copyright 2021 Dolphin Emulator Project
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
#pragma once
|
|
|
|
#include "Core/HotkeyManager.h"
|
|
|
|
#include <QFileDialog>
|
|
#include <QObject>
|
|
#include <QString>
|
|
|
|
namespace DolphinFileDialog
|
|
{
|
|
class HotkeyDisabler final
|
|
{
|
|
public:
|
|
HotkeyDisabler() { HotkeyManagerEmu::Enable(false); }
|
|
~HotkeyDisabler() { HotkeyManagerEmu::Enable(true); }
|
|
};
|
|
|
|
QString getExistingDirectory(QWidget* parent = nullptr, const QString& caption = QString(),
|
|
const QString& dir = QString(),
|
|
QFileDialog::Options options = QFileDialog::ShowDirsOnly);
|
|
|
|
QString getOpenFileName(QWidget* parent = nullptr, const QString& caption = QString(),
|
|
const QString& dir = QString(), const QString& filter = QString(),
|
|
QString* selectedFilter = nullptr,
|
|
QFileDialog::Options options = QFileDialog::Options());
|
|
|
|
QStringList getOpenFileNames(QWidget* parent = nullptr, const QString& caption = QString(),
|
|
const QString& dir = QString(), const QString& filter = QString(),
|
|
QString* selectedFilter = nullptr,
|
|
QFileDialog::Options options = QFileDialog::Options());
|
|
|
|
QString getSaveFileName(QWidget* parent = nullptr, const QString& caption = QString(),
|
|
const QString& dir = QString(), const QString& filter = QString(),
|
|
QString* selectedFilter = nullptr,
|
|
QFileDialog::Options options = QFileDialog::Options());
|
|
|
|
} // namespace DolphinFileDialog
|