Showing the changes to interface/src/Application.cpp (1 of 159 files). Show all
Unified · Split
| @@ -137,7 +137,8 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 136 unmodified lines | ||
| 137 | 137 | _frameCount(0), |
| 138 | 138 | _fps(60.0f), |
| 139 | 139 | _justStarted(true), |
| 140 | − _voxelImporter(NULL), | |
| 140 | + _voxelImportDialog(NULL), | |
| 141 | + _voxelImporter(), | |
| 141 | 142 | _importSucceded(false), |
| 142 | 143 | _sharedVoxelSystem(TREE_SCALE, DEFAULT_MAX_VOXELS_PER_SYSTEM, &_clipboard), |
| 143 | 144 | _entityClipboardRenderer(), |
| @@ -242,6 +243,8 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 98 unmodified lines | ||
| 242 | 243 | |
| 243 | 244 | connect(&domainHandler, SIGNAL(hostnameChanged(const QString&)), SLOT(domainChanged(const QString&))); |
| 244 | 245 | connect(&domainHandler, SIGNAL(connectedToDomain(const QString&)), SLOT(connectedToDomain(const QString&))); |
| 246 | + connect(&domainHandler, SIGNAL(connectedToDomain(const QString&)), SLOT(updateWindowTitle())); | |
| 247 | + connect(&domainHandler, SIGNAL(disconnectedFromDomain()), SLOT(updateWindowTitle())); | |
| 245 | 248 | connect(&domainHandler, &DomainHandler::settingsReceived, this, &Application::domainSettingsReceived); |
| 246 | 249 | |
| 247 | 250 | // hookup VoxelEditSender to PaymentManager so we can pay for octree edits |
| @@ -430,7 +433,7 @@ Application::~Application() { · 182 unmodified lines | ||
| 430 | 433 | delete idleTimer; |
| 431 | 434 | |
| 432 | 435 | _sharedVoxelSystem.changeTree(new VoxelTree); |
| 433 | − delete _voxelImporter; | |
| 436 | + delete _voxelImportDialog; | |
| 434 | 437 | |
| 435 | 438 | // let the avatar mixer know we're out |
| 436 | 439 | MyAvatar::sendKillAvatar(); |
| @@ -465,8 +468,8 @@ void Application::saveSettings() { · 28 unmodified lines | ||
| 465 | 468 | Menu::getInstance()->saveSettings(); |
| 466 | 469 | _rearMirrorTools->saveSettings(_settings); |
| 467 | 470 | |
| 468 | − if (_voxelImporter) { | |
| 469 | − _voxelImporter->saveSettings(_settings); | |
| 471 | + if (_voxelImportDialog) { | |
| 472 | + _voxelImportDialog->saveSettings(_settings); | |
| 470 | 473 | } |
| 471 | 474 | _settings->sync(); |
| 472 | 475 | _numChangedSettings = 0; |
| @@ -599,7 +602,7 @@ void Application::paintGL() { · 126 unmodified lines | ||
| 599 | 602 | |
| 600 | 603 | if (_myCamera.getMode() == CAMERA_MODE_FIRST_PERSON) { |
| 601 | 604 | _myCamera.setTightness(0.0f); // In first person, camera follows (untweaked) head exactly without delay |
| 602 | − _myCamera.setTargetPosition(_myAvatar->getHead()->getFilteredEyePosition()); | |
| 605 | + _myCamera.setTargetPosition(_myAvatar->getHead()->getEyePosition()); | |
| 603 | 606 | _myCamera.setTargetRotation(_myAvatar->getHead()->getCameraOrientation()); |
| 604 | 607 | |
| 605 | 608 | } else if (_myCamera.getMode() == CAMERA_MODE_THIRD_PERSON) { |
| @@ -621,7 +624,7 @@ void Application::paintGL() { · 15 unmodified lines | ||
| 621 | 624 | _myCamera.setTargetPosition(_myAvatar->getHead()->getEyePosition() + glm::vec3(0, _raiseMirror * _myAvatar->getScale(), 0)); |
| 622 | 625 | } else { |
| 623 | 626 | _myCamera.setTightness(0.0f); |
| 624 | − glm::vec3 eyePosition = _myAvatar->getHead()->getFilteredEyePosition(); | |
| 627 | + glm::vec3 eyePosition = _myAvatar->getHead()->getEyePosition(); | |
| 625 | 628 | float headHeight = eyePosition.y - _myAvatar->getPosition().y; |
| 626 | 629 | _myCamera.setDistance(MIRROR_FULLSCREEN_DISTANCE * _scaleMirror); |
| 627 | 630 | _myCamera.setTargetPosition(_myAvatar->getPosition() + glm::vec3(0, headHeight + (_raiseMirror * _myAvatar->getScale()), 0)); |
| @@ -814,9 +817,8 @@ bool Application::event(QEvent* event) { · 186 unmodified lines | ||
| 814 | 817 | QFileOpenEvent* fileEvent = static_cast<QFileOpenEvent*>(event); |
| 815 | 818 | bool isHifiSchemeURL = !fileEvent->url().isEmpty() && fileEvent->url().toLocalFile().startsWith(CUSTOM_URL_SCHEME); |
| 816 | 819 | if (isHifiSchemeURL) { |
| 817 | − Menu::getInstance()->goTo(fileEvent->url().toString()); | |
| 820 | + Menu::getInstance()->goToURL(fileEvent->url().toLocalFile()); | |
| 818 | 821 | } |
| 819 | − | |
| 820 | 822 | return false; |
| 821 | 823 | } |
| 822 | 824 | return QApplication::event(event); |
| @@ -1440,6 +1442,15 @@ void Application::setEnable3DTVMode(bool enable3DTVMode) { · 617 unmodified lines | ||
| 1440 | 1442 | } |
| 1441 | 1443 | |
| 1442 | 1444 | void Application::setEnableVRMode(bool enableVRMode) { |
| 1445 | + if (enableVRMode) { | |
| 1446 | + if (!OculusManager::isConnected()) { | |
| 1447 | + // attempt to reconnect the Oculus manager - it's possible this was a workaround | |
| 1448 | + // for the sixense crash | |
| 1449 | + OculusManager::disconnect(); | |
| 1450 | + OculusManager::connect(); | |
| 1451 | + } | |
| 1452 | + } | |
| 1453 | + | |
| 1443 | 1454 | resizeGL(_glWidget->width(), _glWidget->height()); |
| 1444 | 1455 | } |
| 1445 | 1456 | |
| @@ -1599,17 +1610,17 @@ void Application::exportVoxels(const VoxelDetail& sourceVoxel) { · 153 unmodified lines | ||
| 1599 | 1610 | void Application::importVoxels() { |
| 1600 | 1611 | _importSucceded = false; |
| 1601 | 1612 | |
| 1602 | − if (!_voxelImporter) { | |
| 1603 | − _voxelImporter = new VoxelImporter(_window); | |
| 1604 | − _voxelImporter->loadSettings(_settings); | |
| 1613 | + if (!_voxelImportDialog) { | |
| 1614 | + _voxelImportDialog = new VoxelImportDialog(_window); | |
| 1615 | + _voxelImportDialog->loadSettings(_settings); | |
| 1605 | 1616 | } |
| 1606 | 1617 | |
| 1607 | − if (!_voxelImporter->exec()) { | |
| 1618 | + if (!_voxelImportDialog->exec()) { | |
| 1608 | 1619 | qDebug() << "Import succeeded." << endl; |
| 1609 | 1620 | _importSucceded = true; |
| 1610 | 1621 | } else { |
| 1611 | 1622 | qDebug() << "Import failed." << endl; |
| 1612 | − if (_sharedVoxelSystem.getTree() == _voxelImporter->getVoxelTree()) { | |
| 1623 | + if (_sharedVoxelSystem.getTree() == _voxelImporter.getVoxelTree()) { | |
| 1613 | 1624 | _sharedVoxelSystem.killLocalVoxels(); |
| 1614 | 1625 | _sharedVoxelSystem.changeTree(&_clipboard); |
| 1615 | 1626 | } |
| @@ -1724,7 +1735,7 @@ void Application::init() { · 108 unmodified lines | ||
| 1724 | 1735 | // Cleanup of the original shared tree |
| 1725 | 1736 | _sharedVoxelSystem.init(); |
| 1726 | 1737 | |
| 1727 | − _voxelImporter = new VoxelImporter(_window); | |
| 1738 | + _voxelImportDialog = new VoxelImportDialog(_window); | |
| 1728 | 1739 | |
| 1729 | 1740 | _environment.init(); |
| 1730 | 1741 | |
| @@ -3322,9 +3333,10 @@ void Application::updateWindowTitle(){ · 1591 unmodified lines | ||
| 3322 | 3333 | QString buildVersion = " (build " + applicationVersion() + ")"; |
| 3323 | 3334 | NodeList* nodeList = NodeList::getInstance(); |
| 3324 | 3335 | |
| 3336 | + QString connectionStatus = nodeList->getDomainHandler().isConnected() ? "" : " (NOT CONNECTED) "; | |
| 3325 | 3337 | QString username = AccountManager::getInstance().getAccountInfo().getUsername(); |
| 3326 | 3338 | QString title = QString() + (!username.isEmpty() ? username + " @ " : QString()) |
| 3327 | − + nodeList->getDomainHandler().getHostname() + buildVersion; | |
| 3339 | + + nodeList->getDomainHandler().getHostname() + connectionStatus + buildVersion; | |
| 3328 | 3340 | |
| 3329 | 3341 | AccountManager& accountManager = AccountManager::getInstance(); |
| 3330 | 3342 | if (accountManager.getAccountInfo().hasBalance()) { |