2019-09-08 22:27:57 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <pajlada/signals/signal.hpp>
|
Sort and force grouping of includes (#4172)
This change enforces strict include grouping using IncludeCategories
In addition to adding this to the .clang-format file and applying it in the tests/src and src directories, I also did the following small changes:
In ChatterSet.hpp, I changed lrucache to a <>include
In Irc2.hpp, I change common/SignalVector.hpp to a "project-include"
In AttachedWindow.cpp, NativeMessaging.cpp, WindowsHelper.hpp, BaseWindow.cpp, and StreamerMode.cpp, I disabled clang-format for the windows-includes
In WindowDescriptors.hpp, I added the missing vector include. It was previously not needed because the include was handled by another file that was previously included first.
clang-format minimum version has been bumped, so Ubuntu version used in the check-formatting job has been bumped to 22.04 (which is the latest LTS)
2022-11-27 19:32:53 +01:00
|
|
|
#include <QString>
|
2019-09-08 22:27:57 +02:00
|
|
|
|
|
|
|
namespace chatterino {
|
|
|
|
|
|
|
|
class Updates
|
|
|
|
{
|
|
|
|
Updates();
|
|
|
|
|
|
|
|
public:
|
|
|
|
enum Status {
|
|
|
|
None,
|
|
|
|
Searching,
|
|
|
|
UpdateAvailable,
|
|
|
|
NoUpdateAvailable,
|
|
|
|
SearchFailed,
|
|
|
|
Downloading,
|
|
|
|
DownloadFailed,
|
|
|
|
WriteFileFailed,
|
|
|
|
};
|
|
|
|
|
|
|
|
// fourtf: don't add this class to the application class
|
2019-10-07 22:42:34 +02:00
|
|
|
static Updates &instance();
|
2019-09-08 22:27:57 +02:00
|
|
|
|
2023-01-26 19:22:48 +01:00
|
|
|
static bool isDowngradeOf(const QString &online, const QString ¤t);
|
|
|
|
|
2019-09-08 22:27:57 +02:00
|
|
|
void checkForUpdates();
|
|
|
|
const QString &getCurrentVersion() const;
|
|
|
|
const QString &getOnlineVersion() const;
|
|
|
|
void installUpdates();
|
|
|
|
Status getStatus() const;
|
|
|
|
|
|
|
|
bool shouldShowUpdateButton() const;
|
|
|
|
bool isError() const;
|
2019-10-07 19:53:46 +02:00
|
|
|
bool isDowngrade() const;
|
2019-09-08 22:27:57 +02:00
|
|
|
|
|
|
|
pajlada::Signals::Signal<Status> statusUpdated;
|
|
|
|
|
|
|
|
private:
|
|
|
|
QString currentVersion_;
|
|
|
|
QString onlineVersion_;
|
|
|
|
Status status_ = None;
|
2019-10-07 19:53:46 +02:00
|
|
|
bool isDowngrade_{};
|
2019-09-08 22:27:57 +02:00
|
|
|
|
|
|
|
QString updateExe_;
|
|
|
|
QString updatePortable_;
|
|
|
|
QString updateGuideLink_;
|
|
|
|
|
|
|
|
void setStatus_(Status status);
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace chatterino
|