Showing the changes to interface/src/Application.cpp (1 of 47 files). Show all
Unified · Split
| @@ -30,7 +30,6 @@ · 29 unmodified lines | |||
| 30 | #include <QImage> | 30 | #include <QImage> |
| 31 | #include <QInputDialog> | 31 | #include <QInputDialog> |
| 32 | #include <QKeyEvent> | 32 | #include <QKeyEvent> |
| 33 | #include <QMainWindow> | ||
| 34 | #include <QMenuBar> | 33 | #include <QMenuBar> |
| 35 | #include <QMouseEvent> | 34 | #include <QMouseEvent> |
| 36 | #include <QNetworkAccessManager> | 35 | #include <QNetworkAccessManager> |
| @@ -134,7 +133,7 @@ QString& Application::resourcesPath() { · 97 unmodified lines | |||
| 134 | 133 | ||
| 135 | Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : | 134 | Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : |
| 136 | QApplication(argc, argv), | 135 | QApplication(argc, argv), |
| 137 | _window(new QMainWindow(desktop())), | 136 | _window(new MainWindow(desktop())), |
| 138 | _glWidget(new GLCanvas()), | 137 | _glWidget(new GLCanvas()), |
| 139 | _nodeThread(new QThread(this)), | 138 | _nodeThread(new QThread(this)), |
| 140 | _datagramProcessor(), | 139 | _datagramProcessor(), |
| @@ -166,11 +165,13 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 25 unmodified lines | |||
| 166 | _packetsPerSecond(0), | 165 | _packetsPerSecond(0), |
| 167 | _bytesPerSecond(0), | 166 | _bytesPerSecond(0), |
| 168 | _previousScriptLocation(), | 167 | _previousScriptLocation(), |
| 169 | _logger(new FileLogger(this)) | 168 | _logger(new FileLogger(this)), |
| 169 | _runningScriptsWidget(new RunningScriptsWidget(_window)), | ||
| 170 | _runningScriptsWidgetWasVisible(false) | ||
| 170 | { | 171 | { |
| 171 | // init GnuTLS for DTLS with domain-servers | 172 | // init GnuTLS for DTLS with domain-servers |
| 172 | DTLSClientSession::globalInit(); | 173 | DTLSClientSession::globalInit(); |
| 173 | 174 | ||
| 174 | // read the ApplicationInfo.ini file for Name/Version/Domain information | 175 | // read the ApplicationInfo.ini file for Name/Version/Domain information |
| 175 | QSettings applicationInfo(Application::resourcesPath() + "info/ApplicationInfo.ini", QSettings::IniFormat); | 176 | QSettings applicationInfo(Application::resourcesPath() + "info/ApplicationInfo.ini", QSettings::IniFormat); |
| 176 | 177 | ||
| @@ -318,6 +319,9 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 141 unmodified lines | |||
| 318 | Particle::setVoxelEditPacketSender(&_voxelEditSender); | 319 | Particle::setVoxelEditPacketSender(&_voxelEditSender); |
| 319 | Particle::setParticleEditPacketSender(&_particleEditSender); | 320 | Particle::setParticleEditPacketSender(&_particleEditSender); |
| 320 | 321 | ||
| 322 | // when -url in command line, teleport to location | ||
| 323 | urlGoTo(argc, constArgv); | ||
| 324 | |||
| 321 | // For now we're going to set the PPS for outbound packets to be super high, this is | 325 | // For now we're going to set the PPS for outbound packets to be super high, this is |
| 322 | // probably not the right long term solution. But for now, we're going to do this to | 326 | // probably not the right long term solution. But for now, we're going to do this to |
| 323 | // allow you to move a particle around in your hand | 327 | // allow you to move a particle around in your hand |
| @@ -333,7 +337,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 9 unmodified lines | |||
| 333 | LocalVoxelsList::getInstance()->addPersistantTree(DOMAIN_TREE_NAME, _voxels.getTree()); | 337 | LocalVoxelsList::getInstance()->addPersistantTree(DOMAIN_TREE_NAME, _voxels.getTree()); |
| 334 | LocalVoxelsList::getInstance()->addPersistantTree(CLIPBOARD_TREE_NAME, &_clipboard); | 338 | LocalVoxelsList::getInstance()->addPersistantTree(CLIPBOARD_TREE_NAME, &_clipboard); |
| 335 | 339 | ||
| 336 | _window->addDockWidget(Qt::NoDockWidgetArea, _runningScriptsWidget = new RunningScriptsWidget()); | ||
| 337 | _runningScriptsWidget->setRunningScripts(getRunningScripts()); | 340 | _runningScriptsWidget->setRunningScripts(getRunningScripts()); |
| 338 | connect(_runningScriptsWidget, &RunningScriptsWidget::stopScriptName, this, &Application::stopScript); | 341 | connect(_runningScriptsWidget, &RunningScriptsWidget::stopScriptName, this, &Application::stopScript); |
| 339 | 342 | ||
| @@ -344,18 +347,22 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 4 unmodified lines | |||
| 344 | // clear the scripts, and set out script to our default scripts | 347 | // clear the scripts, and set out script to our default scripts |
| 345 | clearScriptsBeforeRunning(); | 348 | clearScriptsBeforeRunning(); |
| 346 | loadScript("http://public.highfidelity.io/scripts/defaultScripts.js"); | 349 | loadScript("http://public.highfidelity.io/scripts/defaultScripts.js"); |
| 347 | 350 | ||
| 348 | QMutexLocker locker(&_settingsMutex); | 351 | QMutexLocker locker(&_settingsMutex); |
| 349 | _settings->setValue("firstRun",QVariant(false)); | 352 | _settings->setValue("firstRun",QVariant(false)); |
| 350 | } else { | 353 | } else { |
| 351 | // do this as late as possible so that all required subsystems are inialized | 354 | // do this as late as possible so that all required subsystems are inialized |
| 352 | loadScripts(); | 355 | loadScripts(); |
| 353 | 356 | ||
| 354 | QMutexLocker locker(&_settingsMutex); | 357 | QMutexLocker locker(&_settingsMutex); |
| 355 | _previousScriptLocation = _settings->value("LastScriptLocation", QVariant("")).toString(); | 358 | _previousScriptLocation = _settings->value("LastScriptLocation", QVariant("")).toString(); |
| 356 | } | 359 | } |
| 357 | //When -url in command line, teleport to location | 360 | |
| 358 | urlGoTo(argc, constArgv); | 361 | connect(_window, &MainWindow::windowGeometryChanged, |
| 362 | _runningScriptsWidget, &RunningScriptsWidget::setBoundary); | ||
| 363 | |||
| 364 | //When -url in command line, teleport to location | ||
| 365 | urlGoTo(argc, constArgv); | ||
| 359 | } | 366 | } |
| 360 | 367 | ||
| 361 | Application::~Application() { | 368 | Application::~Application() { |
| @@ -364,11 +371,11 @@ Application::~Application() { · 2 unmodified lines | |||
| 364 | 371 | ||
| 365 | // make sure we don't call the idle timer any more | 372 | // make sure we don't call the idle timer any more |
| 366 | delete idleTimer; | 373 | delete idleTimer; |
| 367 | 374 | ||
| 368 | _sharedVoxelSystem.changeTree(new VoxelTree); | 375 | _sharedVoxelSystem.changeTree(new VoxelTree); |
| 369 | 376 | ||
| 370 | saveSettings(); | 377 | saveSettings(); |
| 371 | 378 | ||
| 372 | delete _voxelImporter; | 379 | delete _voxelImporter; |
| 373 | 380 | ||
| 374 | // let the avatar mixer know we're out | 381 | // let the avatar mixer know we're out |
| @@ -401,14 +408,14 @@ Application::~Application() { · 26 unmodified lines | |||
| 401 | delete _glWidget; | 408 | delete _glWidget; |
| 402 | 409 | ||
| 403 | AccountManager::getInstance().destroy(); | 410 | AccountManager::getInstance().destroy(); |
| 404 | 411 | ||
| 405 | DTLSClientSession::globalDeinit(); | 412 | DTLSClientSession::globalDeinit(); |
| 406 | } | 413 | } |
| 407 | 414 | ||
| 408 | void Application::saveSettings() { | 415 | void Application::saveSettings() { |
| 409 | Menu::getInstance()->saveSettings(); | 416 | Menu::getInstance()->saveSettings(); |
| 410 | _rearMirrorTools->saveSettings(_settings); | 417 | _rearMirrorTools->saveSettings(_settings); |
| 411 | 418 | ||
| 412 | if (_voxelImporter) { | 419 | if (_voxelImporter) { |
| 413 | _voxelImporter->saveSettings(_settings); | 420 | _voxelImporter->saveSettings(_settings); |
| 414 | } | 421 | } |
| @@ -575,7 +582,7 @@ void Application::paintGL() { · 160 unmodified lines | |||
| 575 | pushback = qMin(pushback, MAX_PUSHBACK * _myAvatar->getScale()); | 582 | pushback = qMin(pushback, MAX_PUSHBACK * _myAvatar->getScale()); |
| 576 | const float BASE_PUSHBACK_FOCAL_LENGTH = 0.5f; | 583 | const float BASE_PUSHBACK_FOCAL_LENGTH = 0.5f; |
| 577 | pushbackFocalLength = BASE_PUSHBACK_FOCAL_LENGTH * _myAvatar->getScale(); | 584 | pushbackFocalLength = BASE_PUSHBACK_FOCAL_LENGTH * _myAvatar->getScale(); |
| 578 | 585 | ||
| 579 | } else if (_myCamera.getMode() == CAMERA_MODE_THIRD_PERSON) { | 586 | } else if (_myCamera.getMode() == CAMERA_MODE_THIRD_PERSON) { |
| 580 | _myCamera.setTightness(0.0f); // Camera is directly connected to head without smoothing | 587 | _myCamera.setTightness(0.0f); // Camera is directly connected to head without smoothing |
| 581 | _myCamera.setTargetPosition(_myAvatar->getUprightHeadPosition()); | 588 | _myCamera.setTargetPosition(_myAvatar->getUprightHeadPosition()); |
| @@ -588,7 +595,7 @@ void Application::paintGL() { · 6 unmodified lines | |||
| 588 | _myCamera.setDistance(MIRROR_FULLSCREEN_DISTANCE * _myAvatar->getScale()); | 595 | _myCamera.setDistance(MIRROR_FULLSCREEN_DISTANCE * _myAvatar->getScale()); |
| 589 | _myCamera.setTargetPosition(_myAvatar->getPosition() + glm::vec3(0, headHeight, 0)); | 596 | _myCamera.setTargetPosition(_myAvatar->getPosition() + glm::vec3(0, headHeight, 0)); |
| 590 | _myCamera.setTargetRotation(_myAvatar->getWorldAlignedOrientation() * glm::quat(glm::vec3(0.0f, PI, 0.0f))); | 597 | _myCamera.setTargetRotation(_myAvatar->getWorldAlignedOrientation() * glm::quat(glm::vec3(0.0f, PI, 0.0f))); |
| 591 | 598 | ||
| 592 | // if the head would intersect the near clip plane, we must push the camera out | 599 | // if the head would intersect the near clip plane, we must push the camera out |
| 593 | glm::vec3 relativePosition = glm::inverse(_myCamera.getTargetRotation()) * | 600 | glm::vec3 relativePosition = glm::inverse(_myCamera.getTargetRotation()) * |
| 594 | (eyePosition - _myCamera.getTargetPosition()); | 601 | (eyePosition - _myCamera.getTargetPosition()); |
| @@ -597,7 +604,7 @@ void Application::paintGL() { · 2 unmodified lines | |||
| 597 | pushback = relativePosition.z + pushbackRadius - _myCamera.getDistance(); | 604 | pushback = relativePosition.z + pushbackRadius - _myCamera.getDistance(); |
| 598 | pushbackFocalLength = _myCamera.getDistance(); | 605 | pushbackFocalLength = _myCamera.getDistance(); |
| 599 | } | 606 | } |
| 600 | 607 | ||
| 601 | // handle pushback, if any | 608 | // handle pushback, if any |
| 602 | if (pushbackFocalLength > 0.0f) { | 609 | if (pushbackFocalLength > 0.0f) { |
| 603 | const float PUSHBACK_DECAY = 0.5f; | 610 | const float PUSHBACK_DECAY = 0.5f; |
| @@ -859,7 +866,7 @@ void Application::keyPressEvent(QKeyEvent* event) { · 255 unmodified lines | |||
| 859 | 866 | ||
| 860 | case Qt::Key_G: | 867 | case Qt::Key_G: |
| 861 | if (isShifted) { | 868 | if (isShifted) { |
| 862 | Menu::getInstance()->triggerOption(MenuOption::ObeyGravity); | 869 | Menu::getInstance()->triggerOption(MenuOption::ObeyEnvironmentalGravity); |
| 863 | } | 870 | } |
| 864 | break; | 871 | break; |
| 865 | 872 | ||
| @@ -1276,7 +1283,7 @@ void Application::timer() { · 410 unmodified lines | |||
| 1276 | if (Menu::getInstance()->isOptionChecked(MenuOption::TestPing)) { | 1283 | if (Menu::getInstance()->isOptionChecked(MenuOption::TestPing)) { |
| 1277 | sendPingPackets(); | 1284 | sendPingPackets(); |
| 1278 | } | 1285 | } |
| 1279 | 1286 | ||
| 1280 | float diffTime = (float)_timerStart.nsecsElapsed() / 1000000000.0f; | 1287 | float diffTime = (float)_timerStart.nsecsElapsed() / 1000000000.0f; |
| 1281 | 1288 | ||
| 1282 | _fps = (float)_frameCount / diffTime; | 1289 | _fps = (float)_frameCount / diffTime; |
| @@ -1677,7 +1684,7 @@ void Application::init() { · 394 unmodified lines | |||
| 1677 | connect(_rearMirrorTools, SIGNAL(restoreView()), SLOT(restoreMirrorView())); | 1684 | connect(_rearMirrorTools, SIGNAL(restoreView()), SLOT(restoreMirrorView())); |
| 1678 | connect(_rearMirrorTools, SIGNAL(shrinkView()), SLOT(shrinkMirrorView())); | 1685 | connect(_rearMirrorTools, SIGNAL(shrinkView()), SLOT(shrinkMirrorView())); |
| 1679 | connect(_rearMirrorTools, SIGNAL(resetView()), SLOT(resetSensors())); | 1686 | connect(_rearMirrorTools, SIGNAL(resetView()), SLOT(resetSensors())); |
| 1680 | 1687 | ||
| 1681 | // set up our audio reflector | 1688 | // set up our audio reflector |
| 1682 | _audioReflector.setMyAvatar(getAvatar()); | 1689 | _audioReflector.setMyAvatar(getAvatar()); |
| 1683 | _audioReflector.setVoxels(_voxels.getTree()); | 1690 | _audioReflector.setVoxels(_voxels.getTree()); |
| @@ -1686,7 +1693,7 @@ void Application::init() { · 2 unmodified lines | |||
| 1686 | 1693 | ||
| 1687 | connect(getAudio(), &Audio::processInboundAudio, &_audioReflector, &AudioReflector::processInboundAudio,Qt::DirectConnection); | 1694 | connect(getAudio(), &Audio::processInboundAudio, &_audioReflector, &AudioReflector::processInboundAudio,Qt::DirectConnection); |
| 1688 | connect(getAudio(), &Audio::processLocalAudio, &_audioReflector, &AudioReflector::processLocalAudio,Qt::DirectConnection); | 1695 | connect(getAudio(), &Audio::processLocalAudio, &_audioReflector, &AudioReflector::processLocalAudio,Qt::DirectConnection); |
| 1689 | connect(getAudio(), &Audio::preProcessOriginalInboundAudio, &_audioReflector, | 1696 | connect(getAudio(), &Audio::preProcessOriginalInboundAudio, &_audioReflector, |
| 1690 | &AudioReflector::preProcessOriginalInboundAudio,Qt::DirectConnection); | 1697 | &AudioReflector::preProcessOriginalInboundAudio,Qt::DirectConnection); |
| 1691 | 1698 | ||
| 1692 | // save settings when avatar changes | 1699 | // save settings when avatar changes |
| @@ -1820,7 +1827,7 @@ void Application::updateMyAvatarLookAtPosition() { · 127 unmodified lines | |||
| 1820 | if (tracker) { | 1827 | if (tracker) { |
| 1821 | float eyePitch = tracker->getEstimatedEyePitch(); | 1828 | float eyePitch = tracker->getEstimatedEyePitch(); |
| 1822 | float eyeYaw = tracker->getEstimatedEyeYaw(); | 1829 | float eyeYaw = tracker->getEstimatedEyeYaw(); |
| 1823 | 1830 | ||
| 1824 | // deflect using Faceshift gaze data | 1831 | // deflect using Faceshift gaze data |
| 1825 | glm::vec3 origin = _myAvatar->getHead()->calculateAverageEyePosition(); | 1832 | glm::vec3 origin = _myAvatar->getHead()->calculateAverageEyePosition(); |
| 1826 | float pitchSign = (_myCamera.getMode() == CAMERA_MODE_MIRROR) ? -1.0f : 1.0f; | 1833 | float pitchSign = (_myCamera.getMode() == CAMERA_MODE_MIRROR) ? -1.0f : 1.0f; |
| @@ -1907,7 +1914,7 @@ void Application::updateCamera(float deltaTime) { · 80 unmodified lines | |||
| 1907 | PerformanceWarning warn(showWarnings, "Application::updateCamera()"); | 1914 | PerformanceWarning warn(showWarnings, "Application::updateCamera()"); |
| 1908 | 1915 | ||
| 1909 | if (!OculusManager::isConnected() && !TV3DManager::isConnected() && | 1916 | if (!OculusManager::isConnected() && !TV3DManager::isConnected() && |
| 1910 | Menu::getInstance()->isOptionChecked(MenuOption::OffAxisProjection)) { | 1917 | Menu::getInstance()->isOptionChecked(MenuOption::OffAxisProjection)) { |
| 1911 | FaceTracker* tracker = getActiveFaceTracker(); | 1918 | FaceTracker* tracker = getActiveFaceTracker(); |
| 1912 | if (tracker) { | 1919 | if (tracker) { |
| 1913 | const float EYE_OFFSET_SCALE = 0.025f; | 1920 | const float EYE_OFFSET_SCALE = 0.025f; |
| @@ -2462,7 +2469,7 @@ void Application::displaySide(Camera& whichCamera, bool selfAvatarOnly) { · 548 unmodified lines | |||
| 2462 | 2469 | ||
| 2463 | // disable specular lighting for ground and voxels | 2470 | // disable specular lighting for ground and voxels |
| 2464 | glMaterialfv(GL_FRONT, GL_SPECULAR, NO_SPECULAR_COLOR); | 2471 | glMaterialfv(GL_FRONT, GL_SPECULAR, NO_SPECULAR_COLOR); |
| 2465 | 2472 | ||
| 2466 | // draw the audio reflector overlay | 2473 | // draw the audio reflector overlay |
| 2467 | _audioReflector.render(); | 2474 | _audioReflector.render(); |
| 2468 | 2475 | ||
| @@ -2620,7 +2627,7 @@ void Application::displayOverlay() { · 151 unmodified lines | |||
| 2620 | const float LOG2_LOUDNESS_FLOOR = 11.f; | 2627 | const float LOG2_LOUDNESS_FLOOR = 11.f; |
| 2621 | float audioLevel = 0.f; | 2628 | float audioLevel = 0.f; |
| 2622 | float loudness = _audio.getLastInputLoudness() + 1.f; | 2629 | float loudness = _audio.getLastInputLoudness() + 1.f; |
| 2623 | 2630 | ||
| 2624 | _trailingAudioLoudness = AUDIO_METER_AVERAGING * _trailingAudioLoudness + (1.f - AUDIO_METER_AVERAGING) * loudness; | 2631 | _trailingAudioLoudness = AUDIO_METER_AVERAGING * _trailingAudioLoudness + (1.f - AUDIO_METER_AVERAGING) * loudness; |
| 2625 | float log2loudness = log(_trailingAudioLoudness) / LOG2; | 2632 | float log2loudness = log(_trailingAudioLoudness) / LOG2; |
| 2626 | 2633 | ||
| @@ -2632,9 +2639,8 @@ void Application::displayOverlay() { · 5 unmodified lines | |||
| 2632 | if (audioLevel > AUDIO_METER_SCALE_WIDTH) { | 2639 | if (audioLevel > AUDIO_METER_SCALE_WIDTH) { |
| 2633 | audioLevel = AUDIO_METER_SCALE_WIDTH; | 2640 | audioLevel = AUDIO_METER_SCALE_WIDTH; |
| 2634 | } | 2641 | } |
| 2635 | |||
| 2636 | bool isClipping = ((_audio.getTimeSinceLastClip() > 0.f) && (_audio.getTimeSinceLastClip() < CLIPPING_INDICATOR_TIME)); | 2642 | bool isClipping = ((_audio.getTimeSinceLastClip() > 0.f) && (_audio.getTimeSinceLastClip() < CLIPPING_INDICATOR_TIME)); |
| 2637 | 2643 | ||
| 2638 | if ((_audio.getTimeSinceLastClip() > 0.f) && (_audio.getTimeSinceLastClip() < CLIPPING_INDICATOR_TIME)) { | 2644 | if ((_audio.getTimeSinceLastClip() > 0.f) && (_audio.getTimeSinceLastClip() < CLIPPING_INDICATOR_TIME)) { |
| 2639 | const float MAX_MAGNITUDE = 0.7f; | 2645 | const float MAX_MAGNITUDE = 0.7f; |
| 2640 | float magnitude = MAX_MAGNITUDE * (1 - _audio.getTimeSinceLastClip() / CLIPPING_INDICATOR_TIME); | 2646 | float magnitude = MAX_MAGNITUDE * (1 - _audio.getTimeSinceLastClip() / CLIPPING_INDICATOR_TIME); |
| @@ -3272,7 +3278,7 @@ void Application::loadScripts() { · 631 unmodified lines | |||
| 3272 | loadScript(string); | 3278 | loadScript(string); |
| 3273 | } | 3279 | } |
| 3274 | } | 3280 | } |
| 3275 | 3281 | ||
| 3276 | QMutexLocker locker(&_settingsMutex); | 3282 | QMutexLocker locker(&_settingsMutex); |
| 3277 | _settings->endArray(); | 3283 | _settings->endArray(); |
| 3278 | } | 3284 | } |
| @@ -3327,31 +3333,23 @@ void Application::reloadAllScripts() { · 48 unmodified lines | |||
| 3327 | } | 3333 | } |
| 3328 | } | 3334 | } |
| 3329 | 3335 | ||
| 3330 | void Application::toggleRunningScriptsWidget() | 3336 | void Application::manageRunningScriptsWidgetVisibility(bool shown) { |
| 3331 | { | 3337 | if (_runningScriptsWidgetWasVisible && shown) { |
| 3332 | if (!_runningScriptsWidget->toggleViewAction()->isChecked()) { | 3338 | _runningScriptsWidget->show(); |
| 3333 | _runningScriptsWidget->move(_window->geometry().topLeft().x(), _window->geometry().topLeft().y()); | 3339 | } else if (_runningScriptsWidgetWasVisible && !shown) { |
| 3334 | _runningScriptsWidget->resize(0, _window->height()); | 3340 | _runningScriptsWidget->hide(); |
| 3335 | _runningScriptsWidget->toggleViewAction()->trigger(); | 3341 | } |
| 3336 | _runningScriptsWidget->grabKeyboard(); | 3342 | } |
| 3337 | |||
| 3338 | QPropertyAnimation* slideAnimation = new QPropertyAnimation(_runningScriptsWidget, "geometry", _runningScriptsWidget); | ||
| 3339 | slideAnimation->setStartValue(_runningScriptsWidget->geometry()); | ||
| 3340 | slideAnimation->setEndValue(QRect(_window->geometry().topLeft().x(), _window->geometry().topLeft().y(), | ||
| 3341 | 310, _runningScriptsWidget->height())); | ||
| 3342 | slideAnimation->setDuration(250); | ||
| 3343 | slideAnimation->start(QAbstractAnimation::DeleteWhenStopped); | ||
| 3344 | } else { | ||
| 3345 | _runningScriptsWidget->releaseKeyboard(); | ||
| 3346 | |||
| 3347 | QPropertyAnimation* slideAnimation = new QPropertyAnimation(_runningScriptsWidget, "geometry", _runningScriptsWidget); | ||
| 3348 | slideAnimation->setStartValue(_runningScriptsWidget->geometry()); | ||
| 3349 | slideAnimation->setEndValue(QRect(_window->geometry().topLeft().x(), _window->geometry().topLeft().y(), | ||
| 3350 | 0, _runningScriptsWidget->height())); | ||
| 3351 | slideAnimation->setDuration(250); | ||
| 3352 | slideAnimation->start(QAbstractAnimation::DeleteWhenStopped); | ||
| 3353 | 3343 | ||
| 3354 | QTimer::singleShot(260, _runningScriptsWidget->toggleViewAction(), SLOT(trigger())); | 3344 | void Application::toggleRunningScriptsWidget() { |
| 3345 | if (_runningScriptsWidgetWasVisible) { | ||
| 3346 | _runningScriptsWidget->hide(); | ||
| 3347 | _runningScriptsWidgetWasVisible = false; | ||
| 3348 | } else { | ||
| 3349 | _runningScriptsWidget->setBoundary(QRect(_window->geometry().topLeft(), | ||
| 3350 | _window->size())); | ||
| 3351 | _runningScriptsWidget->show(); | ||
| 3352 | _runningScriptsWidgetWasVisible = true; | ||
| 3355 | } | 3353 | } |
| 3356 | } | 3354 | } |
| 3357 | 3355 | ||
| @@ -3361,7 +3359,7 @@ void Application::uploadFST(bool isHead) { · 3 unmodified lines | |||
| 3361 | thread->connect(uploader, SIGNAL(destroyed()), SLOT(quit())); | 3359 | thread->connect(uploader, SIGNAL(destroyed()), SLOT(quit())); |
| 3362 | thread->connect(thread, SIGNAL(finished()), SLOT(deleteLater())); | 3360 | thread->connect(thread, SIGNAL(finished()), SLOT(deleteLater())); |
| 3363 | uploader->connect(thread, SIGNAL(started()), SLOT(send())); | 3361 | uploader->connect(thread, SIGNAL(started()), SLOT(send())); |
| 3364 | 3362 | ||
| 3365 | thread->start(); | 3363 | thread->start(); |
| 3366 | } | 3364 | } |
| 3367 | 3365 | ||
| @@ -3471,7 +3469,7 @@ void Application::loadDialog() { · 103 unmodified lines | |||
| 3471 | _previousScriptLocation = fileNameString; | 3469 | _previousScriptLocation = fileNameString; |
| 3472 | QMutexLocker locker(&_settingsMutex); | 3470 | QMutexLocker locker(&_settingsMutex); |
| 3473 | _settings->setValue("LastScriptLocation", _previousScriptLocation); | 3471 | _settings->setValue("LastScriptLocation", _previousScriptLocation); |
| 3474 | 3472 | ||
| 3475 | loadScript(fileNameString); | 3473 | loadScript(fileNameString); |
| 3476 | } | 3474 | } |
| 3477 | } | 3475 | } |
| @@ -3590,34 +3588,33 @@ void Application::takeSnapshot() { · 112 unmodified lines | |||
| 3590 | void Application::urlGoTo(int argc, const char * constArgv[]) { | 3588 | void Application::urlGoTo(int argc, const char * constArgv[]) { |
| 3591 | //Gets the url (hifi://domain/destination/orientation) | 3589 | //Gets the url (hifi://domain/destination/orientation) |
| 3592 | QString customUrl = getCmdOption(argc, constArgv, "-url"); | 3590 | QString customUrl = getCmdOption(argc, constArgv, "-url"); |
| 3593 | 3591 | if(customUrl.startsWith(CUSTOM_URL_SCHEME + "//")) { | |
| 3594 | if (customUrl.startsWith("hifi://")) { | ||
| 3595 | QStringList urlParts = customUrl.remove(0, CUSTOM_URL_SCHEME.length() + 2).split('/', QString::SkipEmptyParts); | 3592 | QStringList urlParts = customUrl.remove(0, CUSTOM_URL_SCHEME.length() + 2).split('/', QString::SkipEmptyParts); |
| 3596 | if (urlParts.count() > 1) { | 3593 | if (urlParts.count() == 1) { |
| 3594 | // location coordinates or place name | ||
| 3595 | QString domain = urlParts[0]; | ||
| 3596 | Menu::goToDomain(domain); | ||
| 3597 | } else if (urlParts.count() > 1) { | ||
| 3597 | // if url has 2 or more parts, the first one is domain name | 3598 | // if url has 2 or more parts, the first one is domain name |
| 3598 | QString domain = urlParts[0]; | 3599 | QString domain = urlParts[0]; |
| 3599 | 3600 | ||
| 3600 | // second part is either a destination coordinate or | 3601 | // second part is either a destination coordinate or |
| 3601 | // a place name | 3602 | // a place name |
| 3602 | QString destination = urlParts[1]; | 3603 | QString destination = urlParts[1]; |
| 3603 | 3604 | ||
| 3604 | // any third part is an avatar orientation. | 3605 | // any third part is an avatar orientation. |
| 3605 | QString orientation = urlParts.count() > 2 ? urlParts[2] : QString(); | 3606 | QString orientation = urlParts.count() > 2 ? urlParts[2] : QString(); |
| 3606 | 3607 | ||
| 3607 | Menu::goToDomain(domain); | 3608 | Menu::goToDomain(domain); |
| 3608 | 3609 | ||
| 3609 | // goto either @user, #place, or x-xx,y-yy,z-zz | 3610 | // goto either @user, #place, or x-xx,y-yy,z-zz |
| 3610 | // style co-ordinate. | 3611 | // style co-ordinate. |
| 3611 | Menu::goTo(destination); | 3612 | Menu::goTo(destination); |
| 3612 | 3613 | ||
| 3613 | if (!orientation.isEmpty()) { | 3614 | if (!orientation.isEmpty()) { |
| 3614 | // location orientation | 3615 | // location orientation |
| 3615 | Menu::goToOrientation(orientation); | 3616 | Menu::goToOrientation(orientation); |
| 3616 | } | 3617 | } |
| 3617 | } else if (urlParts.count() == 1) { | 3618 | } |
| 3618 | // location coordinates or place name | ||
| 3619 | QString destination = urlParts[0]; | ||
| 3620 | Menu::goTo(destination); | ||
| 3621 | } | ||
| 3622 | } | 3619 | } |
| 3623 | } | 3620 | } |