qt: implement RequestExit for applets

This commit is contained in:
Liam
2023-03-25 13:29:08 -04:00
parent 950db851ea
commit 50a59487eb
38 changed files with 250 additions and 69 deletions

View File

@ -678,12 +678,19 @@ void QtControllerSelectorDialog::DisableUnsupportedPlayers() {
QtControllerSelector::QtControllerSelector(GMainWindow& parent) {
connect(this, &QtControllerSelector::MainWindowReconfigureControllers, &parent,
&GMainWindow::ControllerSelectorReconfigureControllers, Qt::QueuedConnection);
connect(this, &QtControllerSelector::MainWindowRequestExit, &parent,
&GMainWindow::ControllerSelectorRequestExit, Qt::QueuedConnection);
connect(&parent, &GMainWindow::ControllerSelectorReconfigureFinished, this,
&QtControllerSelector::MainWindowReconfigureFinished, Qt::QueuedConnection);
}
QtControllerSelector::~QtControllerSelector() = default;
void QtControllerSelector::Close() const {
callback = {};
emit MainWindowRequestExit();
}
void QtControllerSelector::ReconfigureControllers(
ReconfigureCallback callback_, const Core::Frontend::ControllerParameters& parameters) const {
callback = std::move(callback_);
@ -691,5 +698,7 @@ void QtControllerSelector::ReconfigureControllers(
}
void QtControllerSelector::MainWindowReconfigureFinished() {
callback();
if (callback) {
callback();
}
}