mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-07-08 13:08:29 +02:00
add special modrinth header
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
parent
18924e43da
commit
ca721f9d67
18 changed files with 127 additions and 27 deletions
|
|
@ -185,7 +185,7 @@ void ResourceDownloadDialog::confirm()
|
|||
return;
|
||||
}
|
||||
for (const auto& dep : task->getDependecies()) {
|
||||
addResource(dep->pack, dep->version);
|
||||
addResource(dep->pack, dep->version, "dependency");
|
||||
depNames << dep->pack->name;
|
||||
}
|
||||
dependencyExtraInfo = task->getExtraInfo();
|
||||
|
|
@ -234,10 +234,10 @@ ResourcePage* ResourceDownloadDialog::selectedPage()
|
|||
return result;
|
||||
}
|
||||
|
||||
void ResourceDownloadDialog::addResource(ModPlatform::IndexedPack::Ptr pack, ModPlatform::IndexedVersion& ver)
|
||||
void ResourceDownloadDialog::addResource(ModPlatform::IndexedPack::Ptr pack, ModPlatform::IndexedVersion& ver, QString downloadReason)
|
||||
{
|
||||
removeResource(pack->name);
|
||||
selectedPage()->addResourceToPage(pack, ver, getBaseModel());
|
||||
selectedPage()->addResourceToPage(pack, ver, getBaseModel(), downloadReason);
|
||||
setButtonStatus();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ class ResourceDownloadDialog : public QDialog, public BasePageProvider {
|
|||
bool selectPage(QString pageId);
|
||||
ResourcePage* selectedPage();
|
||||
|
||||
void addResource(ModPlatform::IndexedPack::Ptr, ModPlatform::IndexedVersion&);
|
||||
void addResource(ModPlatform::IndexedPack::Ptr, ModPlatform::IndexedVersion&, QString downloadReason = "standalone");
|
||||
void removeResource(const QString&);
|
||||
|
||||
QList<DownloadTaskPtr> getTasks();
|
||||
|
|
|
|||
|
|
@ -234,7 +234,7 @@ void ResourceUpdateDialog::checkCandidates()
|
|||
auto changelog = dep->version.changelog;
|
||||
if (dep->pack->provider == ModPlatform::ResourceProvider::FLAME)
|
||||
changelog = api.getModFileChangelog(dep->version.addonId.toInt(), dep->version.fileId.toInt());
|
||||
auto download_task = makeShared<ResourceDownloadTask>(dep->pack, dep->version, m_resourceModel);
|
||||
auto download_task = makeShared<ResourceDownloadTask>(dep->pack, dep->version, m_resourceModel, true, "dependency");
|
||||
auto extraInfo = dependencyExtraInfo.value(dep->version.addonId.toString());
|
||||
CheckUpdateTask::Update updatable = {
|
||||
dep->pack->name, dep->version.hash, tr("Not installed"), dep->version.version, dep->version.version_type,
|
||||
|
|
|
|||
|
|
@ -112,10 +112,10 @@ QMap<QString, QString> ModPage::urlHandlers() const
|
|||
|
||||
/******** Make changes to the UI ********/
|
||||
|
||||
void ModPage::addResourceToPage(ModPlatform::IndexedPack::Ptr pack, ModPlatform::IndexedVersion& version, ResourceFolderModel* base_model)
|
||||
void ModPage::addResourceToPage(ModPlatform::IndexedPack::Ptr pack, ModPlatform::IndexedVersion& version, ResourceFolderModel* base_model, QString downloadReason)
|
||||
{
|
||||
bool is_indexed = !APPLICATION->settings()->get("ModMetadataDisabled").toBool();
|
||||
m_model->addPack(pack, version, base_model, is_indexed);
|
||||
m_model->addPack(pack, version, base_model, is_indexed, downloadReason);
|
||||
}
|
||||
|
||||
} // namespace ResourceDownload
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ class ModPage : public ResourcePage {
|
|||
|
||||
QMap<QString, QString> urlHandlers() const override;
|
||||
|
||||
void addResourceToPage(ModPlatform::IndexedPack::Ptr, ModPlatform::IndexedVersion&, ResourceFolderModel*) override;
|
||||
void addResourceToPage(ModPlatform::IndexedPack::Ptr, ModPlatform::IndexedVersion&, ResourceFolderModel*, QString downloadReason = "standalone") override;
|
||||
|
||||
virtual std::unique_ptr<ModFilterWidget> createFilterWidget() = 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -486,10 +486,11 @@ void ResourceModel::infoRequestSucceeded(ModPlatform::IndexedPack::Ptr pack, con
|
|||
void ResourceModel::addPack(ModPlatform::IndexedPack::Ptr pack,
|
||||
ModPlatform::IndexedVersion& version,
|
||||
ResourceFolderModel* packs,
|
||||
bool is_indexed)
|
||||
bool is_indexed,
|
||||
QString downloadReason)
|
||||
{
|
||||
version.is_currently_selected = true;
|
||||
m_selected.append(makeShared<ResourceDownloadTask>(pack, version, packs, is_indexed));
|
||||
m_selected.append(makeShared<ResourceDownloadTask>(pack, version, packs, is_indexed, downloadReason));
|
||||
}
|
||||
|
||||
void ResourceModel::removePack(const QString& rem)
|
||||
|
|
|
|||
|
|
@ -94,7 +94,8 @@ class ResourceModel : public QAbstractListModel {
|
|||
void addPack(ModPlatform::IndexedPack::Ptr pack,
|
||||
ModPlatform::IndexedVersion& version,
|
||||
ResourceFolderModel* packs,
|
||||
bool is_indexed = false);
|
||||
bool is_indexed = false,
|
||||
QString downloadReason = "standalone");
|
||||
void removePack(const QString& rem);
|
||||
QList<DownloadTaskPtr> selectedPacks() { return m_selected; }
|
||||
|
||||
|
|
|
|||
|
|
@ -395,7 +395,10 @@ void ResourcePage::removeResourceFromDialog(const QString& packName)
|
|||
m_parentDialog->removeResource(packName);
|
||||
}
|
||||
|
||||
void ResourcePage::addResourceToPage(ModPlatform::IndexedPack::Ptr pack, ModPlatform::IndexedVersion& ver, ResourceFolderModel* baseModel)
|
||||
void ResourcePage::addResourceToPage(ModPlatform::IndexedPack::Ptr pack,
|
||||
ModPlatform::IndexedVersion& ver,
|
||||
ResourceFolderModel* baseModel,
|
||||
QString downloadReason)
|
||||
{
|
||||
bool isIndexed = !APPLICATION->settings()->get("ModMetadataDisabled").toBool();
|
||||
m_model->addPack(std::move(pack), ver, baseModel, isIndexed);
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ class ResourcePage : public QWidget, public BasePage {
|
|||
void addResourceToDialog(ModPlatform::IndexedPack::Ptr, ModPlatform::IndexedVersion&);
|
||||
void removeResourceFromDialog(const QString& packName);
|
||||
virtual void removeResourceFromPage(const QString& name);
|
||||
virtual void addResourceToPage(ModPlatform::IndexedPack::Ptr, ModPlatform::IndexedVersion&, ResourceFolderModel*);
|
||||
virtual void addResourceToPage(ModPlatform::IndexedPack::Ptr, ModPlatform::IndexedVersion&, ResourceFolderModel*, QString downloadReason = "standalone");
|
||||
|
||||
virtual void modelReset();
|
||||
|
||||
|
|
|
|||
|
|
@ -44,10 +44,11 @@ QMap<QString, QString> ShaderPackResourcePage::urlHandlers() const
|
|||
|
||||
void ShaderPackResourcePage::addResourceToPage(ModPlatform::IndexedPack::Ptr pack,
|
||||
ModPlatform::IndexedVersion& version,
|
||||
ResourceFolderModel* base_model)
|
||||
ResourceFolderModel* base_model,
|
||||
QString downloadReason)
|
||||
{
|
||||
bool is_indexed = !APPLICATION->settings()->get("ModMetadataDisabled").toBool();
|
||||
m_model->addPack(pack, version, base_model, is_indexed);
|
||||
m_model->addPack(pack, version, base_model, is_indexed, downloadReason);
|
||||
}
|
||||
|
||||
} // namespace ResourceDownload
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ class ShaderPackResourcePage : public ResourcePage {
|
|||
|
||||
bool supportsFiltering() const override { return false; };
|
||||
|
||||
void addResourceToPage(ModPlatform::IndexedPack::Ptr, ModPlatform::IndexedVersion&, ResourceFolderModel*) override;
|
||||
void addResourceToPage(ModPlatform::IndexedPack::Ptr, ModPlatform::IndexedVersion&, ResourceFolderModel*, QString downloadReason = "standalone") override;
|
||||
|
||||
QMap<QString, QString> urlHandlers() const override;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue