UI for mrpack export (broken)
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
This commit is contained in:
		| @@ -851,6 +851,8 @@ SET(LAUNCHER_SOURCES | |||||||
|     ui/dialogs/EditAccountDialog.h |     ui/dialogs/EditAccountDialog.h | ||||||
|     ui/dialogs/ExportInstanceDialog.cpp |     ui/dialogs/ExportInstanceDialog.cpp | ||||||
|     ui/dialogs/ExportInstanceDialog.h |     ui/dialogs/ExportInstanceDialog.h | ||||||
|  |     ui/dialogs/ExportMrPackDialog.cpp | ||||||
|  |     ui/dialogs/ExportMrPackDialog.h | ||||||
|     ui/dialogs/IconPickerDialog.cpp |     ui/dialogs/IconPickerDialog.cpp | ||||||
|     ui/dialogs/IconPickerDialog.h |     ui/dialogs/IconPickerDialog.h | ||||||
|     ui/dialogs/ImportResourceDialog.cpp |     ui/dialogs/ImportResourceDialog.cpp | ||||||
| @@ -995,6 +997,7 @@ qt_wrap_ui(LAUNCHER_UI | |||||||
|     ui/dialogs/ProfileSelectDialog.ui |     ui/dialogs/ProfileSelectDialog.ui | ||||||
|     ui/dialogs/SkinUploadDialog.ui |     ui/dialogs/SkinUploadDialog.ui | ||||||
|     ui/dialogs/ExportInstanceDialog.ui |     ui/dialogs/ExportInstanceDialog.ui | ||||||
|  |     ui/dialogs/ExportMrPackDialog.ui | ||||||
|     ui/dialogs/IconPickerDialog.ui |     ui/dialogs/IconPickerDialog.ui | ||||||
|     ui/dialogs/ImportResourceDialog.ui |     ui/dialogs/ImportResourceDialog.ui | ||||||
|     ui/dialogs/MSALoginDialog.ui |     ui/dialogs/MSALoginDialog.ui | ||||||
|   | |||||||
| @@ -2,7 +2,7 @@ | |||||||
| /* | /* | ||||||
|  *  Prism Launcher - Minecraft Launcher |  *  Prism Launcher - Minecraft Launcher | ||||||
|  *  Copyright (C) 2022 Sefa Eyeoglu <contact@scrumplex.net> |  *  Copyright (C) 2022 Sefa Eyeoglu <contact@scrumplex.net> | ||||||
|  *  Copyright (C) 2022 TheKodeToad <TheKodeToad@proton.me> |  *  Copyright (C) 2023 TheKodeToad <TheKodeToad@proton.me> | ||||||
|  * |  * | ||||||
|  *  This program is free software: you can redistribute it and/or modify |  *  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 |  *  it under the terms of the GNU General Public License as published by | ||||||
| @@ -107,6 +107,7 @@ | |||||||
| #include "ui/dialogs/CopyInstanceDialog.h" | #include "ui/dialogs/CopyInstanceDialog.h" | ||||||
| #include "ui/dialogs/EditAccountDialog.h" | #include "ui/dialogs/EditAccountDialog.h" | ||||||
| #include "ui/dialogs/ExportInstanceDialog.h" | #include "ui/dialogs/ExportInstanceDialog.h" | ||||||
|  | #include "ui/dialogs/ExportMrPackDialog.h" | ||||||
| #include "ui/dialogs/ImportResourceDialog.h" | #include "ui/dialogs/ImportResourceDialog.h" | ||||||
| #include "ui/themes/ITheme.h" | #include "ui/themes/ITheme.h" | ||||||
| #include "ui/themes/ThemeManager.h" | #include "ui/themes/ThemeManager.h" | ||||||
| @@ -397,6 +398,8 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi | |||||||
|     // removing this looks stupid |     // removing this looks stupid | ||||||
|     view->setFocus(); |     view->setFocus(); | ||||||
|  |  | ||||||
|  |     ui->actionExportInstance->setMenu(ui->exportInstanceMenu); | ||||||
|  |  | ||||||
|     retranslateUi(); |     retranslateUi(); | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -1345,7 +1348,7 @@ void MainWindow::on_actionDeleteInstance_triggered() | |||||||
|     APPLICATION->instances()->deleteInstance(id); |     APPLICATION->instances()->deleteInstance(id); | ||||||
| } | } | ||||||
|  |  | ||||||
| void MainWindow::on_actionExportInstance_triggered() | void MainWindow::on_actionExportInstanceZip_triggered() | ||||||
| { | { | ||||||
|     if (m_selectedInstance) |     if (m_selectedInstance) | ||||||
|     { |     { | ||||||
| @@ -1354,6 +1357,15 @@ void MainWindow::on_actionExportInstance_triggered() | |||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
|  | void MainWindow::on_actionExportInstanceMrPack_triggered() | ||||||
|  | { | ||||||
|  |     if (m_selectedInstance) | ||||||
|  |     { | ||||||
|  |         ExportMrPackDialog dlg(m_selectedInstance, this); | ||||||
|  |         dlg.exec(); | ||||||
|  |     } | ||||||
|  | } | ||||||
|  |  | ||||||
| void MainWindow::on_actionRenameInstance_triggered() | void MainWindow::on_actionRenameInstance_triggered() | ||||||
| { | { | ||||||
|     if (m_selectedInstance) |     if (m_selectedInstance) | ||||||
|   | |||||||
| @@ -2,6 +2,7 @@ | |||||||
| /* | /* | ||||||
|  *  PolyMC - Minecraft Launcher |  *  PolyMC - Minecraft Launcher | ||||||
|  *  Copyright (C) 2022 Sefa Eyeoglu <contact@scrumplex.net> |  *  Copyright (C) 2022 Sefa Eyeoglu <contact@scrumplex.net> | ||||||
|  |  *  Copyright (C) 2023 TheKodeToad <TheKodeToad@proton.me> | ||||||
|  * |  * | ||||||
|  *  This program is free software: you can redistribute it and/or modify |  *  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 |  *  it under the terms of the GNU General Public License as published by | ||||||
| @@ -151,7 +152,9 @@ private slots: | |||||||
|     void deleteGroup(); |     void deleteGroup(); | ||||||
|     void undoTrashInstance(); |     void undoTrashInstance(); | ||||||
|  |  | ||||||
|     void on_actionExportInstance_triggered(); |     inline void on_actionExportInstance_triggered() { on_actionExportInstanceZip_triggered(); } | ||||||
|  |     void on_actionExportInstanceZip_triggered(); | ||||||
|  |     void on_actionExportInstanceMrPack_triggered(); | ||||||
|  |  | ||||||
|     void on_actionRenameInstance_triggered(); |     void on_actionRenameInstance_triggered(); | ||||||
|  |  | ||||||
|   | |||||||
| @@ -459,10 +459,27 @@ | |||||||
|     <string>E&xport...</string> |     <string>E&xport...</string> | ||||||
|    </property> |    </property> | ||||||
|    <property name="toolTip"> |    <property name="toolTip"> | ||||||
|     <string>Export the selected instance as a zip file.</string> |     <string>Export the selected instance to supported formats.</string> | ||||||
|    </property> |    </property> | ||||||
|    <property name="shortcut"> |   </action> | ||||||
|     <string>Ctrl+E</string> |   <widget class="QMenu" name="exportInstanceMenu"> | ||||||
|  |    <addaction name="actionExportInstanceZip"/> | ||||||
|  |    <addaction name="actionExportInstanceMrPack"/> | ||||||
|  |   </widget> | ||||||
|  |   <action name="actionExportInstanceZip"> | ||||||
|  |    <property name="text"> | ||||||
|  |     <string>Prism Launcher (zip)</string> | ||||||
|  |    </property> | ||||||
|  |    <property name="toolTip"> | ||||||
|  |     <string>Export the instance as a ZIP.</string> | ||||||
|  |    </property> | ||||||
|  |   </action> | ||||||
|  |   <action name="actionExportInstanceMrPack"> | ||||||
|  |    <property name="text"> | ||||||
|  |     <string>Modrinth (mrpack)</string> | ||||||
|  |    </property> | ||||||
|  |    <property name="toolTip"> | ||||||
|  |     <string>Export to a Modrinth modpack.</string> | ||||||
|    </property> |    </property> | ||||||
|   </action> |   </action> | ||||||
|   <action name="actionCreateInstanceShortcut"> |   <action name="actionCreateInstanceShortcut"> | ||||||
|   | |||||||
							
								
								
									
										31
									
								
								launcher/ui/dialogs/ExportMrPackDialog.cpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								launcher/ui/dialogs/ExportMrPackDialog.cpp
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,31 @@ | |||||||
|  | // SPDX-License-Identifier: GPL-3.0-only | ||||||
|  | /* | ||||||
|  |  *  Prism Launcher - Minecraft Launcher | ||||||
|  |  *  Copyright (C) 2023 TheKodeToad <TheKodeToad@proton.me> | ||||||
|  |  * | ||||||
|  |  *  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/>. | ||||||
|  |  */ | ||||||
|  |  | ||||||
|  | #include "ExportMrPackDialog.h" | ||||||
|  | #include "ui_ExportMrPackDialog.h" | ||||||
|  |  | ||||||
|  | ExportMrPackDialog::ExportMrPackDialog(InstancePtr instance, QWidget* parent) | ||||||
|  |     : QDialog(parent), instance(instance), ui(new Ui::ExportMrPackDialog) | ||||||
|  | { | ||||||
|  |     ui->setupUi(this); | ||||||
|  | } | ||||||
|  |  | ||||||
|  | ExportMrPackDialog::~ExportMrPackDialog() | ||||||
|  | { | ||||||
|  |     delete ui; | ||||||
|  | } | ||||||
							
								
								
									
										38
									
								
								launcher/ui/dialogs/ExportMrPackDialog.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										38
									
								
								launcher/ui/dialogs/ExportMrPackDialog.h
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,38 @@ | |||||||
|  | // SPDX-License-Identifier: GPL-3.0-only | ||||||
|  | /* | ||||||
|  |  *  Prism Launcher - Minecraft Launcher | ||||||
|  |  *  Copyright (C) 2023 TheKodeToad <TheKodeToad@proton.me> | ||||||
|  |  * | ||||||
|  |  *  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/>. | ||||||
|  |  */ | ||||||
|  |  | ||||||
|  | #pragma once | ||||||
|  |  | ||||||
|  | #include <QDialog> | ||||||
|  | #include "BaseInstance.h" | ||||||
|  |  | ||||||
|  | namespace Ui { | ||||||
|  | class ExportMrPackDialog; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | class ExportMrPackDialog : public QDialog { | ||||||
|  |     Q_OBJECT | ||||||
|  |  | ||||||
|  |    public: | ||||||
|  |     explicit ExportMrPackDialog(InstancePtr instance, QWidget* parent = nullptr); | ||||||
|  |     ~ExportMrPackDialog(); | ||||||
|  |  | ||||||
|  |    private: | ||||||
|  |     InstancePtr instance; | ||||||
|  |     Ui::ExportMrPackDialog* ui; | ||||||
|  | }; | ||||||
							
								
								
									
										77
									
								
								launcher/ui/dialogs/ExportMrPackDialog.ui
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										77
									
								
								launcher/ui/dialogs/ExportMrPackDialog.ui
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,77 @@ | |||||||
|  | <?xml version="1.0" encoding="UTF-8"?> | ||||||
|  | <ui version="4.0"> | ||||||
|  |  <class>ExportMrPackDialog</class> | ||||||
|  |  <widget class="QDialog" name="ExportMrPackDialog"> | ||||||
|  |   <property name="geometry"> | ||||||
|  |    <rect> | ||||||
|  |     <x>0</x> | ||||||
|  |     <y>0</y> | ||||||
|  |     <width>650</width> | ||||||
|  |     <height>413</height> | ||||||
|  |    </rect> | ||||||
|  |   </property> | ||||||
|  |   <property name="windowTitle"> | ||||||
|  |    <string>Export Modrinth Pack</string> | ||||||
|  |   </property> | ||||||
|  |   <layout class="QVBoxLayout" name="verticalLayout_2"> | ||||||
|  |    <item> | ||||||
|  |     <widget class="QGroupBox" name="groupBox"> | ||||||
|  |      <property name="title"> | ||||||
|  |       <string>Information</string> | ||||||
|  |      </property> | ||||||
|  |      <layout class="QGridLayout" name="gridLayout"> | ||||||
|  |       <item row="3" column="0"> | ||||||
|  |        <widget class="QLabel" name="label_3"> | ||||||
|  |         <property name="text"> | ||||||
|  |          <string>Summary</string> | ||||||
|  |         </property> | ||||||
|  |        </widget> | ||||||
|  |       </item> | ||||||
|  |       <item row="3" column="1"> | ||||||
|  |        <widget class="QLineEdit" name="lineEdit_3"/> | ||||||
|  |       </item> | ||||||
|  |       <item row="0" column="0"> | ||||||
|  |        <widget class="QLabel" name="label"> | ||||||
|  |         <property name="text"> | ||||||
|  |          <string>Name</string> | ||||||
|  |         </property> | ||||||
|  |        </widget> | ||||||
|  |       </item> | ||||||
|  |       <item row="1" column="0"> | ||||||
|  |        <widget class="QLabel" name="label_2"> | ||||||
|  |         <property name="text"> | ||||||
|  |          <string>Version</string> | ||||||
|  |         </property> | ||||||
|  |        </widget> | ||||||
|  |       </item> | ||||||
|  |       <item row="0" column="1"> | ||||||
|  |        <widget class="QLineEdit" name="lineEdit"/> | ||||||
|  |       </item> | ||||||
|  |       <item row="1" column="1"> | ||||||
|  |        <widget class="QLineEdit" name="lineEdit_2"/> | ||||||
|  |       </item> | ||||||
|  |      </layout> | ||||||
|  |     </widget> | ||||||
|  |    </item> | ||||||
|  |    <item> | ||||||
|  |     <widget class="QLabel" name="label_4"> | ||||||
|  |      <property name="text"> | ||||||
|  |       <string>Files</string> | ||||||
|  |      </property> | ||||||
|  |     </widget> | ||||||
|  |    </item> | ||||||
|  |    <item> | ||||||
|  |     <widget class="QTreeView" name="treeView"/> | ||||||
|  |    </item> | ||||||
|  |    <item> | ||||||
|  |     <widget class="QDialogButtonBox" name="buttonBox"> | ||||||
|  |      <property name="standardButtons"> | ||||||
|  |       <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> | ||||||
|  |      </property> | ||||||
|  |     </widget> | ||||||
|  |    </item> | ||||||
|  |   </layout> | ||||||
|  |  </widget> | ||||||
|  |  <resources/> | ||||||
|  |  <connections/> | ||||||
|  | </ui> | ||||||
		Reference in New Issue
	
	Block a user
	 TheKodeToad
					TheKodeToad