mirror of
https://github.com/huderlem/porymap.git
synced 2026-08-15 13:26:53 -05:00
Fix map duplication
This commit is contained in:
@@ -30,10 +30,7 @@ signals:
|
||||
private:
|
||||
Ui::NewLayoutDialog *ui;
|
||||
Project *project;
|
||||
Layout *importedLayout = nullptr;
|
||||
|
||||
static Layout::Settings settings;
|
||||
static bool initializedSettings;
|
||||
const Layout *layoutToCopy;
|
||||
|
||||
// Each of these validation functions will allow empty names up until `OK` is selected,
|
||||
// because clearing the text during editing is common and we don't want to flash errors for this.
|
||||
@@ -41,7 +38,6 @@ private:
|
||||
bool validateName(bool allowEmpty = false);
|
||||
|
||||
void refresh();
|
||||
|
||||
void saveSettings();
|
||||
bool isExistingLayout() const;
|
||||
|
||||
|
||||
@@ -19,8 +19,8 @@ class NewMapDialog : public QDialog
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit NewMapDialog(Project *project, QWidget *parent = nullptr);
|
||||
explicit NewMapDialog(Project *project, const Map *mapToCopy = nullptr, QWidget *parent = nullptr);
|
||||
explicit NewMapDialog(Project *project, int mapListTab, const QString &mapListItem, QWidget *parent = nullptr);
|
||||
explicit NewMapDialog(Project *project, const Map *mapToCopy, QWidget *parent = nullptr);
|
||||
~NewMapDialog();
|
||||
|
||||
virtual void accept() override;
|
||||
@@ -30,26 +30,21 @@ private:
|
||||
Project *project;
|
||||
CollapsibleSection *headerSection;
|
||||
MapHeaderForm *headerForm;
|
||||
Map *importedMap = nullptr;
|
||||
|
||||
static Project::NewMapSettings settings;
|
||||
static bool initializedSettings;
|
||||
const Map *mapToCopy;
|
||||
|
||||
// Each of these validation functions will allow empty names up until `OK` is selected,
|
||||
// because clearing the text during editing is common and we don't want to flash errors for this.
|
||||
bool validateMapID(bool allowEmpty = false);
|
||||
bool validateName(bool allowEmpty = false);
|
||||
bool validateGroup(bool allowEmpty = false);
|
||||
bool validateLayoutID(bool allowEmpty = false);
|
||||
|
||||
void setUI(const Project::NewMapSettings &settings);
|
||||
void refresh();
|
||||
void saveSettings();
|
||||
void setLayout(const Layout *mapLayout);
|
||||
|
||||
private slots:
|
||||
void dialogButtonClicked(QAbstractButton *button);
|
||||
void on_lineEdit_Name_textChanged(const QString &);
|
||||
void on_lineEdit_MapID_textChanged(const QString &);
|
||||
void on_comboBox_Group_currentTextChanged(const QString &text);
|
||||
void on_comboBox_LayoutID_currentTextChanged(const QString &text);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user