mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-06-17 19:45:45 -04:00
Qt: Show dialog on startup for settings version mismatch
For the QMessageBox to appear, error reporting is performed again after main window creation.
This commit is contained in:
@ -1995,8 +1995,10 @@ void CommonHostInterface::CheckSettings(SettingsInterface& si)
|
||||
if (settings_version == SETTINGS_VERSION)
|
||||
return;
|
||||
|
||||
ReportFormattedError("Settings version %d does not match expected version %d, resetting", settings_version,
|
||||
SETTINGS_VERSION);
|
||||
m_settings_version_mismatch_str = StringUtil::StdStringFromFormat(
|
||||
"Settings version %d does not match expected version %d, resetting", settings_version, SETTINGS_VERSION);
|
||||
ReportError(m_settings_version_mismatch_str.c_str());
|
||||
|
||||
si.Clear();
|
||||
si.SetIntValue("Main", "SettingsVersion", SETTINGS_VERSION);
|
||||
SetDefaultSettings(si);
|
||||
@ -2101,6 +2103,11 @@ void CommonHostInterface::CheckForSettingsChanges(const Settings& old_settings)
|
||||
UpdateInputMap();
|
||||
}
|
||||
|
||||
const std::string& CommonHostInterface::GetSettingsVersionMismatchString() const
|
||||
{
|
||||
return m_settings_version_mismatch_str;
|
||||
}
|
||||
|
||||
void CommonHostInterface::SetTimerResolutionIncreased(bool enabled)
|
||||
{
|
||||
if (m_timer_resolution_increased == enabled)
|
||||
|
@ -174,6 +174,10 @@ public:
|
||||
/// Reloads post processing shaders with the current configuration.
|
||||
void ReloadPostProcessingShaders();
|
||||
|
||||
/// Returns an empty string if no settings version mismatch was detected, non-empty otherwise. Should not be called
|
||||
/// before CheckSettings(SettingsInterface& si).
|
||||
const std::string& GetSettingsVersionMismatchString() const;
|
||||
|
||||
protected:
|
||||
enum : u32
|
||||
{
|
||||
@ -371,6 +375,8 @@ private:
|
||||
// running in batch mode? i.e. exit after stopping emulation
|
||||
bool m_batch_mode = false;
|
||||
|
||||
std::string m_settings_version_mismatch_str;
|
||||
|
||||
#ifdef WITH_DISCORD_PRESENCE
|
||||
// discord rich presence
|
||||
bool m_discord_presence_enabled = false;
|
||||
|
Reference in New Issue
Block a user