rpcsx/rpcs3/rpcs3qt/update_manager.h

46 lines
998 B
C
Raw Normal View History

2020-12-05 13:08:24 +01:00
#pragma once
2019-09-11 09:55:43 +02:00
#include "util/types.hpp"
#include <QObject>
#include <QByteArray>
2020-02-22 20:42:49 +01:00
#include <string>
class downloader;
2019-09-11 09:55:43 +02:00
class update_manager final : public QObject
2019-09-11 09:55:43 +02:00
{
2020-03-21 22:17:15 +01:00
Q_OBJECT
2019-09-11 09:55:43 +02:00
private:
downloader* m_downloader = nullptr;
QWidget* m_parent = nullptr;
2019-09-11 09:55:43 +02:00
// This message is empty if there is no download available
QString m_update_message;
2019-09-11 09:55:43 +02:00
2021-09-16 05:34:06 +02:00
struct changelog_data
{
QString version;
QString title;
};
std::vector<changelog_data> m_changelog;
std::string m_request_url;
2019-09-11 09:55:43 +02:00
std::string m_expected_hash;
std::string m_old_version;
std::string m_new_version;
2019-09-11 09:55:43 +02:00
u64 m_expected_size = 0;
2021-07-22 23:38:26 +02:00
bool handle_json(bool automatic, bool check_only, bool auto_accept, const QByteArray& data);
bool handle_rpcs3(const QByteArray& data, bool auto_accept);
2019-09-11 09:55:43 +02:00
public:
2021-04-07 23:05:18 +02:00
update_manager() = default;
2021-07-22 23:38:26 +02:00
void check_for_updates(bool automatic, bool check_only, bool auto_accept, QWidget* parent = nullptr);
void update(bool auto_accept);
2020-03-21 22:17:15 +01:00
Q_SIGNALS:
void signal_update_available(bool update_available);
2019-09-11 09:55:43 +02:00
};