mirror of
https://github.com/overte-org/overte.git
synced 2025-07-14 03:56:40 +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 <QGridLayout>
|
||||
#include <QSplitter>
|
||||
#include <QApplication>
|
||||
#include <QJsonDocument>
|
||||
#include <QJsonArray>
|
||||
#include <QJsonObject>
|
||||
|
@ -20,9 +19,9 @@ const QString IMPORT_BUTTON_NAME = QObject::tr("Import");
|
|||
const QString IMPORT_INFO = QObject::tr("<b>Import</b> %1 as voxels");
|
||||
const QString CANCEL_BUTTON_NAME = QObject::tr("Cancel");
|
||||
const QString INFO_LABEL_TEXT = QObject::tr("<div style='line-height:20px;'>"
|
||||
"This will load the selected file into Hifi and allow you<br/>"
|
||||
"to place it with %1-V; you must be in select or<br/>"
|
||||
"add mode (S or V keys will toggle mode) to place.</div>");
|
||||
"This will load the selected file into Hifi and allow you<br/>"
|
||||
"to place it with %1-V; you must be in select or<br/>"
|
||||
"add mode (S or V keys will toggle mode) to place.</div>");
|
||||
|
||||
const QString DESKTOP_LOCATION = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation);
|
||||
const int SHORT_FILE_EXTENSION = 4;
|
||||
|
@ -121,6 +120,8 @@ ImportDialog::ImportDialog(QWidget* parent) :
|
|||
setLayout();
|
||||
|
||||
connect(&_importButton, SIGNAL(pressed()), SLOT(import()));
|
||||
connect(this, SIGNAL(currentChanged(QString)), SLOT(saveCurrentFile(QString)));
|
||||
|
||||
connect(&_cancelButton, SIGNAL(pressed()), SLOT(close()));
|
||||
connect(this, SIGNAL(currentChanged(QString)), SLOT(saveCurrentFile(QString)));
|
||||
}
|
||||
|
@ -131,7 +132,6 @@ ImportDialog::~ImportDialog() {
|
|||
|
||||
void ImportDialog::import() {
|
||||
emit accepted();
|
||||
close();
|
||||
}
|
||||
|
||||
void ImportDialog::accept() {
|
||||
|
@ -251,7 +251,6 @@ void ImportDialog::setImportTypes() {
|
|||
QJsonObject fileFormatObject = fileFormat.toObject();
|
||||
|
||||
QString ext(fileFormatObject["extension"].toString());
|
||||
QString description(fileFormatObject.value("description").toString());
|
||||
QString icon(fileFormatObject.value("icon").toString());
|
||||
|
||||
if (formatsCounter > 0) {
|
||||
|
|
|
@ -103,6 +103,21 @@ int VoxelImporter::preImport() {
|
|||
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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue