mirror of
https://github.com/huderlem/porymap.git
synced 2026-08-12 03:45:51 -05:00
Correctly restore window focus for file dialogs
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#include "config.h"
|
||||
#include "noscrollcombobox.h"
|
||||
#include "prefab.h"
|
||||
#include "filedialog.h"
|
||||
|
||||
#include <QAbstractButton>
|
||||
#include <QFormLayout>
|
||||
@@ -383,10 +384,10 @@ QString ProjectSettingsEditor::chooseProjectFile(const QString &defaultFilepath)
|
||||
QString path;
|
||||
if (defaultFilepath.endsWith("/")){
|
||||
// Default filepath is a folder, choose a new folder
|
||||
path = QFileDialog::getExistingDirectory(this, "Choose Project File Folder", startDir) + QDir::separator();
|
||||
path = FileDialog::getExistingDirectory(this, "Choose Project File Folder", startDir) + QDir::separator();
|
||||
} else{
|
||||
// Default filepath is not a folder, choose a new file
|
||||
path = QFileDialog::getOpenFileName(this, "Choose Project File", startDir);
|
||||
path = FileDialog::getOpenFileName(this, "Choose Project File", startDir);
|
||||
}
|
||||
|
||||
if (!path.startsWith(this->baseDir)){
|
||||
@@ -573,10 +574,9 @@ void ProjectSettingsEditor::chooseImageFile(QLineEdit * filepathEdit) {
|
||||
}
|
||||
|
||||
void ProjectSettingsEditor::chooseFile(QLineEdit * filepathEdit, const QString &description, const QString &extensions) {
|
||||
QString filepath = QFileDialog::getOpenFileName(this, description, this->project->importExportPath, extensions);
|
||||
QString filepath = FileDialog::getOpenFileName(this, description, "", extensions);
|
||||
if (filepath.isEmpty())
|
||||
return;
|
||||
this->project->setImportExportPath(filepath);
|
||||
|
||||
if (filepathEdit)
|
||||
filepathEdit->setText(this->stripProjectDir(filepath));
|
||||
|
||||
Reference in New Issue
Block a user