mirror of
https://github.com/UltimMC/Launcher.git
synced 2026-01-02 21:59:59 +00:00
GH-4699 Clean some things up
Add a menu to select between MMC/Modrinth format packs instead of the custom dialog Treat 404s on requests to the Modrinth API as success, as the API returns a 404 if a hash was not found, and we don't want to retry the download in this case Improve logging
This commit is contained in:
@@ -1,37 +0,0 @@
|
||||
/*
|
||||
* Copyright 2023 arthomnix
|
||||
*
|
||||
* This source is subject to the Microsoft Public License (MS-PL).
|
||||
* Please see the COPYING.md file for more information.
|
||||
*/
|
||||
|
||||
#include "SelectInstanceExportFormatDialog.h"
|
||||
#include "ui_SelectInstanceExportFormatDialog.h"
|
||||
#include "BuildConfig.h"
|
||||
#include "ModrinthExportDialog.h"
|
||||
|
||||
|
||||
SelectInstanceExportFormatDialog::SelectInstanceExportFormatDialog(InstancePtr instance, QWidget *parent) :
|
||||
QDialog(parent), ui(new Ui::SelectInstanceExportFormatDialog), m_instance(instance)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
ui->mmcFormat->setText(BuildConfig.LAUNCHER_NAME);
|
||||
}
|
||||
|
||||
void SelectInstanceExportFormatDialog::accept()
|
||||
{
|
||||
if (ui->mmcFormat->isChecked()) {
|
||||
ExportInstanceDialog dlg(m_instance, parentWidget());
|
||||
QDialog::accept();
|
||||
dlg.exec();
|
||||
} else if (ui->modrinthFormat->isChecked()) {
|
||||
ModrinthExportDialog dlg(m_instance, parentWidget());
|
||||
QDialog::accept();
|
||||
dlg.exec();
|
||||
}
|
||||
}
|
||||
|
||||
SelectInstanceExportFormatDialog::~SelectInstanceExportFormatDialog()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
/*
|
||||
* Copyright 2023 arthomnix
|
||||
*
|
||||
* This source is subject to the Microsoft Public License (MS-PL).
|
||||
* Please see the COPYING.md file for more information.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QDialog>
|
||||
#include "ExportInstanceDialog.h"
|
||||
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
namespace Ui
|
||||
{
|
||||
class SelectInstanceExportFormatDialog;
|
||||
}
|
||||
QT_END_NAMESPACE
|
||||
|
||||
class SelectInstanceExportFormatDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit SelectInstanceExportFormatDialog(InstancePtr instance, QWidget *parent = nullptr);
|
||||
|
||||
~SelectInstanceExportFormatDialog() override;
|
||||
|
||||
private slots:
|
||||
void accept() override;
|
||||
|
||||
private:
|
||||
Ui::SelectInstanceExportFormatDialog *ui;
|
||||
InstancePtr m_instance;
|
||||
};
|
||||
@@ -1,95 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>SelectInstanceExportFormatDialog</class>
|
||||
<widget class="QDialog" name="SelectInstanceExportFormatDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>446</width>
|
||||
<height>181</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Select Instance Export Format</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="verticalLayoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>10</y>
|
||||
<width>421</width>
|
||||
<height>161</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Select export format</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="mmcFormat">
|
||||
<property name="text">
|
||||
<string>Launcher</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="modrinthFormat">
|
||||
<property name="text">
|
||||
<string>Modrinth (WIP)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>SelectInstanceExportFormatDialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>220</x>
|
||||
<y>152</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>222</x>
|
||||
<y>90</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>SelectInstanceExportFormatDialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>220</x>
|
||||
<y>152</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>222</x>
|
||||
<y>90</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
Reference in New Issue
Block a user