MultiMC5/launcher/ui/dialogs/SelectInstanceExportFormatDialog.cpp

38 lines
1.0 KiB
C++
Raw Normal View History

2023-02-04 21:41:24 +00:00
/*
* 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;
}