From 32b3ed0a1362a4b0798ad71fac3450fb77cb7e41 Mon Sep 17 00:00:00 2001 From: Thomas Groman Date: Thu, 19 Sep 2019 00:41:48 -0700 Subject: merged from 0.6.7 codebase --- application/pages/modplatform/FTBPage.h | 104 +++++++++++++++++++------------- 1 file changed, 63 insertions(+), 41 deletions(-) (limited to 'application/pages/modplatform/FTBPage.h') diff --git a/application/pages/modplatform/FTBPage.h b/application/pages/modplatform/FTBPage.h index 00c5e9c5..215252ee 100644 --- a/application/pages/modplatform/FTBPage.h +++ b/application/pages/modplatform/FTBPage.h @@ -1,4 +1,4 @@ -/* Copyright 2013-2018 MultiMC Contributors +/* Copyright 2013-2019 MultiMC Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,12 +16,15 @@ #pragma once #include +#include +#include #include "pages/BasePage.h" #include #include "tasks/Task.h" #include "modplatform/ftb/PackHelpers.h" #include "modplatform/ftb/FtbPackFetchTask.h" +#include "QObjectPtr.h" namespace Ui { @@ -31,62 +34,81 @@ class FTBPage; class FtbListModel; class FtbFilterModel; class NewInstanceDialog; +class FtbPrivatePackListModel; +class FtbPrivatePackFilterModel; +class FtbPrivatePackManager; class FTBPage : public QWidget, public BasePage { - Q_OBJECT + Q_OBJECT public: - explicit FTBPage(NewInstanceDialog * dialog, QWidget *parent = 0); - virtual ~FTBPage(); - QString displayName() const override - { - return tr("FTB Legacy"); - } - QIcon icon() const override - { - return MMC->getThemedIcon("ftb_logo"); - } - QString id() const override - { - return "ftb"; - } - QString helpPage() const override - { - return "FTB-platform"; - } - bool shouldDisplay() const override; - void openedImpl() override; + explicit FTBPage(NewInstanceDialog * dialog, QWidget *parent = 0); + virtual ~FTBPage(); + QString displayName() const override + { + return tr("FTB Legacy"); + } + QIcon icon() const override + { + return MMC->getThemedIcon("ftb_logo"); + } + QString id() const override + { + return "ftb"; + } + QString helpPage() const override + { + return "FTB-platform"; + } + bool shouldDisplay() const override; + void openedImpl() override; private: - void suggestCurrent(); - void onPackSelectionChanged(FtbModpack *pack = nullptr); + void suggestCurrent(); + void onPackSelectionChanged(FtbModpack *pack = nullptr); private slots: - void ftbPackDataDownloadSuccessfully(FtbModpackList publicPacks, FtbModpackList thirdPartyPacks); - void ftbPackDataDownloadFailed(QString reason); + void ftbPackDataDownloadSuccessfully(FtbModpackList publicPacks, FtbModpackList thirdPartyPacks); + void ftbPackDataDownloadFailed(QString reason); - void onSortingSelectionChanged(QString data); - void onVersionSelectionItemChanged(QString data); + void ftbPrivatePackDataDownloadSuccessfully(FtbModpack pack); + void ftbPrivatePackDataDownloadFailed(QString reason, QString packCode); - void onPublicPackSelectionChanged(QModelIndex first, QModelIndex second); - void onThirdPartyPackSelectionChanged(QModelIndex first, QModelIndex second); + void onSortingSelectionChanged(QString data); + void onVersionSelectionItemChanged(QString data); - void onTabChanged(int tab); + void onPublicPackSelectionChanged(QModelIndex first, QModelIndex second); + void onThirdPartyPackSelectionChanged(QModelIndex first, QModelIndex second); + void onPrivatePackSelectionChanged(QModelIndex first, QModelIndex second); + + void onTabChanged(int tab); + + void onAddPackClicked(); + void onRemovePackClicked(); private: - bool initialized = false; - FtbModpack selected; - QString selectedVersion; + FtbFilterModel* currentModel = nullptr; + QTreeView* currentList = nullptr; + QTextBrowser* currentModpackInfo = nullptr; + + bool initialized = false; + FtbModpack selected; + QString selectedVersion; + + FtbListModel* publicListModel = nullptr; + FtbFilterModel* publicFilterModel = nullptr; + + FtbListModel *thirdPartyModel = nullptr; + FtbFilterModel *thirdPartyFilterModel = nullptr; - FtbListModel* publicListModel = nullptr; - FtbFilterModel* publicFilterModel = nullptr; + FtbListModel *privateListModel = nullptr; + FtbFilterModel *privateFilterModel = nullptr; - FtbListModel *thirdPartyModel = nullptr; - FtbFilterModel *thirdPartyFilterModel = nullptr; + unique_qobject_ptr ftbFetchTask; + std::unique_ptr ftbPrivatePacks; - FtbPackFetchTask *ftbFetchTask = nullptr; - NewInstanceDialog* dialog = nullptr; + NewInstanceDialog* dialog = nullptr; - Ui::FTBPage *ui = nullptr; + Ui::FTBPage *ui = nullptr; }; -- cgit v1.2.3