Renamed ExportMrPackDialog to ExportPackDialog
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
parent
59e1e51903
commit
25579fbedc
@ -908,8 +908,8 @@ SET(LAUNCHER_SOURCES
|
||||
ui/dialogs/EditAccountDialog.h
|
||||
ui/dialogs/ExportInstanceDialog.cpp
|
||||
ui/dialogs/ExportInstanceDialog.h
|
||||
ui/dialogs/ExportMrPackDialog.cpp
|
||||
ui/dialogs/ExportMrPackDialog.h
|
||||
ui/dialogs/ExportPackDialog.cpp
|
||||
ui/dialogs/ExportPackDialog.h
|
||||
ui/dialogs/IconPickerDialog.cpp
|
||||
ui/dialogs/IconPickerDialog.h
|
||||
ui/dialogs/ImportResourceDialog.cpp
|
||||
@ -1056,7 +1056,7 @@ qt_wrap_ui(LAUNCHER_UI
|
||||
ui/dialogs/ProfileSelectDialog.ui
|
||||
ui/dialogs/SkinUploadDialog.ui
|
||||
ui/dialogs/ExportInstanceDialog.ui
|
||||
ui/dialogs/ExportMrPackDialog.ui
|
||||
ui/dialogs/ExportPackDialog.ui
|
||||
ui/dialogs/IconPickerDialog.ui
|
||||
ui/dialogs/ImportResourceDialog.ui
|
||||
ui/dialogs/MSALoginDialog.ui
|
||||
|
@ -107,7 +107,7 @@
|
||||
#include "ui/dialogs/CopyInstanceDialog.h"
|
||||
#include "ui/dialogs/EditAccountDialog.h"
|
||||
#include "ui/dialogs/ExportInstanceDialog.h"
|
||||
#include "ui/dialogs/ExportMrPackDialog.h"
|
||||
#include "ui/dialogs/ExportPackDialog.h"
|
||||
#include "ui/dialogs/ImportResourceDialog.h"
|
||||
#include "ui/themes/ITheme.h"
|
||||
#include "ui/themes/ThemeManager.h"
|
||||
@ -1412,7 +1412,7 @@ void MainWindow::on_actionExportInstanceMrPack_triggered()
|
||||
{
|
||||
if (m_selectedInstance)
|
||||
{
|
||||
ExportMrPackDialog dlg(m_selectedInstance, this);
|
||||
ExportPackDialog dlg(m_selectedInstance, this);
|
||||
dlg.exec();
|
||||
}
|
||||
}
|
||||
@ -1428,7 +1428,7 @@ void MainWindow::on_actionExportInstanceFlamePack_triggered()
|
||||
msgBox.exec();
|
||||
return;
|
||||
}
|
||||
ExportMrPackDialog dlg(m_selectedInstance, this, ModPlatform::ResourceProvider::FLAME);
|
||||
ExportPackDialog dlg(m_selectedInstance, this, ModPlatform::ResourceProvider::FLAME);
|
||||
dlg.exec();
|
||||
}
|
||||
}
|
||||
|
@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "ExportMrPackDialog.h"
|
||||
#include "ExportPackDialog.h"
|
||||
#include "minecraft/mod/ModFolderModel.h"
|
||||
#include "modplatform/ModIndex.h"
|
||||
#include "modplatform/flame/FlamePackExportTask.h"
|
||||
@ -34,8 +34,8 @@
|
||||
#include "MMCZip.h"
|
||||
#include "modplatform/modrinth/ModrinthPackExportTask.h"
|
||||
|
||||
ExportMrPackDialog::ExportMrPackDialog(InstancePtr instance, QWidget* parent, ModPlatform::ResourceProvider provider)
|
||||
: QDialog(parent), instance(instance), ui(new Ui::ExportMrPackDialog), m_provider(provider)
|
||||
ExportPackDialog::ExportPackDialog(InstancePtr instance, QWidget* parent, ModPlatform::ResourceProvider provider)
|
||||
: QDialog(parent), instance(instance), ui(new Ui::ExportPackDialog), m_provider(provider)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
ui->name->setText(instance->name());
|
||||
@ -51,8 +51,8 @@ ExportMrPackDialog::ExportMrPackDialog(InstancePtr instance, QWidget* parent, Mo
|
||||
|
||||
// ensure a valid pack is generated
|
||||
// the name and version fields mustn't be empty
|
||||
connect(ui->name, &QLineEdit::textEdited, this, &ExportMrPackDialog::validate);
|
||||
connect(ui->version, &QLineEdit::textEdited, this, &ExportMrPackDialog::validate);
|
||||
connect(ui->name, &QLineEdit::textEdited, this, &ExportPackDialog::validate);
|
||||
connect(ui->version, &QLineEdit::textEdited, this, &ExportPackDialog::validate);
|
||||
// the instance name can technically be empty
|
||||
validate();
|
||||
|
||||
@ -92,12 +92,12 @@ ExportMrPackDialog::ExportMrPackDialog(InstancePtr instance, QWidget* parent, Mo
|
||||
headerView->setSectionResizeMode(0, QHeaderView::Stretch);
|
||||
}
|
||||
|
||||
ExportMrPackDialog::~ExportMrPackDialog()
|
||||
ExportPackDialog::~ExportPackDialog()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void ExportMrPackDialog::done(int result)
|
||||
void ExportPackDialog::done(int result)
|
||||
{
|
||||
if (result == Accepted) {
|
||||
const QString filename = FS::RemoveInvalidFilenameChars(ui->name->text());
|
||||
@ -137,7 +137,7 @@ void ExportMrPackDialog::done(int result)
|
||||
QDialog::done(result);
|
||||
}
|
||||
|
||||
void ExportMrPackDialog::validate()
|
||||
void ExportPackDialog::validate()
|
||||
{
|
||||
const bool invalid =
|
||||
ui->name->text().isEmpty() || ((m_provider == ModPlatform::ResourceProvider::MODRINTH) && ui->version->text().isEmpty());
|
@ -25,24 +25,24 @@
|
||||
#include "modplatform/ModIndex.h"
|
||||
|
||||
namespace Ui {
|
||||
class ExportMrPackDialog;
|
||||
class ExportPackDialog;
|
||||
}
|
||||
|
||||
class ExportMrPackDialog : public QDialog {
|
||||
class ExportPackDialog : public QDialog {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ExportMrPackDialog(InstancePtr instance,
|
||||
QWidget* parent = nullptr,
|
||||
ModPlatform::ResourceProvider provider = ModPlatform::ResourceProvider::MODRINTH);
|
||||
~ExportMrPackDialog();
|
||||
explicit ExportPackDialog(InstancePtr instance,
|
||||
QWidget* parent = nullptr,
|
||||
ModPlatform::ResourceProvider provider = ModPlatform::ResourceProvider::MODRINTH);
|
||||
~ExportPackDialog();
|
||||
|
||||
void done(int result) override;
|
||||
void validate();
|
||||
|
||||
private:
|
||||
const InstancePtr instance;
|
||||
Ui::ExportMrPackDialog* ui;
|
||||
Ui::ExportPackDialog* ui;
|
||||
FileIgnoreProxy* proxy;
|
||||
FastFileIconProvider icons;
|
||||
const ModPlatform::ResourceProvider m_provider;
|
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>ExportMrPackDialog</class>
|
||||
<widget class="QDialog" name="ExportMrPackDialog">
|
||||
<class>ExportPackDialog</class>
|
||||
<widget class="QDialog" name="ExportPackDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
@ -113,7 +113,7 @@
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>ExportMrPackDialog</receiver>
|
||||
<receiver>ExportPackDialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
@ -129,7 +129,7 @@
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>ExportMrPackDialog</receiver>
|
||||
<receiver>ExportPackDialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
Loading…
x
Reference in New Issue
Block a user