History

Dialogbox for import fully functionnal

atlante45 committed 13 years ago

Commit 24531fd1 parent b41575912 files · +270 −81Browse files

Showing the changes to interface/src/Application.cpp (1 of 12 files). Show all

Unified · Split

interface/src/Application.cpp+17−7
@@ -1199,13 +1199,13 @@ void Application::importVoxelsToClipboard() { · 1198 unmodified lines
11991199 QByteArray fileNameAscii = fileNameString.toLocal8Bit();
12001200 const char* fileName = fileNameAscii.data();
12011201
1202− _clipboardTree.eraseAllVoxels();
1202+ _clipboard.killLocalVoxels();
12031203 if (fileNameString.endsWith(".png", Qt::CaseInsensitive)) {
1204− _clipboardTree.readFromSquareARGB32Pixels(fileName);
1204+ _clipboard.readFromSquareARGB32Pixels(fileName);
12051205 } else if (fileNameString.endsWith(".svo", Qt::CaseInsensitive)) {
1206− _clipboardTree.readFromSVOFile(fileName);
1206+ _clipboard.readFromSVOFile(fileName);
12071207 } else if (fileNameString.endsWith(".schematic", Qt::CaseInsensitive)) {
1208− _clipboardTree.readFromSchematicFile(fileName);
1208+ _clipboard.readFromSchematicFile(fileName);
12091209 }
12101210
12111211 // restore the main window's active state
@@ -1213,6 +1213,16 @@ void Application::importVoxelsToClipboard() { · 1 unmodified line
12131213 }
12141214
12151215 void Application::importVoxels() {
1216+ if (_voxelImporter.exec()) {
1217+ qDebug("[DEBUG] Import succedded.\n");
1218+
1219+
1220+ } else {
1221+ qDebug("[DEBUG] Import failed.\n");
1222+ }
1223+
1224+ return;
1225+
12161226 QString desktopLocation = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation);
12171227
12181228 QStringList fileNameStringList = QFileDialog::getOpenFileNames(_glWidget, tr("Import Voxels"), desktopLocation,
@@ -1369,10 +1379,10 @@ void Application::copyVoxels() { · 150 unmodified lines
13691379 VoxelNode* selectedNode = _voxels.getVoxelAt(_mouseVoxel.x, _mouseVoxel.y, _mouseVoxel.z, _mouseVoxel.s);
13701380 if (selectedNode) {
13711381 // clear the clipboard first...
1372− _clipboardTree.eraseAllVoxels();
1382+ _clipboard.killLocalVoxels();
13731383
13741384 // then copy onto it
1375− _voxels.copySubTreeIntoNewTree(selectedNode, &_clipboardTree, true);
1385+ //_voxels.copySubTreeIntoNewTree(selectedNode, _clipboard, true);
13761386 }
13771387 }
13781388
@@ -1393,7 +1403,7 @@ void Application::pasteVoxels() { · 14 unmodified lines
13931403 args.newBaseOctCode = calculatedOctCode = pointToVoxel(_mouseVoxel.x, _mouseVoxel.y, _mouseVoxel.z, _mouseVoxel.s);
13941404 }
13951405
1396− _clipboardTree.recurseTreeWithOperation(sendVoxelsOperation, &args);
1406+ //_clipboard.recurseTreeWithOperation(sendVoxelsOperation, &args);
13971407 _voxelEditSender.flushQueue();
13981408
13991409 if (calculatedOctCode) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t