New paste behaviour
Showing the changes to interface/src/Application.cpp (1 of 4 files). Show all
Unified · Split
| @@ -495,6 +495,11 @@ void Application::keyPressEvent(QKeyEvent* event) { · 494 unmodified lines | ||
| 495 | 495 | |
| 496 | 496 | bool isShifted = event->modifiers().testFlag(Qt::ShiftModifier); |
| 497 | 497 | switch (event->key()) { |
| 498 | + case Qt::Key_Shift: | |
| 499 | + if (Menu::getInstance()->isOptionChecked(MenuOption::VoxelSelectMode)) { | |
| 500 | + _pasteMode = true; | |
| 501 | + } | |
| 502 | + break; | |
| 498 | 503 | case Qt::Key_BracketLeft: |
| 499 | 504 | case Qt::Key_BracketRight: |
| 500 | 505 | case Qt::Key_BraceLeft: |
| @@ -726,6 +731,9 @@ void Application::keyReleaseEvent(QKeyEvent* event) { · 225 unmodified lines | ||
| 726 | 731 | } |
| 727 | 732 | |
| 728 | 733 | switch (event->key()) { |
| 734 | + case Qt::Key_Shift: | |
| 735 | + _pasteMode = false; | |
| 736 | + break; | |
| 729 | 737 | case Qt::Key_E: |
| 730 | 738 | _myAvatar.setDriveKeys(UP, 0); |
| 731 | 739 | break; |
| @@ -1201,22 +1209,17 @@ void Application::exportVoxels() { · 469 unmodified lines | ||
| 1201 | 1209 | } |
| 1202 | 1210 | |
| 1203 | 1211 | void Application::importVoxels() { |
| 1204 | − _pasteMode = false; | |
| 1205 | − | |
| 1206 | 1212 | if (_voxelImporter.exec()) { |
| 1207 | 1213 | qDebug("[DEBUG] Import succedded.\n"); |
| 1208 | 1214 | |
| 1209 | − if (_voxelImporter.getimportIntoClipboard()) { | |
| 1215 | + if (_voxelImporter.getImportIntoClipboard()) { | |
| 1210 | 1216 | _clipboard.killLocalVoxels(); |
| 1211 | 1217 | _voxelImporter.getVoxelSystem()->copySubTreeIntoNewTree( |
| 1212 | 1218 | _voxelImporter.getVoxelSystem()->getVoxelAt(0, 0, 0, 1), |
| 1213 | 1219 | &_clipboard, |
| 1214 | 1220 | true); |
| 1215 | − } else { | |
| 1216 | − _pasteMode = true; | |
| 1221 | + _voxelImporter.reset(); | |
| 1217 | 1222 | } |
| 1218 | − | |
| 1219 | − | |
| 1220 | 1223 | } else { |
| 1221 | 1224 | qDebug("[DEBUG] Import failed.\n"); |
| 1222 | 1225 | } |
| @@ -1239,12 +1242,6 @@ void Application::copyVoxels() { · 16 unmodified lines | ||
| 1239 | 1242 | // then copy onto it |
| 1240 | 1243 | _voxels.copySubTreeIntoNewTree(selectedNode, &_clipboard, true); |
| 1241 | 1244 | } |
| 1242 | − | |
| 1243 | − _pasteMode = false; | |
| 1244 | −} | |
| 1245 | − | |
| 1246 | −void Application::togglePasteMode() { | |
| 1247 | − _pasteMode = !_pasteMode; | |
| 1248 | 1245 | } |
| 1249 | 1246 | |
| 1250 | 1247 | void Application::pasteVoxels() { |