2023-06-25 22:21:55 +01:00
|
|
|
// SPDX-FileCopyrightText: 2023 Rachel Powers <508861+Ryex@users.noreply.github.com>
|
|
|
|
//
|
|
|
|
// SPDX-License-Identifier: GPL-3.0-only
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Prism Launcher - Minecraft Launcher
|
|
|
|
* Copyright (C) 2023 Rachel Powers <508861+Ryex@users.noreply.github.com>
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, version 3.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2023-05-31 07:03:44 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QDialog>
|
|
|
|
#include <QTreeWidgetItem>
|
|
|
|
|
2023-06-25 22:21:55 +01:00
|
|
|
#include "GitHubRelease.h"
|
2023-09-26 18:19:35 +01:00
|
|
|
#include "Version.h"
|
2023-05-31 07:03:44 +01:00
|
|
|
|
|
|
|
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;
|
|
|
|
};
|
2023-06-04 02:41:54 +01:00
|
|
|
|
|
|
|
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;
|
|
|
|
};
|