History

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

ZappoMan committed 12 years ago

Commit 32d5eb32 parents 1b1c386 a6f0c9b159 files · +4368 −3616Browse files

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

Unified · Split

interface/src/Application.cpp+27−15
@@ -137,7 +137,8 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 136 unmodified lines
137137 _frameCount(0),
138138 _fps(60.0f),
139139 _justStarted(true),
140− _voxelImporter(NULL),
140+ _voxelImportDialog(NULL),
141+ _voxelImporter(),
141142 _importSucceded(false),
142143 _sharedVoxelSystem(TREE_SCALE, DEFAULT_MAX_VOXELS_PER_SYSTEM, &_clipboard),
143144 _entityClipboardRenderer(),
@@ -242,6 +243,8 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 98 unmodified lines
242243
243244 connect(&domainHandler, SIGNAL(hostnameChanged(const QString&)), SLOT(domainChanged(const QString&)));
244245 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()));
245248 connect(&domainHandler, &DomainHandler::settingsReceived, this, &Application::domainSettingsReceived);
246249
247250 // hookup VoxelEditSender to PaymentManager so we can pay for octree edits
@@ -430,7 +433,7 @@ Application::~Application() { · 182 unmodified lines
430433 delete idleTimer;
431434
432435 _sharedVoxelSystem.changeTree(new VoxelTree);
433− delete _voxelImporter;
436+ delete _voxelImportDialog;
434437
435438 // let the avatar mixer know we're out
436439 MyAvatar::sendKillAvatar();
@@ -465,8 +468,8 @@ void Application::saveSettings() { · 28 unmodified lines
465468 Menu::getInstance()->saveSettings();
466469 _rearMirrorTools->saveSettings(_settings);
467470
468− if (_voxelImporter) {
469− _voxelImporter->saveSettings(_settings);
471+ if (_voxelImportDialog) {
472+ _voxelImportDialog->saveSettings(_settings);
470473 }
471474 _settings->sync();
472475 _numChangedSettings = 0;
@@ -599,7 +602,7 @@ void Application::paintGL() { · 126 unmodified lines
599602
600603 if (_myCamera.getMode() == CAMERA_MODE_FIRST_PERSON) {
601604 _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());
603606 _myCamera.setTargetRotation(_myAvatar->getHead()->getCameraOrientation());
604607
605608 } else if (_myCamera.getMode() == CAMERA_MODE_THIRD_PERSON) {
@@ -621,7 +624,7 @@ void Application::paintGL() { · 15 unmodified lines
621624 _myCamera.setTargetPosition(_myAvatar->getHead()->getEyePosition() + glm::vec3(0, _raiseMirror * _myAvatar->getScale(), 0));
622625 } else {
623626 _myCamera.setTightness(0.0f);
624− glm::vec3 eyePosition = _myAvatar->getHead()->getFilteredEyePosition();
627+ glm::vec3 eyePosition = _myAvatar->getHead()->getEyePosition();
625628 float headHeight = eyePosition.y - _myAvatar->getPosition().y;
626629 _myCamera.setDistance(MIRROR_FULLSCREEN_DISTANCE * _scaleMirror);
627630 _myCamera.setTargetPosition(_myAvatar->getPosition() + glm::vec3(0, headHeight + (_raiseMirror * _myAvatar->getScale()), 0));
@@ -814,9 +817,8 @@ bool Application::event(QEvent* event) { · 186 unmodified lines
814817 QFileOpenEvent* fileEvent = static_cast<QFileOpenEvent*>(event);
815818 bool isHifiSchemeURL = !fileEvent->url().isEmpty() && fileEvent->url().toLocalFile().startsWith(CUSTOM_URL_SCHEME);
816819 if (isHifiSchemeURL) {
817− Menu::getInstance()->goTo(fileEvent->url().toString());
820+ Menu::getInstance()->goToURL(fileEvent->url().toLocalFile());
818821 }
819−
820822 return false;
821823 }
822824 return QApplication::event(event);
@@ -1440,6 +1442,15 @@ void Application::setEnable3DTVMode(bool enable3DTVMode) { · 617 unmodified lines
14401442 }
14411443
14421444 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+
14431454 resizeGL(_glWidget->width(), _glWidget->height());
14441455 }
14451456
@@ -1599,17 +1610,17 @@ void Application::exportVoxels(const VoxelDetail& sourceVoxel) { · 153 unmodified lines
15991610 void Application::importVoxels() {
16001611 _importSucceded = false;
16011612
1602− if (!_voxelImporter) {
1603− _voxelImporter = new VoxelImporter(_window);
1604− _voxelImporter->loadSettings(_settings);
1613+ if (!_voxelImportDialog) {
1614+ _voxelImportDialog = new VoxelImportDialog(_window);
1615+ _voxelImportDialog->loadSettings(_settings);
16051616 }
16061617
1607− if (!_voxelImporter->exec()) {
1618+ if (!_voxelImportDialog->exec()) {
16081619 qDebug() << "Import succeeded." << endl;
16091620 _importSucceded = true;
16101621 } else {
16111622 qDebug() << "Import failed." << endl;
1612− if (_sharedVoxelSystem.getTree() == _voxelImporter->getVoxelTree()) {
1623+ if (_sharedVoxelSystem.getTree() == _voxelImporter.getVoxelTree()) {
16131624 _sharedVoxelSystem.killLocalVoxels();
16141625 _sharedVoxelSystem.changeTree(&_clipboard);
16151626 }
@@ -1724,7 +1735,7 @@ void Application::init() { · 108 unmodified lines
17241735 // Cleanup of the original shared tree
17251736 _sharedVoxelSystem.init();
17261737
1727− _voxelImporter = new VoxelImporter(_window);
1738+ _voxelImportDialog = new VoxelImportDialog(_window);
17281739
17291740 _environment.init();
17301741
@@ -3322,9 +3333,10 @@ void Application::updateWindowTitle(){ · 1591 unmodified lines
33223333 QString buildVersion = " (build " + applicationVersion() + ")";
33233334 NodeList* nodeList = NodeList::getInstance();
33243335
3336+ QString connectionStatus = nodeList->getDomainHandler().isConnected() ? "" : " (NOT CONNECTED) ";
33253337 QString username = AccountManager::getInstance().getAccountInfo().getUsername();
33263338 QString title = QString() + (!username.isEmpty() ? username + " @ " : QString())
3327− + nodeList->getDomainHandler().getHostname() + buildVersion;
3339+ + nodeList->getDomainHandler().getHostname() + connectionStatus + buildVersion;
33283340
33293341 AccountManager& accountManager = AccountManager::getInstance();
33303342 if (accountManager.getAccountInfo().hasBalance()) {

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