Sync with some additional dialogs
This commit is contained in:
parent
f507b3e8a3
commit
b7ec693533
2 changed files with 5 additions and 3 deletions
|
@ -2430,12 +2430,12 @@ void MainWindow::importMapFromAdvanceMap1_92()
|
||||||
QString filepath = QFileDialog::getOpenFileName(
|
QString filepath = QFileDialog::getOpenFileName(
|
||||||
this,
|
this,
|
||||||
QString("Import Map from Advance Map 1.92"),
|
QString("Import Map from Advance Map 1.92"),
|
||||||
this->editor->project->root,
|
this->editor->project->importExportPath,
|
||||||
"Advance Map 1.92 Map Files (*.map)");
|
"Advance Map 1.92 Map Files (*.map)");
|
||||||
if (filepath.isEmpty()) {
|
if (filepath.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
this->editor->project->setImportExportPath(filepath);
|
||||||
MapParser parser;
|
MapParser parser;
|
||||||
bool error = false;
|
bool error = false;
|
||||||
MapLayout *mapLayout = parser.parse(filepath, &error, editor->project);
|
MapLayout *mapLayout = parser.parse(filepath, &error, editor->project);
|
||||||
|
|
|
@ -34,7 +34,9 @@ QString RegionMapPropertiesDialog::browse(QString filter, QFileDialog::FileMode
|
||||||
if (!this->project) return QString();
|
if (!this->project) return QString();
|
||||||
QFileDialog browser;
|
QFileDialog browser;
|
||||||
browser.setFileMode(mode);
|
browser.setFileMode(mode);
|
||||||
QString filepath = browser.getOpenFileName(this, "Select a File", this->project->root, filter);
|
QString filepath = browser.getOpenFileName(this, "Select a File", this->project->importExportPath, filter);
|
||||||
|
if (!filepath.isEmpty())
|
||||||
|
this->project->setImportExportPath(filepath);
|
||||||
|
|
||||||
// remove the project root from the filepath
|
// remove the project root from the filepath
|
||||||
return filepath.replace(this->project->root + "/", "");
|
return filepath.replace(this->project->root + "/", "");
|
||||||
|
|
Loading…
Reference in a new issue