From 4e9039be2d3bc0357e6bfe577c5f2add8313f8d6 Mon Sep 17 00:00:00 2001 From: timoreo Date: Fri, 14 Jan 2022 09:43:42 +0100 Subject: Start of mod downloading --- launcher/ui/dialogs/ModDownloadDialog.h | 65 +++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 launcher/ui/dialogs/ModDownloadDialog.h (limited to 'launcher/ui/dialogs/ModDownloadDialog.h') diff --git a/launcher/ui/dialogs/ModDownloadDialog.h b/launcher/ui/dialogs/ModDownloadDialog.h new file mode 100644 index 00000000..6ce6ff61 --- /dev/null +++ b/launcher/ui/dialogs/ModDownloadDialog.h @@ -0,0 +1,65 @@ +/* Copyright 2013-2021 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include + +#include "BaseVersion.h" +#include "ui/pages/BasePageProvider.h" +#include "minecraft/mod/ModFolderModel.h" +#include "ModDownloadTask.h" + +namespace Ui +{ +class ModDownloadDialog; +} + +class PageContainer; +class QDialogButtonBox; +class ModrinthPage; + +class ModDownloadDialog : public QDialog, public BasePageProvider +{ + Q_OBJECT + +public: + explicit ModDownloadDialog(const std::shared_ptr& mods, QWidget *parent = nullptr); + ~ModDownloadDialog(); + + QString dialogTitle() override; + QList getPages() override; + + void setSuggestedMod(const QString & name = QString(), ModDownloadTask * task = nullptr); + + ModDownloadTask * getTask(); + +public slots: + void accept() override; + void reject() override; + +//private slots: + +private: + Ui::ModDownloadDialog *ui = nullptr; + PageContainer * m_container = nullptr; + QDialogButtonBox * m_buttons = nullptr; + QVBoxLayout *m_verticalLayout = nullptr; + + + ModrinthPage *modrinthPage = nullptr; + std::unique_ptr modTask; +}; -- cgit From 9e6fa8f29aa8bc0f609bfcdb6460c6845b73448a Mon Sep 17 00:00:00 2001 From: timoreo Date: Fri, 14 Jan 2022 12:47:18 +0100 Subject: Added the downloading of the mods --- launcher/ui/dialogs/ModDownloadDialog.h | 1 + 1 file changed, 1 insertion(+) (limited to 'launcher/ui/dialogs/ModDownloadDialog.h') diff --git a/launcher/ui/dialogs/ModDownloadDialog.h b/launcher/ui/dialogs/ModDownloadDialog.h index 6ce6ff61..ac40257d 100644 --- a/launcher/ui/dialogs/ModDownloadDialog.h +++ b/launcher/ui/dialogs/ModDownloadDialog.h @@ -46,6 +46,7 @@ public: void setSuggestedMod(const QString & name = QString(), ModDownloadTask * task = nullptr); ModDownloadTask * getTask(); + const std::shared_ptr &mods; public slots: void accept() override; -- cgit From 1a8c972aefae75ee91295ea5a926cca71d95140a Mon Sep 17 00:00:00 2001 From: timoreo Date: Fri, 14 Jan 2022 20:22:15 +0100 Subject: Fixed icons Also having a mod loader is now enforced --- launcher/ui/dialogs/ModDownloadDialog.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'launcher/ui/dialogs/ModDownloadDialog.h') diff --git a/launcher/ui/dialogs/ModDownloadDialog.h b/launcher/ui/dialogs/ModDownloadDialog.h index ac40257d..7b2d18a0 100644 --- a/launcher/ui/dialogs/ModDownloadDialog.h +++ b/launcher/ui/dialogs/ModDownloadDialog.h @@ -37,7 +37,7 @@ class ModDownloadDialog : public QDialog, public BasePageProvider Q_OBJECT public: - explicit ModDownloadDialog(const std::shared_ptr& mods, QWidget *parent = nullptr); + explicit ModDownloadDialog(const std::shared_ptr &mods, QWidget *parent, BaseInstance *instance); ~ModDownloadDialog(); QString dialogTitle() override; @@ -63,4 +63,5 @@ private: ModrinthPage *modrinthPage = nullptr; std::unique_ptr modTask; + BaseInstance *m_instance; }; -- cgit From 2896f70cd83761a1248d55b28e2b5cc2cf465049 Mon Sep 17 00:00:00 2001 From: timoreo Date: Fri, 14 Jan 2022 22:07:54 +0100 Subject: Removing copyrights --- launcher/ui/dialogs/ModDownloadDialog.h | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'launcher/ui/dialogs/ModDownloadDialog.h') diff --git a/launcher/ui/dialogs/ModDownloadDialog.h b/launcher/ui/dialogs/ModDownloadDialog.h index 7b2d18a0..12be7295 100644 --- a/launcher/ui/dialogs/ModDownloadDialog.h +++ b/launcher/ui/dialogs/ModDownloadDialog.h @@ -1,18 +1,3 @@ -/* Copyright 2013-2021 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - #pragma once #include -- cgit From 975f77756d7ffeb94fb14355b622ee850e04bd8b Mon Sep 17 00:00:00 2001 From: timoreo Date: Sun, 16 Jan 2022 11:20:21 +0100 Subject: Added curseforge selection --- launcher/ui/dialogs/ModDownloadDialog.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'launcher/ui/dialogs/ModDownloadDialog.h') diff --git a/launcher/ui/dialogs/ModDownloadDialog.h b/launcher/ui/dialogs/ModDownloadDialog.h index 12be7295..ece8e328 100644 --- a/launcher/ui/dialogs/ModDownloadDialog.h +++ b/launcher/ui/dialogs/ModDownloadDialog.h @@ -7,6 +7,7 @@ #include "ui/pages/BasePageProvider.h" #include "minecraft/mod/ModFolderModel.h" #include "ModDownloadTask.h" +#include "ui/pages/modplatform/flame/FlameModPage.h" namespace Ui { @@ -47,6 +48,7 @@ private: ModrinthPage *modrinthPage = nullptr; + FlameModPage *flameModPage = nullptr; std::unique_ptr modTask; BaseInstance *m_instance; }; -- cgit