From 1bab65683eb941391cb8dc4bc88735cc2c972271 Mon Sep 17 00:00:00 2001 From: PatTheMav Date: Sat, 22 Oct 2022 16:57:37 +0200 Subject: [PATCH] frontend-plugins: Fix auto scene switcher not saving settings on close The `done` event does not emit a `closeEvent`, but saving is only implemented in that event handler. Changing this to `close` correctly triggers the default QWidget event and thus settings are saved. --- UI/frontend-plugins/frontend-tools/auto-scene-switcher.cpp | 3 ++- UI/frontend-plugins/frontend-tools/auto-scene-switcher.hpp | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/UI/frontend-plugins/frontend-tools/auto-scene-switcher.cpp b/UI/frontend-plugins/frontend-tools/auto-scene-switcher.cpp index d8f3985c9..f5e56078a 100644 --- a/UI/frontend-plugins/frontend-tools/auto-scene-switcher.cpp +++ b/UI/frontend-plugins/frontend-tools/auto-scene-switcher.cpp @@ -128,9 +128,10 @@ SceneSwitcher::SceneSwitcher(QWidget *parent) SetStopped(); loading = false; + connect(this, &QDialog::finished, this, &SceneSwitcher::finished); } -void SceneSwitcher::closeEvent(QCloseEvent *) +void SceneSwitcher::finished() { obs_frontend_save(); } diff --git a/UI/frontend-plugins/frontend-tools/auto-scene-switcher.hpp b/UI/frontend-plugins/frontend-tools/auto-scene-switcher.hpp index 4ab611783..74dc3af99 100644 --- a/UI/frontend-plugins/frontend-tools/auto-scene-switcher.hpp +++ b/UI/frontend-plugins/frontend-tools/auto-scene-switcher.hpp @@ -21,8 +21,6 @@ public: SceneSwitcher(QWidget *parent); - void closeEvent(QCloseEvent *event) override; - void SetStarted(); void SetStopped(); @@ -41,6 +39,7 @@ public slots: void on_noMatchSwitchScene_currentTextChanged(const QString &text); void on_checkInterval_valueChanged(int value); void on_toggleStartButton_clicked(); + void finished(); }; void GetWindowList(std::vector &windows);