mirror of
https://github.com/overte-org/overte.git
synced 2025-04-25 22:36:39 +02:00
Voxel import fix
This commit is contained in:
parent
c17476c985
commit
ef39d019ac
2 changed files with 54 additions and 40 deletions
|
@ -10,7 +10,6 @@
|
||||||
#include <QStandardPaths>
|
#include <QStandardPaths>
|
||||||
#include <QGridLayout>
|
#include <QGridLayout>
|
||||||
#include <QSplitter>
|
#include <QSplitter>
|
||||||
#include <QApplication>
|
|
||||||
#include <QJsonDocument>
|
#include <QJsonDocument>
|
||||||
#include <QJsonArray>
|
#include <QJsonArray>
|
||||||
#include <QJsonObject>
|
#include <QJsonObject>
|
||||||
|
@ -121,6 +120,8 @@ ImportDialog::ImportDialog(QWidget* parent) :
|
||||||
setLayout();
|
setLayout();
|
||||||
|
|
||||||
connect(&_importButton, SIGNAL(pressed()), SLOT(import()));
|
connect(&_importButton, SIGNAL(pressed()), SLOT(import()));
|
||||||
|
connect(this, SIGNAL(currentChanged(QString)), SLOT(saveCurrentFile(QString)));
|
||||||
|
|
||||||
connect(&_cancelButton, SIGNAL(pressed()), SLOT(close()));
|
connect(&_cancelButton, SIGNAL(pressed()), SLOT(close()));
|
||||||
connect(this, SIGNAL(currentChanged(QString)), SLOT(saveCurrentFile(QString)));
|
connect(this, SIGNAL(currentChanged(QString)), SLOT(saveCurrentFile(QString)));
|
||||||
}
|
}
|
||||||
|
@ -131,7 +132,6 @@ ImportDialog::~ImportDialog() {
|
||||||
|
|
||||||
void ImportDialog::import() {
|
void ImportDialog::import() {
|
||||||
emit accepted();
|
emit accepted();
|
||||||
close();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ImportDialog::accept() {
|
void ImportDialog::accept() {
|
||||||
|
@ -251,7 +251,6 @@ void ImportDialog::setImportTypes() {
|
||||||
QJsonObject fileFormatObject = fileFormat.toObject();
|
QJsonObject fileFormatObject = fileFormat.toObject();
|
||||||
|
|
||||||
QString ext(fileFormatObject["extension"].toString());
|
QString ext(fileFormatObject["extension"].toString());
|
||||||
QString description(fileFormatObject.value("description").toString());
|
|
||||||
QString icon(fileFormatObject.value("icon").toString());
|
QString icon(fileFormatObject.value("icon").toString());
|
||||||
|
|
||||||
if (formatsCounter > 0) {
|
if (formatsCounter > 0) {
|
||||||
|
|
|
@ -103,6 +103,21 @@ int VoxelImporter::preImport() {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_filename = filename;
|
||||||
|
|
||||||
|
if (_nextTask) {
|
||||||
|
delete _nextTask;
|
||||||
|
}
|
||||||
|
|
||||||
|
_nextTask = new ImportTask(_filename);
|
||||||
|
connect(_nextTask, SIGNAL(destroyed()), SLOT(launchTask()));
|
||||||
|
|
||||||
|
if (_currentTask != NULL) {
|
||||||
|
_voxelTree.cancelImport();
|
||||||
|
} else {
|
||||||
|
launchTask();
|
||||||
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue