History

Added switch to pasteMode after successful import.

Atlante45 committed 12 years ago

Commit f24cd0c1 parent 64031701 file · +29 −12Browse files

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

Unified · Split

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

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