add back in entry point for import voxels

This commit is contained in:
ZappoMan 2014-02-27 15:41:36 -08:00
parent b7f62eabf0
commit 1cc6288899
2 changed files with 21 additions and 0 deletions

View file

@ -1379,6 +1379,26 @@ void Application::exportVoxels(const VoxelDetail& sourceVoxel) {
_window->activateWindow();
}
void Application::importVoxels() {
if (!_voxelImporter) {
_voxelImporter = new VoxelImporter(_window);
_voxelImporter->loadSettings(_settings);
}
if (!_voxelImporter->exec()) {
qDebug() << "[DEBUG] Import succeeded." << endl;
} else {
qDebug() << "[DEBUG] Import failed." << endl;
if (_sharedVoxelSystem.getTree() == _voxelImporter->getVoxelTree()) {
_sharedVoxelSystem.killLocalVoxels();
_sharedVoxelSystem.changeTree(&_clipboard);
}
}
// restore the main window's active state
_window->activateWindow();
}
void Application::cutVoxels(const VoxelDetail& sourceVoxel) {
copyVoxels(sourceVoxel);
deleteVoxelAt(sourceVoxel);

View file

@ -235,6 +235,7 @@ public slots:
void nodeKilled(SharedNodePointer node);
void packetSent(quint64 length);
void importVoxels(); // doesn't include source voxel because it goes to clipboard
void cutVoxels(const VoxelDetail& sourceVoxel);
void copyVoxels(const VoxelDetail& sourceVoxel);
void pasteVoxels(const VoxelDetail& sourceVoxel);