diff options
author | flodavid <fl.david.53@gmail.com> | 2023-07-25 22:31:39 +0200 |
---|---|---|
committer | flodavid <fl.david.53@gmail.com> | 2023-10-12 01:51:52 +0200 |
commit | a34565727b6eba66cf20d32f3ec2ad073f29f9e1 (patch) | |
tree | 9263279b90c2241c2f28d54051f95c05e3ec1f24 /src/yuzu/main.h | |
parent | da6824d9fd35ab19e4a9c51d0139add9fe127c13 (diff) |
yuzu: Enable to use controller to close a game
- Add General setting to choose if a confirm dialog is shown when stopping
- Show the right confirm dialog if wanted
- Reuse dialog window that ask to close the game
- Add "L + Plus + Minus" default shortcut to Stop emulation
- Create generic question dialog based on TAS dialog
- It allows controller interaction on most dialogs
Diffstat (limited to 'src/yuzu/main.h')
-rw-r--r-- | src/yuzu/main.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/yuzu/main.h b/src/yuzu/main.h index 2346eb3bd..711c53a32 100644 --- a/src/yuzu/main.h +++ b/src/yuzu/main.h @@ -7,6 +7,7 @@ #include <optional> #include <QMainWindow> +#include <QMessageBox> #include <QTimer> #include <QTranslator> @@ -15,6 +16,7 @@ #include "input_common/drivers/tas_input.h" #include "yuzu/compatibility_list.h" #include "yuzu/hotkeys.h" +#include "yuzu/util/controller_navigation.h" #ifdef __unix__ #include <QVariant> @@ -431,6 +433,17 @@ private: const std::string& command, const std::string& arguments, const std::string& categories, const std::string& keywords); + /** + * Mimic the behavior of QMessageBox::question but link controller navigation to the dialog + * The only difference is that it returns a boolean. + * + * @returns true if buttons contains QMessageBox::Yes and the user clicks on the "Yes" button. + */ + bool question(QWidget* parent, const QString& title, const QString& text, + QMessageBox::StandardButtons buttons = + QMessageBox::StandardButtons(QMessageBox::Yes | QMessageBox::No), + QMessageBox::StandardButton defaultButton = QMessageBox::NoButton); + std::unique_ptr<Ui::MainWindow> ui; std::unique_ptr<Core::System> system; |