mirror-chatterino2/src/singletons/updatemanager.hpp

37 lines
839 B
C++
Raw Normal View History

2018-04-19 22:16:55 +02:00
#pragma once
2018-05-06 14:16:41 +02:00
#include <QString>
2018-04-19 22:16:55 +02:00
#include <pajlada/signals/signal.hpp>
namespace chatterino {
namespace singletons {
class UpdateManager
{
UpdateManager();
public:
2018-06-01 14:20:46 +02:00
enum UpdateStatus { None, Searching, UpdateAvailable, NoUpdateAvailable, Error };
// fourtf: don't add this class to the application class
2018-04-19 22:16:55 +02:00
static UpdateManager &getInstance();
void checkForUpdates();
const QString &getCurrentVersion() const;
const QString &getOnlineVersion() const;
2018-06-01 14:20:46 +02:00
void installUpdates();
UpdateStatus getStatus() const;
2018-04-19 22:16:55 +02:00
2018-06-01 14:20:46 +02:00
pajlada::Signals::Signal<UpdateStatus> statusUpdated;
2018-04-19 22:16:55 +02:00
private:
2018-06-01 14:20:46 +02:00
QString currentVersion_;
QString onlineVersion_;
UpdateStatus status_ = None;
void setStatus_(UpdateStatus status);
2018-04-19 22:16:55 +02:00
};
} // namespace singletons
} // namespace chatterino