UICommon: Add AutoUpdate module + placeholder Qt implementation

The AutoUpdate module is a generic update checker mechanism which can be
used by UI backends to trigger an auto-update check as well as the
actual update process.

Currently only configurable through .ini and the Qt implementation is
completely placeholder-y -- blocking the main thread on a network
request on startup, etc.
This commit is contained in:
Pierre Bourdon 2018-03-17 17:22:05 -07:00
parent 37902c4aa4
commit 66b41c5509
7 changed files with 244 additions and 1 deletions

View file

@ -23,6 +23,7 @@
#include "Common/MsgHandler.h"
#include "Common/NandPaths.h"
#include "Common/StringUtil.h"
#include "Common/scmrev.h"
#include "Core/Analytics.h"
#include "Core/Boot/Boot.h"
@ -90,6 +91,7 @@ void SConfig::SaveSettings()
SaveNetworkSettings(ini);
SaveBluetoothPassthroughSettings(ini);
SaveUSBPassthroughSettings(ini);
SaveAutoUpdateSettings(ini);
ini.Save(File::GetUserPath(F_DOLPHINCONFIG_IDX));
@ -370,6 +372,14 @@ void SConfig::SaveUSBPassthroughSettings(IniFile& ini)
section->Set("Devices", devices_string);
}
void SConfig::SaveAutoUpdateSettings(IniFile& ini)
{
IniFile::Section* section = ini.GetOrCreateSection("AutoUpdate");
section->Set("TrackForTesting", m_auto_update_track);
section->Set("HashOverride", m_auto_update_hash_override);
}
void SConfig::LoadSettings()
{
Config::Load();
@ -391,6 +401,7 @@ void SConfig::LoadSettings()
LoadAnalyticsSettings(ini);
LoadBluetoothPassthroughSettings(ini);
LoadUSBPassthroughSettings(ini);
LoadAutoUpdateSettings(ini);
}
void SConfig::LoadGeneralSettings(IniFile& ini)
@ -671,6 +682,15 @@ void SConfig::LoadUSBPassthroughSettings(IniFile& ini)
}
}
void SConfig::LoadAutoUpdateSettings(IniFile& ini)
{
IniFile::Section* section = ini.GetOrCreateSection("AutoUpdate");
// TODO: Rename and default to SCM_UPDATE_TRACK_STR when ready for general consumption.
section->Get("TrackForTesting", &m_auto_update_track, "");
section->Get("HashOverride", &m_auto_update_hash_override, "");
}
void SConfig::ResetRunningGameMetadata()
{
SetRunningGameMetadata("00000000", 0, 0, Core::TitleDatabase::TitleType::Other);