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