History

Merge pull request #877 from Atlante45/separate_import_with_preview

New paste behaviour

ZappoMan committed 13 years ago

Commit 18dbfd52 parents 1995788 bae0f7f4 files · +12 −16Browse files

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

Unified · Split

interface/src/Application.cpp+10−13
@@ -495,6 +495,11 @@ void Application::keyPressEvent(QKeyEvent* event) { · 494 unmodified lines
495495
496496 bool isShifted = event->modifiers().testFlag(Qt::ShiftModifier);
497497 switch (event->key()) {
498+ case Qt::Key_Shift:
499+ if (Menu::getInstance()->isOptionChecked(MenuOption::VoxelSelectMode)) {
500+ _pasteMode = true;
501+ }
502+ break;
498503 case Qt::Key_BracketLeft:
499504 case Qt::Key_BracketRight:
500505 case Qt::Key_BraceLeft:
@@ -726,6 +731,9 @@ void Application::keyReleaseEvent(QKeyEvent* event) { · 225 unmodified lines
726731 }
727732
728733 switch (event->key()) {
734+ case Qt::Key_Shift:
735+ _pasteMode = false;
736+ break;
729737 case Qt::Key_E:
730738 _myAvatar.setDriveKeys(UP, 0);
731739 break;
@@ -1201,22 +1209,17 @@ void Application::exportVoxels() { · 469 unmodified lines
12011209 }
12021210
12031211 void Application::importVoxels() {
1204− _pasteMode = false;
1205−
12061212 if (_voxelImporter.exec()) {
12071213 qDebug("[DEBUG] Import succedded.\n");
12081214
1209− if (_voxelImporter.getimportIntoClipboard()) {
1215+ if (_voxelImporter.getImportIntoClipboard()) {
12101216 _clipboard.killLocalVoxels();
12111217 _voxelImporter.getVoxelSystem()->copySubTreeIntoNewTree(
12121218 _voxelImporter.getVoxelSystem()->getVoxelAt(0, 0, 0, 1),
12131219 &_clipboard,
12141220 true);
1215− } else {
1216− _pasteMode = true;
1221+ _voxelImporter.reset();
12171222 }
1218−
1219−
12201223 } else {
12211224 qDebug("[DEBUG] Import failed.\n");
12221225 }
@@ -1239,12 +1242,6 @@ void Application::copyVoxels() { · 16 unmodified lines
12391242 // then copy onto it
12401243 _voxels.copySubTreeIntoNewTree(selectedNode, &_clipboard, true);
12411244 }
1242−
1243− _pasteMode = false;
1244−}
1245−
1246−void Application::togglePasteMode() {
1247− _pasteMode = !_pasteMode;
12481245 }
12491246
12501247 void Application::pasteVoxels() {

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