From 50a59487eb49baa229d553dd9a3c00aef20f799f Mon Sep 17 00:00:00 2001 From: Liam Date: Sat, 25 Mar 2023 13:29:08 -0400 Subject: qt: implement RequestExit for applets --- src/yuzu/applets/qt_profile_select.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/yuzu/applets/qt_profile_select.cpp') diff --git a/src/yuzu/applets/qt_profile_select.cpp b/src/yuzu/applets/qt_profile_select.cpp index 4145c5299..c0a1d5ab7 100644 --- a/src/yuzu/applets/qt_profile_select.cpp +++ b/src/yuzu/applets/qt_profile_select.cpp @@ -157,17 +157,26 @@ void QtProfileSelectionDialog::SelectUser(const QModelIndex& index) { QtProfileSelector::QtProfileSelector(GMainWindow& parent) { connect(this, &QtProfileSelector::MainWindowSelectProfile, &parent, &GMainWindow::ProfileSelectorSelectProfile, Qt::QueuedConnection); + connect(this, &QtProfileSelector::MainWindowRequestExit, &parent, + &GMainWindow::ProfileSelectorRequestExit, Qt::QueuedConnection); connect(&parent, &GMainWindow::ProfileSelectorFinishedSelection, this, &QtProfileSelector::MainWindowFinishedSelection, Qt::DirectConnection); } QtProfileSelector::~QtProfileSelector() = default; +void QtProfileSelector::Close() const { + callback = {}; + emit MainWindowRequestExit(); +} + void QtProfileSelector::SelectProfile(SelectProfileCallback callback_) const { callback = std::move(callback_); emit MainWindowSelectProfile(); } void QtProfileSelector::MainWindowFinishedSelection(std::optional uuid) { - callback(uuid); + if (callback) { + callback(uuid); + } } -- cgit v1.2.3