mirror of
https://github.com/overte-org/overte.git
synced 2025-07-13 15:39:00 +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>
|
||||||
|
@ -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 IMPORT_INFO = QObject::tr("<b>Import</b> %1 as voxels");
|
||||||
const QString CANCEL_BUTTON_NAME = QObject::tr("Cancel");
|
const QString CANCEL_BUTTON_NAME = QObject::tr("Cancel");
|
||||||
const QString INFO_LABEL_TEXT = QObject::tr("<div style='line-height:20px;'>"
|
const QString INFO_LABEL_TEXT = QObject::tr("<div style='line-height:20px;'>"
|
||||||
"This will load the selected file into Hifi and allow you<br/>"
|
"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/>"
|
"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>");
|
"add mode (S or V keys will toggle mode) to place.</div>");
|
||||||
|
|
||||||
const QString DESKTOP_LOCATION = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation);
|
const QString DESKTOP_LOCATION = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation);
|
||||||
const int SHORT_FILE_EXTENSION = 4;
|
const int SHORT_FILE_EXTENSION = 4;
|
||||||
|
@ -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