From a34565727b6eba66cf20d32f3ec2ad073f29f9e1 Mon Sep 17 00:00:00 2001 From: flodavid Date: Tue, 25 Jul 2023 22:31:39 +0200 Subject: 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 --- src/yuzu/main.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/yuzu/main.h') 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 #include +#include #include #include @@ -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 @@ -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; std::unique_ptr system; -- cgit v1.2.3