porymap/include/ui/updatepromoter.h
2024-01-21 12:01:31 -05:00

44 lines
908 B
C++

#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);
private slots:
void dialogButtonClicked(QAbstractButton *button);
signals:
void changedPreferences();
};
#endif // UPDATEPROMOTER_H