porymap/include/ui/updatepromoter.h

46 lines
966 B
C
Raw Normal View History

2024-01-21 07:00:28 +00:00
#ifndef UPDATEPROMOTER_H
#define UPDATEPROMOTER_H
#include <QDialog>
#include <QPushButton>
#include <QNetworkAccessManager>
#include <QNetworkReply>
namespace Ui {
class UpdatePromoter;
}
class UpdatePromoter : public QDialog
{
Q_OBJECT
public:
explicit UpdatePromoter(QWidget *parent, QNetworkAccessManager *manager);
~UpdatePromoter() {};
void checkForUpdates();
void requestDialog();
void updatePreferences();
private:
Ui::UpdatePromoter *ui;
QNetworkAccessManager *const manager;
QNetworkReply * reply = nullptr;
QPushButton * button_Downloads;
QString downloadLink;
QString changelog;
void resetDialog();
void processWebpage(const QJsonDocument &data);
void processError(const QString &err);
2024-01-21 23:41:23 +00:00
bool isNewerVersion(int major, int minor, int patch);
2024-01-21 07:00:28 +00:00
private slots:
void dialogButtonClicked(QAbstractButton *button);
signals:
void changedPreferences();
};
#endif // UPDATEPROMOTER_H