mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 22:29:39 -06:00
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:
38
Source/Core/UICommon/AutoUpdate.h
Normal file
38
Source/Core/UICommon/AutoUpdate.h
Normal file
@ -0,0 +1,38 @@
|
||||
// Copyright 2018 Dolphin Emulator Project
|
||||
// Licensed under GPLv2+
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
||||
// This class defines all the logic for Dolphin auto-update checking. UI-specific elements have to
|
||||
// be defined in a backend specific subclass.
|
||||
class AutoUpdateChecker
|
||||
{
|
||||
public:
|
||||
// Initiates a check for updates in the background. Calls the OnUpdateAvailable callback if an
|
||||
// update is available, does "nothing" otherwise.
|
||||
void CheckForUpdate();
|
||||
|
||||
struct NewVersionInformation
|
||||
{
|
||||
// Name (5.0-1234) and revision hash of the new version.
|
||||
std::string new_shortrev;
|
||||
std::string new_hash;
|
||||
|
||||
// The full changelog in HTML format.
|
||||
std::string changelog_html;
|
||||
|
||||
// Internals, to be passed to the updater binary.
|
||||
std::string this_manifest_url;
|
||||
std::string next_manifest_url;
|
||||
std::string content_store_url;
|
||||
};
|
||||
|
||||
// Starts the updater process, which will wait in the background until the current process exits.
|
||||
void TriggerUpdate(const NewVersionInformation& info);
|
||||
|
||||
protected:
|
||||
virtual void OnUpdateAvailable(const NewVersionInformation& info) = 0;
|
||||
};
|
Reference in New Issue
Block a user