Combine minor creation dialogs

This commit is contained in:
GriffinR
2024-12-10 18:22:22 -05:00
parent 391f7b1685
commit 52a7cd4f56
8 changed files with 275 additions and 117 deletions

View File

@@ -33,7 +33,8 @@ private:
Project *m_project;
bool validateMapDimensions();
bool validateTilesets();
bool validatePrimaryTileset(bool allowEmpty = false);
bool validateSecondaryTileset(bool allowEmpty = false);
};
#endif // NEWLAYOUTFORM_H

View File

@@ -0,0 +1,42 @@
#ifndef NEWNAMEDIALOG_H
#define NEWNAMEDIALOG_H
/*
This is a generic dialog for requesting a new unique name from the user.
*/
#include <QDialog>
#include <QAbstractButton>
class Project;
namespace Ui {
class NewNameDialog;
}
class NewNameDialog : public QDialog
{
Q_OBJECT
public:
explicit NewNameDialog(const QString &label, Project *project, QWidget *parent = nullptr);
~NewNameDialog();
void setNamePrefix(const QString &prefix);
virtual void accept() override;
signals:
void applied(const QString &newName);
private:
Ui::NewNameDialog *ui;
Project *project = nullptr;
const QString symbolPrefix;
bool validateName(bool allowEmpty = false);
void onNameChanged(const QString &name);
void dialogButtonClicked(QAbstractButton *button);
};
#endif // NEWNAMEDIALOG_H