mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2026-03-21 17:49:58 -05:00
DolphinQt: Save when closing settings window
If Dolphin crashes, changes that have been made to settings are often lost. This has been a minor annoyance for me when developing, but it has become a much bigger issue recently due to the problem where Dolphin freezes on shutdown for ROG Ally users. Instead of saving the config when certain arbitrary settings are changed, let's save the config when the user closes the settings window.
This commit is contained in:
parent
239c4e444c
commit
d25ef67d6f
|
|
@ -210,3 +210,8 @@ void SettingsWindow::SelectPane(SettingsWindowPaneIndex index)
|
|||
{
|
||||
ActivatePane(std::to_underlying(index));
|
||||
}
|
||||
|
||||
void SettingsWindow::closeEvent(QCloseEvent*)
|
||||
{
|
||||
Config::Save();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,4 +60,6 @@ public:
|
|||
explicit SettingsWindow(MainWindow* parent);
|
||||
|
||||
void SelectPane(SettingsWindowPaneIndex);
|
||||
|
||||
void closeEvent(QCloseEvent* event) override;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@
|
|||
#include "Core/AchievementManager.h"
|
||||
#include "Core/Config/MainSettings.h"
|
||||
#include "Core/Config/UISettings.h"
|
||||
#include "Core/ConfigManager.h"
|
||||
#include "Core/Core.h"
|
||||
#include "Core/DolphinAnalytics.h"
|
||||
#include "Core/System.h"
|
||||
|
|
@ -117,7 +116,6 @@ void GeneralPane::ConnectLayout()
|
|||
connect(m_combobox_speedlimit, &QComboBox::currentIndexChanged, [this] {
|
||||
Config::SetBaseOrCurrent(Config::MAIN_EMULATION_SPEED,
|
||||
m_combobox_speedlimit->currentIndex() * 0.1f);
|
||||
Config::Save();
|
||||
});
|
||||
|
||||
connect(m_combobox_fallback_region, &QComboBox::currentIndexChanged, this,
|
||||
|
|
@ -339,7 +337,6 @@ void GeneralPane::OnSaveConfig()
|
|||
{
|
||||
Config::ConfigChangeCallbackGuard config_guard;
|
||||
|
||||
auto& settings = SConfig::GetInstance();
|
||||
if (AutoUpdateChecker::SystemSupportsAutoUpdates())
|
||||
{
|
||||
Settings::Instance().SetAutoUpdateTrack(
|
||||
|
|
@ -356,8 +353,6 @@ void GeneralPane::OnSaveConfig()
|
|||
#endif
|
||||
Settings::Instance().SetFallbackRegion(
|
||||
UpdateFallbackRegionFromIndex(m_combobox_fallback_region->currentIndex()));
|
||||
|
||||
settings.SaveSettings();
|
||||
}
|
||||
|
||||
#if defined(USE_ANALYTICS) && USE_ANALYTICS
|
||||
|
|
|
|||
|
|
@ -369,7 +369,6 @@ void WiiPane::OnUSBWhitelistAddButton()
|
|||
}
|
||||
whitelist.emplace(*usb_device);
|
||||
Config::SetUSBDeviceWhitelist(whitelist);
|
||||
Config::Save();
|
||||
PopulateUSBPassthroughListWidget();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user