Showing the changes to interface/src/Application.cpp (1 of 1 file). Show all
Unified · Split
| @@ -309,8 +309,13 @@ Application::~Application() { · 308 unmodified lines | ||
| 309 | 309 | delete idleTimer; |
| 310 | 310 | |
| 311 | 311 | Menu::getInstance()->saveSettings(); |
| 312 | − | |
| 313 | 312 | _rearMirrorTools->saveSettings(_settings); |
| 313 | + | |
| 314 | + _sharedVoxelSystem.changeTree(new VoxelTree); | |
| 315 | + if (_voxelImporter) { | |
| 316 | + _voxelImporter->saveSettings(_settings); | |
| 317 | + delete _voxelImporter; | |
| 318 | + } | |
| 314 | 319 | _settings->sync(); |
| 315 | 320 | |
| 316 | 321 | // let the avatar mixer know we're out |
| @@ -331,7 +336,6 @@ Application::~Application() { · 14 unmodified lines | ||
| 331 | 336 | |
| 332 | 337 | storeSizeAndPosition(); |
| 333 | 338 | saveScripts(); |
| 334 | − _sharedVoxelSystem.changeTree(new VoxelTree); | |
| 335 | 339 | |
| 336 | 340 | VoxelTreeElement::removeDeleteHook(&_voxels); // we don't need to do this processing on shutdown |
| 337 | 341 | Menu::getInstance()->deleteLater(); |
| @@ -1296,8 +1300,14 @@ void Application::mousePressEvent(QMouseEvent* event) { · 958 unmodified lines | ||
| 1296 | 1300 | pasteVoxels(); |
| 1297 | 1301 | } |
| 1298 | 1302 | |
| 1299 | − } else if (event->button() == Qt::RightButton && Menu::getInstance()->isVoxelModeActionChecked()) { | |
| 1300 | − deleteVoxelUnderCursor(); | |
| 1303 | + } else if (event->button() == Qt::RightButton) { | |
| 1304 | + if (Menu::getInstance()->isVoxelModeActionChecked()) { | |
| 1305 | + deleteVoxelUnderCursor(); | |
| 1306 | + } | |
| 1307 | + if (_pasteMode) { | |
| 1308 | + _pasteMode = false; | |
| 1309 | + } | |
| 1310 | + | |
| 1301 | 1311 | } |
| 1302 | 1312 | } |
| 1303 | 1313 | } |
| @@ -1707,13 +1717,19 @@ void Application::exportVoxels() { · 403 unmodified lines | ||
| 1707 | 1717 | void Application::importVoxels() { |
| 1708 | 1718 | if (!_voxelImporter) { |
| 1709 | 1719 | _voxelImporter = new VoxelImporter(_window); |
| 1710 | − _voxelImporter->init(_settings); | |
| 1720 | + _voxelImporter->loadSettings(_settings); | |
| 1711 | 1721 | } |
| 1712 | 1722 | |
| 1713 | − if (_voxelImporter->exec()) { | |
| 1714 | − qDebug("[DEBUG] Import succeeded."); | |
| 1723 | + if (!_voxelImporter->exec()) { | |
| 1724 | + qDebug() << "[DEBUG] Import succeeded." << endl; | |
| 1725 | + Menu::getInstance()->setIsOptionChecked(MenuOption::VoxelSelectMode, true); | |
| 1726 | + _pasteMode = true; | |
| 1715 | 1727 | } else { |
| 1716 | − qDebug("[DEBUG] Import failed."); | |
| 1728 | + qDebug() << "[DEBUG] Import failed." << endl; | |
| 1729 | + if (_sharedVoxelSystem.getTree() == _voxelImporter->getVoxelTree()) { | |
| 1730 | + _sharedVoxelSystem.killLocalVoxels(); | |
| 1731 | + _sharedVoxelSystem.changeTree(&_clipboard); | |
| 1732 | + } | |
| 1717 | 1733 | } |
| 1718 | 1734 | |
| 1719 | 1735 | // restore the main window's active state |
| @@ -1770,10 +1786,11 @@ void Application::pasteVoxels() { · 50 unmodified lines | ||
| 1770 | 1786 | } |
| 1771 | 1787 | |
| 1772 | 1788 | pasteVoxelsToOctalCode(octalCodeDestination); |
| 1773 | − | |
| 1789 | + | |
| 1774 | 1790 | if (calculatedOctCode) { |
| 1775 | 1791 | delete[] calculatedOctCode; |
| 1776 | 1792 | } |
| 1793 | + _pasteMode = false; | |
| 1777 | 1794 | } |
| 1778 | 1795 | |
| 1779 | 1796 | void Application::findAxisAlignment() { |
| @@ -1845,6 +1862,7 @@ void Application::init() { · 65 unmodified lines | ||
| 1845 | 1862 | |
| 1846 | 1863 | VoxelTreeElement::removeUpdateHook(&_sharedVoxelSystem); |
| 1847 | 1864 | |
| 1865 | + // Cleanup of the original shared tree | |
| 1848 | 1866 | _sharedVoxelSystem.init(); |
| 1849 | 1867 | VoxelTree* tmpTree = _sharedVoxelSystem.getTree(); |
| 1850 | 1868 | _sharedVoxelSystem.changeTree(&_clipboard); |
| @@ -1936,12 +1954,11 @@ void Application::init() { · 85 unmodified lines | ||
| 1936 | 1954 | _audio.init(_glWidget); |
| 1937 | 1955 | |
| 1938 | 1956 | _rearMirrorTools = new RearMirrorTools(_glWidget, _mirrorViewRect, _settings); |
| 1957 | + | |
| 1939 | 1958 | connect(_rearMirrorTools, SIGNAL(closeView()), SLOT(closeMirrorView())); |
| 1940 | 1959 | connect(_rearMirrorTools, SIGNAL(restoreView()), SLOT(restoreMirrorView())); |
| 1941 | 1960 | connect(_rearMirrorTools, SIGNAL(shrinkView()), SLOT(shrinkMirrorView())); |
| 1942 | 1961 | connect(_rearMirrorTools, SIGNAL(resetView()), SLOT(resetSensors())); |
| 1943 | − | |
| 1944 | − | |
| 1945 | 1962 | } |
| 1946 | 1963 | |
| 1947 | 1964 | void Application::closeMirrorView() { |
| @@ -2090,7 +2107,7 @@ void Application::updateMouseVoxels(float deltaTime, float& distance, BoxFace& f · 142 unmodified lines | ||
| 2090 | 2107 | PerformanceWarning warn(showWarnings, "Application::updateMouseVoxels()"); |
| 2091 | 2108 | |
| 2092 | 2109 | _mouseVoxel.s = 0.0f; |
| 2093 | − bool wasInitialized = _mouseVoxelScaleInitialized; | |
| 2110 | + bool wasInitialized = _mouseVoxelScaleInitialized ; | |
| 2094 | 2111 | if (Menu::getInstance()->isVoxelModeActionChecked() && |
| 2095 | 2112 | (fabs(_myAvatar->getVelocity().x) + |
| 2096 | 2113 | fabs(_myAvatar->getVelocity().y) + |