rpcsx/rpcs3/rpcs3qt/update_manager.h

37 lines
763 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
std::string m_request_url;
2019-09-11 09:55:43 +02:00
std::string m_expected_hash;
u64 m_expected_size = 0;
bool handle_json(bool automatic, bool check_only, const QByteArray& data);
bool handle_rpcs3(const QByteArray& data);
2019-09-11 09:55:43 +02:00
public:
2021-04-07 23:05:18 +02:00
update_manager() = default;
void check_for_updates(bool automatic, bool check_only, QWidget* parent = nullptr);
void update();
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
};