PrismLauncher/launcher/updater/prismupdater/UpdaterDialogs.h
Rachel Powers bee88b1c7f
feat(updater) select valid asset
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
2023-06-25 13:47:30 -07:00

54 lines
1.5 KiB
C++

#pragma once
#include <QDialog>
#include <QTreeWidgetItem>
#include "Version.h"
#include "updater/prismupdater/GitHubRelease.h"
namespace Ui {
class SelectReleaseDialog;
}
class SelectReleaseDialog : public QDialog {
Q_OBJECT
public:
explicit SelectReleaseDialog(const Version& cur_version, const QList<GitHubRelease>& releases, QWidget* parent = 0);
~SelectReleaseDialog();
void loadReleases();
void appendRelease(GitHubRelease const& release);
GitHubRelease selectedRelease() { return m_selectedRelease; }
private slots:
GitHubRelease getRelease(QTreeWidgetItem* item);
void selectionChanged(QTreeWidgetItem* current, QTreeWidgetItem* previous);
protected:
QList<GitHubRelease> m_releases;
GitHubRelease m_selectedRelease;
Version m_currentVersion;
Ui::SelectReleaseDialog* ui;
};
class SelectReleaseAssetDialog : public QDialog {
Q_OBJECT
public:
explicit SelectReleaseAssetDialog(const QList<GitHubReleaseAsset>& assets, QWidget* parent = 0);
~SelectReleaseAssetDialog();
void loadAssets();
void appendAsset(GitHubReleaseAsset const& asset);
GitHubReleaseAsset selectedAsset() { return m_selectedAsset; }
private slots:
GitHubReleaseAsset getAsset(QTreeWidgetItem* item);
void selectionChanged(QTreeWidgetItem* current, QTreeWidgetItem* previous);
protected:
QList<GitHubReleaseAsset> m_assets;
GitHubReleaseAsset m_selectedAsset;
Ui::SelectReleaseDialog* ui;
};