mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
46 lines
945 B
C++
46 lines
945 B
C++
#pragma once
|
|
|
|
#include <QString>
|
|
#include <pajlada/signals/signal.hpp>
|
|
|
|
namespace chatterino {
|
|
|
|
class UpdateManager
|
|
{
|
|
UpdateManager();
|
|
|
|
public:
|
|
enum UpdateStatus {
|
|
None,
|
|
Searching,
|
|
UpdateAvailable,
|
|
NoUpdateAvailable,
|
|
SearchFailed,
|
|
Downloading,
|
|
DownloadFailed,
|
|
WriteFileFailed,
|
|
};
|
|
|
|
// fourtf: don't add this class to the application class
|
|
static UpdateManager &getInstance();
|
|
|
|
void checkForUpdates();
|
|
const QString &getCurrentVersion() const;
|
|
const QString &getOnlineVersion() const;
|
|
void installUpdates();
|
|
UpdateStatus getStatus() const;
|
|
|
|
pajlada::Signals::Signal<UpdateStatus> statusUpdated;
|
|
|
|
private:
|
|
QString currentVersion_;
|
|
QString onlineVersion_;
|
|
UpdateStatus status_ = None;
|
|
|
|
QString updateUrl_;
|
|
|
|
void setStatus_(UpdateStatus status);
|
|
};
|
|
|
|
} // namespace chatterino
|