History

Merge branch 'master' of https://github.com/highfidelity/hifi

Stephen Birarda committed 12 years ago

Commit 7f9794d2 parents ee9f893 8ede0ed9 files · +287 −223Browse files

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

Unified · Split

interface/src/Application.cpp+28−11
@@ -309,8 +309,13 @@ Application::~Application() { · 308 unmodified lines
309309 delete idleTimer;
310310
311311 Menu::getInstance()->saveSettings();
312−
313312 _rearMirrorTools->saveSettings(_settings);
313+
314+ _sharedVoxelSystem.changeTree(new VoxelTree);
315+ if (_voxelImporter) {
316+ _voxelImporter->saveSettings(_settings);
317+ delete _voxelImporter;
318+ }
314319 _settings->sync();
315320
316321 // let the avatar mixer know we're out
@@ -331,7 +336,6 @@ Application::~Application() { · 14 unmodified lines
331336
332337 storeSizeAndPosition();
333338 saveScripts();
334− _sharedVoxelSystem.changeTree(new VoxelTree);
335339
336340 VoxelTreeElement::removeDeleteHook(&_voxels); // we don't need to do this processing on shutdown
337341 Menu::getInstance()->deleteLater();
@@ -1299,8 +1303,14 @@ void Application::mousePressEvent(QMouseEvent* event) { · 961 unmodified lines
12991303 pasteVoxels();
13001304 }
13011305
1302− } else if (event->button() == Qt::RightButton && Menu::getInstance()->isVoxelModeActionChecked()) {
1303− deleteVoxelUnderCursor();
1306+ } else if (event->button() == Qt::RightButton) {
1307+ if (Menu::getInstance()->isVoxelModeActionChecked()) {
1308+ deleteVoxelUnderCursor();
1309+ }
1310+ if (_pasteMode) {
1311+ _pasteMode = false;
1312+ }
1313+
13041314 }
13051315 }
13061316 }
@@ -1710,13 +1720,19 @@ void Application::exportVoxels() { · 403 unmodified lines
17101720 void Application::importVoxels() {
17111721 if (!_voxelImporter) {
17121722 _voxelImporter = new VoxelImporter(_window);
1713− _voxelImporter->init(_settings);
1723+ _voxelImporter->loadSettings(_settings);
17141724 }
17151725
1716− if (_voxelImporter->exec()) {
1717− qDebug("[DEBUG] Import succeeded.");
1726+ if (!_voxelImporter->exec()) {
1727+ qDebug() << "[DEBUG] Import succeeded." << endl;
1728+ Menu::getInstance()->setIsOptionChecked(MenuOption::VoxelSelectMode, true);
1729+ _pasteMode = true;
17181730 } else {
1719− qDebug("[DEBUG] Import failed.");
1731+ qDebug() << "[DEBUG] Import failed." << endl;
1732+ if (_sharedVoxelSystem.getTree() == _voxelImporter->getVoxelTree()) {
1733+ _sharedVoxelSystem.killLocalVoxels();
1734+ _sharedVoxelSystem.changeTree(&_clipboard);
1735+ }
17201736 }
17211737
17221738 // restore the main window's active state
@@ -1773,10 +1789,11 @@ void Application::pasteVoxels() { · 50 unmodified lines
17731789 }
17741790
17751791 pasteVoxelsToOctalCode(octalCodeDestination);
1776−
1792+
17771793 if (calculatedOctCode) {
17781794 delete[] calculatedOctCode;
17791795 }
1796+ _pasteMode = false;
17801797 }
17811798
17821799 void Application::findAxisAlignment() {
@@ -1848,6 +1865,7 @@ void Application::init() { · 65 unmodified lines
18481865
18491866 VoxelTreeElement::removeUpdateHook(&_sharedVoxelSystem);
18501867
1868+ // Cleanup of the original shared tree
18511869 _sharedVoxelSystem.init();
18521870 VoxelTree* tmpTree = _sharedVoxelSystem.getTree();
18531871 _sharedVoxelSystem.changeTree(&_clipboard);
@@ -1939,12 +1957,11 @@ void Application::init() { · 85 unmodified lines
19391957 _audio.init(_glWidget);
19401958
19411959 _rearMirrorTools = new RearMirrorTools(_glWidget, _mirrorViewRect, _settings);
1960+
19421961 connect(_rearMirrorTools, SIGNAL(closeView()), SLOT(closeMirrorView()));
19431962 connect(_rearMirrorTools, SIGNAL(restoreView()), SLOT(restoreMirrorView()));
19441963 connect(_rearMirrorTools, SIGNAL(shrinkView()), SLOT(shrinkMirrorView()));
19451964 connect(_rearMirrorTools, SIGNAL(resetView()), SLOT(resetSensors()));
1946−
1947−
19481965 }
19491966
19501967 void Application::closeMirrorView() {

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