Renamed ExportMrPackDialog to ExportPackDialog

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
Trial97 2023-06-24 14:54:39 +03:00
parent 59e1e51903
commit 25579fbedc
No known key found for this signature in database
GPG Key ID: 55EF5DA53DB36318
5 changed files with 25 additions and 25 deletions

View File

@ -908,8 +908,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/ExportPackDialog.cpp
ui/dialogs/ExportMrPackDialog.h ui/dialogs/ExportPackDialog.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
@ -1056,7 +1056,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/ExportPackDialog.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

View File

@ -107,7 +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/ExportPackDialog.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"
@ -1412,7 +1412,7 @@ void MainWindow::on_actionExportInstanceMrPack_triggered()
{ {
if (m_selectedInstance) if (m_selectedInstance)
{ {
ExportMrPackDialog dlg(m_selectedInstance, this); ExportPackDialog dlg(m_selectedInstance, this);
dlg.exec(); dlg.exec();
} }
} }
@ -1428,7 +1428,7 @@ void MainWindow::on_actionExportInstanceFlamePack_triggered()
msgBox.exec(); msgBox.exec();
return; return;
} }
ExportMrPackDialog dlg(m_selectedInstance, this, ModPlatform::ResourceProvider::FLAME); ExportPackDialog dlg(m_selectedInstance, this, ModPlatform::ResourceProvider::FLAME);
dlg.exec(); dlg.exec();
} }
} }

View File

@ -16,7 +16,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
#include "ExportMrPackDialog.h" #include "ExportPackDialog.h"
#include "minecraft/mod/ModFolderModel.h" #include "minecraft/mod/ModFolderModel.h"
#include "modplatform/ModIndex.h" #include "modplatform/ModIndex.h"
#include "modplatform/flame/FlamePackExportTask.h" #include "modplatform/flame/FlamePackExportTask.h"
@ -34,8 +34,8 @@
#include "MMCZip.h" #include "MMCZip.h"
#include "modplatform/modrinth/ModrinthPackExportTask.h" #include "modplatform/modrinth/ModrinthPackExportTask.h"
ExportMrPackDialog::ExportMrPackDialog(InstancePtr instance, QWidget* parent, ModPlatform::ResourceProvider provider) ExportPackDialog::ExportPackDialog(InstancePtr instance, QWidget* parent, ModPlatform::ResourceProvider provider)
: QDialog(parent), instance(instance), ui(new Ui::ExportMrPackDialog), m_provider(provider) : QDialog(parent), instance(instance), ui(new Ui::ExportPackDialog), m_provider(provider)
{ {
ui->setupUi(this); ui->setupUi(this);
ui->name->setText(instance->name()); ui->name->setText(instance->name());
@ -51,8 +51,8 @@ ExportMrPackDialog::ExportMrPackDialog(InstancePtr instance, QWidget* parent, Mo
// ensure a valid pack is generated // ensure a valid pack is generated
// the name and version fields mustn't be empty // the name and version fields mustn't be empty
connect(ui->name, &QLineEdit::textEdited, this, &ExportMrPackDialog::validate); connect(ui->name, &QLineEdit::textEdited, this, &ExportPackDialog::validate);
connect(ui->version, &QLineEdit::textEdited, this, &ExportMrPackDialog::validate); connect(ui->version, &QLineEdit::textEdited, this, &ExportPackDialog::validate);
// the instance name can technically be empty // the instance name can technically be empty
validate(); validate();
@ -92,12 +92,12 @@ ExportMrPackDialog::ExportMrPackDialog(InstancePtr instance, QWidget* parent, Mo
headerView->setSectionResizeMode(0, QHeaderView::Stretch); headerView->setSectionResizeMode(0, QHeaderView::Stretch);
} }
ExportMrPackDialog::~ExportMrPackDialog() ExportPackDialog::~ExportPackDialog()
{ {
delete ui; delete ui;
} }
void ExportMrPackDialog::done(int result) void ExportPackDialog::done(int result)
{ {
if (result == Accepted) { if (result == Accepted) {
const QString filename = FS::RemoveInvalidFilenameChars(ui->name->text()); const QString filename = FS::RemoveInvalidFilenameChars(ui->name->text());
@ -137,7 +137,7 @@ void ExportMrPackDialog::done(int result)
QDialog::done(result); QDialog::done(result);
} }
void ExportMrPackDialog::validate() void ExportPackDialog::validate()
{ {
const bool invalid = const bool invalid =
ui->name->text().isEmpty() || ((m_provider == ModPlatform::ResourceProvider::MODRINTH) && ui->version->text().isEmpty()); ui->name->text().isEmpty() || ((m_provider == ModPlatform::ResourceProvider::MODRINTH) && ui->version->text().isEmpty());

View File

@ -25,24 +25,24 @@
#include "modplatform/ModIndex.h" #include "modplatform/ModIndex.h"
namespace Ui { namespace Ui {
class ExportMrPackDialog; class ExportPackDialog;
} }
class ExportMrPackDialog : public QDialog { class ExportPackDialog : public QDialog {
Q_OBJECT Q_OBJECT
public: public:
explicit ExportMrPackDialog(InstancePtr instance, explicit ExportPackDialog(InstancePtr instance,
QWidget* parent = nullptr, QWidget* parent = nullptr,
ModPlatform::ResourceProvider provider = ModPlatform::ResourceProvider::MODRINTH); ModPlatform::ResourceProvider provider = ModPlatform::ResourceProvider::MODRINTH);
~ExportMrPackDialog(); ~ExportPackDialog();
void done(int result) override; void done(int result) override;
void validate(); void validate();
private: private:
const InstancePtr instance; const InstancePtr instance;
Ui::ExportMrPackDialog* ui; Ui::ExportPackDialog* ui;
FileIgnoreProxy* proxy; FileIgnoreProxy* proxy;
FastFileIconProvider icons; FastFileIconProvider icons;
const ModPlatform::ResourceProvider m_provider; const ModPlatform::ResourceProvider m_provider;

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>ExportMrPackDialog</class> <class>ExportPackDialog</class>
<widget class="QDialog" name="ExportMrPackDialog"> <widget class="QDialog" name="ExportPackDialog">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
@ -113,7 +113,7 @@
<connection> <connection>
<sender>buttonBox</sender> <sender>buttonBox</sender>
<signal>accepted()</signal> <signal>accepted()</signal>
<receiver>ExportMrPackDialog</receiver> <receiver>ExportPackDialog</receiver>
<slot>accept()</slot> <slot>accept()</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
@ -129,7 +129,7 @@
<connection> <connection>
<sender>buttonBox</sender> <sender>buttonBox</sender>
<signal>rejected()</signal> <signal>rejected()</signal>
<receiver>ExportMrPackDialog</receiver> <receiver>ExportPackDialog</receiver>
<slot>reject()</slot> <slot>reject()</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">