From 8c9c7248d4a00b3233becfa60c2934e25be9ccf7 Mon Sep 17 00:00:00 2001 From: Alexia Mandeville Date: Mon, 12 Mar 2018 12:52:12 -0700 Subject: [PATCH 01/61] Reorganize of menu action items as well as QML categories --- .../hifi/dialogs/AvatarPreferencesDialog.qml | 2 +- .../hifi/dialogs/GeneralPreferencesDialog.qml | 2 +- .../dialogs/GraphicsPreferencesDialog.qml | 2 +- .../qml/hifi/tablet/ControllerSettings.qml | 19 +- .../hifi/tablet/TabletGraphicsPreferences.qml | 2 +- interface/src/Menu.cpp | 367 +++++++++--------- interface/src/Menu.h | 10 +- interface/src/ui/PreferencesDialog.cpp | 122 +++--- 8 files changed, 268 insertions(+), 258 deletions(-) diff --git a/interface/resources/qml/hifi/dialogs/AvatarPreferencesDialog.qml b/interface/resources/qml/hifi/dialogs/AvatarPreferencesDialog.qml index 86f195612c..01b2690afb 100644 --- a/interface/resources/qml/hifi/dialogs/AvatarPreferencesDialog.qml +++ b/interface/resources/qml/hifi/dialogs/AvatarPreferencesDialog.qml @@ -7,7 +7,7 @@ PreferencesDialog { id: root objectName: "AvatarPreferencesDialog" title: "Avatar Settings" - showCategories: [ "Avatar Basics", "Avatar Tuning", "Avatar Camera" ] + showCategories: [ "Avatar Basics", "Avatar Tuning" ] property var settings: Settings { category: root.objectName property alias x: root.x diff --git a/interface/resources/qml/hifi/dialogs/GeneralPreferencesDialog.qml b/interface/resources/qml/hifi/dialogs/GeneralPreferencesDialog.qml index 6f5798e2b2..cb4913f999 100644 --- a/interface/resources/qml/hifi/dialogs/GeneralPreferencesDialog.qml +++ b/interface/resources/qml/hifi/dialogs/GeneralPreferencesDialog.qml @@ -17,7 +17,7 @@ PreferencesDialog { id: root objectName: "GeneralPreferencesDialog" title: "General Settings" - showCategories: ["UI", "Snapshots", "Privacy", "HMD", "Game Controller", "Sixense Controllers", "Perception Neuron", "Kinect", "Leap Motion"] + showCategories: ["User Interface", "HMD", "Snapshots", "Privacy"] property var settings: Settings { category: root.objectName property alias x: root.x diff --git a/interface/resources/qml/hifi/dialogs/GraphicsPreferencesDialog.qml b/interface/resources/qml/hifi/dialogs/GraphicsPreferencesDialog.qml index d95bafd0a9..1388889248 100644 --- a/interface/resources/qml/hifi/dialogs/GraphicsPreferencesDialog.qml +++ b/interface/resources/qml/hifi/dialogs/GraphicsPreferencesDialog.qml @@ -7,7 +7,7 @@ PreferencesDialog { id: root objectName: "GraphicsPreferencesDialog" title: "Graphics Settings" - showCategories: ["Graphics"] + showCategories: ["Graphics Quality"] property var settings: Settings { category: root.objectName property alias x: root.x diff --git a/interface/resources/qml/hifi/tablet/ControllerSettings.qml b/interface/resources/qml/hifi/tablet/ControllerSettings.qml index 4814eaf01c..b71719aa48 100644 --- a/interface/resources/qml/hifi/tablet/ControllerSettings.qml +++ b/interface/resources/qml/hifi/tablet/ControllerSettings.qml @@ -9,10 +9,26 @@ import QtQuick 2.5 import QtQuick.Controls 1.4 import QtGraphicalEffects 1.0 +import Qt.labs.settings 1.0 import "../../styles-uit" import "../../controls" import "../../controls-uit" as HifiControls +import "../../dialogs" +PreferencesDialog { + id: root + objectName: "ControlSettings" + title: "Control Settings" + showCategories: ["VR Movement", "Mouse Sensitivity", "Game Controller", "Face Tracking", "Sixense Controllers", "Perception Neuron", "Kinect", "Leap Motion"] + property var settings: Settings { + category: root.objectName + property alias x: root.x + property alias y: root.y + property alias width: root.width + property alias height: root.height + } +} +/* StackView { id: stack initialItem: inputConfiguration @@ -45,7 +61,7 @@ StackView { RalewayRegular { id: header - text: "Controller Settings" + text: "Control Settings" size: 22 color: "white" @@ -226,3 +242,4 @@ StackView { timer.start(); } } +*/ diff --git a/interface/resources/qml/hifi/tablet/TabletGraphicsPreferences.qml b/interface/resources/qml/hifi/tablet/TabletGraphicsPreferences.qml index 25b5be05f2..67794e8f14 100644 --- a/interface/resources/qml/hifi/tablet/TabletGraphicsPreferences.qml +++ b/interface/resources/qml/hifi/tablet/TabletGraphicsPreferences.qml @@ -32,6 +32,6 @@ StackView { TabletPreferencesDialog { id: root objectName: "TabletGraphicsPreferences" - showCategories: ["Graphics"] + showCategories: ["Graphics Quality"] } } diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index 8c0ac584c5..9e11ad801d 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -12,6 +12,8 @@ #include #include #include +#include +#include #include @@ -43,12 +45,13 @@ #include "ui/StandAloneJSConsole.h" #include "InterfaceLogging.h" #include "LocationBookmarks.h" +#include "Menu.h" #if defined(Q_OS_MAC) || defined(Q_OS_WIN) #include "SpeechRecognizer.h" #endif -#include "Menu.h" + extern bool DEV_DECIMATE_TEXTURES; @@ -76,9 +79,6 @@ Menu::Menu() { dialogsManager.data(), &DialogsManager::toggleLoginDialog); } - // File > Help - addActionToQMenuAndActionHash(fileMenu, MenuOption::Help, 0, qApp, SLOT(showHelp())); - // File > Quit addActionToQMenuAndActionHash(fileMenu, MenuOption::Quit, Qt::CTRL | Qt::Key_Q, qApp, SLOT(quit()), QAction::QuitRole); @@ -97,6 +97,22 @@ Menu::Menu() { redoAction->setShortcut(Qt::CTRL | Qt::SHIFT | Qt::Key_Z); addActionToQMenuAndActionHash(editMenu, redoAction); + editMenu->addSeparator(); + + // Edit > Cut + addActionToQMenuAndActionHash(editMenu, "Cut", Qt::CTRL | Qt::Key_X); + + // Edit > Copy + addActionToQMenuAndActionHash(editMenu, "Copy", Qt::CTRL | Qt::Key_C); + + // Edit > Paste + addActionToQMenuAndActionHash(editMenu, "Paste", Qt::CTRL | Qt::Key_V); + + // Edit > Delete + addActionToQMenuAndActionHash(editMenu, "Delete", Qt::Key_Delete); + + editMenu->addSeparator(); + // Edit > Running Scripts auto action = addActionToQMenuAndActionHash(editMenu, MenuOption::RunningScripts, Qt::CTRL | Qt::Key_J); connect(action, &QAction::triggered, [] { @@ -106,41 +122,9 @@ Menu::Menu() { qApp->showDialog(widgetUrl, tabletUrl, name); }); - // Edit > Open and Run Script from File... [advanced] - addActionToQMenuAndActionHash(editMenu, MenuOption::LoadScript, Qt::CTRL | Qt::Key_O, - qApp, SLOT(loadDialog()), - QAction::NoRole, UNSPECIFIED_POSITION, "Advanced"); - - // Edit > Open and Run Script from Url... [advanced] - addActionToQMenuAndActionHash(editMenu, MenuOption::LoadScriptURL, - Qt::CTRL | Qt::SHIFT | Qt::Key_O, qApp, SLOT(loadScriptURLDialog()), - QAction::NoRole, UNSPECIFIED_POSITION, "Advanced"); - - auto scriptEngines = DependencyManager::get(); - // Edit > Stop All Scripts... [advanced] - addActionToQMenuAndActionHash(editMenu, MenuOption::StopAllScripts, 0, - scriptEngines.data(), SLOT(stopAllScripts()), - QAction::NoRole, UNSPECIFIED_POSITION, "Advanced"); - - // Edit > Reload All Scripts... [advanced] - action = addActionToQMenuAndActionHash(editMenu, MenuOption::ReloadAllScripts, Qt::CTRL | Qt::Key_R, - nullptr, nullptr, - QAction::NoRole, UNSPECIFIED_POSITION, "Advanced"); - connect(action, &QAction::triggered, [] { - DependencyManager::get()->reloadAllScripts(); - DependencyManager::get()->clearCache(); - }); - - - // Edit > Console... [advanced] - addActionToQMenuAndActionHash(editMenu, MenuOption::Console, Qt::CTRL | Qt::ALT | Qt::Key_J, - DependencyManager::get().data(), - SLOT(toggleConsole()), - QAction::NoRole, UNSPECIFIED_POSITION, "Advanced"); - editMenu->addSeparator(); - // Edit > My Asset Server + // Edit > Asset Browser auto assetServerAction = addActionToQMenuAndActionHash(editMenu, MenuOption::AssetServer, Qt::CTRL | Qt::SHIFT | Qt::Key_A, qApp, SLOT(showAssetServerWidget())); @@ -148,64 +132,16 @@ Menu::Menu() { QObject::connect(nodeList.data(), &NodeList::canWriteAssetsChanged, assetServerAction, &QAction::setEnabled); assetServerAction->setEnabled(nodeList->getThisNodeCanWriteAssets()); - // Edit > Package Model... [advanced] + // Edit > Package Model as .fst... addActionToQMenuAndActionHash(editMenu, MenuOption::PackageModel, 0, - qApp, SLOT(packageModel()), - QAction::NoRole, UNSPECIFIED_POSITION, "Advanced"); + qApp, SLOT(packageModel())); - // Edit > Reload All Content [advanced] - addActionToQMenuAndActionHash(editMenu, MenuOption::ReloadContent, 0, qApp, SLOT(reloadResourceCaches()), - QAction::NoRole, UNSPECIFIED_POSITION, "Advanced"); + // Edit > Reload All Content + addActionToQMenuAndActionHash(editMenu, MenuOption::ReloadContent, 0, qApp, SLOT(reloadResourceCaches())); - // Avatar menu ---------------------------------- - MenuWrapper* avatarMenu = addMenu("Avatar"); auto avatarManager = DependencyManager::get(); auto avatar = avatarManager->getMyAvatar(); - // Avatar > Attachments... - action = addActionToQMenuAndActionHash(avatarMenu, MenuOption::Attachments); - connect(action, &QAction::triggered, [] { - qApp->showDialog(QString("hifi/dialogs/AttachmentsDialog.qml"), - QString("hifi/tablet/TabletAttachmentsDialog.qml"), "AttachmentsDialog"); - }); - - // Avatar > Size - MenuWrapper* avatarSizeMenu = avatarMenu->addMenu("Size"); - - // Avatar > Size > Increase - addActionToQMenuAndActionHash(avatarSizeMenu, - MenuOption::IncreaseAvatarSize, - 0, // QML Qt::Key_Plus, - avatar.get(), SLOT(increaseSize())); - - // Avatar > Size > Decrease - addActionToQMenuAndActionHash(avatarSizeMenu, - MenuOption::DecreaseAvatarSize, - 0, // QML Qt::Key_Minus, - avatar.get(), SLOT(decreaseSize())); - - // Avatar > Size > Reset - addActionToQMenuAndActionHash(avatarSizeMenu, - MenuOption::ResetAvatarSize, - 0, // QML Qt::Key_Equal, - avatar.get(), SLOT(resetSize())); - - // Avatar > Reset Sensors - addActionToQMenuAndActionHash(avatarMenu, - MenuOption::ResetSensors, - 0, // QML Qt::Key_Apostrophe, - qApp, SLOT(resetSensors())); - - addCheckableActionToQMenuAndActionHash(avatarMenu, MenuOption::EnableAvatarCollisions, 0, true, - avatar.get(), SLOT(updateMotionBehaviorFromMenu())); - - addCheckableActionToQMenuAndActionHash(avatarMenu, MenuOption::EnableFlying, 0, true, - avatar.get(), SLOT(setFlyingEnabled(bool))); - - // Avatar > AvatarBookmarks related menus -- Note: the AvatarBookmarks class adds its own submenus here. - auto avatarBookmarks = DependencyManager::get(); - avatarBookmarks->setupMenus(this, avatarMenu); - // Display menu ---------------------------------- // FIXME - this is not yet matching Alan's spec because it doesn't have // menus for "2D"/"3D" - we need to add support for detecting the appropriate @@ -225,38 +161,36 @@ Menu::Menu() { // View > First Person auto firstPersonAction = cameraModeGroup->addAction(addCheckableActionToQMenuAndActionHash( - viewMenu, MenuOption::FirstPerson, Qt::CTRL | Qt::Key_F, + viewMenu, MenuOption::FirstPerson, Qt::Key_1, true, qApp, SLOT(cameraMenuChanged()))); firstPersonAction->setProperty(EXCLUSION_GROUP_KEY, QVariant::fromValue(cameraModeGroup)); // View > Third Person auto thirdPersonAction = cameraModeGroup->addAction(addCheckableActionToQMenuAndActionHash( - viewMenu, MenuOption::ThirdPerson, Qt::CTRL | Qt::Key_G, + viewMenu, MenuOption::ThirdPerson, Qt::Key_3, false, qApp, SLOT(cameraMenuChanged()))); thirdPersonAction->setProperty(EXCLUSION_GROUP_KEY, QVariant::fromValue(cameraModeGroup)); // View > Mirror auto viewMirrorAction = cameraModeGroup->addAction(addCheckableActionToQMenuAndActionHash( - viewMenu, MenuOption::FullscreenMirror, Qt::CTRL | Qt::Key_H, + viewMenu, MenuOption::FullscreenMirror, Qt::Key_2, false, qApp, SLOT(cameraMenuChanged()))); viewMirrorAction->setProperty(EXCLUSION_GROUP_KEY, QVariant::fromValue(cameraModeGroup)); - // View > Independent [advanced] + // View > Independent auto viewIndependentAction = cameraModeGroup->addAction(addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::IndependentMode, 0, - false, qApp, SLOT(cameraMenuChanged()), - UNSPECIFIED_POSITION, "Advanced")); + false, qApp, SLOT(cameraMenuChanged()))); viewIndependentAction->setProperty(EXCLUSION_GROUP_KEY, QVariant::fromValue(cameraModeGroup)); - // View > Entity Camera [advanced] + // View > Entity Camera auto viewEntityCameraAction = cameraModeGroup->addAction(addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::CameraEntityMode, 0, - false, qApp, SLOT(cameraMenuChanged()), - UNSPECIFIED_POSITION, "Advanced")); + false, qApp, SLOT(cameraMenuChanged()))); viewEntityCameraAction->setProperty(EXCLUSION_GROUP_KEY, QVariant::fromValue(cameraModeGroup)); @@ -264,54 +198,51 @@ Menu::Menu() { // View > Center Player In View addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::CenterPlayerInView, - 0, true, qApp, SLOT(rotationModeChanged()), - UNSPECIFIED_POSITION, "Advanced"); + 0, true, qApp, SLOT(rotationModeChanged())); + //TODO: remove Overlays action, but the action is tied to some other places in code // View > Overlays addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::Overlays, 0, true); // View > Enter First Person Mode in HMD addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::FirstPersonHMD, 0, true); + //TODO: Remove Navigation menu when these functions are included in GoTo menu // Navigate menu ---------------------------------- MenuWrapper* navigateMenu = addMenu("Navigate"); - // Navigate > Show Address Bar - addActionToQMenuAndActionHash(navigateMenu, MenuOption::AddressBar, Qt::CTRL | Qt::Key_L, - dialogsManager.data(), SLOT(toggleAddressBar())); - // Navigate > LocationBookmarks related menus -- Note: the LocationBookmarks class adds its own submenus here. auto locationBookmarks = DependencyManager::get(); locationBookmarks->setupMenus(this, navigateMenu); - // Navigate > Copy Address [advanced] + // Navigate > Copy Address auto addressManager = DependencyManager::get(); addActionToQMenuAndActionHash(navigateMenu, MenuOption::CopyAddress, 0, - addressManager.data(), SLOT(copyAddress()), - QAction::NoRole, UNSPECIFIED_POSITION, "Advanced"); + addressManager.data(), SLOT(copyAddress())); - // Navigate > Copy Path [advanced] + // Navigate > Copy Path addActionToQMenuAndActionHash(navigateMenu, MenuOption::CopyPath, 0, - addressManager.data(), SLOT(copyPath()), - QAction::NoRole, UNSPECIFIED_POSITION, "Advanced"); + addressManager.data(), SLOT(copyPath())); // Settings menu ---------------------------------- MenuWrapper* settingsMenu = addMenu("Settings"); - // Settings > Advance Menus - addCheckableActionToQMenuAndActionHash(settingsMenu, "Advanced Menus", 0, false, this, SLOT(toggleAdvancedMenus())); - - // Settings > Developer Menus - addCheckableActionToQMenuAndActionHash(settingsMenu, "Developer Menus", 0, false, this, SLOT(toggleDeveloperMenus())); - // Settings > General... - action = addActionToQMenuAndActionHash(settingsMenu, MenuOption::Preferences, Qt::CTRL | Qt::Key_Comma, nullptr, nullptr, QAction::PreferencesRole); + action = addActionToQMenuAndActionHash(settingsMenu, MenuOption::Preferences, Qt::CTRL | Qt::Key_G, nullptr, nullptr, QAction::PreferencesRole); connect(action, &QAction::triggered, [] { qApp->showDialog(QString("hifi/dialogs/GeneralPreferencesDialog.qml"), QString("hifi/tablet/TabletGeneralPreferences.qml"), "GeneralPreferencesDialog"); }); + // Settings > Controls... + action = addActionToQMenuAndActionHash(settingsMenu, "Controls..."); + connect(action, &QAction::triggered, [] { + qApp->showDialog(QString("hifi/tablet/ControllerSettings.qml"), + QString("hifi/tablet/ControllerSettings.qml"), "ControlSettings"); + }); + + // Settings > Audio... action = addActionToQMenuAndActionHash(settingsMenu, "Audio..."); connect(action, &QAction::triggered, [] { static const QUrl widgetUrl("hifi/dialogs/Audio.qml"); @@ -320,6 +251,13 @@ Menu::Menu() { qApp->showDialog(widgetUrl, tabletUrl, name); }); + // Settings > Graphics... + action = addActionToQMenuAndActionHash(settingsMenu, "Graphics..."); + connect(action, &QAction::triggered, [] { + qApp->showDialog(QString("hifi/dialogs/GraphicsPreferencesDialog.qml"), + QString("hifi/tablet/TabletGraphicsPreferences.qml"), "GraphicsPreferencesDialog"); + }); + // Settings > Avatar... action = addActionToQMenuAndActionHash(settingsMenu, "Avatar..."); connect(action, &QAction::triggered, [] { @@ -327,44 +265,83 @@ Menu::Menu() { QString("hifi/tablet/TabletAvatarPreferences.qml"), "AvatarPreferencesDialog"); }); - // Settings > LOD... - action = addActionToQMenuAndActionHash(settingsMenu, "LOD..."); - connect(action, &QAction::triggered, [] { - qApp->showDialog(QString("hifi/dialogs/LodPreferencesDialog.qml"), - QString("hifi/tablet/TabletLodPreferences.qml"), "LodPreferencesDialog"); - }); + // Settings > Notifications + MenuWrapper * notificationsMenu = settingsMenu->addMenu("Notifications"); //This was in notifications.js. The menu needs to be moved here. - action = addActionToQMenuAndActionHash(settingsMenu, "Controller Settings..."); - connect(action, &QAction::triggered, [] { - auto tablet = DependencyManager::get()->getTablet("com.highfidelity.interface.tablet.system"); - auto hmd = DependencyManager::get(); - tablet->loadQMLSource("hifi/tablet/ControllerSettings.qml"); + //TODO: Hookup notification actions below. + // Settings > Notifications > Play Notification Sounds + addActionToQMenuAndActionHash(notificationsMenu, "Play Notification Sounds"); - if (!hmd->getShouldShowTablet()) { - hmd->toggleShouldShowTablet(); - } - }); + notificationsMenu->addSeparator(); - // Settings > Control with Speech [advanced] -#if defined(Q_OS_MAC) || defined(Q_OS_WIN) - auto speechRecognizer = DependencyManager::get(); - QAction* speechRecognizerAction = addCheckableActionToQMenuAndActionHash(settingsMenu, MenuOption::ControlWithSpeech, - Qt::CTRL | Qt::SHIFT | Qt::Key_C, - speechRecognizer->getEnabled(), - speechRecognizer.data(), - SLOT(setEnabled(bool)), - UNSPECIFIED_POSITION, "Advanced"); - connect(speechRecognizer.data(), SIGNAL(enabledUpdated(bool)), speechRecognizerAction, SLOT(setChecked(bool))); -#endif + // Settings > Notifications > Play Sounds for: + addDisabledActionAndSeparator(notificationsMenu, "Show notifications for:"); + + // Settings > Notifications > Snapshot + addActionToQMenuAndActionHash(notificationsMenu, "Snapshot"); + + // Settings > Notifications > Level of Detail + addActionToQMenuAndActionHash(notificationsMenu, "Level of Detail"); + + // Settings > Notifications > Connection + addActionToQMenuAndActionHash(notificationsMenu, "Connection"); + + // Settings > Notifications > Connection Refused + addActionToQMenuAndActionHash(notificationsMenu, "Connection Refused"); + + // Settings > Notifications > Edit Error + addActionToQMenuAndActionHash(notificationsMenu, "Edit Error"); + + // Settings > Notifications > Tablet + addActionToQMenuAndActionHash(notificationsMenu, "Tablet"); + + // Settings > Notifications > Wallet + addActionToQMenuAndActionHash(notificationsMenu, "Wallet"); + + // Settings > Developer Menu + addCheckableActionToQMenuAndActionHash(settingsMenu, "Developer Menu", 0, false, this, SLOT(toggleDeveloperMenus())); + + // Settings > Ask to Reset Settings + addCheckableActionToQMenuAndActionHash(settingsMenu, MenuOption::AskToResetSettings, 0, false); // Developer menu ---------------------------------- MenuWrapper* developerMenu = addMenu("Developer", "Developer"); - // Developer > Graphics... - action = addActionToQMenuAndActionHash(developerMenu, "Graphics..."); + // Developer > Console... + addActionToQMenuAndActionHash(developerMenu, MenuOption::Console, Qt::CTRL | Qt::ALT | Qt::Key_J, + DependencyManager::get().data(), + SLOT(toggleConsole()), + QAction::NoRole); + + // Developer > Scripting >>> + MenuWrapper* scriptingOptionsMenu = developerMenu->addMenu("Scripting"); + + // Developer > Scripting > Log... + addActionToQMenuAndActionHash(scriptingOptionsMenu, MenuOption::Log, Qt::CTRL | Qt::SHIFT | Qt::Key_L, + qApp, SLOT(toggleLogDialog())); + + // Developer > Scripting > Entity Script Server Log + auto essLogAction = addActionToQMenuAndActionHash(scriptingOptionsMenu, MenuOption::EntityScriptServerLog, 0, + qApp, SLOT(toggleEntityScriptServerLogDialog())); + + QObject::connect(nodeList.data(), &NodeList::canRezChanged, essLogAction, [essLogAction] { + auto nodeList = DependencyManager::get(); + essLogAction->setEnabled(nodeList->getThisNodeCanRez()); + }); + + essLogAction->setEnabled(nodeList->getThisNodeCanRez()); + + // Developer > Scripting > Script Log (HMD Friendly)... + action = addActionToQMenuAndActionHash(scriptingOptionsMenu, "Script Log (HMD Friendly)...", Qt::NoButton, + qApp, SLOT(showScriptLogs())); + + // Developer > Scripting > API Debugger + action = addActionToQMenuAndActionHash(scriptingOptionsMenu, "API Debugger..."); connect(action, &QAction::triggered, [] { - qApp->showDialog(QString("hifi/dialogs/GraphicsPreferencesDialog.qml"), - QString("hifi/tablet/TabletGraphicsPreferences.qml"), "GraphicsPreferencesDialog"); + auto scriptEngines = DependencyManager::get(); + QUrl defaultScriptsLoc = PathUtils::defaultScriptsLocation(); + defaultScriptsLoc.setPath(defaultScriptsLoc.path() + "developer/utilities/tools/currentAPI.js"); + scriptEngines->loadScript(defaultScriptsLoc.toString()); }); // Developer > UI >>> @@ -698,12 +675,6 @@ Menu::Menu() { } addCheckableActionToQMenuAndActionHash(physicsOptionsMenu, MenuOption::PhysicsShowHulls, 0, false, qApp->getEntities().data(), SIGNAL(setRenderDebugHulls())); - // Developer > Ask to Reset Settings - addCheckableActionToQMenuAndActionHash(developerMenu, MenuOption::AskToResetSettings, 0, false); - - // Developer > Display Crash Options - addCheckableActionToQMenuAndActionHash(developerMenu, MenuOption::DisplayCrashOptions, 0, true); - // Developer > Crash >>> MenuWrapper* crashMenu = developerMenu->addMenu("Crash"); @@ -740,38 +711,23 @@ Menu::Menu() { action = addActionToQMenuAndActionHash(crashMenu, MenuOption::CrashNewFaultThreaded); connect(action, &QAction::triggered, qApp, []() { std::thread([]() { crash::newFault(); }); }); - // Developer > Log... - addActionToQMenuAndActionHash(developerMenu, MenuOption::Log, Qt::CTRL | Qt::SHIFT | Qt::Key_L, - qApp, SLOT(toggleLogDialog())); - auto essLogAction = addActionToQMenuAndActionHash(developerMenu, MenuOption::EntityScriptServerLog, 0, - qApp, SLOT(toggleEntityScriptServerLogDialog())); - QObject::connect(nodeList.data(), &NodeList::canRezChanged, essLogAction, [essLogAction] { - auto nodeList = DependencyManager::get(); - essLogAction->setEnabled(nodeList->getThisNodeCanRez()); - }); - essLogAction->setEnabled(nodeList->getThisNodeCanRez()); - - action = addActionToQMenuAndActionHash(developerMenu, "Script Log (HMD friendly)...", Qt::NoButton, - qApp, SLOT(showScriptLogs())); + // Developer > Display Crash Options + addCheckableActionToQMenuAndActionHash(developerMenu, MenuOption::DisplayCrashOptions, 0, true); // Developer > Stats addCheckableActionToQMenuAndActionHash(developerMenu, MenuOption::Stats); - // Developer > Advanced Settings... - action = addActionToQMenuAndActionHash(developerMenu, "Advanced Preferences..."); - connect(action, &QAction::triggered, [] { - qApp->showDialog(QString("hifi/dialogs/AdvancedPreferencesDialog.qml"), - QString("hifi/tablet/AdvancedPreferencesDialog.qml"), "AdvancedPreferencesDialog"); - }); - - // Developer > API Debugger - action = addActionToQMenuAndActionHash(developerMenu, "API Debugger"); - connect(action, &QAction::triggered, [] { - auto scriptEngines = DependencyManager::get(); - QUrl defaultScriptsLoc = PathUtils::defaultScriptsLocation(); - defaultScriptsLoc.setPath(defaultScriptsLoc.path() + "developer/utilities/tools/currentAPI.js"); - scriptEngines->loadScript(defaultScriptsLoc.toString()); - }); + // Settings > Enable Speech Control API +#if defined(Q_OS_MAC) || defined(Q_OS_WIN) + auto speechRecognizer = DependencyManager::get(); + QAction* speechRecognizerAction = addCheckableActionToQMenuAndActionHash(settingsMenu, MenuOption::ControlWithSpeech, + Qt::CTRL | Qt::SHIFT | Qt::Key_C, + speechRecognizer->getEnabled(), + speechRecognizer.data(), + SLOT(setEnabled(bool)), + UNSPECIFIED_POSITION, "Advanced"); + connect(speechRecognizer.data(), SIGNAL(enabledUpdated(bool)), speechRecognizerAction, SLOT(setChecked(bool))); +#endif #if 0 /// -------------- REMOVED FOR NOW -------------- addDisabledActionAndSeparator(navigateMenu, "History"); @@ -798,6 +754,55 @@ Menu::Menu() { addCheckableActionToQMenuAndActionHash(avatarMenu, MenuOption::NamesAboveHeads, 0, true, NULL, NULL, UNSPECIFIED_POSITION, "Advanced"); #endif + + // Help/Application menu ---------------------------------- + MenuWrapper * helpMenu = addMenu("Help"); + + // Help > About High Fidelity + //TODO: Add dialog to show about: Logo, Company, Version + addActionToQMenuAndActionHash(helpMenu, "About High Fidelity"); + + helpMenu->addSeparator(); + + // Help > HiFi Docs + action = addActionToQMenuAndActionHash(helpMenu, "Online Documentation"); + connect(action, &QAction::triggered, qApp, [] { + QDesktopServices::openUrl(QUrl("https://docs.highfidelity.com/")); + }); + + // Help > HiFi Forum + action = addActionToQMenuAndActionHash(helpMenu, "Online Forums"); + connect(action, &QAction::triggered, qApp, [] { + QDesktopServices::openUrl(QUrl("https://forums.highfidelity.com/")); + }); + + // Help > Scripting Reference + action = addActionToQMenuAndActionHash(helpMenu, "Online Script Reference"); + connect(action, &QAction::triggered, qApp, [] { + QDesktopServices::openUrl(QUrl("https://docs.highfidelity.com/api-reference")); + }); + + addActionToQMenuAndActionHash(helpMenu, "Controls Reference", 0, qApp, SLOT(showHelp())); + + helpMenu->addSeparator(); + + // Help > Check for Updates + //ToDo: Add check for updates + addActionToQMenuAndActionHash(helpMenu, "Check for Updates"); + + helpMenu->addSeparator(); + + // Help > Release Notes + action = addActionToQMenuAndActionHash(helpMenu, "Release Notes"); + connect(action, &QAction::triggered, qApp, [] { + QDesktopServices::openUrl(QUrl("http://steamcommunity.com/games/390540/announcements/")); + }); + + // Help > Report a Bug! + action = addActionToQMenuAndActionHash(helpMenu, "Report a Bug!"); + connect(action, &QAction::triggered, qApp, [] { + QDesktopServices::openUrl(QUrl("mailto:support@highfidelity.com")); + }); } void Menu::addMenuItem(const MenuItemProperties& properties) { diff --git a/interface/src/Menu.h b/interface/src/Menu.h index 34588535ec..5adde90b0f 100644 --- a/interface/src/Menu.h +++ b/interface/src/Menu.h @@ -32,7 +32,7 @@ namespace MenuOption { const QString AnimDebugDrawAnimPose = "Debug Draw Animation"; const QString AnimDebugDrawDefaultPose = "Debug Draw Default Pose"; const QString AnimDebugDrawPosition= "Debug Draw Position"; - const QString AskToResetSettings = "Ask To Reset Settings"; + const QString AskToResetSettings = "Ask To Reset Settings on Start"; const QString AssetMigration = "ATP Asset Migration"; const QString AssetServer = "Asset Browser"; const QString Attachments = "Attachments..."; @@ -59,7 +59,7 @@ namespace MenuOption { const QString Collisions = "Collisions"; const QString Connexion = "Activate 3D Connexion Devices"; const QString Console = "Console..."; - const QString ControlWithSpeech = "Control With Speech"; + const QString ControlWithSpeech = "Enable Speech Control API"; const QString CopyAddress = "Copy Address to Clipboard"; const QString CopyPath = "Copy Path to Clipboard"; const QString CoupleEyelids = "Couple Eyelids"; @@ -121,7 +121,7 @@ namespace MenuOption { const QString LoadScript = "Open and Run Script File..."; const QString LoadScriptURL = "Open and Run Script from URL..."; const QString LodTools = "LOD Tools"; - const QString Login = "Login / Sign Up"; + const QString Login = "Login/Sign Up"; const QString Log = "Log"; const QString LogExtraTimings = "Log Extra Timing Details"; const QString LowVelocityFilter = "Low Velocity Filter"; @@ -137,7 +137,7 @@ namespace MenuOption { const QString OpenVrThreadedSubmit = "OpenVR Threaded Submit"; const QString OutputMenu = "Display"; const QString Overlays = "Overlays"; - const QString PackageModel = "Package Model..."; + const QString PackageModel = "Package Model as .fst..."; const QString Pair = "Pair"; const QString PhysicsShowHulls = "Draw Collision Shapes"; const QString PhysicsShowOwned = "Highlight Simulation Ownership"; @@ -186,7 +186,7 @@ namespace MenuOption { const QString SimulateEyeTracking = "Simulate"; const QString SMIEyeTracking = "SMI Eye Tracking"; const QString SparseTextureManagement = "Enable Sparse Texture Management"; - const QString Stats = "Stats"; + const QString Stats = "Show Statistics"; const QString StopAllScripts = "Stop All Scripts"; const QString SuppressShortTimings = "Suppress Timings Less than 10ms"; const QString ThirdPerson = "Third Person"; diff --git a/interface/src/ui/PreferencesDialog.cpp b/interface/src/ui/PreferencesDialog.cpp index 48b56c7ced..8860f4dab7 100644 --- a/interface/src/ui/PreferencesDialog.cpp +++ b/interface/src/ui/PreferencesDialog.cpp @@ -56,33 +56,31 @@ void setupPreferences() { preferences->addPreference(preference); } - { - auto getter = [=]()->bool { return myAvatar->getSnapTurn(); }; - auto setter = [=](bool value) { myAvatar->setSnapTurn(value); }; - preferences->addPreference(new CheckPreference(AVATAR_BASICS, "Snap turn when in HMD", getter, setter)); - } - { - auto getter = [=]()->bool { return myAvatar->getClearOverlayWhenMoving(); }; - auto setter = [=](bool value) { myAvatar->setClearOverlayWhenMoving(value); }; - preferences->addPreference(new CheckPreference(AVATAR_BASICS, "Clear overlays when moving", getter, setter)); - } - // UI - static const QString UI_CATEGORY { "UI" }; + static const QString UI_CATEGORY { "User Interface" }; { auto getter = []()->bool { return qApp->getSettingConstrainToolbarPosition(); }; auto setter = [](bool value) { qApp->setSettingConstrainToolbarPosition(value); }; preferences->addPreference(new CheckPreference(UI_CATEGORY, "Constrain Toolbar Position to Horizontal Center", getter, setter)); } + { - auto getter = []()->float { return qApp->getHMDTabletScale(); }; - auto setter = [](float value) { qApp->setHMDTabletScale(value); }; - auto preference = new SpinnerPreference(UI_CATEGORY, "HMD Tablet Scale %", getter, setter); + auto getter = []()->float { return qApp->getDesktopTabletScale(); }; + auto setter = [](float value) { qApp->setDesktopTabletScale(value); }; + auto preference = new SpinnerPreference(UI_CATEGORY, "Desktop Tablet Scale %", getter, setter); preference->setMin(20); preference->setMax(500); preferences->addPreference(preference); } + { + auto getter = []()->float { return qApp->getHMDTabletScale(); }; + auto setter = [](float value) { qApp->setHMDTabletScale(value); }; + auto preference = new SpinnerPreference(UI_CATEGORY, "VR Tablet Scale %", getter, setter); + preference->setMin(20); + preference->setMax(500); + preferences->addPreference(preference); + } { auto getter = []()->bool { return qApp->getPreferStylusOverLaser(); }; @@ -90,19 +88,18 @@ void setupPreferences() { preferences->addPreference(new CheckPreference(UI_CATEGORY, "Prefer Stylus Over Laser", getter, setter)); } - static const QString ADVANCED_UI_CATEGORY { "Advanced UI" }; { - auto getter = []()->float { return qApp->getDesktopTabletScale(); }; - auto setter = [](float value) { qApp->setDesktopTabletScale(value); }; - auto preference = new SpinnerPreference(ADVANCED_UI_CATEGORY, "Desktop Tablet Scale %", getter, setter); - preference->setMin(20); - preference->setMax(500); - preferences->addPreference(preference); + static const QString RETICLE_ICON_NAME = { Cursor::Manager::getIconName(Cursor::Icon::RETICLE) }; + auto getter = []()->bool { return qApp->getPreferredCursor() == RETICLE_ICON_NAME; }; + auto setter = [](bool value) { qApp->setPreferredCursor(value ? RETICLE_ICON_NAME : QString()); }; + preferences->addPreference(new CheckPreference(UI_CATEGORY, "Use reticle cursor instead of arrow", getter, setter)); } + + static const QString VIEW_CATEGORY{ "View" }; { auto getter = [=]()->float { return myAvatar->getRealWorldFieldOfView(); }; auto setter = [=](float value) { myAvatar->setRealWorldFieldOfView(value); }; - auto preference = new SpinnerPreference(ADVANCED_UI_CATEGORY, "Real world vertical field of view (angular size of monitor)", getter, setter); + auto preference = new SpinnerPreference(VIEW_CATEGORY, "Real world vertical field of view (angular size of monitor)", getter, setter); preference->setMin(1); preference->setMax(180); preferences->addPreference(preference); @@ -110,7 +107,7 @@ void setupPreferences() { { auto getter = []()->float { return qApp->getFieldOfView(); }; auto setter = [](float value) { qApp->setFieldOfView(value); }; - auto preference = new SpinnerPreference(ADVANCED_UI_CATEGORY, "Vertical field of view", getter, setter); + auto preference = new SpinnerPreference(VIEW_CATEGORY, "Vertical field of view", getter, setter); preference->setMin(1); preference->setMax(180); preference->setStep(1); @@ -126,12 +123,6 @@ void setupPreferences() { preferences->addPreference(new CheckPreference(UI_CATEGORY, "Prefer Avatar Finger Over Stylus", getter, setter)); } */ - { - static const QString RETICLE_ICON_NAME = { Cursor::Manager::getIconName(Cursor::Icon::RETICLE) }; - auto getter = []()->bool { return qApp->getPreferredCursor() == RETICLE_ICON_NAME; }; - auto setter = [](bool value) { qApp->setPreferredCursor(value ? RETICLE_ICON_NAME : QString()); }; - preferences->addPreference(new CheckPreference(UI_CATEGORY, "Use reticle cursor instead of arrow", getter, setter)); - } // Snapshots static const QString SNAPSHOTS { "Snapshots" }; @@ -160,27 +151,6 @@ void setupPreferences() { "this information you are helping to improve the product. ", getter, setter)); } - static const QString LOD_TUNING("Level of Detail Tuning"); - { - auto getter = []()->float { return DependencyManager::get()->getDesktopLODDecreaseFPS(); }; - auto setter = [](float value) { DependencyManager::get()->setDesktopLODDecreaseFPS(value); }; - auto preference = new SpinnerPreference(LOD_TUNING, "Minimum desktop FPS", getter, setter); - preference->setMin(0); - preference->setMax(120); - preference->setStep(1); - preferences->addPreference(preference); - } - - { - auto getter = []()->float { return DependencyManager::get()->getHMDLODDecreaseFPS(); }; - auto setter = [](float value) { DependencyManager::get()->setHMDLODDecreaseFPS(value); }; - auto preference = new SpinnerPreference(LOD_TUNING, "Minimum HMD FPS", getter, setter); - preference->setMin(0); - preference->setMax(120); - preference->setStep(1); - preferences->addPreference(preference); - } - static const QString AVATAR_TUNING { "Avatar Tuning" }; { auto getter = [=]()->QString { return myAvatar->getDominantHand(); }; @@ -210,16 +180,7 @@ void setupPreferences() { preference->setStep(0.001f); preferences->addPreference(preference); } - { - auto getter = []()->float { return DependencyManager::get()->getEyeClosingThreshold(); }; - auto setter = [](float value) { DependencyManager::get()->setEyeClosingThreshold(value); }; - preferences->addPreference(new SliderPreference(AVATAR_TUNING, "Camera binary eyelid threshold", getter, setter)); - } - { - auto getter = []()->float { return FaceTracker::getEyeDeflection(); }; - auto setter = [](float value) { FaceTracker::setEyeDeflection(value); }; - preferences->addPreference(new SliderPreference(AVATAR_TUNING, "Face tracker eye deflection", getter, setter)); - } + { auto getter = [=]()->QString { return myAvatar->getAnimGraphOverrideUrl().toString(); }; auto setter = [=](const QString& value) { myAvatar->setAnimGraphOverrideUrl(QUrl(value)); }; @@ -228,11 +189,38 @@ void setupPreferences() { preferences->addPreference(preference); } - static const QString AVATAR_CAMERA { "Avatar Camera" }; + static const QString FACE_TRACKING{ "Face Tracking" }; + { + auto getter = []()->float { return DependencyManager::get()->getEyeClosingThreshold(); }; + auto setter = [](float value) { DependencyManager::get()->setEyeClosingThreshold(value); }; + preferences->addPreference(new SliderPreference(FACE_TRACKING, "Eye Closing Threshold", getter, setter)); + } + { + auto getter = []()->float { return FaceTracker::getEyeDeflection(); }; + auto setter = [](float value) { FaceTracker::setEyeDeflection(value); }; + preferences->addPreference(new SliderPreference(FACE_TRACKING, "Eye Deflection", getter, setter)); + } + + static const QString MOVEMENT{ "VR Movement" }; + + { + auto getter = [=]()->bool { return myAvatar->getSnapTurn(); }; + auto setter = [=](bool value) { myAvatar->setSnapTurn(value); }; + preferences->addPreference(new CheckPreference(MOVEMENT, "Snap turn rotation", getter, setter)); + } + + //TODO: Update with advanced movement logic, test that it works + { + auto getter = [=]()->bool { return myAvatar->useAdvancedMovementControls(); }; + auto setter = [=](bool value) { myAvatar->setUseAdvancedMovementControls(value); }; + preferences->addPreference(new CheckPreference(MOVEMENT, "Advanced movement for hand controllers", getter, setter)); + } + + static const QString AVATAR_CAMERA{ "Mouse Sensitivity" }; { auto getter = [=]()->float { return myAvatar->getPitchSpeed(); }; auto setter = [=](float value) { myAvatar->setPitchSpeed(value); }; - auto preference = new SpinnerPreference(AVATAR_CAMERA, "Camera pitch speed (degrees/second)", getter, setter); + auto preference = new SpinnerPreference(AVATAR_CAMERA, "Pitch speed (degrees/second)", getter, setter); preference->setMin(1.0f); preference->setMax(360.0f); preferences->addPreference(preference); @@ -240,7 +228,7 @@ void setupPreferences() { { auto getter = [=]()->float { return myAvatar->getYawSpeed(); }; auto setter = [=](float value) { myAvatar->setYawSpeed(value); }; - auto preference = new SpinnerPreference(AVATAR_CAMERA, "Camera yaw speed (degrees/second)", getter, setter); + auto preference = new SpinnerPreference(AVATAR_CAMERA, "Yaw speed (degrees/second)", getter, setter); preference->setMin(1.0f); preference->setMax(360.0f); preferences->addPreference(preference); @@ -297,14 +285,14 @@ void setupPreferences() { { - static const QString RENDER("Graphics"); + static const QString GRAPHICS_QUALITY("Graphics Quality"); auto renderConfig = qApp->getRenderEngine()->getConfiguration(); if (renderConfig) { auto mainViewAmbientOcclusionConfig = renderConfig->getConfig("RenderMainView.AmbientOcclusion"); if (mainViewAmbientOcclusionConfig) { auto getter = [mainViewAmbientOcclusionConfig]()->QString { return mainViewAmbientOcclusionConfig->getPreset(); }; auto setter = [mainViewAmbientOcclusionConfig](QString preset) { mainViewAmbientOcclusionConfig->setPreset(preset); }; - auto preference = new ComboBoxPreference(RENDER, "Ambient occlusion", getter, setter); + auto preference = new ComboBoxPreference(GRAPHICS_QUALITY, "Ambient occlusion", getter, setter); preference->setItems(mainViewAmbientOcclusionConfig->getPresetList()); preferences->addPreference(preference); } @@ -313,7 +301,7 @@ void setupPreferences() { if (mainViewShadowConfig) { auto getter = [mainViewShadowConfig]()->QString { return mainViewShadowConfig->getPreset(); }; auto setter = [mainViewShadowConfig](QString preset) { mainViewShadowConfig->setPreset(preset); }; - auto preference = new ComboBoxPreference(RENDER, "Shadows", getter, setter); + auto preference = new ComboBoxPreference(GRAPHICS_QUALITY, "Shadows", getter, setter); preference->setItems(mainViewShadowConfig->getPresetList()); preferences->addPreference(preference); } From 61e2814db4dc0455e56aef4acc30cf5861f6cf92 Mon Sep 17 00:00:00 2001 From: Alexia Mandeville Date: Mon, 12 Mar 2018 13:07:21 -0700 Subject: [PATCH 02/61] Removing toolbar apps that are no longer necessary --- scripts/defaultScripts.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/scripts/defaultScripts.js b/scripts/defaultScripts.js index 71755e3abb..b0cbf0e246 100644 --- a/scripts/defaultScripts.js +++ b/scripts/defaultScripts.js @@ -19,14 +19,12 @@ var DEFAULT_SCRIPTS_COMBINED = [ "system/menu.js", "system/bubble.js", "system/snapshot.js", - "system/help.js", "system/pal.js", // "system/mod.js", // older UX, if you prefer "system/makeUserConnection.js", "system/tablet-goto.js", "system/marketplaces/marketplaces.js", "system/commerce/wallet.js", "system/edit.js", - "system/notifications.js", "system/dialTone.js", "system/firstPersonHMD.js", "system/tablet-ui/tabletUI.js", From c760c44531e1915671b17be1219301cfb0bcc045 Mon Sep 17 00:00:00 2001 From: Alexia Mandeville Date: Mon, 12 Mar 2018 13:17:23 -0700 Subject: [PATCH 03/61] Revert "Update repo script with marketplace script" This reverts commit 5139f3f50328c0299801906ba435d5e1528c72f8. --- scripts/tutorials/entity_scripts/sit.js | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/scripts/tutorials/entity_scripts/sit.js b/scripts/tutorials/entity_scripts/sit.js index 9de65d7037..70456ea493 100644 --- a/scripts/tutorials/entity_scripts/sit.js +++ b/scripts/tutorials/entity_scripts/sit.js @@ -12,9 +12,9 @@ Script.include("/~/system/libraries/utils.js"); if (!String.prototype.startsWith) { String.prototype.startsWith = function(searchString, position){ - position = position || 0; - return this.substr(position, searchString.length) === searchString; - }; + position = position || 0; + return this.substr(position, searchString.length) === searchString; + }; } var SETTING_KEY = "com.highfidelity.avatar.isSitting"; @@ -122,10 +122,20 @@ this.rolesToOverride = function() { return MyAvatar.getAnimationRoles().filter(function(role) { - return !(role.startsWith("right") || role.startsWith("left")); + return !(role.startsWith("right") || role.startsWith("left")); }); } + // Handler for user changing the avatar model while sitting. There's currently an issue with changing avatar models while override role animations are applied, + // so to avoid that problem, re-apply the role overrides once the model has finished changing. + this.modelURLChangeFinished = function () { + print("Sitter's model has FINISHED changing. Reapply anim role overrides."); + var roles = this.rolesToOverride(); + for (i in roles) { + MyAvatar.overrideRoleAnimation(roles[i], ANIMATION_URL, ANIMATION_FPS, true, ANIMATION_FIRST_FRAME, ANIMATION_LAST_FRAME); + } + } + this.sitDown = function() { if (this.checkSeatForAvatar()) { print("Someone is already sitting in that chair."); @@ -164,12 +174,14 @@ return { headType: 0 }; }, ["headType"]); Script.update.connect(this, this.update); + MyAvatar.onLoadComplete.connect(this, this.modelURLChangeFinished); } this.standUp = function() { print("Standing up (" + this.entityID + ")"); MyAvatar.removeAnimationStateHandler(this.animStateHandlerID); Script.update.disconnect(this, this.update); + MyAvatar.onLoadComplete.disconnect(this, this.modelURLChangeFinished); if (MyAvatar.sessionUUID === this.getSeatUser()) { this.setSeatUser(null); @@ -331,7 +343,7 @@ } this.cleanupOverlay(); } - + this.clickDownOnEntity = function (id, event) { if (isInEditMode()) { return; @@ -340,4 +352,4 @@ this.sitDown(); } } -}); \ No newline at end of file +}); From 6ddb91e5939632fe2a16b8a44768b09d93cb6230 Mon Sep 17 00:00:00 2001 From: Alexia Mandeville Date: Mon, 12 Mar 2018 13:17:48 -0700 Subject: [PATCH 04/61] Revert "Updating default mouse pitch/yaw input to be more stabilized" This reverts commit 2598be16f81734e86e00f2789bc2111bcdf448b8. --- interface/src/avatar/MyAvatar.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index 8bbbef041a..53116d81f3 100755 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -67,8 +67,8 @@ using namespace std; const float DEFAULT_REAL_WORLD_FIELD_OF_VIEW_DEGREES = 30.0f; -const float YAW_SPEED_DEFAULT = 75.0f; // degrees/sec -const float PITCH_SPEED_DEFAULT = 50.0f; // degrees/sec +const float YAW_SPEED_DEFAULT = 100.0f; // degrees/sec +const float PITCH_SPEED_DEFAULT = 75.0f; // degrees/sec const float MAX_BOOST_SPEED = 0.5f * DEFAULT_AVATAR_MAX_WALKING_SPEED; // action motor gets additive boost below this speed const float MIN_AVATAR_SPEED = 0.05f; From c5b8a2d06ecd933279334ae47858c1a0ef6756c4 Mon Sep 17 00:00:00 2001 From: Alexia Mandeville Date: Mon, 12 Mar 2018 13:18:02 -0700 Subject: [PATCH 05/61] Revert "Increasing speed on mousescroll - zooming in/out of avatar" This reverts commit 748507f1e357b7a03177f847c63362297de9663e. --- interface/src/avatar/MyAvatar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index 53116d81f3..b6fa3fde96 100755 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -2229,7 +2229,7 @@ void MyAvatar::updateActionMotor(float deltaTime) { } float boomChange = getDriveKey(ZOOM); - _boomLength += 4.0f * _boomLength * boomChange + boomChange * boomChange; + _boomLength += 2.0f * _boomLength * boomChange + boomChange * boomChange; _boomLength = glm::clamp(_boomLength, ZOOM_MIN, ZOOM_MAX); } From 31ab39834461afb448bd3a21c55c94bd4cb6a87f Mon Sep 17 00:00:00 2001 From: Alexia Mandeville Date: Thu, 29 Mar 2018 11:20:01 -0700 Subject: [PATCH 06/61] Moving user height and clarifying verbiage --- interface/src/ui/PreferencesDialog.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/interface/src/ui/PreferencesDialog.cpp b/interface/src/ui/PreferencesDialog.cpp index 8860f4dab7..b309ecd5e3 100644 --- a/interface/src/ui/PreferencesDialog.cpp +++ b/interface/src/ui/PreferencesDialog.cpp @@ -170,16 +170,6 @@ void setupPreferences() { // which can't be changed across domain switches. Having these values loaded up when you load the Dialog each time // is a way around this, therefore they're not specified here but in the QML. } - { - auto getter = [=]()->float { return myAvatar->getUserHeight(); }; - auto setter = [=](float value) { myAvatar->setUserHeight(value); }; - auto preference = new SpinnerPreference(AVATAR_TUNING, "User height (meters)", getter, setter); - preference->setMin(1.0f); - preference->setMax(2.2f); - preference->setDecimals(3); - preference->setStep(0.001f); - preferences->addPreference(preference); - } { auto getter = [=]()->QString { return myAvatar->getAnimGraphOverrideUrl().toString(); }; @@ -216,6 +206,17 @@ void setupPreferences() { preferences->addPreference(new CheckPreference(MOVEMENT, "Advanced movement for hand controllers", getter, setter)); } + { + auto getter = [=]()->float { return myAvatar->getUserHeight(); }; + auto setter = [=](float value) { myAvatar->setUserHeight(value); }; + auto preference = new SpinnerPreference(MOVEMENT, "User real-world height (meters)", getter, setter); + preference->setMin(1.0f); + preference->setMax(2.2f); + preference->setDecimals(3); + preference->setStep(0.001f); + preferences->addPreference(preference); + } + static const QString AVATAR_CAMERA{ "Mouse Sensitivity" }; { auto getter = [=]()->float { return myAvatar->getPitchSpeed(); }; From 8a5d80de312fbe7512a6a1b40fe18c2c32edaf16 Mon Sep 17 00:00:00 2001 From: vladest Date: Tue, 17 Apr 2018 19:51:24 +0200 Subject: [PATCH 07/61] Fix Desktop double windows --- interface/src/Application.cpp | 7 +------ interface/src/ui/PreferencesDialog.cpp | 7 +++++++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index aec31f2de4..a2d117e6ee 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -6518,12 +6518,7 @@ void Application::showDialog(const QUrl& widgetUrl, const QUrl& tabletUrl, const if (onTablet) { toggleTabletUI(true); } - } - - if (!onTablet) { - DependencyManager::get()->show(widgetUrl, name); - } - if (tablet->getToolbarMode()) { + } else { DependencyManager::get()->show(widgetUrl, name); } } diff --git a/interface/src/ui/PreferencesDialog.cpp b/interface/src/ui/PreferencesDialog.cpp index 289166648e..a678a1b94b 100644 --- a/interface/src/ui/PreferencesDialog.cpp +++ b/interface/src/ui/PreferencesDialog.cpp @@ -51,6 +51,13 @@ void setupPreferences() { auto preference = new AvatarPreference(AVATAR_BASICS, "Appearance", getter, setter); preferences->addPreference(preference); } + // UI + static const QString GRAPHICS_QUALITY { "Graphics Quality" }; + { + auto getter = []()->float { return DependencyManager::get()->getLODLevel(); }; + auto setter = [](float value) { FaceTracker::setEyeDeflection(value); }; + preferences->addPreference(new SliderPreference(GRAPHICS_QUALITY, "World Detail", getter, setter)); + } // UI static const QString UI_CATEGORY { "User Interface" }; From c402cb2c19f93b7e4d7b619171996514deaa70aa Mon Sep 17 00:00:00 2001 From: vladest Date: Tue, 17 Apr 2018 19:51:43 +0200 Subject: [PATCH 08/61] Fix Desktop double windows --- .../dialogs/GraphicsPreferencesDialog.qml | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 interface/resources/qml/hifi/dialogs/GraphicsPreferencesDialog.qml diff --git a/interface/resources/qml/hifi/dialogs/GraphicsPreferencesDialog.qml b/interface/resources/qml/hifi/dialogs/GraphicsPreferencesDialog.qml new file mode 100644 index 0000000000..eaab5b8173 --- /dev/null +++ b/interface/resources/qml/hifi/dialogs/GraphicsPreferencesDialog.qml @@ -0,0 +1,29 @@ +// +// AdvancedPreferencesDialog.qml +// +// Created by Brad Hefta-Gaub on 20 Jan 2018 +// Copyright 2018 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// + +import QtQuick 2.5 +import Qt.labs.settings 1.0 + +import "../../dialogs" + +PreferencesDialog { + id: root + objectName: "GraphicsPreferencesDialog" + title: "Graphics Settings" + showCategories: ["Graphics Quality" ] + property var settings: Settings { + category: root.objectName + property alias x: root.x + property alias y: root.y + property alias width: root.width + property alias height: root.height + } +} + From ee1738adac9aa0070bd42eb35c802cd5e647d25b Mon Sep 17 00:00:00 2001 From: vladest Date: Tue, 17 Apr 2018 21:58:53 +0200 Subject: [PATCH 09/61] Add stubs for graphics settings. Add avatar collision setting --- interface/src/ui/PreferencesDialog.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/interface/src/ui/PreferencesDialog.cpp b/interface/src/ui/PreferencesDialog.cpp index a678a1b94b..ac7a4f0610 100644 --- a/interface/src/ui/PreferencesDialog.cpp +++ b/interface/src/ui/PreferencesDialog.cpp @@ -55,8 +55,11 @@ void setupPreferences() { static const QString GRAPHICS_QUALITY { "Graphics Quality" }; { auto getter = []()->float { return DependencyManager::get()->getLODLevel(); }; - auto setter = [](float value) { FaceTracker::setEyeDeflection(value); }; + auto setter = [](float value) { }; preferences->addPreference(new SliderPreference(GRAPHICS_QUALITY, "World Detail", getter, setter)); + auto getterSQ = []()->float { return 1.0; }; + auto setterSQ = [](float value) { }; + preferences->addPreference(new SliderPreference(GRAPHICS_QUALITY, "Shadow Quality", getterSQ, setterSQ)); } // UI @@ -182,6 +185,13 @@ void setupPreferences() { preferences->addPreference(preference); } + { + auto getter = [=]()->bool { return myAvatar->getCollisionsEnabled(); }; + auto setter = [=](bool value) { myAvatar->setCollisionsEnabled(value); }; + auto preference = new CheckPreference(AVATAR_TUNING, "Enable Avatar collisions", getter, setter); + preferences->addPreference(preference); + } + static const QString FACE_TRACKING{ "Face Tracking" }; { auto getter = []()->float { return DependencyManager::get()->getEyeClosingThreshold(); }; From cacb9359c232b58b2c31a91273783149e1a4289c Mon Sep 17 00:00:00 2001 From: vladest Date: Wed, 18 Apr 2018 20:57:28 +0200 Subject: [PATCH 10/61] Toolbar at bottom --- interface/resources/qml/hifi/Desktop.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/interface/resources/qml/hifi/Desktop.qml b/interface/resources/qml/hifi/Desktop.qml index 24111ad935..e3e6d40891 100644 --- a/interface/resources/qml/hifi/Desktop.qml +++ b/interface/resources/qml/hifi/Desktop.qml @@ -36,7 +36,7 @@ OriginalDesktop.Desktop { } } - Component { id: toolbarBuilder; Toolbar { } } + Component { id: toolbarBuilder; Toolbar { y: desktop.y - 50 } } // This used to create sysToolbar dynamically with a call to getToolbar() within onCompleted. // Beginning with QT 5.6, this stopped working, as anything added to toolbars too early got // wiped during startup. @@ -47,7 +47,7 @@ OriginalDesktop.Desktop { anchors.horizontalCenter: settings.constrainToolbarToCenterX ? desktop.horizontalCenter : undefined; // Literal 50 is overwritten by settings from previous session, and sysToolbar.x comes from settings when not constrained. x: sysToolbar.x - y: 50 + y: desktop.height - 50 - height buttonModel: tablet.buttons; shown: tablet.toolbarMode; } From 7b21b36d3cb524edb20bbeb82488ae110d9390a4 Mon Sep 17 00:00:00 2001 From: vladest Date: Wed, 18 Apr 2018 22:19:54 +0200 Subject: [PATCH 11/61] Disable menu button in Toolbar mode --- interface/resources/qml/hifi/Desktop.qml | 4 ++-- interface/resources/qml/hifi/toolbars/Toolbar.qml | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/interface/resources/qml/hifi/Desktop.qml b/interface/resources/qml/hifi/Desktop.qml index e3e6d40891..5a0d0e3c05 100644 --- a/interface/resources/qml/hifi/Desktop.qml +++ b/interface/resources/qml/hifi/Desktop.qml @@ -36,7 +36,7 @@ OriginalDesktop.Desktop { } } - Component { id: toolbarBuilder; Toolbar { y: desktop.y - 50 } } + Component { id: toolbarBuilder; Toolbar { } } // This used to create sysToolbar dynamically with a call to getToolbar() within onCompleted. // Beginning with QT 5.6, this stopped working, as anything added to toolbars too early got // wiped during startup. @@ -47,7 +47,7 @@ OriginalDesktop.Desktop { anchors.horizontalCenter: settings.constrainToolbarToCenterX ? desktop.horizontalCenter : undefined; // Literal 50 is overwritten by settings from previous session, and sysToolbar.x comes from settings when not constrained. x: sysToolbar.x - y: desktop.height - 50 - height + y: desktop.height - sysToolbar.height - 50 buttonModel: tablet.buttons; shown: tablet.toolbarMode; } diff --git a/interface/resources/qml/hifi/toolbars/Toolbar.qml b/interface/resources/qml/hifi/toolbars/Toolbar.qml index 49aff06929..79162d9240 100644 --- a/interface/resources/qml/hifi/toolbars/Toolbar.qml +++ b/interface/resources/qml/hifi/toolbars/Toolbar.qml @@ -38,6 +38,8 @@ Window { property var proxy: modelData; onClicked: proxy.clicked() Component.onCompleted: updateProperties() + //menu button should be visible only in VR mode + visible: text !== "MENU" Connections { target: proxy; From fffd4eec419cb689bdbbea6a0edb63060e7995cf Mon Sep 17 00:00:00 2001 From: vladest Date: Thu, 19 Apr 2018 08:46:20 +0200 Subject: [PATCH 12/61] Avatar enable flying added --- interface/src/ui/PreferencesDialog.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/interface/src/ui/PreferencesDialog.cpp b/interface/src/ui/PreferencesDialog.cpp index ac7a4f0610..b82f387137 100644 --- a/interface/src/ui/PreferencesDialog.cpp +++ b/interface/src/ui/PreferencesDialog.cpp @@ -229,6 +229,11 @@ void setupPreferences() { preference->setStep(0.001f); preferences->addPreference(preference); } + { + auto getter = [=]()->bool { return myAvatar->getFlyingEnabled(); }; + auto setter = [=](bool value) { myAvatar->setFlyingEnabled(value); }; + preferences->addPreference(new CheckPreference(MOVEMENT, "Enable Flying", getter, setter)); + } static const QString AVATAR_CAMERA{ "Mouse Sensitivity" }; { From 60d53359bbe0faf31a7cc896eaa3ac0c83c2c4b5 Mon Sep 17 00:00:00 2001 From: vladest Date: Thu, 19 Apr 2018 11:39:58 +0200 Subject: [PATCH 13/61] Fix Toolbar vertical position --- interface/resources/qml/hifi/Desktop.qml | 24 ++++++++++++++++++- .../resources/qml/hifi/toolbars/Toolbar.qml | 16 +++++++++++-- 2 files changed, 37 insertions(+), 3 deletions(-) diff --git a/interface/resources/qml/hifi/Desktop.qml b/interface/resources/qml/hifi/Desktop.qml index 5a0d0e3c05..4d342fe775 100644 --- a/interface/resources/qml/hifi/Desktop.qml +++ b/interface/resources/qml/hifi/Desktop.qml @@ -36,6 +36,29 @@ OriginalDesktop.Desktop { } } + onHeightChanged: { + if (height > 100) { + adjustToolbarPosition(); + } + } + + function adjustToolbarPosition() { + var toolbar = getToolbar("com.highfidelity.interface.toolbar.system") + // check if Y position was changed, if toolbar height is assigned etc + // default position is adjusted to border width + var toolbarY = toolbar.settings.y > 6 ? + toolbar.settings.y : + desktop.height - (toolbar.height > 0 ? toolbar.height : 50) - 56 + + if (toolbar.settings.desktopHeight > 100 && desktop.height !== toolbar.settings.desktopHeight) { + toolbarY += desktop.height - toolbar.settings.desktopHeight + } + + toolbar.y = toolbarY + toolbar.settings.y = toolbarY + toolbar.settings.desktopHeight = desktop.height + } + Component { id: toolbarBuilder; Toolbar { } } // This used to create sysToolbar dynamically with a call to getToolbar() within onCompleted. // Beginning with QT 5.6, this stopped working, as anything added to toolbars too early got @@ -47,7 +70,6 @@ OriginalDesktop.Desktop { anchors.horizontalCenter: settings.constrainToolbarToCenterX ? desktop.horizontalCenter : undefined; // Literal 50 is overwritten by settings from previous session, and sysToolbar.x comes from settings when not constrained. x: sysToolbar.x - y: desktop.height - sysToolbar.height - 50 buttonModel: tablet.buttons; shown: tablet.toolbarMode; } diff --git a/interface/resources/qml/hifi/toolbars/Toolbar.qml b/interface/resources/qml/hifi/toolbars/Toolbar.qml index 79162d9240..b31a61e066 100644 --- a/interface/resources/qml/hifi/toolbars/Toolbar.qml +++ b/interface/resources/qml/hifi/toolbars/Toolbar.qml @@ -25,12 +25,24 @@ Window { property bool horizontal: true property real buttonSize: 50; + property alias settings: settings + Settings { + id: settings category: "toolbar/" + window.objectName property alias x: window.x - property alias y: window.y + property real y: 0 + property real desktopHeight: 0 //placeholder for desktop height } - + + onYChanged: { + //check if Y changed not due to Desktop size changed. ie. mouse manipulations + //otherwise it will be save by Desktop + if (desktop.height > 100 && desktop.height === settings.desktopHeight) { + settings.y = window.y + } + } + Component { id: buttonComponent ToolbarButton { From ba4ef74313e58e5e2eecaf122d751f529dbb2083 Mon Sep 17 00:00:00 2001 From: vladest Date: Thu, 19 Apr 2018 12:01:58 +0200 Subject: [PATCH 14/61] Remove View->Overlays menu --- interface/src/Application.cpp | 9 ++------- interface/src/Menu.cpp | 4 ---- interface/src/ui/OverlayConductor.cpp | 2 +- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 420818d931..663902d90f 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -4819,14 +4819,10 @@ void Application::updateThreads(float deltaTime) { } } -void Application::toggleOverlays() { - auto menu = Menu::getInstance(); - menu->setIsOptionChecked(MenuOption::Overlays, !menu->isOptionChecked(MenuOption::Overlays)); -} +void Application::toggleOverlays() {} void Application::setOverlaysVisible(bool visible) { - auto menu = Menu::getInstance(); - menu->setIsOptionChecked(MenuOption::Overlays, true); + Q_UNUSED(visible) } void Application::centerUI() { @@ -7770,7 +7766,6 @@ void Application::readArgumentsFromLocalSocket() const { } void Application::showDesktop() { - Menu::getInstance()->setIsOptionChecked(MenuOption::Overlays, true); } CompositorHelper& Application::getApplicationCompositor() const { diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index 70f32dd216..6b199896f4 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -202,10 +202,6 @@ Menu::Menu() { addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::CenterPlayerInView, 0, true, qApp, SLOT(rotationModeChanged())); - //TODO: remove Overlays action, but the action is tied to some other places in code - // View > Overlays - addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::Overlays, 0, true); - // View > Enter First Person Mode in HMD addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::FirstPersonHMD, 0, true); diff --git a/interface/src/ui/OverlayConductor.cpp b/interface/src/ui/OverlayConductor.cpp index ed8fa53fe2..b265849f62 100644 --- a/interface/src/ui/OverlayConductor.cpp +++ b/interface/src/ui/OverlayConductor.cpp @@ -143,7 +143,7 @@ void OverlayConductor::update(float dt) { } - bool targetVisible = Menu::getInstance()->isOptionChecked(MenuOption::Overlays) && (0 == (_flags & SuppressMask)); + bool targetVisible = (0 == (_flags & SuppressMask)); if (targetVisible != currentVisible) { offscreenUi->setPinned(!targetVisible); } From 3d8d0bfa0741d85148e218a2f52678dec25be455 Mon Sep 17 00:00:00 2001 From: vladest Date: Thu, 19 Apr 2018 12:31:14 +0200 Subject: [PATCH 15/61] Added hot keys enumeration for display menu --- interface/src/Application.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 663902d90f..16dfb70d08 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -7457,7 +7457,7 @@ DisplayPluginPointer Application::getActiveDisplayPlugin() const { static const char* EXCLUSION_GROUP_KEY = "exclusionGroup"; -static void addDisplayPluginToMenu(DisplayPluginPointer displayPlugin, bool active = false) { +static void addDisplayPluginToMenu(DisplayPluginPointer displayPlugin, int index) { auto menu = Menu::getInstance(); QString name = displayPlugin->getName(); auto grouping = displayPlugin->getGrouping(); @@ -7484,12 +7484,12 @@ static void addDisplayPluginToMenu(DisplayPluginPointer displayPlugin, bool acti } auto parent = menu->getMenu(MenuOption::OutputMenu); auto action = menu->addActionToQMenuAndActionHash(parent, - name, 0, qApp, + name, QKeySequence(Qt::CTRL + (Qt::Key_0 + index)), qApp, SLOT(updateDisplayMode()), QAction::NoRole, Menu::UNSPECIFIED_POSITION, groupingMenu); action->setCheckable(true); - action->setChecked(active); + action->setChecked(index == 1); displayPluginGroup->addAction(action); action->setProperty(EXCLUSION_GROUP_KEY, QVariant::fromValue(displayPluginGroup)); @@ -7507,8 +7507,6 @@ void Application::updateDisplayMode() { static std::once_flag once; std::call_once(once, [&] { - bool first = true; - // first sort the plugins into groupings: standard, advanced, developer DisplayPluginList standard; DisplayPluginList advanced; @@ -7533,14 +7531,15 @@ void Application::updateDisplayMode() { standard.insert(std::end(standard), std::begin(advanced), std::end(advanced)); standard.insert(std::end(standard), std::begin(developer), std::end(developer)); + int dpIndex = 1; foreach(auto displayPlugin, standard) { - addDisplayPluginToMenu(displayPlugin, first); + addDisplayPluginToMenu(displayPlugin, dpIndex); auto displayPluginName = displayPlugin->getName(); QObject::connect(displayPlugin.get(), &DisplayPlugin::recommendedFramebufferSizeChanged, [this](const QSize & size) { resizeGL(); }); QObject::connect(displayPlugin.get(), &DisplayPlugin::resetSensorsRequested, this, &Application::requestReset); - first = false; + dpIndex++; } // after all plugins have been added to the menu, add a separator to the menu From b191ad866f1cf491d6a53afc90abfdb8e5e84b82 Mon Sep 17 00:00:00 2001 From: vladest Date: Thu, 19 Apr 2018 21:04:11 +0200 Subject: [PATCH 16/61] Merge fixes --- interface/src/Application.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 78beb99e39..78a9f682d9 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -7543,10 +7543,10 @@ void Application::updateDisplayMode() { standard.insert(std::end(standard), std::begin(advanced), std::end(advanced)); standard.insert(std::end(standard), std::begin(developer), std::end(developer)); - int dpIndex = 1; + int dpIndex = 1; foreach(auto displayPlugin, standard) { - addDisplayPluginToMenu(displayPlugin, dpIndex); - dpIndex++; + addDisplayPluginToMenu(displayPlugin, dpIndex); + dpIndex++; } // after all plugins have been added to the menu, add a separator to the menu From d54739cfc29eab6946b7a9302fd6640284acedf0 Mon Sep 17 00:00:00 2001 From: vladest Date: Fri, 20 Apr 2018 18:08:11 +0200 Subject: [PATCH 17/61] Start adding notifications [DNP] --- interface/src/Menu.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index 6b199896f4..f9cf0bb3c2 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -49,6 +49,7 @@ #include "AmbientOcclusionEffect.h" #include "RenderShadowTask.h" +#include "scripting/SettingsScriptingInterface.h" #if defined(Q_OS_MAC) || defined(Q_OS_WIN) #include "SpeechRecognizer.h" #endif @@ -266,10 +267,15 @@ Menu::Menu() { // Settings > Notifications MenuWrapper * notificationsMenu = settingsMenu->addMenu("Notifications"); //This was in notifications.js. The menu needs to be moved here. - //TODO: Hookup notification actions below. + //TODO: Hookup notification actions below. // Settings > Notifications > Play Notification Sounds + SettingsScriptingInterface* settings = SettingsScriptingInterface::getInstance(); addActionToQMenuAndActionHash(notificationsMenu, "Play Notification Sounds"); - + action = addCheckableActionToQMenuAndActionHash(notificationsMenu, "Play Notification Sounds", 0, + settings->getValue("play_notification_sounds_type_0")); + connect(action, &QAction::triggered, [action] { + qApp->setDesktopTabletBecomesToolbarSetting(action->isChecked()); + }); notificationsMenu->addSeparator(); // Settings > Notifications > Play Sounds for: From e1222ddbc59ce69462c1121c1ad8aafde9f77ed7 Mon Sep 17 00:00:00 2001 From: vladest Date: Mon, 23 Apr 2018 18:54:41 +0200 Subject: [PATCH 18/61] 1st notifications added --- interface/src/Menu.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index 99643835a7..1ffcdd73ea 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -270,11 +270,10 @@ Menu::Menu() { //TODO: Hookup notification actions below. // Settings > Notifications > Play Notification Sounds SettingsScriptingInterface* settings = SettingsScriptingInterface::getInstance(); - addActionToQMenuAndActionHash(notificationsMenu, "Play Notification Sounds"); action = addCheckableActionToQMenuAndActionHash(notificationsMenu, "Play Notification Sounds", 0, - settings->getValue("play_notification_sounds_type_0")); - connect(action, &QAction::triggered, [action] { - qApp->setDesktopTabletBecomesToolbarSetting(action->isChecked()); + settings->getValue("play_notification_sounds").toBool()); + connect(action, &QAction::triggered, [action, settings] { + settings->setValue("play_notification_sounds", action->isChecked()); }); notificationsMenu->addSeparator(); @@ -282,11 +281,14 @@ Menu::Menu() { addDisabledActionAndSeparator(notificationsMenu, "Show notifications for:"); // Settings > Notifications > Snapshot - addActionToQMenuAndActionHash(notificationsMenu, "Snapshot"); - + action = addCheckableActionToQMenuAndActionHash(notificationsMenu, "Snapshot", 0, + settings->getValue("play_notification_sounds_type_0").toBool()); + connect(action, &QAction::triggered, [action, settings] { + settings->setValue("play_notification_sounds_type_0", action->isChecked()); + }); // Settings > Notifications > Level of Detail addActionToQMenuAndActionHash(notificationsMenu, "Level of Detail"); - + // Settings > Notifications > Connection addActionToQMenuAndActionHash(notificationsMenu, "Connection"); From deaecc705086c37411a60dc522be9058c39542d5 Mon Sep 17 00:00:00 2001 From: vladest Date: Sun, 29 Apr 2018 11:19:01 +0200 Subject: [PATCH 19/61] Added notifications settings --- interface/src/Menu.cpp | 42 +++++++++++++++++++++++++++++++----------- 1 file changed, 31 insertions(+), 11 deletions(-) diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index 74cd1c0ca1..ed8c6910ce 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -287,23 +287,43 @@ Menu::Menu() { settings->setValue("play_notification_sounds_type_0", action->isChecked()); }); // Settings > Notifications > Level of Detail - addActionToQMenuAndActionHash(notificationsMenu, "Level of Detail"); - + action = addCheckableActionToQMenuAndActionHash(notificationsMenu, "Level of Detail", 0, + settings->getValue("play_notification_sounds_type_1").toBool()); + connect(action, &QAction::triggered, [action, settings] { + settings->setValue("play_notification_sounds_type_1", action->isChecked()); + }); // Settings > Notifications > Connection - addActionToQMenuAndActionHash(notificationsMenu, "Connection"); - + action = addCheckableActionToQMenuAndActionHash(notificationsMenu, "Connection", 0, + settings->getValue("play_notification_sounds_type_2").toBool()); + connect(action, &QAction::triggered, [action, settings] { + settings->setValue("play_notification_sounds_type_2", action->isChecked()); + }); // Settings > Notifications > Connection Refused - addActionToQMenuAndActionHash(notificationsMenu, "Connection Refused"); - + action = addCheckableActionToQMenuAndActionHash(notificationsMenu, "Connection Refused", 0, + settings->getValue("play_notification_sounds_type_3").toBool()); + connect(action, &QAction::triggered, [action, settings] { + settings->setValue("play_notification_sounds_type_3", action->isChecked()); + }); // Settings > Notifications > Edit Error - addActionToQMenuAndActionHash(notificationsMenu, "Edit Error"); - + action = addCheckableActionToQMenuAndActionHash(notificationsMenu, "Edit Error", 0, + settings->getValue("play_notification_sounds_type_4").toBool()); + connect(action, &QAction::triggered, [action, settings] { + settings->setValue("play_notification_sounds_type_4", action->isChecked()); + }); // Settings > Notifications > Tablet - addActionToQMenuAndActionHash(notificationsMenu, "Tablet"); - + action = addCheckableActionToQMenuAndActionHash(notificationsMenu, "Tablet", 0, + settings->getValue("play_notification_sounds_type_5").toBool()); + connect(action, &QAction::triggered, [action, settings] { + settings->setValue("play_notification_sounds_type_5", action->isChecked()); + }); // Settings > Notifications > Wallet addActionToQMenuAndActionHash(notificationsMenu, "Wallet"); - + action = addCheckableActionToQMenuAndActionHash(notificationsMenu, "Wallet", 0, + settings->getValue("play_notification_sounds_type_6").toBool()); + connect(action, &QAction::triggered, [action, settings] { + settings->setValue("play_notification_sounds_type_6", action->isChecked()); + }); + // Settings > Developer Menu addCheckableActionToQMenuAndActionHash(settingsMenu, "Developer Menu", 0, false, this, SLOT(toggleDeveloperMenus())); From a16b2c0d20dc8d66b578b52f886bef48e427d6e0 Mon Sep 17 00:00:00 2001 From: vladest Date: Sun, 29 Apr 2018 12:38:37 +0200 Subject: [PATCH 20/61] Restore preferences dialogs buttons spacing --- interface/resources/qml/dialogs/PreferencesDialog.qml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/interface/resources/qml/dialogs/PreferencesDialog.qml b/interface/resources/qml/dialogs/PreferencesDialog.qml index 0a97ab9241..fffd0e2ed9 100644 --- a/interface/resources/qml/dialogs/PreferencesDialog.qml +++ b/interface/resources/qml/dialogs/PreferencesDialog.qml @@ -26,7 +26,7 @@ ScrollingWindow { property var showCategories: [] minSize: Qt.vector2d(400, 500) - //HifiConstants { id: hifi } + HifiConstants { id: hifi } function saveAll() { for (var i = 0; i < sections.length; ++i) { @@ -96,9 +96,9 @@ ScrollingWindow { anchors { top: parent.top right: parent.right - rightMargin: 10//hifi.dimensions.contentMargin.x + rightMargin: hifi.dimensions.contentMargin.x } - spacing: 1//hifi.dimensions.contentSpacing.x + spacing: hifi.dimensions.contentSpacing.x HifiControls.Button { text: "Save changes" From 4adfe94ed5becfb7dcb533c314161c2c7a6a9e8b Mon Sep 17 00:00:00 2001 From: vladest Date: Mon, 30 Apr 2018 20:43:36 +0200 Subject: [PATCH 21/61] Removed check for updates menu item. POC: settings for advanced movements mappings --- interface/src/Menu.cpp | 6 --- interface/src/ui/PreferencesDialog.cpp | 67 +++++++++++++++++++++++++- 2 files changed, 66 insertions(+), 7 deletions(-) diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index ed8c6910ce..0f7c0947cf 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -818,12 +818,6 @@ Menu::Menu() { helpMenu->addSeparator(); - // Help > Check for Updates - //ToDo: Add check for updates - addActionToQMenuAndActionHash(helpMenu, "Check for Updates"); - - helpMenu->addSeparator(); - // Help > Release Notes action = addActionToQMenuAndActionHash(helpMenu, "Release Notes"); connect(action, &QAction::triggered, qApp, [] { diff --git a/interface/src/ui/PreferencesDialog.cpp b/interface/src/ui/PreferencesDialog.cpp index b82f387137..e9e13721e7 100644 --- a/interface/src/ui/PreferencesDialog.cpp +++ b/interface/src/ui/PreferencesDialog.cpp @@ -14,6 +14,7 @@ #include #include #include +#include #include #include "Application.h" @@ -24,6 +25,9 @@ #include "SnapshotAnimated.h" #include "UserActivityLogger.h" +#include "controllers/impl/MappingBuilderProxy.h" +#include "controllers/impl/RouteBuilderProxy.h" + void setupPreferences() { auto preferences = DependencyManager::get(); auto nodeList = DependencyManager::get(); @@ -214,8 +218,69 @@ void setupPreferences() { //TODO: Update with advanced movement logic, test that it works { + + using namespace controller; + auto controllerScriptingInterface = DependencyManager::get().data(); + static QString advMovementsMappingName = QString("Hifi-AdvancedMovement-Dev-%1").arg(QRandomGenerator().generateDouble()); + static bool advMovementsIsDisabled = false; + static bool inFlipTurn = false; + + //code need to be revise so it should make correct iteration thru controller interface + /* + if (!advMovementsIsDisabled) { + MappingBuilderProxy* basicMapping = static_cast + (controllerScriptingInterface->newMapping(advMovementsMappingName)); + const auto standard = controllerScriptingInterface->getStandard(); + const auto hardware = controllerScriptingInterface->getHardware(); + qDebug() << "hardware" << hardware; + RouteBuilderProxy* fromMapping = static_cast + (basicMapping->fromQml(QJSValue(standard.value("LY").toFloat()))); + for(QMap::const_iterator i = standard.find("LY"); i != standard.end(); ++i) { + auto stick = controllerScriptingInterface->getValue(standard.value("LS").toInt()); + const float value = i.value().toFloat(); + if(value == 1.0f && hardware.contains("OculusTouch")) { + //rotate180 + myAvatar->setWorldOrientation(Quat().multiply(myAvatar->getWorldOrientation(), + Quat().angleAxis(180.0, glm::vec3(0,1,0)))); + + } else if (hardware.contains("Vive")) { + if (value > 0.75f && inFlipTurn == false) { + inFlipTurn = true; + //rotate180(); + QTimer::singleShot(1000, []() { inFlipTurn = false; } ); + } + } + } + for(QMap::const_iterator i = standard.find("RY"); i != standard.end(); ++i) { + auto stick = controllerScriptingInterface->getValue(standard.value("RS").toInt()); + const float value = i.value().toFloat(); + if(value == 1.0f && hardware.contains("OculusTouch")) { + //rotate180 + myAvatar->setWorldOrientation(Quat().multiply(myAvatar->getWorldOrientation(), + Quat().angleAxis(180.0, glm::vec3(0,1,0)))); + } else if (hardware.contains("Vive")) { + if (value > 0.75f && inFlipTurn == false) { + inFlipTurn = true; + //rotate180 + myAvatar->setWorldOrientation(Quat().multiply(myAvatar->getWorldOrientation(), + Quat().angleAxis(180.0, glm::vec3(0,1,0)))); + + QTimer::singleShot(1000, []() { inFlipTurn = false; } ); + } + } + } + }*/ auto getter = [=]()->bool { return myAvatar->useAdvancedMovementControls(); }; - auto setter = [=](bool value) { myAvatar->setUseAdvancedMovementControls(value); }; + auto setter = [=](bool value) { + auto controllerScriptingInterface = DependencyManager::get().data(); + myAvatar->setUseAdvancedMovementControls(value); + if (value) { + controllerScriptingInterface->enableMapping(advMovementsMappingName); + } else { + controllerScriptingInterface->disableMapping(advMovementsMappingName); + } + + }; preferences->addPreference(new CheckPreference(MOVEMENT, "Advanced movement for hand controllers", getter, setter)); } From 617b49fe1467462d850ba78662d82ee5c6741cf2 Mon Sep 17 00:00:00 2001 From: vladest Date: Tue, 1 May 2018 21:22:48 +0200 Subject: [PATCH 22/61] Added mouse sensivity UI. Reworked advanced movements. TODO: properties interface complitely broken in Tablet mode --- interface/resources/qml/desktop/Desktop.qml | 24 +++--- .../hifi/dialogs/GeneralPreferencesDialog.qml | 2 +- .../hifi/tablet/TabletGeneralPreferences.qml | 2 +- interface/resources/qml/windows/Frame.qml | 2 +- interface/src/ui/PreferencesDialog.cpp | 79 ++++++------------- interface/src/ui/overlays/Web3DOverlay.cpp | 3 + ...oggleAdvancedMovementForHandControllers.js | 40 ++-------- 7 files changed, 49 insertions(+), 103 deletions(-) diff --git a/interface/resources/qml/desktop/Desktop.qml b/interface/resources/qml/desktop/Desktop.qml index 5f924834d9..a59b9d5ac0 100644 --- a/interface/resources/qml/desktop/Desktop.qml +++ b/interface/resources/qml/desktop/Desktop.qml @@ -149,17 +149,17 @@ FocusScope { } function isModalWindow(window) { - return window.modality !== Qt.NonModal; + return true;//window.modality !== (typeof Qt !== 'undefined' ? Qt.NonModal : 0); } function getTopLevelWindows(predicate) { - return findMatchingChildren(desktop, function(child) { - return (isTopLevelWindow(child) && (!predicate || predicate(child))); + return d.findMatchingChildren(desktop, function(child) { + return (d.isTopLevelWindow(child) && (!predicate || predicate(child))); }); } function getDesktopWindow(item) { - return findParentMatching(item, isTopLevelWindow) + return d.findParentMatching(item, d.isTopLevelWindow) } function fixupZOrder(windows, basis, topWindow) { @@ -205,23 +205,23 @@ FocusScope { function raiseWindow(targetWindow) { var predicate; var zBasis; - if (isModalWindow(targetWindow)) { - predicate = isModalWindow; + if (d.isModalWindow(targetWindow)) { + predicate = d.isModalWindow; zBasis = zLevels.modal - } else if (isAlwaysOnTopWindow(targetWindow)) { + } else if (d.isAlwaysOnTopWindow(targetWindow)) { predicate = function(window) { - return (isAlwaysOnTopWindow(window) && !isModalWindow(window)); + return (d.isAlwaysOnTopWindow(window) && !d.isModalWindow(window)); } zBasis = zLevels.top } else { predicate = function(window) { - return (!isAlwaysOnTopWindow(window) && !isModalWindow(window)); + return (!d.isAlwaysOnTopWindow(window) && !d.isModalWindow(window)); } zBasis = zLevels.normal } - var windows = getTopLevelWindows(predicate); - fixupZOrder(windows, zBasis, targetWindow); + var windows = d.getTopLevelWindows(predicate); + d.fixupZOrder(windows, zBasis, targetWindow); } Component.onCompleted: { @@ -264,7 +264,7 @@ FocusScope { } function getRepositionChildren(predicate) { - return findMatchingChildren(desktop, function(child) { + return d.findMatchingChildren(desktop, function(child) { return (child.shouldReposition === true && (!predicate || predicate(child))); }); } diff --git a/interface/resources/qml/hifi/dialogs/GeneralPreferencesDialog.qml b/interface/resources/qml/hifi/dialogs/GeneralPreferencesDialog.qml index cb4913f999..b6441573d8 100644 --- a/interface/resources/qml/hifi/dialogs/GeneralPreferencesDialog.qml +++ b/interface/resources/qml/hifi/dialogs/GeneralPreferencesDialog.qml @@ -17,7 +17,7 @@ PreferencesDialog { id: root objectName: "GeneralPreferencesDialog" title: "General Settings" - showCategories: ["User Interface", "HMD", "Snapshots", "Privacy"] + showCategories: ["User Interface", "HMD", "Snapshots", "Privacy", "Mouse Sensivity"] property var settings: Settings { category: root.objectName property alias x: root.x diff --git a/interface/resources/qml/hifi/tablet/TabletGeneralPreferences.qml b/interface/resources/qml/hifi/tablet/TabletGeneralPreferences.qml index 810f5bb43f..f754bd4ea5 100644 --- a/interface/resources/qml/hifi/tablet/TabletGeneralPreferences.qml +++ b/interface/resources/qml/hifi/tablet/TabletGeneralPreferences.qml @@ -32,6 +32,6 @@ StackView { TabletPreferencesDialog { id: root objectName: "TabletGeneralPreferences" - showCategories: ["UI", "Snapshots", "Scripts", "Privacy", "Octree", "HMD", "Game Controller", "Sixense Controllers", "Perception Neuron", "Kinect", "Leap Motion"] + showCategories: ["UI", "Snapshots", "Scripts", "Privacy", "Octree", "HMD", "Game Controller", "Sixense Controllers", "Perception Neuron", "Kinect", "Leap Motion", "Mouse Sensivity"] } } diff --git a/interface/resources/qml/windows/Frame.qml b/interface/resources/qml/windows/Frame.qml index 98bfb52c38..271d4f2e07 100644 --- a/interface/resources/qml/windows/Frame.qml +++ b/interface/resources/qml/windows/Frame.qml @@ -43,7 +43,7 @@ Item { Text { id: debugZ - visible: DebugQML + visible: (typeof DebugQML !== 'undefined') ? DebugQML : false color: "red" text: (window ? "Z: " + window.z : "") + " " + qmlFile y: window ? window.height + 4 : 0 diff --git a/interface/src/ui/PreferencesDialog.cpp b/interface/src/ui/PreferencesDialog.cpp index e9e13721e7..0ef2aa38a9 100644 --- a/interface/src/ui/PreferencesDialog.cpp +++ b/interface/src/ui/PreferencesDialog.cpp @@ -15,6 +15,7 @@ #include #include #include +#include #include #include "Application.h" @@ -55,7 +56,20 @@ void setupPreferences() { auto preference = new AvatarPreference(AVATAR_BASICS, "Appearance", getter, setter); preferences->addPreference(preference); } - // UI + + static const QString MOUSE_SENSIVITY { "Mouse Sensivity" }; + { + auto getterY = []()->float { return 1.0; }; + auto setterY = [](float value) { }; + preferences->addPreference(new SliderPreference(MOUSE_SENSIVITY, "Y Input", getterY, setterY)); + auto getterX = []()->float { return 1.0; }; + auto setterX = [](float value) { }; + preferences->addPreference(new SliderPreference(MOUSE_SENSIVITY, "X Input", getterX, setterX)); + auto getterSW = []()->float { return 1.0; }; + auto setterSW = [](float value) { }; + preferences->addPreference(new SliderPreference(MOUSE_SENSIVITY, "Scroll Wheel", getterSW, setterSW)); + } + // Graphics quality static const QString GRAPHICS_QUALITY { "Graphics Quality" }; { auto getter = []()->float { return DependencyManager::get()->getLODLevel(); }; @@ -219,69 +233,22 @@ void setupPreferences() { //TODO: Update with advanced movement logic, test that it works { - using namespace controller; - auto controllerScriptingInterface = DependencyManager::get().data(); - static QString advMovementsMappingName = QString("Hifi-AdvancedMovement-Dev-%1").arg(QRandomGenerator().generateDouble()); - static bool advMovementsIsDisabled = false; - static bool inFlipTurn = false; - - //code need to be revise so it should make correct iteration thru controller interface - /* - if (!advMovementsIsDisabled) { - MappingBuilderProxy* basicMapping = static_cast - (controllerScriptingInterface->newMapping(advMovementsMappingName)); - const auto standard = controllerScriptingInterface->getStandard(); - const auto hardware = controllerScriptingInterface->getHardware(); - qDebug() << "hardware" << hardware; - RouteBuilderProxy* fromMapping = static_cast - (basicMapping->fromQml(QJSValue(standard.value("LY").toFloat()))); - for(QMap::const_iterator i = standard.find("LY"); i != standard.end(); ++i) { - auto stick = controllerScriptingInterface->getValue(standard.value("LS").toInt()); - const float value = i.value().toFloat(); - if(value == 1.0f && hardware.contains("OculusTouch")) { - //rotate180 - myAvatar->setWorldOrientation(Quat().multiply(myAvatar->getWorldOrientation(), - Quat().angleAxis(180.0, glm::vec3(0,1,0)))); - - } else if (hardware.contains("Vive")) { - if (value > 0.75f && inFlipTurn == false) { - inFlipTurn = true; - //rotate180(); - QTimer::singleShot(1000, []() { inFlipTurn = false; } ); - } - } - } - for(QMap::const_iterator i = standard.find("RY"); i != standard.end(); ++i) { - auto stick = controllerScriptingInterface->getValue(standard.value("RS").toInt()); - const float value = i.value().toFloat(); - if(value == 1.0f && hardware.contains("OculusTouch")) { - //rotate180 - myAvatar->setWorldOrientation(Quat().multiply(myAvatar->getWorldOrientation(), - Quat().angleAxis(180.0, glm::vec3(0,1,0)))); - } else if (hardware.contains("Vive")) { - if (value > 0.75f && inFlipTurn == false) { - inFlipTurn = true; - //rotate180 - myAvatar->setWorldOrientation(Quat().multiply(myAvatar->getWorldOrientation(), - Quat().angleAxis(180.0, glm::vec3(0,1,0)))); - - QTimer::singleShot(1000, []() { inFlipTurn = false; } ); - } - } - } - }*/ + static const QString movementsControlChannel = QStringLiteral("Hifi-Advanced-Movement-Disabler"); auto getter = [=]()->bool { return myAvatar->useAdvancedMovementControls(); }; auto setter = [=](bool value) { - auto controllerScriptingInterface = DependencyManager::get().data(); + auto messagesClient = DependencyManager::get().data(); myAvatar->setUseAdvancedMovementControls(value); + qDebug() << "vladest movement" << value; if (value) { - controllerScriptingInterface->enableMapping(advMovementsMappingName); + messagesClient->sendMessage(movementsControlChannel, QStringLiteral("enable_mappings"), true); } else { - controllerScriptingInterface->disableMapping(advMovementsMappingName); + messagesClient->sendMessage(movementsControlChannel, QStringLiteral("disable_mappings"), true); } }; - preferences->addPreference(new CheckPreference(MOVEMENT, "Advanced movement for hand controllers", getter, setter)); + preferences->addPreference(new CheckPreference(MOVEMENT, + QStringLiteral("Advanced movement for hand controllers"), + getter, setter)); } { diff --git a/interface/src/ui/overlays/Web3DOverlay.cpp b/interface/src/ui/overlays/Web3DOverlay.cpp index fcdac8c00c..a48e5eaf54 100644 --- a/interface/src/ui/overlays/Web3DOverlay.cpp +++ b/interface/src/ui/overlays/Web3DOverlay.cpp @@ -56,6 +56,7 @@ #include "ui/Snapshot.h" #include "SoundCache.h" #include "raypick/PointerScriptingInterface.h" +#include static int MAX_WINDOW_SIZE = 4096; static const float METERS_TO_INCHES = 39.3701f; @@ -256,6 +257,8 @@ void Web3DOverlay::setupQmlSurface() { _webSurface->getSurfaceContext()->setContextProperty("Pointers", DependencyManager::get().data()); _webSurface->getSurfaceContext()->setContextProperty("Web3DOverlay", this); _webSurface->getSurfaceContext()->setContextProperty("Window", DependencyManager::get().data()); + _webSurface->getSurfaceContext()->setContextProperty("Reticle", qApp->getApplicationCompositor().getReticleInterface()); + _webSurface->getSurfaceContext()->setContextProperty("desktop", DependencyManager::get()->getDesktop()); // Override min fps for tablet UI, for silky smooth scrolling setMaxFPS(90); diff --git a/scripts/system/controllers/toggleAdvancedMovementForHandControllers.js b/scripts/system/controllers/toggleAdvancedMovementForHandControllers.js index e6c9b0aee0..40721e7f72 100644 --- a/scripts/system/controllers/toggleAdvancedMovementForHandControllers.js +++ b/scripts/system/controllers/toggleAdvancedMovementForHandControllers.js @@ -16,7 +16,6 @@ var mappingName, basicMapping, isChecked; var TURN_RATE = 1000; -var MENU_ITEM_NAME = "Advanced Movement For Hand Controllers"; var isDisabled = false; var previousSetting = MyAvatar.useAdvancedMovementControls; if (previousSetting === false) { @@ -29,15 +28,6 @@ if (previousSetting === true) { isChecked = true; } -function addAdvancedMovementItemToSettingsMenu() { - Menu.addMenuItem({ - menuName: "Settings", - menuItemName: MENU_ITEM_NAME, - isCheckable: true, - isChecked: previousSetting - }); -} - function rotate180() { var newOrientation = Quat.multiply(MyAvatar.orientation, Quat.angleAxis(180, { x: 0, @@ -100,30 +90,11 @@ function disableMappings() { } function scriptEnding() { - Menu.removeMenuItem("Settings", MENU_ITEM_NAME); disableMappings(); } - -function menuItemEvent(menuItem) { - if (menuItem == MENU_ITEM_NAME) { - isChecked = Menu.isOptionChecked(MENU_ITEM_NAME); - if (isChecked === true) { - MyAvatar.useAdvancedMovementControls = true; - disableMappings(); - } else if (isChecked === false) { - MyAvatar.useAdvancedMovementControls = false; - enableMappings(); - } - } -} - -addAdvancedMovementItemToSettingsMenu(); - Script.scriptEnding.connect(scriptEnding); -Menu.menuItemEvent.connect(menuItemEvent); - registerBasicMapping(); Script.setTimeout(function() { @@ -151,11 +122,16 @@ HMD.displayModeChanged.connect(function(isHMDMode) { var HIFI_ADVANCED_MOVEMENT_DISABLER_CHANNEL = 'Hifi-Advanced-Movement-Disabler'; function handleMessage(channel, message, sender) { - if (channel == HIFI_ADVANCED_MOVEMENT_DISABLER_CHANNEL) { - if (message == 'disable') { + if (channel === HIFI_ADVANCED_MOVEMENT_DISABLER_CHANNEL) { + if (message === 'disable') { isDisabled = true; - } else if (message == 'enable') { + } else if (message === 'enable') { isDisabled = false; + } else if (message === 'enable_mappings') { + print("enable mappings") + enableMappings(); + } else if (message === 'disable_mappings') { + disableMappings(); } } } From ea66e04ab859fbecc0cd714cd46bdfaef26eb913 Mon Sep 17 00:00:00 2001 From: vladest Date: Wed, 2 May 2018 18:58:40 +0200 Subject: [PATCH 23/61] Removed unwanted code --- .../qml/hifi/tablet/ControllerSettings.qml | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/interface/resources/qml/hifi/tablet/ControllerSettings.qml b/interface/resources/qml/hifi/tablet/ControllerSettings.qml index 0e110517e0..f134e280e6 100644 --- a/interface/resources/qml/hifi/tablet/ControllerSettings.qml +++ b/interface/resources/qml/hifi/tablet/ControllerSettings.qml @@ -15,20 +15,6 @@ import "../../controls" import "../../controls-uit" as HifiControls import "../../dialogs" -PreferencesDialog { - id: root - objectName: "ControlSettings" - title: "Control Settings" - showCategories: ["VR Movement", "Mouse Sensitivity", "Game Controller", "Face Tracking", "Sixense Controllers", "Perception Neuron", "Kinect", "Leap Motion"] - property var settings: Settings { - category: root.objectName - property alias x: root.x - property alias y: root.y - property alias width: root.width - property alias height: root.height - } -} -/* StackView { id: stack initialItem: inputConfiguration @@ -243,4 +229,3 @@ StackView { timer.start(); } } -*/ From 14dfafa815d107aa6800bdd53068482ff06abebd Mon Sep 17 00:00:00 2001 From: vladest Date: Wed, 2 May 2018 19:46:18 +0200 Subject: [PATCH 24/61] Brings logging back --- interface/src/Menu.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index 0f7c0947cf..653800a1ab 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -758,6 +758,20 @@ Menu::Menu() { connect(speechRecognizer.data(), SIGNAL(enabledUpdated(bool)), speechRecognizerAction, SLOT(setChecked(bool))); #endif + // Developer > Log... + addActionToQMenuAndActionHash(developerMenu, MenuOption::Log, Qt::CTRL | Qt::SHIFT | Qt::Key_L, + qApp, SLOT(toggleLogDialog())); + auto essLogAction = addActionToQMenuAndActionHash(developerMenu, MenuOption::EntityScriptServerLog, 0, + qApp, SLOT(toggleEntityScriptServerLogDialog())); + QObject::connect(nodeList.data(), &NodeList::canRezChanged, essLogAction, [essLogAction] { + auto nodeList = DependencyManager::get(); + essLogAction->setEnabled(nodeList->getThisNodeCanRez()); + }); + essLogAction->setEnabled(nodeList->getThisNodeCanRez()); + + action = addActionToQMenuAndActionHash(developerMenu, "Script Log (HMD friendly)...", Qt::NoButton, + qApp, SLOT(showScriptLogs())); + addCheckableActionToQMenuAndActionHash(developerMenu, MenuOption::VerboseLogging, 0, false, qApp, SLOT(updateVerboseLogging())); From 9e5dbf9a9912802078b79d4aab561043dce3bc51 Mon Sep 17 00:00:00 2001 From: vladest Date: Fri, 4 May 2018 22:01:44 +0200 Subject: [PATCH 25/61] Snapshot notification sound settings --- interface/src/Application.cpp | 15 ++++++++------- interface/src/Menu.cpp | 4 ++-- interface/src/Menu.h | 1 + 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index a480af2e0e..83e1f622fd 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -3601,13 +3601,14 @@ void Application::keyPressEvent(QKeyEvent* event) { AudioInjectorOptions options; options.localOnly = true; options.stereo = true; - - if (_snapshotSoundInjector) { - _snapshotSoundInjector->setOptions(options); - _snapshotSoundInjector->restart(); - } else { - QByteArray samples = _snapshotSound->getByteArray(); - _snapshotSoundInjector = AudioInjector::playSound(samples, options); + if (SettingsScriptingInterface::getInstance()->getValue(MenuOption::NotificationSoundsSnapshot).toBool()) { + if (_snapshotSoundInjector) { + _snapshotSoundInjector->setOptions(options); + _snapshotSoundInjector->restart(); + } else { + QByteArray samples = _snapshotSound->getByteArray(); + _snapshotSoundInjector = AudioInjector::playSound(samples, options); + } } takeSnapshot(true); break; diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index 653800a1ab..676e4f25e9 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -282,9 +282,9 @@ Menu::Menu() { // Settings > Notifications > Snapshot action = addCheckableActionToQMenuAndActionHash(notificationsMenu, "Snapshot", 0, - settings->getValue("play_notification_sounds_type_0").toBool()); + settings->getValue(MenuOption::NotificationSoundsSnapshot).toBool()); connect(action, &QAction::triggered, [action, settings] { - settings->setValue("play_notification_sounds_type_0", action->isChecked()); + settings->setValue(MenuOption::NotificationSoundsSnapshot, action->isChecked()); }); // Settings > Notifications > Level of Detail action = addCheckableActionToQMenuAndActionHash(notificationsMenu, "Level of Detail", 0, diff --git a/interface/src/Menu.h b/interface/src/Menu.h index 3a4864cfc6..5917aab38b 100644 --- a/interface/src/Menu.h +++ b/interface/src/Menu.h @@ -212,6 +212,7 @@ namespace MenuOption { const QString HMDTabletToToolbar = "HMD Tablet Becomes Toolbar"; const QString Shadows = "Shadows"; const QString AmbientOcclusion = "Ambient Occlusion"; + const QString NotificationSoundsSnapshot = "play_notification_sounds_snapshot"; } #endif // hifi_Menu_h From ac413c88541c2eb6961c546cc36fb0fda4b72e38 Mon Sep 17 00:00:00 2001 From: vladest Date: Sun, 6 May 2018 09:41:10 +0200 Subject: [PATCH 26/61] Tablet opening notification sound settings added --- interface/src/Menu.cpp | 5 +++-- interface/src/Menu.h | 1 + libraries/ui/src/ui/TabletScriptingInterface.cpp | 5 ++++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index b95a789570..ceef87f97b 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -311,9 +311,10 @@ Menu::Menu() { }); // Settings > Notifications > Tablet action = addCheckableActionToQMenuAndActionHash(notificationsMenu, "Tablet", 0, - settings->getValue("play_notification_sounds_type_5").toBool()); + settings->getValue(MenuOption::NotificationSoundsTablet).toBool()); connect(action, &QAction::triggered, [action, settings] { - settings->setValue("play_notification_sounds_type_5", action->isChecked()); + settings->setValue(MenuOption::NotificationSoundsTablet, action->isChecked()); + qDebug() << "vladest. tablet sound check up" << settings->getValue(MenuOption::NotificationSoundsTablet).toBool(); }); // Settings > Notifications > Wallet addActionToQMenuAndActionHash(notificationsMenu, "Wallet"); diff --git a/interface/src/Menu.h b/interface/src/Menu.h index dc833be173..496368c30b 100644 --- a/interface/src/Menu.h +++ b/interface/src/Menu.h @@ -218,6 +218,7 @@ namespace MenuOption { const QString Shadows = "Shadows"; const QString AmbientOcclusion = "Ambient Occlusion"; const QString NotificationSoundsSnapshot = "play_notification_sounds_snapshot"; + const QString NotificationSoundsTablet = "play_notification_sounds_tablet"; } #endif // hifi_Menu_h diff --git a/libraries/ui/src/ui/TabletScriptingInterface.cpp b/libraries/ui/src/ui/TabletScriptingInterface.cpp index a079609bb7..89751b142e 100644 --- a/libraries/ui/src/ui/TabletScriptingInterface.cpp +++ b/libraries/ui/src/ui/TabletScriptingInterface.cpp @@ -441,7 +441,10 @@ void TabletProxy::emitWebEvent(const QVariant& msg) { void TabletProxy::onTabletShown() { if (_tabletShown) { - static_cast(parent())->playSound(TabletScriptingInterface::TabletOpen); + Setting::Handle notificationSoundTablet{ "play_notification_sounds_tablet", true}; + if (notificationSoundTablet.get()) { + static_cast(parent())->playSound(TabletScriptingInterface::TabletOpen); + } if (_showRunningScripts) { _showRunningScripts = false; pushOntoStack("hifi/dialogs/TabletRunningScripts.qml"); From 1794113f37b7d2f2799e652acb4b64e16d369a79 Mon Sep 17 00:00:00 2001 From: vladest Date: Sun, 6 May 2018 12:51:59 +0200 Subject: [PATCH 27/61] Check global switch as well --- interface/src/Application.cpp | 4 +++- interface/src/Menu.cpp | 4 ++-- interface/src/Menu.h | 1 + libraries/ui/src/ui/TabletScriptingInterface.cpp | 7 ++++--- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index e2010c199e..76e20434b0 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -3609,7 +3609,9 @@ void Application::keyPressEvent(QKeyEvent* event) { AudioInjectorOptions options; options.localOnly = true; options.stereo = true; - if (SettingsScriptingInterface::getInstance()->getValue(MenuOption::NotificationSoundsSnapshot).toBool()) { + Setting::Handle notificationSounds{ MenuOption::NotificationSounds, true}; + Setting::Handle notificationSoundSnapshot{ MenuOption::NotificationSoundsSnapshot, true}; + if (notificationSounds.get() && notificationSoundSnapshot.get()) { if (_snapshotSoundInjector) { _snapshotSoundInjector->setOptions(options); _snapshotSoundInjector->restart(); diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index ceef87f97b..e040f7a22c 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -270,9 +270,9 @@ Menu::Menu() { // Settings > Notifications > Play Notification Sounds SettingsScriptingInterface* settings = SettingsScriptingInterface::getInstance(); action = addCheckableActionToQMenuAndActionHash(notificationsMenu, "Play Notification Sounds", 0, - settings->getValue("play_notification_sounds").toBool()); + settings->getValue(MenuOption::NotificationSounds).toBool()); connect(action, &QAction::triggered, [action, settings] { - settings->setValue("play_notification_sounds", action->isChecked()); + settings->setValue(MenuOption::NotificationSounds, action->isChecked()); }); notificationsMenu->addSeparator(); diff --git a/interface/src/Menu.h b/interface/src/Menu.h index 496368c30b..86e44775c5 100644 --- a/interface/src/Menu.h +++ b/interface/src/Menu.h @@ -217,6 +217,7 @@ namespace MenuOption { const QString HMDTabletToToolbar = "HMD Tablet Becomes Toolbar"; const QString Shadows = "Shadows"; const QString AmbientOcclusion = "Ambient Occlusion"; + const QString NotificationSounds = "play_notification_sounds"; const QString NotificationSoundsSnapshot = "play_notification_sounds_snapshot"; const QString NotificationSoundsTablet = "play_notification_sounds_tablet"; } diff --git a/libraries/ui/src/ui/TabletScriptingInterface.cpp b/libraries/ui/src/ui/TabletScriptingInterface.cpp index 89751b142e..9070d87a3c 100644 --- a/libraries/ui/src/ui/TabletScriptingInterface.cpp +++ b/libraries/ui/src/ui/TabletScriptingInterface.cpp @@ -441,9 +441,10 @@ void TabletProxy::emitWebEvent(const QVariant& msg) { void TabletProxy::onTabletShown() { if (_tabletShown) { - Setting::Handle notificationSoundTablet{ "play_notification_sounds_tablet", true}; - if (notificationSoundTablet.get()) { - static_cast(parent())->playSound(TabletScriptingInterface::TabletOpen); + Setting::Handle notificationSounds{ QStringLiteral("play_notification_sounds"), true}; + Setting::Handle notificationSoundTablet{ QStringLiteral("play_notification_sounds_tablet"), true}; + if (notificationSounds.get() && notificationSoundTablet.get()) { + dynamic_cast(parent())->playSound(TabletScriptingInterface::TabletOpen); } if (_showRunningScripts) { _showRunningScripts = false; From afe04f3a4fbd1ffbd6c3e188264276079f9fefca Mon Sep 17 00:00:00 2001 From: vladest Date: Sun, 6 May 2018 14:24:54 +0200 Subject: [PATCH 28/61] cleanup --- interface/src/Menu.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index e040f7a22c..33e185b954 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -314,7 +314,6 @@ Menu::Menu() { settings->getValue(MenuOption::NotificationSoundsTablet).toBool()); connect(action, &QAction::triggered, [action, settings] { settings->setValue(MenuOption::NotificationSoundsTablet, action->isChecked()); - qDebug() << "vladest. tablet sound check up" << settings->getValue(MenuOption::NotificationSoundsTablet).toBool(); }); // Settings > Notifications > Wallet addActionToQMenuAndActionHash(notificationsMenu, "Wallet"); From 399e18dfc16b779df23428cb1f1c3291d2024bee Mon Sep 17 00:00:00 2001 From: vladest Date: Thu, 10 May 2018 10:28:48 +0200 Subject: [PATCH 29/61] Disable non implemented sound notifications until further notice --- interface/src/Menu.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index 33e185b954..b8fbfcd07f 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -285,6 +285,15 @@ Menu::Menu() { connect(action, &QAction::triggered, [action, settings] { settings->setValue(MenuOption::NotificationSoundsSnapshot, action->isChecked()); }); + // Settings > Notifications > Tablet + action = addCheckableActionToQMenuAndActionHash(notificationsMenu, "Tablet", 0, + settings->getValue(MenuOption::NotificationSoundsTablet).toBool()); + connect(action, &QAction::triggered, [action, settings] { + settings->setValue(MenuOption::NotificationSoundsTablet, action->isChecked()); + }); + + //Further sound notificaions disabled until new notification system will be implemented + /* // Settings > Notifications > Level of Detail action = addCheckableActionToQMenuAndActionHash(notificationsMenu, "Level of Detail", 0, settings->getValue("play_notification_sounds_type_1").toBool()); @@ -309,12 +318,6 @@ Menu::Menu() { connect(action, &QAction::triggered, [action, settings] { settings->setValue("play_notification_sounds_type_4", action->isChecked()); }); - // Settings > Notifications > Tablet - action = addCheckableActionToQMenuAndActionHash(notificationsMenu, "Tablet", 0, - settings->getValue(MenuOption::NotificationSoundsTablet).toBool()); - connect(action, &QAction::triggered, [action, settings] { - settings->setValue(MenuOption::NotificationSoundsTablet, action->isChecked()); - }); // Settings > Notifications > Wallet addActionToQMenuAndActionHash(notificationsMenu, "Wallet"); action = addCheckableActionToQMenuAndActionHash(notificationsMenu, "Wallet", 0, @@ -322,7 +325,7 @@ Menu::Menu() { connect(action, &QAction::triggered, [action, settings] { settings->setValue("play_notification_sounds_type_6", action->isChecked()); }); - +*/ // Settings > Developer Menu addCheckableActionToQMenuAndActionHash(settingsMenu, "Developer Menu", 0, false, this, SLOT(toggleDeveloperMenus())); From a3f814816593148bf454633b2783fb8488a61ddb Mon Sep 17 00:00:00 2001 From: vladest Date: Thu, 10 May 2018 12:40:13 +0200 Subject: [PATCH 30/61] Added enable disable shadows menu --- interface/src/ui/PreferencesDialog.cpp | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/interface/src/ui/PreferencesDialog.cpp b/interface/src/ui/PreferencesDialog.cpp index 0ef2aa38a9..905991834d 100644 --- a/interface/src/ui/PreferencesDialog.cpp +++ b/interface/src/ui/PreferencesDialog.cpp @@ -16,6 +16,7 @@ #include #include #include +#include #include #include "Application.h" @@ -78,6 +79,29 @@ void setupPreferences() { auto getterSQ = []()->float { return 1.0; }; auto setterSQ = [](float value) { }; preferences->addPreference(new SliderPreference(GRAPHICS_QUALITY, "Shadow Quality", getterSQ, setterSQ)); + + auto getterShadow = []()->bool { + bool ret = false; + auto renderConfig = qApp->getRenderEngine()->getConfiguration(); + if (renderConfig) { + auto mainViewShadowTaskConfig = renderConfig->getConfig("RenderMainView.RenderShadowTask"); + if (mainViewShadowTaskConfig) { + ret = (mainViewShadowTaskConfig->getPreset() == QStringLiteral("Enabled")); + } + } + return ret; + }; + auto setterShadow = [](bool value) { + auto renderConfig = qApp->getRenderEngine()->getConfiguration(); + if (renderConfig) { + auto mainViewShadowTaskConfig = renderConfig->getConfig("RenderMainView.RenderShadowTask"); + if (mainViewShadowTaskConfig) { + mainViewShadowTaskConfig->setPreset(value ? QStringLiteral("Enabled") + : QStringLiteral("None")); + } + } + }; + preferences->addPreference(new CheckPreference(GRAPHICS_QUALITY, "Enable/disable shadows", getterShadow, setterShadow)); } // UI @@ -238,7 +262,6 @@ void setupPreferences() { auto setter = [=](bool value) { auto messagesClient = DependencyManager::get().data(); myAvatar->setUseAdvancedMovementControls(value); - qDebug() << "vladest movement" << value; if (value) { messagesClient->sendMessage(movementsControlChannel, QStringLiteral("enable_mappings"), true); } else { From f8ebe7e6693f55ce502f66b2d5a656dc64b6e88c Mon Sep 17 00:00:00 2001 From: vladest Date: Sat, 12 May 2018 16:01:43 +0200 Subject: [PATCH 31/61] remoed no more used LOD dialogs. Fixed Slider properties min and max settings --- .../dialogs/preferences/SliderPreference.qml | 2 + .../qml/hifi/tablet/ControllerSettings.qml | 388 +++++++++--------- interface/src/Application.cpp | 14 - interface/src/Application.h | 2 - interface/src/LODManager.cpp | 5 +- interface/src/Menu.cpp | 4 - interface/src/Menu.h | 1 - interface/src/ui/DialogsManager.cpp | 11 - interface/src/ui/DialogsManager.h | 4 - interface/src/ui/HMDToolsDialog.cpp | 3 - interface/src/ui/LodToolsDialog.cpp | 133 ------ interface/src/ui/LodToolsDialog.h | 55 --- interface/src/ui/PreferencesDialog.cpp | 9 +- 13 files changed, 213 insertions(+), 418 deletions(-) delete mode 100644 interface/src/ui/LodToolsDialog.cpp delete mode 100644 interface/src/ui/LodToolsDialog.h diff --git a/interface/resources/qml/dialogs/preferences/SliderPreference.qml b/interface/resources/qml/dialogs/preferences/SliderPreference.qml index e9013bc17a..79c7149f3e 100644 --- a/interface/resources/qml/dialogs/preferences/SliderPreference.qml +++ b/interface/resources/qml/dialogs/preferences/SliderPreference.qml @@ -53,6 +53,8 @@ Preference { Slider { id: slider value: preference.value + minimumValue: preference.min + maximumValue: preference.max width: 130 anchors { right: parent.right diff --git a/interface/resources/qml/hifi/tablet/ControllerSettings.qml b/interface/resources/qml/hifi/tablet/ControllerSettings.qml index f134e280e6..4ee69c4982 100644 --- a/interface/resources/qml/hifi/tablet/ControllerSettings.qml +++ b/interface/resources/qml/hifi/tablet/ControllerSettings.qml @@ -14,218 +14,238 @@ import "../../styles-uit" import "../../controls" import "../../controls-uit" as HifiControls import "../../dialogs" +import "../../dialogs/preferences" -StackView { - id: stack - initialItem: inputConfiguration - property alias messageVisible: imageMessageBox.visible - property alias selectedPlugin: box.currentText - Rectangle { - id: inputConfiguration - anchors.fill: parent +PreferencesDialog { + id: root + objectName: "ControlSettings" + title: "Control Settings" + showCategories: ["VR Movement", inputConfigurationComponents] + property var settings: Settings { + category: root.objectName + property alias x: root.x + property alias y: root.y + property alias width: root.width + property alias height: root.height + } + Component { + id: inputConfigurationComponents - HifiConstants { id: hifi } + Preference { - color: hifi.colors.baseGray + StackView { + id: stack + initialItem: inputConfiguration + property alias messageVisible: imageMessageBox.visible + property alias selectedPlugin: box.currentText + Rectangle { + id: inputConfiguration + anchors.fill: parent - property var pluginSettings: null + HifiConstants { id: hifi } - HifiControls.ImageMessageBox { - id: imageMessageBox - anchors.fill: parent - z: 2000 - imageWidth: 442 - imageHeight: 670 - source: "../../../images/calibration-help.png" - } + color: hifi.colors.baseGray - Rectangle { - width: inputConfiguration.width - height: 1 - color: hifi.colors.baseGrayShadow - x: -hifi.dimensions.contentMargin.x - } + property var pluginSettings: null - RalewayRegular { - id: header - text: "Control Settings" - size: 22 - color: "white" + HifiControls.ImageMessageBox { + id: imageMessageBox + anchors.fill: parent + z: 2000 + imageWidth: 442 + imageHeight: 670 + source: "../../../images/calibration-help.png" + } - anchors.top: inputConfiguration.top - anchors.left: inputConfiguration.left - anchors.leftMargin: 20 - anchors.topMargin: 20 - } + Rectangle { + width: inputConfiguration.width + height: 1 + color: hifi.colors.baseGrayShadow + x: -hifi.dimensions.contentMargin.x + } + + RalewayRegular { + id: header + text: "Control Settings" + size: 22 + color: "white" + + anchors.top: inputConfiguration.top + anchors.left: inputConfiguration.left + anchors.leftMargin: 20 + anchors.topMargin: 20 + } + + Separator { + id: headerSeparator + width: inputConfiguration.width + anchors.top: header.bottom + anchors.topMargin: 10 + } + + HiFiGlyphs { + id: sourceGlyph + text: hifi.glyphs.source + size: 36 + color: hifi.colors.blueHighlight + + anchors.top: headerSeparator.bottom + anchors.left: inputConfiguration.left + anchors.leftMargin: 40 + anchors.topMargin: 20 + } + + RalewayRegular { + id: configuration + text: "SELECT DEVICE" + size: 15 + color: hifi.colors.lightGrayText - Separator { - id: headerSeparator - width: inputConfiguration.width - anchors.top: header.bottom - anchors.topMargin: 10 - } + anchors.top: headerSeparator.bottom + anchors.left: sourceGlyph.right + anchors.leftMargin: 10 + anchors.topMargin: 30 + } - HiFiGlyphs { - id: sourceGlyph - text: hifi.glyphs.source - size: 36 - color: hifi.colors.blueHighlight + Row { + id: configRow + z: 999 + anchors.top: sourceGlyph.bottom + anchors.topMargin: 20 + anchors.left: sourceGlyph.left + anchors.leftMargin: 40 + spacing: 10 + HifiControls.ComboBox { + id: box + width: 160 + z: 999 + editable: true + colorScheme: hifi.colorSchemes.dark + model: inputPlugins() + label: "" - anchors.top: headerSeparator.bottom - anchors.left: inputConfiguration.left - anchors.leftMargin: 40 - anchors.topMargin: 20 - } + onCurrentIndexChanged: { + changeSource(); + } + } - RalewayRegular { - id: configuration - text: "SELECT DEVICE" - size: 15 - color: hifi.colors.lightGrayText + HifiControls.CheckBox { + id: checkBox + colorScheme: hifi.colorSchemes.dark + text: "show all input devices" + + onClicked: { + inputPlugins(); + changeSource(); + } + } + } - anchors.top: headerSeparator.bottom - anchors.left: sourceGlyph.right - anchors.leftMargin: 10 - anchors.topMargin: 30 - } - - Row { - id: configRow - z: 999 - anchors.top: sourceGlyph.bottom - anchors.topMargin: 20 - anchors.left: sourceGlyph.left - anchors.leftMargin: 40 - spacing: 10 - HifiControls.ComboBox { - id: box - width: 160 - z: 999 - editable: true - colorScheme: hifi.colorSchemes.dark - model: inputPlugins() - label: "" - - onCurrentIndexChanged: { - changeSource(); - } - } - - HifiControls.CheckBox { - id: checkBox - colorScheme: hifi.colorSchemes.dark - text: "show all input devices" - - onClicked: { - inputPlugins(); - changeSource(); - } - } - } + Separator { + id: configurationSeparator + z: 0 + width: inputConfiguration.width + anchors.top: configRow.bottom + anchors.topMargin: 10 + } - Separator { - id: configurationSeparator - z: 0 - width: inputConfiguration.width - anchors.top: configRow.bottom - anchors.topMargin: 10 - } + HiFiGlyphs { + id: sliderGlyph + text: hifi.glyphs.sliders + size: 36 + color: hifi.colors.blueHighlight + + anchors.top: configurationSeparator.bottom + anchors.left: inputConfiguration.left + anchors.leftMargin: 40 + anchors.topMargin: 20 + } + + RalewayRegular { + id: configurationHeader + text: "CONFIGURATION" + size: 15 + color: hifi.colors.lightGrayText - HiFiGlyphs { - id: sliderGlyph - text: hifi.glyphs.sliders - size: 36 - color: hifi.colors.blueHighlight + anchors.top: configurationSeparator.bottom + anchors.left: sliderGlyph.right + anchors.leftMargin: 10 + anchors.topMargin: 30 + } - anchors.top: configurationSeparator.bottom - anchors.left: inputConfiguration.left - anchors.leftMargin: 40 - anchors.topMargin: 20 - } + Loader { + id: loader + asynchronous: false - RalewayRegular { - id: configurationHeader - text: "CONFIGURATION" - size: 15 - color: hifi.colors.lightGrayText + width: inputConfiguration.width + anchors.left: inputConfiguration.left + anchors.right: inputConfiguration.right + anchors.top: configurationHeader.bottom + anchors.topMargin: 10 + anchors.bottom: inputConfiguration.bottom + source: InputConfiguration.configurationLayout(box.currentText); + onLoaded: { + if (loader.item.hasOwnProperty("pluginName")) { + if (box.currentText === "Vive") { + loader.item.pluginName = "OpenVR"; + } else { + loader.item.pluginName = box.currentText; + } + } - anchors.top: configurationSeparator.bottom - anchors.left: sliderGlyph.right - anchors.leftMargin: 10 - anchors.topMargin: 30 - } - - Loader { - id: loader - asynchronous: false - - width: inputConfiguration.width - anchors.left: inputConfiguration.left - anchors.right: inputConfiguration.right - anchors.top: configurationHeader.bottom - anchors.topMargin: 10 - anchors.bottom: inputConfiguration.bottom - - source: InputConfiguration.configurationLayout(box.currentText); - onLoaded: { - if (loader.item.hasOwnProperty("pluginName")) { - if (box.currentText === "Vive") { - loader.item.pluginName = "OpenVR"; - } else { - loader.item.pluginName = box.currentText; + if (loader.item.hasOwnProperty("displayInformation")) { + loader.item.displayConfiguration(); + } + } } } - if (loader.item.hasOwnProperty("displayInformation")) { - loader.item.displayConfiguration(); + + function inputPlugins() { + if (checkBox.checked) { + return InputConfiguration.inputPlugins(); + } else { + return InputConfiguration.activeInputPlugins(); + } + } + + function initialize() { + changeSource(); + } + + function changeSource() { + loader.source = ""; + var source = ""; + if (box.currentText == "Vive") { + source = InputConfiguration.configurationLayout("OpenVR"); + } else { + source = InputConfiguration.configurationLayout(box.currentText); + } + + loader.source = source; + if (source === "") { + box.label = "(not configurable)"; + } else { + box.label = ""; + } + } + + Timer { + id: timer + repeat: false + interval: 300 + onTriggered: initialize() + } + + Component.onCompleted: { + timer.start(); } } } } - - - function inputPlugins() { - if (checkBox.checked) { - return InputConfiguration.inputPlugins(); - } else { - return InputConfiguration.activeInputPlugins(); - } - } - - function initialize() { - changeSource(); - } - - function changeSource() { - loader.source = ""; - var source = ""; - if (box.currentText == "Vive") { - source = InputConfiguration.configurationLayout("OpenVR"); - } else { - source = InputConfiguration.configurationLayout(box.currentText); - } - - loader.source = source; - if (source === "") { - box.label = "(not configurable)"; - } else { - box.label = ""; - } - } - - Timer { - id: timer - repeat: false - interval: 300 - onTriggered: initialize() - } - - Component.onCompleted: { - timer.start(); - } } diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index b57dd84d33..13dea71ba4 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -3690,8 +3690,6 @@ void Application::keyPressEvent(QKeyEvent* event) { Menu::getInstance()->triggerOption(MenuOption::Log); } else if (isMeta) { Menu::getInstance()->triggerOption(MenuOption::AddressBar); - } else if (isShifted) { - Menu::getInstance()->triggerOption(MenuOption::LodTools); } break; @@ -7509,18 +7507,6 @@ SharedSoundPointer Application::getSampleSound() const { return _sampleSound; } -void Application::loadLODToolsDialog() { - auto tabletScriptingInterface = DependencyManager::get(); - auto tablet = dynamic_cast(tabletScriptingInterface->getTablet(SYSTEM_TABLET)); - if (tablet->getToolbarMode() || (!tablet->getTabletRoot() && !isHMDMode())) { - auto dialogsManager = DependencyManager::get(); - dialogsManager->lodTools(); - } else { - tablet->pushOntoStack("hifi/dialogs/TabletLODTools.qml"); - } -} - - void Application::loadEntityStatisticsDialog() { auto tabletScriptingInterface = DependencyManager::get(); auto tablet = dynamic_cast(tabletScriptingInterface->getTablet(SYSTEM_TABLET)); diff --git a/interface/src/Application.h b/interface/src/Application.h index 4946dd7ad9..13c5056402 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -65,7 +65,6 @@ #include "scripting/DialogsManagerScriptingInterface.h" #include "ui/ApplicationOverlay.h" #include "ui/EntityScriptServerLogDialog.h" -#include "ui/LodToolsDialog.h" #include "ui/LogDialog.h" #include "ui/OctreeStatsDialog.h" #include "ui/OverlayConductor.h" @@ -403,7 +402,6 @@ public slots: void addAssetToWorldMessageClose(); - void loadLODToolsDialog(); void loadEntityStatisticsDialog(); void loadDomainConnectionDialog(); void showScriptLogs(); diff --git a/interface/src/LODManager.cpp b/interface/src/LODManager.cpp index d06ba14bcf..90318c2d30 100644 --- a/interface/src/LODManager.cpp +++ b/interface/src/LODManager.cpp @@ -122,10 +122,7 @@ void LODManager::autoAdjustLOD(float realTimeDelta) { } if (oldOctreeSizeScale != _octreeSizeScale) { - auto lodToolsDialog = DependencyManager::get()->getLodToolsDialog(); - if (lodToolsDialog) { - lodToolsDialog->reloadSliders(); - } + //TODO: check Preferences dialog } } diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index b8fbfcd07f..d60e59a1cb 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -469,10 +469,6 @@ Menu::Menu() { }); } - // Developer > Render > LOD Tools - addActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::LodTools, 0, - qApp, SLOT(loadLODToolsDialog())); - // HACK enable texture decimation { auto action = addCheckableActionToQMenuAndActionHash(renderOptionsMenu, "Decimate Textures"); diff --git a/interface/src/Menu.h b/interface/src/Menu.h index 86e44775c5..b8690d5b26 100644 --- a/interface/src/Menu.h +++ b/interface/src/Menu.h @@ -121,7 +121,6 @@ namespace MenuOption { const QString ActionMotorControl = "Enable Default Motor Control"; const QString LoadScript = "Open and Run Script File..."; const QString LoadScriptURL = "Open and Run Script from URL..."; - const QString LodTools = "LOD Tools"; const QString Login = "Login/Sign Up"; const QString Log = "Log"; const QString LogExtraTimings = "Log Extra Timing Details"; diff --git a/interface/src/ui/DialogsManager.cpp b/interface/src/ui/DialogsManager.cpp index d01e7d6671..05fc3e48ba 100644 --- a/interface/src/ui/DialogsManager.cpp +++ b/interface/src/ui/DialogsManager.cpp @@ -23,7 +23,6 @@ #include "ConnectionFailureDialog.h" #include "DomainConnectionDialog.h" #include "HMDToolsDialog.h" -#include "LodToolsDialog.h" #include "LoginDialog.h" #include "OctreeStatsDialog.h" #include "PreferencesDialog.h" @@ -126,16 +125,6 @@ void DialogsManager::octreeStatsDetails() { _octreeStatsDialog->raise(); } -void DialogsManager::lodTools() { - if (!_lodToolsDialog) { - maybeCreateDialog(_lodToolsDialog); - - connect(_lodToolsDialog, SIGNAL(closed()), _lodToolsDialog, SLOT(deleteLater())); - _lodToolsDialog->show(); - } - _lodToolsDialog->raise(); -} - void DialogsManager::hmdTools(bool showTools) { if (showTools) { if (!_hmdToolsDialog) { diff --git a/interface/src/ui/DialogsManager.h b/interface/src/ui/DialogsManager.h index f17ac39a7e..c24f0fc4c0 100644 --- a/interface/src/ui/DialogsManager.h +++ b/interface/src/ui/DialogsManager.h @@ -22,7 +22,6 @@ class AnimationsDialog; class AttachmentsDialog; class CachesSizeDialog; -class LodToolsDialog; class OctreeStatsDialog; class ScriptEditorWindow; class TestingDialog; @@ -35,7 +34,6 @@ class DialogsManager : public QObject, public Dependency { public: QPointer getHMDToolsDialog() const { return _hmdToolsDialog; } - QPointer getLodToolsDialog() const { return _lodToolsDialog; } QPointer getOctreeStatsDialog() const { return _octreeStatsDialog; } QPointer getTestingDialog() const { return _testingDialog; } void emitAddressBarShown(bool visible) { emit addressBarShown(visible); } @@ -49,7 +47,6 @@ public slots: void toggleLoginDialog(); void showLoginDialog(); void octreeStatsDetails(); - void lodTools(); void hmdTools(bool showTools); void showDomainConnectionDialog(); void showTestingResults(); @@ -76,7 +73,6 @@ private: QPointer _cachesSizeDialog; QPointer _ircInfoBox; QPointer _hmdToolsDialog; - QPointer _lodToolsDialog; QPointer _octreeStatsDialog; QPointer _testingDialog; QPointer _domainConnectionDialog; diff --git a/interface/src/ui/HMDToolsDialog.cpp b/interface/src/ui/HMDToolsDialog.cpp index 63794da60f..d3ff239553 100644 --- a/interface/src/ui/HMDToolsDialog.cpp +++ b/interface/src/ui/HMDToolsDialog.cpp @@ -83,9 +83,6 @@ HMDToolsDialog::HMDToolsDialog(QWidget* parent) : if (dialogsManager->getOctreeStatsDialog()) { watchWindow(dialogsManager->getOctreeStatsDialog()->windowHandle()); } - if (dialogsManager->getLodToolsDialog()) { - watchWindow(dialogsManager->getLodToolsDialog()->windowHandle()); - } connect(_switchModeButton, &QPushButton::clicked, [this]{ toggleHMDMode(); diff --git a/interface/src/ui/LodToolsDialog.cpp b/interface/src/ui/LodToolsDialog.cpp deleted file mode 100644 index 71e5293f30..0000000000 --- a/interface/src/ui/LodToolsDialog.cpp +++ /dev/null @@ -1,133 +0,0 @@ -// -// LodToolsDialog.cpp -// interface/src/ui -// -// Created by Brad Hefta-Gaub on 7/19/13. -// Copyright 2013 High Fidelity, Inc. -// -// Distributed under the Apache License, Version 2.0. -// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html -// - -#include "LodToolsDialog.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include "Menu.h" - - -LodToolsDialog::LodToolsDialog(QWidget* parent) : - QDialog(parent, Qt::Window | Qt::WindowCloseButtonHint | Qt::WindowStaysOnTopHint) -{ - this->setWindowTitle("LOD Tools"); - auto lodManager = DependencyManager::get(); - - // Create layouter - QFormLayout* form = new QFormLayout(this); - - // Create a label with feedback... - _feedback = new QLabel(this); - QPalette palette = _feedback->palette(); - const unsigned redish = 0xfff00000; - palette.setColor(QPalette::WindowText, QColor::fromRgb(redish)); - _feedback->setPalette(palette); - _feedback->setText(lodManager->getLODFeedbackText()); - const int FEEDBACK_WIDTH = 350; - _feedback->setFixedWidth(FEEDBACK_WIDTH); - form->addRow("You can see... ", _feedback); - - form->addRow("Manually Adjust Level of Detail:", _manualLODAdjust = new QCheckBox(this)); - _manualLODAdjust->setChecked(!lodManager->getAutomaticLODAdjust()); - connect(_manualLODAdjust, SIGNAL(toggled(bool)), SLOT(updateAutomaticLODAdjust())); - - _lodSize = new QSlider(Qt::Horizontal, this); - const int MAX_LOD_SIZE = 2000; // ~20:4 vision -- really good. - const int MIN_LOD_SIZE = 5; // ~20:1600 vision -- really bad! - const int STEP_LOD_SIZE = 1; - const int PAGE_STEP_LOD_SIZE = 100; - const int SLIDER_WIDTH = 300; - _lodSize->setMaximum(MAX_LOD_SIZE); - _lodSize->setMinimum(MIN_LOD_SIZE); - _lodSize->setSingleStep(STEP_LOD_SIZE); - _lodSize->setTickInterval(PAGE_STEP_LOD_SIZE); - _lodSize->setTickPosition(QSlider::TicksBelow); - _lodSize->setFixedWidth(SLIDER_WIDTH); - _lodSize->setPageStep(PAGE_STEP_LOD_SIZE); - int sliderValue = lodManager->getOctreeSizeScale() / TREE_SCALE; - _lodSize->setValue(sliderValue); - form->addRow("Level of Detail:", _lodSize); - connect(_lodSize,SIGNAL(valueChanged(int)),this,SLOT(sizeScaleValueChanged(int))); - - // Add a button to reset - QPushButton* resetButton = new QPushButton("Reset", this); - form->addRow("", resetButton); - connect(resetButton, SIGNAL(clicked(bool)), this, SLOT(resetClicked(bool))); - - this->QDialog::setLayout(form); - - updateAutomaticLODAdjust(); -} - -void LodToolsDialog::reloadSliders() { - auto lodManager = DependencyManager::get(); - _lodSize->setValue(lodManager->getOctreeSizeScale() / TREE_SCALE); - _feedback->setText(lodManager->getLODFeedbackText()); -} - -void LodToolsDialog::updateAutomaticLODAdjust() { - auto lodManager = DependencyManager::get(); - lodManager->setAutomaticLODAdjust(!_manualLODAdjust->isChecked()); - _lodSize->setEnabled(_manualLODAdjust->isChecked()); -} - -void LodToolsDialog::sizeScaleValueChanged(int value) { - auto lodManager = DependencyManager::get(); - float realValue = value * TREE_SCALE; - lodManager->setOctreeSizeScale(realValue); - - _feedback->setText(lodManager->getLODFeedbackText()); -} - -void LodToolsDialog::resetClicked(bool checked) { - - int sliderValue = DEFAULT_OCTREE_SIZE_SCALE / TREE_SCALE; - _lodSize->setValue(sliderValue); - _manualLODAdjust->setChecked(false); - - updateAutomaticLODAdjust(); // tell our LOD manager about the reset -} - -void LodToolsDialog::reject() { - // Just regularly close upon ESC - this->QDialog::close(); -} - -void LodToolsDialog::closeEvent(QCloseEvent* event) { - this->QDialog::closeEvent(event); - emit closed(); - -#if RESET_TO_AUTOMATIC_WHEN_YOU_CLOSE_THE_DIALOG_BOX - auto lodManager = DependencyManager::get(); - - // always revert back to automatic LOD adjustment when closed - lodManager->setAutomaticLODAdjust(true); - - // if the user adjusted the LOD above "normal" then always revert back to default - if (lodManager->getOctreeSizeScale() > DEFAULT_OCTREE_SIZE_SCALE) { - lodManager->setOctreeSizeScale(DEFAULT_OCTREE_SIZE_SCALE); - } -#endif -} - - diff --git a/interface/src/ui/LodToolsDialog.h b/interface/src/ui/LodToolsDialog.h deleted file mode 100644 index b2390a1cd7..0000000000 --- a/interface/src/ui/LodToolsDialog.h +++ /dev/null @@ -1,55 +0,0 @@ -// -// LodToolsDialog.h -// interface/src/ui -// -// Created by Brad Hefta-Gaub on 7/19/13. -// Copyright 2013 High Fidelity, Inc. -// -// Distributed under the Apache License, Version 2.0. -// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html -// - -#ifndef hifi_LodToolsDialog_h -#define hifi_LodToolsDialog_h - -#include - -class QCheckBox; -class QDoubleSpinBox; -class QLabel; -class QSlider; - -class LodToolsDialog : public QDialog { - Q_OBJECT -public: - // Sets up the UI - LodToolsDialog(QWidget* parent); - -signals: - void closed(); - -public slots: - void reject() override; - void sizeScaleValueChanged(int value); - void resetClicked(bool checked); - void reloadSliders(); - void updateAutomaticLODAdjust(); - -protected: - - // Emits a 'closed' signal when this dialog is closed. - void closeEvent(QCloseEvent* event) override; - -private: - QSlider* _lodSize; - - QCheckBox* _manualLODAdjust; - - QDoubleSpinBox* _desktopLODDecreaseFPS; - - QDoubleSpinBox* _hmdLODDecreaseFPS; - - QLabel* _feedback; -}; - -#endif // hifi_LodToolsDialog_h diff --git a/interface/src/ui/PreferencesDialog.cpp b/interface/src/ui/PreferencesDialog.cpp index 905991834d..a1b2c93adc 100644 --- a/interface/src/ui/PreferencesDialog.cpp +++ b/interface/src/ui/PreferencesDialog.cpp @@ -73,9 +73,12 @@ void setupPreferences() { // Graphics quality static const QString GRAPHICS_QUALITY { "Graphics Quality" }; { - auto getter = []()->float { return DependencyManager::get()->getLODLevel(); }; - auto setter = [](float value) { }; - preferences->addPreference(new SliderPreference(GRAPHICS_QUALITY, "World Detail", getter, setter)); + auto getter = []()->float { return DependencyManager::get()->getOctreeSizeScale()/TREE_SCALE; }; + auto setter = [](float value) { DependencyManager::get()->setOctreeSizeScale(value*TREE_SCALE); }; + auto wodSlider = new SliderPreference(GRAPHICS_QUALITY, "World Detail", getter, setter); + wodSlider->setMin(0); + wodSlider->setMax(2000); + preferences->addPreference(wodSlider); auto getterSQ = []()->float { return 1.0; }; auto setterSQ = [](float value) { }; preferences->addPreference(new SliderPreference(GRAPHICS_QUALITY, "Shadow Quality", getterSQ, setterSQ)); From 2a3004079e1a76926434f18f674d5ffdf0b15f6b Mon Sep 17 00:00:00 2001 From: vladest Date: Mon, 14 May 2018 23:22:06 +0200 Subject: [PATCH 32/61] About UI --- .../resources/images/about-highfidelity.png | Bin 0 -> 9935 bytes interface/resources/images/about-physics.png | Bin 0 -> 7895 bytes interface/resources/images/about-qt.png | Bin 0 -> 6170 bytes .../qml/hifi/dialogs/AboutDialog.qml | 32 +++++ .../qml/hifi/dialogs/TabletAboutDialog.qml | 120 ++++++++++++++++++ interface/src/Menu.cpp | 8 +- 6 files changed, 157 insertions(+), 3 deletions(-) create mode 100644 interface/resources/images/about-highfidelity.png create mode 100644 interface/resources/images/about-physics.png create mode 100644 interface/resources/images/about-qt.png create mode 100644 interface/resources/qml/hifi/dialogs/AboutDialog.qml create mode 100644 interface/resources/qml/hifi/dialogs/TabletAboutDialog.qml diff --git a/interface/resources/images/about-highfidelity.png b/interface/resources/images/about-highfidelity.png new file mode 100644 index 0000000000000000000000000000000000000000..718ed7d52547343ffd4be35e698017abc1bdecb2 GIT binary patch literal 9935 zcmV;=CNSBFP) zaB^>EX>4U6ba`-PAZ2)IW&i+q+O3*tawI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1Byvp6N2;y&2R{h|h9oOdSsFxG5M4 z3xZIAcPBz!*R)e5=0IuKW+l~pEBeo(W*}#=c>V(A`M6rM6K?U$3hUQZ%7DQ zZKLh#;7$1E=$%yFZ3X5<#473GCNjffwFGNt$Ri;L)hbv{v>qpYm7*u`D8A{p6UzIS zEO`xibS!@goE}PO1SXU*(1jofB@rygk4g8%+#m4q&0b|L?>#tglTp@?zM`3JC^!xm zWj4&^e~<7h2tvh@yZc(-34|gTr*Xj&UI3<}RWgTT#{%<7 z53(=^t$rYnf*^Dz!E!JB7+@jk8%`GkbrruA!1b)|i-^@Tz?d?G4if~Sj6*_)o6q__ z>D%bP1uVulm1`O9o2kIOh*&KHP7|>bgwEQ-+93cFfZ3$Sz%#%Ew0f*!YUi8Yz#P&y znx@2Rlxz?cgsvc1P7KZj?#Bh*Okr^=ic`uuuN7aulY+8DT?0P{oPt)H<@O6gR}m~H z3L}99w2jKL9=IB7=cgHRmPe@i1GfQZ$JB2w&hAi#fr8NG1Z#&t%*XjdkMb&T1D^G% zE%6>F-|UAAwmJ#g#EjbxOs2`s;`AE1>w?f_1q-0TbjNZP@UzGeF~tgC7VuzE{fXC` z1RlrY{A{0*;o3`q@o4p?+-^Y-!3y_s2IIUujLPthW}NYJ1Mn2qzLodxayOAa5*IMy zblOI0PGN9vnD0cZ7P-}eAcB=iR7L|g(tcb+gNyyQ9OuV+J7{vTh+@j0DzZS(*D N002ovPDHLkV1h~k?JfWS literal 0 HcmV?d00001 diff --git a/interface/resources/images/about-physics.png b/interface/resources/images/about-physics.png new file mode 100644 index 0000000000000000000000000000000000000000..62a7666da2ee541122eda1fdca3c70e9d89e5124 GIT binary patch literal 7895 zcmV;|9w_07P) zaB^>EX>4U6ba`-PAZ2)IW&i+q+O3*bavV7pMgOsiSpvLS4s68iV3t4UB9lc)t?rI7 zq(oE9OaRYZ1C-hS`sXqK;3JimO-!Zcmb2v}w%B~I-3sD#I+261H_2(Fx z&z$XNw4Z{Q&hKMr_j^TnUjK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2k*W?1103T#A&mmca(u2T*|EEyeAsIT)Z9HLY@_-#pFuA|2 zd`??zRVF+4GtWsGY+(tdCx8pY8{#1o6vpTSTEv_BBsuSKgi}}&aTgFo(Wzz={YStk z6Rj;i2d2A?6GtZx*jxuUPUteS zM1Wb!WVNG@amr;tu}k;8gB^<{JmRuVYwh-`b8OpQ3aoSK&lLRzm%bRdTyoDZhGDd1 z4U96;dI>k7sFM&Fc*2*Wl*`RYQZAet%bc zd;6Zs%F3-kPIYzlxV*f)b4p7~hxYdN9_saaXG9{Ax~i(GhMJn1-W4lWJk{6N_jXZH zQLAgd4WUrzUBBNS1_*^hKA+E59|#0Cmz0#etF`uYc6JUQHf&h8*X!-8t*wnn(fL#` z82rfZ_lG~IRWMIA|$e}=$ z&@{jUz+5>CdJ=e8+LXCspATForNLr(&Pg%HT<4*pS zbyWeroD7xdM&K-MF-aD7;X?*xb1#dv2r7n5xHylEz=yyxWfIs=@>>;e#T?%FG;lBQ zJMa^5s_VeaBYn~cpaz%(jFuK+Kzj!q2mIpD?UoHAHB1B;35=DL@s`kcNNk^ow}jQ- z$zF0;K0!9wu1xB(96CZ=w?j5sDhuA_C=~07{h4Ot}#8GX($u002ovPDHLkV1fhf B2_66d literal 0 HcmV?d00001 diff --git a/interface/resources/images/about-qt.png b/interface/resources/images/about-qt.png new file mode 100644 index 0000000000000000000000000000000000000000..90230ecbf5d7c5df6461045ac1722c568d7659bf GIT binary patch literal 6170 zcmV+#80F`QP)X1^@s6RQmj^000!ZdQ@0+Qek%> zaB^>EX>4U6ba`-PAZ2)IW&i+q+O3*rcI3Dfh5us}UIKDh4&pi9ftT;^f|ObvW~OIs zRktXySOoCG4WP{a&%clP7hlPHZ(=Gnx123svBl;)KUDjCJx6Eb{eHi^f8TT8pEs_( zZ+K1xj^X(=@Avx7`Sk4rCBEm!_vcNS?|tffBlmgZ`xP{@|8}~*Hwyke|Nd^;`$PY_ zocF(<@8>_3^~3M65R8?$U+~87;DY75^(*-p7>Uz?nS>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#7h1?Fjo(7FjXjvjr8OF<6JP~O_Zr#?=k=&$ZTu=+39V*VBg{mJnUZiMn!EOY9yhT)ecfDef(L)BQz8JFPnrZgce)WZhu^K*{(Y+c%Fujg63iX zt)j<$(1*PvACR~yL|A%ytD#XaDhwVLG9=|owE*hSGbjiTV<4Sq77o??7eWC5#yW6o zF8}}l24YJ`L;(K){{a7>y{D4^000SaNLh0L04^f{04^f|c%?sf00007bV*G`2jT?| z6c`*bQYX*=00QDkL_t(Y$IX>pNK;`L$A3FJy3IQCG>3C&fgfONeW6wq^hJRMMWqyd z+|*Sc1O*XvQ5OXfBt+6pbt6I7l4TzR64^A0l1i3JVL7F8&6=xu=A5&Ox+Kp@%JV?TFZZ{$jC&7gZ8~t=50fkyx-u@QhhZHFfXB2AQB zpRt0Sb9W$1GFmKx$KOm{Pd$yj9{Qsp0G8X!IGJ-W;lE7Tio=qP!;<|^tr<6VId>o# zB(#{uiS{$JM?Z+1{jzk%Lg$!&pNG1hdWvQj;#OV6iF2pt9sq;!XlfuSEO5LXSyS)CtuDLIvDLw@{k$y zgS2Q~p%=_9PU=~ulnL#N^o-ryAn6AQ#DjeN(FH(hRtZZ@^AqxRNo7mUCIE)wG3tX2 zBKLDREVRRD(?3~neYwkV

s|nTxKobcEh9G^mwlu9 z`hrUg#5DQ_`#9QpIyI2nKN@iQ9Bj|sipiLcTXl``c!O^_|LID?+RKQS*WX%MVq1ig zrl6!L*v)o*udir>x`BD-Jk<0|e#XL-W|d$un(=F2+1++1>3?NrH#VaRKxfp)`=M@q zAj#rb_5rqyj`#bY9_oGc8dDx<)&3fKH9r6)bC&9Xcmiye_3TjNyNT1};KsMwlq&&j sepFgJpbO+-xCz4OhM3N`CIJHA7ehMl0>ZgJnE(I)07*qoM6N<$g1Z#FTL1t6 literal 0 HcmV?d00001 diff --git a/interface/resources/qml/hifi/dialogs/AboutDialog.qml b/interface/resources/qml/hifi/dialogs/AboutDialog.qml new file mode 100644 index 0000000000..b8e6e89aec --- /dev/null +++ b/interface/resources/qml/hifi/dialogs/AboutDialog.qml @@ -0,0 +1,32 @@ +// +// AssetDialog.qml +// +// Created by David Rowe on 18 Apr 2017 +// Copyright 2017 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// + +import QtQuick 2.8 + +import "../../styles-uit" +import "../../windows" + +ScrollingWindow { + id: root + resizable: false + implicitWidth: 480 + implicitHeight: 706 + objectName: "aboutDialog" + destroyOnCloseButton: true + destroyOnHidden: true + visible: true + minSize: Qt.vector2d(480, 706) + title: "About" + + TabletAboutDialog { + width: pane.width + height: pane.height + } +} diff --git a/interface/resources/qml/hifi/dialogs/TabletAboutDialog.qml b/interface/resources/qml/hifi/dialogs/TabletAboutDialog.qml new file mode 100644 index 0000000000..d89f8cafe3 --- /dev/null +++ b/interface/resources/qml/hifi/dialogs/TabletAboutDialog.qml @@ -0,0 +1,120 @@ +// +// TabletAssetDialog.qml +// +// Created by David Rowe on 18 Apr 2017 +// Copyright 2017 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// + +import QtQuick 2.5 + +import "../../styles-uit" + +Rectangle { + width: 480 + height: 706 + + HifiConstants { id: hifi; } + + color: hifi.colors.baseGray + + Column { + x: 45 + y: 30 + spacing: 5 + + Image { + sourceSize.width: 295 + sourceSize.height: 75 + source: "../../../images/about-highfidelity.png" + } + Column { + id: buildColumm + anchors.left: parent.left + anchors.leftMargin: 70 + Row { + RalewayRegular { + text: "Build" + size: 16 + color: "white" + } + RalewayRegular { + id: build + size: 16 + color: "white" + } + } + Row { + RalewayRegular { + text: "Released" + size: 16 + color: "white" + } + RalewayRegular { + id: released + size: 16 + color: "white" + } + } + } + Item { height: 10; width: 1 } + RalewayRegular { + text: "An open-source virtual reality platform." + size: 20 + color: "white" + } + RalewayRegular { + textFormat: Text.RichText + color: "white" + text: "www.highfidelity.com." + size: 20 + } + Item { height: 40; width: 1 } + Row { + spacing: 5 + Image { + sourceSize.width: 34 + sourceSize.height: 25 + source: "../../../images/about-qt.png" + } + RalewayRegular { + color: "white" + text: "Built using Qt 5.10.1" + size: 12 + anchors.verticalCenter: parent.verticalCenter + } + Item { height: 1; width: 15 } + Image { + sourceSize.width: 70 + sourceSize.height: 26 + source: "../../../images/about-physics.png" + } + RalewayRegular { + color: "white" + text: "Physics powered by Bullet" + size: 12 + anchors.verticalCenter: parent.verticalCenter + } + } + Item { height: 20; width: 1 } + RalewayRegular { + textFormat: Text.RichText + color: "white" + text: "Blockchain technology from Elements." + size: 14 + } + RalewayRegular { + color: "white" + text: "© 2018 High Fidelity. All rights reserved." + size: 14 + } + RalewayRegular { + textFormat: Text.RichText + color: "white" + text: "Distributed under the Apache License, Version 2.0.." + size: 14 + } + } +} diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index d60e59a1cb..be50fe9119 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -814,9 +814,11 @@ Menu::Menu() { MenuWrapper * helpMenu = addMenu("Help"); // Help > About High Fidelity - //TODO: Add dialog to show about: Logo, Company, Version - addActionToQMenuAndActionHash(helpMenu, "About High Fidelity"); - + action = addActionToQMenuAndActionHash(helpMenu, "About High Fidelity"); + connect(action, &QAction::triggered, [] { + qApp->showDialog(QString("hifi/dialogs/AboutDialog.qml"), + QString("hifi/dialogs/TabletAboutDialog.qml"), "AboutDialog"); + }); helpMenu->addSeparator(); // Help > HiFi Docs From 82422edb59c3150c5a029ab22e53c1869d1dff5a Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Mon, 14 May 2018 18:51:39 -0700 Subject: [PATCH 33/61] fixinig the controller settings page and have menu option on by default --- .../qml/hifi/tablet/CalibratingScreen.qml | 2 +- .../qml/hifi/tablet/ControllerSettings.qml | 491 ++++++++++-------- .../tabletWindows/TabletPreferencesDialog.qml | 6 +- interface/src/Menu.cpp | 9 +- scripts/system/edit.js | 49 +- 5 files changed, 293 insertions(+), 264 deletions(-) diff --git a/interface/resources/qml/hifi/tablet/CalibratingScreen.qml b/interface/resources/qml/hifi/tablet/CalibratingScreen.qml index 6c26bd87c5..e3115a5738 100644 --- a/interface/resources/qml/hifi/tablet/CalibratingScreen.qml +++ b/interface/resources/qml/hifi/tablet/CalibratingScreen.qml @@ -18,7 +18,7 @@ import "../../controls-uit" as HifiControls Rectangle { id: info - + anchors.fill: parent signal canceled() signal restart() diff --git a/interface/resources/qml/hifi/tablet/ControllerSettings.qml b/interface/resources/qml/hifi/tablet/ControllerSettings.qml index 4ee69c4982..f08d6899a3 100644 --- a/interface/resources/qml/hifi/tablet/ControllerSettings.qml +++ b/interface/resources/qml/hifi/tablet/ControllerSettings.qml @@ -8,6 +8,7 @@ import QtQuick 2.7 import QtQuick.Controls 2.2 +import QtQuick.Layouts 1.3 import QtGraphicalEffects 1.0 import Qt.labs.settings 1.0 import "../../styles-uit" @@ -15,237 +16,275 @@ import "../../controls" import "../../controls-uit" as HifiControls import "../../dialogs" import "../../dialogs/preferences" +import "tabletWindows" +import "../audio" -PreferencesDialog { - id: root - objectName: "ControlSettings" - title: "Control Settings" - showCategories: ["VR Movement", inputConfigurationComponents] - property var settings: Settings { - category: root.objectName - property alias x: root.x - property alias y: root.y - property alias width: root.width - property alias height: root.height - } - Component { - id: inputConfigurationComponents +Item { + id: controllerSettings + height: parent.height + width: parent.width - Preference { + HifiConstants { id: hifi } - StackView { - id: stack - initialItem: inputConfiguration - property alias messageVisible: imageMessageBox.visible - property alias selectedPlugin: box.currentText - Rectangle { - id: inputConfiguration - anchors.fill: parent + TabBar { + id: bar + spacing: 0 + width: parent.width - HifiConstants { id: hifi } - - color: hifi.colors.baseGray - - property var pluginSettings: null - - HifiControls.ImageMessageBox { - id: imageMessageBox - anchors.fill: parent - z: 2000 - imageWidth: 442 - imageHeight: 670 - source: "../../../images/calibration-help.png" - } - - Rectangle { - width: inputConfiguration.width - height: 1 - color: hifi.colors.baseGrayShadow - x: -hifi.dimensions.contentMargin.x - } - - RalewayRegular { - id: header - text: "Control Settings" - size: 22 - color: "white" - - anchors.top: inputConfiguration.top - anchors.left: inputConfiguration.left - anchors.leftMargin: 20 - anchors.topMargin: 20 - } - - Separator { - id: headerSeparator - width: inputConfiguration.width - anchors.top: header.bottom - anchors.topMargin: 10 - } - - HiFiGlyphs { - id: sourceGlyph - text: hifi.glyphs.source - size: 36 - color: hifi.colors.blueHighlight - - anchors.top: headerSeparator.bottom - anchors.left: inputConfiguration.left - anchors.leftMargin: 40 - anchors.topMargin: 20 - } - - RalewayRegular { - id: configuration - text: "SELECT DEVICE" - size: 15 - color: hifi.colors.lightGrayText - - - anchors.top: headerSeparator.bottom - anchors.left: sourceGlyph.right - anchors.leftMargin: 10 - anchors.topMargin: 30 - } - - Row { - id: configRow - z: 999 - anchors.top: sourceGlyph.bottom - anchors.topMargin: 20 - anchors.left: sourceGlyph.left - anchors.leftMargin: 40 - spacing: 10 - HifiControls.ComboBox { - id: box - width: 160 - z: 999 - editable: true - colorScheme: hifi.colorSchemes.dark - model: inputPlugins() - label: "" - - onCurrentIndexChanged: { - changeSource(); - } - } - - HifiControls.CheckBox { - id: checkBox - colorScheme: hifi.colorSchemes.dark - text: "show all input devices" - - onClicked: { - inputPlugins(); - changeSource(); - } - } - } - - - Separator { - id: configurationSeparator - z: 0 - width: inputConfiguration.width - anchors.top: configRow.bottom - anchors.topMargin: 10 - } - - - HiFiGlyphs { - id: sliderGlyph - text: hifi.glyphs.sliders - size: 36 - color: hifi.colors.blueHighlight - - anchors.top: configurationSeparator.bottom - anchors.left: inputConfiguration.left - anchors.leftMargin: 40 - anchors.topMargin: 20 - } - - RalewayRegular { - id: configurationHeader - text: "CONFIGURATION" - size: 15 - color: hifi.colors.lightGrayText - - - anchors.top: configurationSeparator.bottom - anchors.left: sliderGlyph.right - anchors.leftMargin: 10 - anchors.topMargin: 30 - } - - Loader { - id: loader - asynchronous: false - - width: inputConfiguration.width - anchors.left: inputConfiguration.left - anchors.right: inputConfiguration.right - anchors.top: configurationHeader.bottom - anchors.topMargin: 10 - anchors.bottom: inputConfiguration.bottom - - source: InputConfiguration.configurationLayout(box.currentText); - onLoaded: { - if (loader.item.hasOwnProperty("pluginName")) { - if (box.currentText === "Vive") { - loader.item.pluginName = "OpenVR"; - } else { - loader.item.pluginName = box.currentText; - } - } - - if (loader.item.hasOwnProperty("displayInformation")) { - loader.item.displayConfiguration(); - } - } - } - } - - - function inputPlugins() { - if (checkBox.checked) { - return InputConfiguration.inputPlugins(); - } else { - return InputConfiguration.activeInputPlugins(); - } - } - - function initialize() { - changeSource(); - } - - function changeSource() { - loader.source = ""; - var source = ""; - if (box.currentText == "Vive") { - source = InputConfiguration.configurationLayout("OpenVR"); - } else { - source = InputConfiguration.configurationLayout(box.currentText); - } - - loader.source = source; - if (source === "") { - box.label = "(not configurable)"; - } else { - box.label = ""; - } - } - - Timer { - id: timer - repeat: false - interval: 300 - onTriggered: initialize() - } - - Component.onCompleted: { - timer.start(); - } + TabButton { + height: parent.height + text: qsTr("Settings") + onClicked: { + stackView.clear(); + stackView.push(controllerPreferencesComponent); + } + } + TabButton { + height: parent.height + text: qsTr("Calibration") + onClicked: { + stackView.clear(); + stackView.push(inputConfigurationComponent); } } } + + + StackView { + id: stackView + anchors.top: bar.bottom + anchors.bottom: controllerSettings.bottom + anchors.left: controllerSettings.left + anchors.right: controllerSettings.right + + initialItem: controllerPreferencesComponent + } + + Component { + id: inputConfigurationComponent + StackView { + id: stack + initialItem: inputConfiguration + property alias messageVisible: imageMessageBox.visible + property alias selectedPlugin: box.currentText + Rectangle { + id: inputConfiguration + anchors.fill: parent + + HifiConstants { id: hifi } + + color: hifi.colors.baseGray + + property var pluginSettings: null + + HifiControls.ImageMessageBox { + id: imageMessageBox + anchors.fill: parent + z: 2000 + imageWidth: 442 + imageHeight: 670 + source: "../../../images/calibration-help.png" + } + + Rectangle { + width: inputConfiguration.width + height: 1 + color: hifi.colors.baseGrayShadow + x: -hifi.dimensions.contentMargin.x + } + + RalewayRegular { + id: header + text: "Control Settings" + size: 22 + color: "white" + + anchors.top: inputConfiguration.top + anchors.left: inputConfiguration.left + anchors.leftMargin: 20 + anchors.topMargin: 20 + } + + Separator { + id: headerSeparator + width: inputConfiguration.width + anchors.top: header.bottom + anchors.topMargin: 10 + } + + HiFiGlyphs { + id: sourceGlyph + text: hifi.glyphs.source + size: 36 + color: hifi.colors.blueHighlight + + anchors.top: headerSeparator.bottom + anchors.left: inputConfiguration.left + anchors.leftMargin: 40 + anchors.topMargin: 20 + } + + RalewayRegular { + id: configuration + text: "SELECT DEVICE" + size: 15 + color: hifi.colors.lightGrayText + + + anchors.top: headerSeparator.bottom + anchors.left: sourceGlyph.right + anchors.leftMargin: 10 + anchors.topMargin: 30 + } + + Row { + id: configRow + z: 999 + anchors.top: sourceGlyph.bottom + anchors.topMargin: 20 + anchors.left: sourceGlyph.left + anchors.leftMargin: 40 + spacing: 10 + HifiControls.ComboBox { + id: box + width: 160 + z: 999 + editable: true + colorScheme: hifi.colorSchemes.dark + model: inputPlugins() + label: "" + + onCurrentIndexChanged: { + changeSource(); + } + } + + HifiControls.CheckBox { + id: checkBox + colorScheme: hifi.colorSchemes.dark + text: "show all input devices" + + onClicked: { + inputPlugins(); + changeSource(); + } + } + } + + + Separator { + id: configurationSeparator + z: 0 + width: inputConfiguration.width + anchors.top: configRow.bottom + anchors.topMargin: 10 + } + + + HiFiGlyphs { + id: sliderGlyph + text: hifi.glyphs.sliders + size: 36 + color: hifi.colors.blueHighlight + + anchors.top: configurationSeparator.bottom + anchors.left: inputConfiguration.left + anchors.leftMargin: 40 + anchors.topMargin: 20 + } + + RalewayRegular { + id: configurationHeader + text: "CONFIGURATION" + size: 15 + color: hifi.colors.lightGrayText + + + anchors.top: configurationSeparator.bottom + anchors.left: sliderGlyph.right + anchors.leftMargin: 10 + anchors.topMargin: 30 + } + + Loader { + id: loader + asynchronous: false + + width: inputConfiguration.width + anchors.left: inputConfiguration.left + anchors.right: inputConfiguration.right + anchors.top: configurationHeader.bottom + anchors.topMargin: 10 + anchors.bottom: inputConfiguration.bottom + + source: InputConfiguration.configurationLayout(box.currentText); + onLoaded: { + if (loader.item.hasOwnProperty("pluginName")) { + if (box.currentText === "Vive") { + loader.item.pluginName = "OpenVR"; + } else { + loader.item.pluginName = box.currentText; + } + } + + if (loader.item.hasOwnProperty("displayInformation")) { + loader.item.displayConfiguration(); + } + } + } + } + + + function inputPlugins() { + if (checkBox.checked) { + return InputConfiguration.inputPlugins(); + } else { + return InputConfiguration.activeInputPlugins(); + } + } + + function initialize() { + changeSource(); + } + + function changeSource() { + loader.source = ""; + var source = ""; + if (box.currentText == "Vive") { + source = InputConfiguration.configurationLayout("OpenVR"); + } else { + source = InputConfiguration.configurationLayout(box.currentText); + } + + loader.source = source; + if (source === "") { + box.label = "(not configurable)"; + } else { + box.label = ""; + } + } + + Timer { + id: timer + repeat: false + interval: 300 + onTriggered: initialize() + } + + Component.onCompleted: { + timer.start(); + } + } + } + + + Component { + id: controllerPreferencesComponent + TabletPreferencesDialog { + anchors.fill: stackView + id: controllerPrefereneces + objectName: "TabletControllerPreferences" + showCategories: ["VR Movement"] + } + } } diff --git a/interface/resources/qml/hifi/tablet/tabletWindows/TabletPreferencesDialog.qml b/interface/resources/qml/hifi/tablet/tabletWindows/TabletPreferencesDialog.qml index a5ef3d2686..646a0d2c77 100644 --- a/interface/resources/qml/hifi/tablet/tabletWindows/TabletPreferencesDialog.qml +++ b/interface/resources/qml/hifi/tablet/tabletWindows/TabletPreferencesDialog.qml @@ -19,6 +19,7 @@ Item { id: dialog width: parent.width height: parent.height + anchors.fill: parent HifiConstants { id: hifi } property var sections: [] @@ -158,14 +159,15 @@ Item { Rectangle { id: footer - height: 40 + height: dialog.height * 0.15 + anchors.bottom: dialog.bottom anchors { bottom: keyboard.top left: parent.left right: parent.right } - + color: hifi.colors.baseGray Row { diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index be50fe9119..dad79faedf 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -236,8 +236,13 @@ Menu::Menu() { // Settings > Controls... action = addActionToQMenuAndActionHash(settingsMenu, "Controls..."); connect(action, &QAction::triggered, [] { - qApp->showDialog(QString("hifi/tablet/ControllerSettings.qml"), - QString("hifi/tablet/ControllerSettings.qml"), "ControlSettings"); + auto tablet = DependencyManager::get()->getTablet("com.highfidelity.interface.tablet.system"); + auto hmd = DependencyManager::get(); + tablet->loadQMLSource("hifi/tablet/ControllerSettings.qml"); + + if (!hmd->getShouldShowTablet()) { + hmd->toggleShouldShowTablet(); + } }); // Settings > Audio... diff --git a/scripts/system/edit.js b/scripts/system/edit.js index 523582836f..f378389d0b 100644 --- a/scripts/system/edit.js +++ b/scripts/system/edit.js @@ -1150,8 +1150,7 @@ function setupModelMenus() { Menu.addMenuItem({ menuName: "Edit", menuItemName: "Entities", - isSeparator: true, - grouping: "Advanced" + isSeparator: true }); if (!Menu.menuItemExists("Edit", "Delete")) { Menu.addMenuItem({ @@ -1161,7 +1160,6 @@ function setupModelMenus() { text: "delete" }, afterItem: "Entities", - grouping: "Advanced" }); modelMenuAddedDelete = true; } @@ -1169,15 +1167,13 @@ function setupModelMenus() { Menu.addMenuItem({ menuName: "Edit", menuItemName: "Parent Entity to Last", - afterItem: "Entities", - grouping: "Advanced" + afterItem: "Entities" }); Menu.addMenuItem({ menuName: "Edit", menuItemName: "Unparent Entity", - afterItem: "Parent Entity to Last", - grouping: "Advanced" + afterItem: "Parent Entity to Last" }); Menu.addMenuItem({ @@ -1185,8 +1181,7 @@ function setupModelMenus() { menuItemName: MENU_CREATE_ENTITIES_GRABBABLE, afterItem: "Unparent Entity", isCheckable: true, - isChecked: Settings.getValue(SETTING_EDIT_PREFIX + MENU_CREATE_ENTITIES_GRABBABLE, true), - grouping: "Advanced" + isChecked: Settings.getValue(SETTING_EDIT_PREFIX + MENU_CREATE_ENTITIES_GRABBABLE, true) }); Menu.addMenuItem({ @@ -1194,87 +1189,75 @@ function setupModelMenus() { menuItemName: MENU_ALLOW_SELECTION_LARGE, afterItem: MENU_CREATE_ENTITIES_GRABBABLE, isCheckable: true, - isChecked: Settings.getValue(SETTING_EDIT_PREFIX + MENU_ALLOW_SELECTION_LARGE, true), - grouping: "Advanced" + isChecked: Settings.getValue(SETTING_EDIT_PREFIX + MENU_ALLOW_SELECTION_LARGE, true) }); Menu.addMenuItem({ menuName: "Edit", menuItemName: MENU_ALLOW_SELECTION_SMALL, afterItem: MENU_ALLOW_SELECTION_LARGE, isCheckable: true, - isChecked: Settings.getValue(SETTING_EDIT_PREFIX + MENU_ALLOW_SELECTION_SMALL, true), - grouping: "Advanced" + isChecked: Settings.getValue(SETTING_EDIT_PREFIX + MENU_ALLOW_SELECTION_SMALL, true) }); Menu.addMenuItem({ menuName: "Edit", menuItemName: MENU_ALLOW_SELECTION_LIGHTS, afterItem: MENU_ALLOW_SELECTION_SMALL, isCheckable: true, - isChecked: Settings.getValue(SETTING_EDIT_PREFIX + MENU_ALLOW_SELECTION_LIGHTS, false), - grouping: "Advanced" + isChecked: Settings.getValue(SETTING_EDIT_PREFIX + MENU_ALLOW_SELECTION_LIGHTS, false) }); Menu.addMenuItem({ menuName: "Edit", menuItemName: "Select All Entities In Box", - afterItem: "Allow Selecting of Lights", - grouping: "Advanced" + afterItem: "Allow Selecting of Lights" }); Menu.addMenuItem({ menuName: "Edit", menuItemName: "Select All Entities Touching Box", - afterItem: "Select All Entities In Box", - grouping: "Advanced" + afterItem: "Select All Entities In Box" }); Menu.addMenuItem({ menuName: "Edit", menuItemName: "Export Entities", - afterItem: "Entities", - grouping: "Advanced" + afterItem: "Entities" }); Menu.addMenuItem({ menuName: "Edit", menuItemName: "Import Entities", - afterItem: "Export Entities", - grouping: "Advanced" + afterItem: "Export Entities" }); Menu.addMenuItem({ menuName: "Edit", menuItemName: "Import Entities from URL", - afterItem: "Import Entities", - grouping: "Advanced" + afterItem: "Import Entities" }); Menu.addMenuItem({ menuName: "Edit", menuItemName: MENU_AUTO_FOCUS_ON_SELECT, isCheckable: true, - isChecked: Settings.getValue(SETTING_AUTO_FOCUS_ON_SELECT) === "true", - grouping: "Advanced" + isChecked: Settings.getValue(SETTING_AUTO_FOCUS_ON_SELECT) === "true" }); Menu.addMenuItem({ menuName: "Edit", menuItemName: MENU_EASE_ON_FOCUS, afterItem: MENU_AUTO_FOCUS_ON_SELECT, isCheckable: true, - isChecked: Settings.getValue(SETTING_EASE_ON_FOCUS) === "true", - grouping: "Advanced" + isChecked: Settings.getValue(SETTING_EASE_ON_FOCUS) === "true" }); Menu.addMenuItem({ menuName: "Edit", menuItemName: MENU_SHOW_LIGHTS_AND_PARTICLES_IN_EDIT_MODE, afterItem: MENU_EASE_ON_FOCUS, isCheckable: true, - isChecked: Settings.getValue(SETTING_SHOW_LIGHTS_AND_PARTICLES_IN_EDIT_MODE) !== "false", - grouping: "Advanced" + isChecked: Settings.getValue(SETTING_SHOW_LIGHTS_AND_PARTICLES_IN_EDIT_MODE) !== "false" }); Menu.addMenuItem({ menuName: "Edit", menuItemName: MENU_SHOW_ZONES_IN_EDIT_MODE, afterItem: MENU_SHOW_LIGHTS_AND_PARTICLES_IN_EDIT_MODE, isCheckable: true, - isChecked: Settings.getValue(SETTING_SHOW_ZONES_IN_EDIT_MODE) !== "false", - grouping: "Advanced" + isChecked: Settings.getValue(SETTING_SHOW_ZONES_IN_EDIT_MODE) !== "false" }); Entities.setLightsArePickable(false); From 58f04121b72628db921552d6a1b43f4e6ba3ed35 Mon Sep 17 00:00:00 2001 From: vladest Date: Tue, 15 May 2018 06:21:40 +0200 Subject: [PATCH 34/61] Correct link colors --- .../resources/qml/hifi/dialogs/TabletAboutDialog.qml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/interface/resources/qml/hifi/dialogs/TabletAboutDialog.qml b/interface/resources/qml/hifi/dialogs/TabletAboutDialog.qml index d89f8cafe3..1a51c33368 100644 --- a/interface/resources/qml/hifi/dialogs/TabletAboutDialog.qml +++ b/interface/resources/qml/hifi/dialogs/TabletAboutDialog.qml @@ -66,7 +66,8 @@ Rectangle { color: "white" } RalewayRegular { - textFormat: Text.RichText + textFormat: Text.StyledText + linkColor: "#00B4EF" color: "white" text: "www.highfidelity.com." size: 20 @@ -100,7 +101,8 @@ Rectangle { } Item { height: 20; width: 1 } RalewayRegular { - textFormat: Text.RichText + textFormat: Text.StyledText + linkColor: "#00B4EF" color: "white" text: "Blockchain technology from Elements." size: 14 @@ -111,8 +113,9 @@ Rectangle { size: 14 } RalewayRegular { - textFormat: Text.RichText + textFormat: Text.StyledText color: "white" + linkColor: "#00B4EF" text: "Distributed under the Apache License, Version 2.0.." size: 14 } From fee3cc0aca2e60f8b7d896128f2824820ba37947 Mon Sep 17 00:00:00 2001 From: vladest Date: Tue, 15 May 2018 15:49:20 +0200 Subject: [PATCH 35/61] Implemented backend for About dialog --- cmake/macros/SetPackagingParameters.cmake | 2 ++ cmake/templates/BuildInfo.h.in | 2 ++ .../qml/hifi/dialogs/TabletAboutDialog.qml | 33 +++++-------------- interface/src/Application.cpp | 4 +++ interface/src/ui/overlays/Web3DOverlay.cpp | 2 ++ 5 files changed, 19 insertions(+), 24 deletions(-) diff --git a/cmake/macros/SetPackagingParameters.cmake b/cmake/macros/SetPackagingParameters.cmake index 3ca5cb0e54..36e5a065df 100644 --- a/cmake/macros/SetPackagingParameters.cmake +++ b/cmake/macros/SetPackagingParameters.cmake @@ -73,6 +73,8 @@ macro(SET_PACKAGING_PARAMETERS) add_definitions(-DDEV_BUILD) endif () + string(TIMESTAMP BUILD_TIME "%d/%m/%Y") + if (DEPLOY_PACKAGE) # for deployed packages always grab the serverless content set(DOWNLOAD_SERVERLESS_CONTENT ON) diff --git a/cmake/templates/BuildInfo.h.in b/cmake/templates/BuildInfo.h.in index b0af1c0524..904d17293b 100644 --- a/cmake/templates/BuildInfo.h.in +++ b/cmake/templates/BuildInfo.h.in @@ -26,4 +26,6 @@ namespace BuildInfo { const QString VERSION = "@BUILD_VERSION@"; const QString BUILD_BRANCH = "@BUILD_BRANCH@"; const QString BUILD_GLOBAL_SERVICES = "@BUILD_GLOBAL_SERVICES@"; + const QString BUILD_TIME = "@BUILD_TIME@"; } + diff --git a/interface/resources/qml/hifi/dialogs/TabletAboutDialog.qml b/interface/resources/qml/hifi/dialogs/TabletAboutDialog.qml index 1a51c33368..34767c607d 100644 --- a/interface/resources/qml/hifi/dialogs/TabletAboutDialog.qml +++ b/interface/resources/qml/hifi/dialogs/TabletAboutDialog.qml @@ -9,7 +9,6 @@ // import QtQuick 2.5 - import "../../styles-uit" Rectangle { @@ -34,29 +33,15 @@ Rectangle { id: buildColumm anchors.left: parent.left anchors.leftMargin: 70 - Row { - RalewayRegular { - text: "Build" - size: 16 - color: "white" - } - RalewayRegular { - id: build - size: 16 - color: "white" - } + RalewayRegular { + text: "Build " + HiFiAbout.buildVersion + size: 16 + color: "white" } - Row { - RalewayRegular { - text: "Released" - size: 16 - color: "white" - } - RalewayRegular { - id: released - size: 16 - color: "white" - } + RalewayRegular { + text: "Released " + HiFiAbout.buildDate + size: 16 + color: "white" } } Item { height: 10; width: 1 } @@ -82,7 +67,7 @@ Rectangle { } RalewayRegular { color: "white" - text: "Built using Qt 5.10.1" + text: "Built using Qt " + HiFiAbout.qtVersion size: 12 anchors.verticalCenter: parent.verticalCenter } diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 13dea71ba4..a4df3880f1 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -220,6 +220,8 @@ #include "webbrowser/WebBrowserSuggestionsEngine.h" #include +#include "AboutUtil.h" + #if defined(Q_OS_WIN) #include @@ -2968,6 +2970,7 @@ void Application::onDesktopRootContextCreated(QQmlContext* surfaceContext) { surfaceContext->setContextProperty("Selection", DependencyManager::get().data()); surfaceContext->setContextProperty("ContextOverlay", DependencyManager::get().data()); surfaceContext->setContextProperty("Wallet", DependencyManager::get().data()); + surfaceContext->setContextProperty("HiFiAbout", AboutUtil::getInstance()); if (auto steamClient = PluginManager::getInstance()->getSteamClientPlugin()) { surfaceContext->setContextProperty("Steam", new SteamScriptingInterface(engine, steamClient.get())); @@ -6577,6 +6580,7 @@ void Application::registerScriptEngineWithApplicationServices(ScriptEnginePointe scriptEngine->registerGlobalObject("ContextOverlay", DependencyManager::get().data()); scriptEngine->registerGlobalObject("Wallet", DependencyManager::get().data()); scriptEngine->registerGlobalObject("AddressManager", DependencyManager::get().data()); + scriptEngine->registerGlobalObject("HifiAbout", AboutUtil::getInstance()); scriptEngine->registerGlobalObject("App", this); diff --git a/interface/src/ui/overlays/Web3DOverlay.cpp b/interface/src/ui/overlays/Web3DOverlay.cpp index a48e5eaf54..c678e3d2a2 100644 --- a/interface/src/ui/overlays/Web3DOverlay.cpp +++ b/interface/src/ui/overlays/Web3DOverlay.cpp @@ -57,6 +57,7 @@ #include "SoundCache.h" #include "raypick/PointerScriptingInterface.h" #include +#include "AboutUtil.h" static int MAX_WINDOW_SIZE = 4096; static const float METERS_TO_INCHES = 39.3701f; @@ -259,6 +260,7 @@ void Web3DOverlay::setupQmlSurface() { _webSurface->getSurfaceContext()->setContextProperty("Window", DependencyManager::get().data()); _webSurface->getSurfaceContext()->setContextProperty("Reticle", qApp->getApplicationCompositor().getReticleInterface()); _webSurface->getSurfaceContext()->setContextProperty("desktop", DependencyManager::get()->getDesktop()); + _webSurface->getSurfaceContext()->setContextProperty("HiFiAbout", AboutUtil::getInstance()); // Override min fps for tablet UI, for silky smooth scrolling setMaxFPS(90); From a6ef459723cb994ff943450265e3467bc01e9b14 Mon Sep 17 00:00:00 2001 From: vladest Date: Tue, 15 May 2018 16:07:32 +0200 Subject: [PATCH 36/61] Open browser within Interface --- .../qml/hifi/dialogs/TabletAboutDialog.qml | 19 +++++- interface/src/AboutUtil.cpp | 63 +++++++++++++++++++ interface/src/AboutUtil.h | 40 ++++++++++++ 3 files changed, 119 insertions(+), 3 deletions(-) create mode 100644 interface/src/AboutUtil.cpp create mode 100644 interface/src/AboutUtil.h diff --git a/interface/resources/qml/hifi/dialogs/TabletAboutDialog.qml b/interface/resources/qml/hifi/dialogs/TabletAboutDialog.qml index 34767c607d..2cb079a070 100644 --- a/interface/resources/qml/hifi/dialogs/TabletAboutDialog.qml +++ b/interface/resources/qml/hifi/dialogs/TabletAboutDialog.qml @@ -15,9 +15,7 @@ Rectangle { width: 480 height: 706 - HifiConstants { id: hifi; } - - color: hifi.colors.baseGray + color: "#404040" Column { x: 45 @@ -56,6 +54,9 @@ Rectangle { color: "white" text: "www.highfidelity.com." size: 20 + onLinkActivated: { + HiFiAbout.openUrl("https:/www.highfidelity.com"); + } } Item { height: 40; width: 1 } Row { @@ -64,6 +65,12 @@ Rectangle { sourceSize.width: 34 sourceSize.height: 25 source: "../../../images/about-qt.png" + MouseArea { + anchors.fill: parent + onClicked: { + HiFiAbout.openUrl("https://www.qt.io/"); + } + } } RalewayRegular { color: "white" @@ -91,6 +98,9 @@ Rectangle { color: "white" text: "Blockchain technology from Elements." size: 14 + onLinkActivated: { + HiFiAbout.openUrl("https://elementsproject.org/elements/"); + } } RalewayRegular { color: "white" @@ -103,6 +113,9 @@ Rectangle { linkColor: "#00B4EF" text: "Distributed under the Apache License, Version 2.0.." size: 14 + onLinkActivated: { + HiFiAbout.openUrl("http://www.apache.org/licenses/LICENSE-2.0.html"); + } } } } diff --git a/interface/src/AboutUtil.cpp b/interface/src/AboutUtil.cpp new file mode 100644 index 0000000000..e70ad9bbbf --- /dev/null +++ b/interface/src/AboutUtil.cpp @@ -0,0 +1,63 @@ +// +// AboutUtil.cpp +// interface/src +// +// Created by Vlad Stelmahovsky on 15/5/2018. +// Copyright 2018 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// + +#include "AboutUtil.h" +#include "BuildInfo.h" +#include +#include "DependencyManager.h" +#include "scripting/HMDScriptingInterface.h" +#include "Application.h" +#include + +AboutUtil::AboutUtil(QObject *parent) : QObject(parent) {} + +AboutUtil *AboutUtil::getInstance() +{ + static AboutUtil instance; + return &instance; +} + +QString AboutUtil::buildDate() const +{ + return BuildInfo::BUILD_TIME; +} + +QString AboutUtil::buildVersion() const +{ + return BuildInfo::VERSION; +} + +QString AboutUtil::qtVersion() const +{ + return qVersion(); +} + +void AboutUtil::openUrl(const QString& url) const { + + auto tabletScriptingInterface = DependencyManager::get(); + auto tablet = dynamic_cast(tabletScriptingInterface->getTablet("com.highfidelity.interface.tablet.system")); + auto hmd = DependencyManager::get(); + auto offscreenUi = DependencyManager::get(); + + if (tablet->getToolbarMode()) { + offscreenUi->load("Browser.qml", [=](QQmlContext* context, QObject* newObject) { + newObject->setProperty("url", url); + }); + } else { + if (!hmd->getShouldShowTablet() && !qApp->isHMDMode()) { + offscreenUi->load("Browser.qml", [=](QQmlContext* context, QObject* newObject) { + newObject->setProperty("url", url); + }); + } else { + tablet->gotoWebScreen(url); + } + } +} diff --git a/interface/src/AboutUtil.h b/interface/src/AboutUtil.h new file mode 100644 index 0000000000..94e9e7b8f3 --- /dev/null +++ b/interface/src/AboutUtil.h @@ -0,0 +1,40 @@ +// +// AboutUtil.h +// interface/src +// +// Created by Vlad Stelmahovsky on 15/5/2018. +// Copyright 2018 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// + + +#ifndef hifi_AboutUtil_h +#define hifi_AboutUtil_h + +#include + +class AboutUtil : public QObject { + + Q_OBJECT + + Q_PROPERTY(QString buildDate READ buildDate CONSTANT) + Q_PROPERTY(QString buildVersion READ buildVersion CONSTANT) + Q_PROPERTY(QString qtVersion READ qtVersion CONSTANT) + + AboutUtil(QObject* parent = nullptr); +public: + static AboutUtil* getInstance(); + ~AboutUtil() {} + + QString buildDate() const; + QString buildVersion() const; + QString qtVersion() const; + +public slots: + void openUrl(const QString &url) const; +private: +}; + +#endif // hifi_AboutUtil_h From e2a8ee2a4cf690100e6df38550c403e189e773b8 Mon Sep 17 00:00:00 2001 From: vladest Date: Tue, 15 May 2018 20:02:29 +0200 Subject: [PATCH 37/61] Fixed About date format. Increased space between logo and build info --- .../resources/qml/hifi/dialogs/TabletAboutDialog.qml | 1 + interface/src/AboutUtil.cpp | 10 ++++++++-- interface/src/AboutUtil.h | 2 ++ interface/src/ui/PreferencesDialog.cpp | 5 ++++- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/interface/resources/qml/hifi/dialogs/TabletAboutDialog.qml b/interface/resources/qml/hifi/dialogs/TabletAboutDialog.qml index 2cb079a070..579aa1cb1e 100644 --- a/interface/resources/qml/hifi/dialogs/TabletAboutDialog.qml +++ b/interface/resources/qml/hifi/dialogs/TabletAboutDialog.qml @@ -27,6 +27,7 @@ Rectangle { sourceSize.height: 75 source: "../../../images/about-highfidelity.png" } + Item { height: 30; width: 1 } Column { id: buildColumm anchors.left: parent.left diff --git a/interface/src/AboutUtil.cpp b/interface/src/AboutUtil.cpp index e70ad9bbbf..5179897443 100644 --- a/interface/src/AboutUtil.cpp +++ b/interface/src/AboutUtil.cpp @@ -8,6 +8,8 @@ // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // +#include +#include #include "AboutUtil.h" #include "BuildInfo.h" @@ -17,7 +19,11 @@ #include "Application.h" #include -AboutUtil::AboutUtil(QObject *parent) : QObject(parent) {} +AboutUtil::AboutUtil(QObject *parent) : QObject(parent) { + QLocale locale_; + m_DateConverted = QDate::fromString(BuildInfo::BUILD_TIME, "dd/MM/yyyy"). + toString(locale_.dateFormat(QLocale::ShortFormat)); +} AboutUtil *AboutUtil::getInstance() { @@ -27,7 +33,7 @@ AboutUtil *AboutUtil::getInstance() QString AboutUtil::buildDate() const { - return BuildInfo::BUILD_TIME; + return m_DateConverted; } QString AboutUtil::buildVersion() const diff --git a/interface/src/AboutUtil.h b/interface/src/AboutUtil.h index 94e9e7b8f3..9b65b887b9 100644 --- a/interface/src/AboutUtil.h +++ b/interface/src/AboutUtil.h @@ -35,6 +35,8 @@ public: public slots: void openUrl(const QString &url) const; private: + + QString m_DateConverted; }; #endif // hifi_AboutUtil_h diff --git a/interface/src/ui/PreferencesDialog.cpp b/interface/src/ui/PreferencesDialog.cpp index a1b2c93adc..269db65cd5 100644 --- a/interface/src/ui/PreferencesDialog.cpp +++ b/interface/src/ui/PreferencesDialog.cpp @@ -252,9 +252,12 @@ void setupPreferences() { static const QString MOVEMENT{ "VR Movement" }; { + auto getterFJ = [=]()->bool { return myAvatar->getFlyingEnabled(); }; + auto setterFJ = [=](bool value) { myAvatar->setFlyingEnabled(value); }; + preferences->addPreference(new CheckPreference(MOVEMENT, "Flying & jumping", getterFJ, setterFJ)); auto getter = [=]()->bool { return myAvatar->getSnapTurn(); }; auto setter = [=](bool value) { myAvatar->setSnapTurn(value); }; - preferences->addPreference(new CheckPreference(MOVEMENT, "Snap turn rotation", getter, setter)); + preferences->addPreference(new CheckPreference(MOVEMENT, "Snap turn / Smooth turn", getter, setter)); } //TODO: Update with advanced movement logic, test that it works From 71633105de77e193ad7f66c005a879f421ce2d48 Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Tue, 15 May 2018 11:31:58 -0700 Subject: [PATCH 38/61] adding back some menus --- interface/src/Menu.cpp | 27 ++++++++++++++++++++++++++ interface/src/ui/PreferencesDialog.cpp | 6 +++--- 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index dad79faedf..5633089019 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -141,9 +141,20 @@ Menu::Menu() { // Edit > Reload All Content addActionToQMenuAndActionHash(editMenu, MenuOption::ReloadContent, 0, qApp, SLOT(reloadResourceCaches())); + + MenuWrapper* avatarMenu = addMenu("Avatar"); auto avatarManager = DependencyManager::get(); auto avatar = avatarManager->getMyAvatar(); + // Avatar > Attachments... + action = addActionToQMenuAndActionHash(avatarMenu, MenuOption::Attachments); + connect(action, &QAction::triggered, [] { + qApp->showDialog(QString("hifi/dialogs/AttachmentsDialog.qml"), + QString("hifi/tablet/TabletAttachmentsDialog.qml"), "AttachmentsDialog"); + }); + + auto avatarBookmarks = DependencyManager::get(); + avatarBookmarks->setupMenus(this, avatarMenu); // Display menu ---------------------------------- // FIXME - this is not yet matching Alan's spec because it doesn't have // menus for "2D"/"3D" - we need to add support for detecting the appropriate @@ -772,6 +783,22 @@ Menu::Menu() { connect(speechRecognizer.data(), SIGNAL(enabledUpdated(bool)), speechRecognizerAction, SLOT(setChecked(bool))); #endif + // console + addActionToQMenuAndActionHash(developerMenu, MenuOption::Console, Qt::CTRL | Qt::ALT | Qt::Key_J, + DependencyManager::get().data(), + SLOT(toggleConsole()), + QAction::NoRole, + UNSPECIFIED_POSITION); + + // Developer > API Debugger + action = addActionToQMenuAndActionHash(developerMenu, "API Debugger"); + connect(action, &QAction::triggered, [] { + auto scriptEngines = DependencyManager::get(); + QUrl defaultScriptsLoc = PathUtils::defaultScriptsLocation(); + defaultScriptsLoc.setPath(defaultScriptsLoc.path() + "developer/utilities/tools/currentAPI.js"); + scriptEngines->loadScript(defaultScriptsLoc.toString()); + }); + // Developer > Log... addActionToQMenuAndActionHash(developerMenu, MenuOption::Log, Qt::CTRL | Qt::SHIFT | Qt::Key_L, qApp, SLOT(toggleLogDialog())); diff --git a/interface/src/ui/PreferencesDialog.cpp b/interface/src/ui/PreferencesDialog.cpp index a1b2c93adc..7e373ac160 100644 --- a/interface/src/ui/PreferencesDialog.cpp +++ b/interface/src/ui/PreferencesDialog.cpp @@ -62,13 +62,13 @@ void setupPreferences() { { auto getterY = []()->float { return 1.0; }; auto setterY = [](float value) { }; - preferences->addPreference(new SliderPreference(MOUSE_SENSIVITY, "Y Input", getterY, setterY)); + preferences->addPreference(new SliderPreference(MOUSE_SENSIVITY, "Mouse Look Y", getterY, setterY)); auto getterX = []()->float { return 1.0; }; auto setterX = [](float value) { }; - preferences->addPreference(new SliderPreference(MOUSE_SENSIVITY, "X Input", getterX, setterX)); + preferences->addPreference(new SliderPreference(MOUSE_SENSIVITY, "Mouse Look X", getterX, setterX)); auto getterSW = []()->float { return 1.0; }; auto setterSW = [](float value) { }; - preferences->addPreference(new SliderPreference(MOUSE_SENSIVITY, "Scroll Wheel", getterSW, setterSW)); + preferences->addPreference(new SliderPreference(MOUSE_SENSIVITY, "Mouse Look Zoom", getterSW, setterSW)); } // Graphics quality static const QString GRAPHICS_QUALITY { "Graphics Quality" }; From dd05afa9748e2b2684b3e7d2450d2883ed6ad160 Mon Sep 17 00:00:00 2001 From: vladest Date: Tue, 15 May 2018 21:41:48 +0200 Subject: [PATCH 39/61] Remove double setting --- interface/src/ui/PreferencesDialog.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/interface/src/ui/PreferencesDialog.cpp b/interface/src/ui/PreferencesDialog.cpp index 994bc8119a..3e23e57bd0 100644 --- a/interface/src/ui/PreferencesDialog.cpp +++ b/interface/src/ui/PreferencesDialog.cpp @@ -250,11 +250,12 @@ void setupPreferences() { } static const QString MOVEMENT{ "VR Movement" }; - { - auto getterFJ = [=]()->bool { return myAvatar->getFlyingEnabled(); }; - auto setterFJ = [=](bool value) { myAvatar->setFlyingEnabled(value); }; - preferences->addPreference(new CheckPreference(MOVEMENT, "Flying & jumping", getterFJ, setterFJ)); + auto getter = [=]()->bool { return myAvatar->getFlyingEnabled(); }; + auto setter = [=](bool value) { myAvatar->setFlyingEnabled(value); }; + preferences->addPreference(new CheckPreference(MOVEMENT, "Flying & jumping", getter, setter)); + } + { auto getter = [=]()->bool { return myAvatar->getSnapTurn(); }; auto setter = [=](bool value) { myAvatar->setSnapTurn(value); }; preferences->addPreference(new CheckPreference(MOVEMENT, "Snap turn / Smooth turn", getter, setter)); @@ -290,11 +291,6 @@ void setupPreferences() { preference->setStep(0.001f); preferences->addPreference(preference); } - { - auto getter = [=]()->bool { return myAvatar->getFlyingEnabled(); }; - auto setter = [=](bool value) { myAvatar->setFlyingEnabled(value); }; - preferences->addPreference(new CheckPreference(MOVEMENT, "Enable Flying", getter, setter)); - } static const QString AVATAR_CAMERA{ "Mouse Sensitivity" }; { From a9930d53a9f604a4f2ba3132ecd53131d76d02e5 Mon Sep 17 00:00:00 2001 From: vladest Date: Wed, 16 May 2018 14:25:58 +0200 Subject: [PATCH 40/61] Reorder VR menu --- interface/src/ui/PreferencesDialog.cpp | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/interface/src/ui/PreferencesDialog.cpp b/interface/src/ui/PreferencesDialog.cpp index 3e23e57bd0..3d23a371b5 100644 --- a/interface/src/ui/PreferencesDialog.cpp +++ b/interface/src/ui/PreferencesDialog.cpp @@ -250,18 +250,6 @@ void setupPreferences() { } static const QString MOVEMENT{ "VR Movement" }; - { - auto getter = [=]()->bool { return myAvatar->getFlyingEnabled(); }; - auto setter = [=](bool value) { myAvatar->setFlyingEnabled(value); }; - preferences->addPreference(new CheckPreference(MOVEMENT, "Flying & jumping", getter, setter)); - } - { - auto getter = [=]()->bool { return myAvatar->getSnapTurn(); }; - auto setter = [=](bool value) { myAvatar->setSnapTurn(value); }; - preferences->addPreference(new CheckPreference(MOVEMENT, "Snap turn / Smooth turn", getter, setter)); - } - - //TODO: Update with advanced movement logic, test that it works { static const QString movementsControlChannel = QStringLiteral("Hifi-Advanced-Movement-Disabler"); @@ -280,7 +268,16 @@ void setupPreferences() { QStringLiteral("Advanced movement for hand controllers"), getter, setter)); } - + { + auto getter = [=]()->bool { return myAvatar->getFlyingEnabled(); }; + auto setter = [=](bool value) { myAvatar->setFlyingEnabled(value); }; + preferences->addPreference(new CheckPreference(MOVEMENT, "Flying & jumping", getter, setter)); + } + { + auto getter = [=]()->bool { return myAvatar->getSnapTurn(); }; + auto setter = [=](bool value) { myAvatar->setSnapTurn(value); }; + preferences->addPreference(new CheckPreference(MOVEMENT, "Snap turn / Smooth turn", getter, setter)); + } { auto getter = [=]()->float { return myAvatar->getUserHeight(); }; auto setter = [=](float value) { myAvatar->setUserHeight(value); }; From 72838f6d34f8375501c7facdb1af94b0ac99c5f5 Mon Sep 17 00:00:00 2001 From: vladest Date: Wed, 16 May 2018 17:06:31 +0200 Subject: [PATCH 41/61] Implemented radio button preferences. Reimplemented snap smooth turn to radio buttons --- .../preferences/RadioButtonsPreference.qml | 57 +++++++++++++++++++ .../qml/dialogs/preferences/Section.qml | 5 ++ .../tabletWindows/preferences/Section.qml | 5 ++ interface/src/ui/PreferencesDialog.cpp | 10 +++- libraries/shared/src/Preferences.h | 17 +++++- 5 files changed, 90 insertions(+), 4 deletions(-) create mode 100644 interface/resources/qml/dialogs/preferences/RadioButtonsPreference.qml diff --git a/interface/resources/qml/dialogs/preferences/RadioButtonsPreference.qml b/interface/resources/qml/dialogs/preferences/RadioButtonsPreference.qml new file mode 100644 index 0000000000..77c94c2ae5 --- /dev/null +++ b/interface/resources/qml/dialogs/preferences/RadioButtonsPreference.qml @@ -0,0 +1,57 @@ +// +// RadioButtonsPreference.qml +// +// Created by Cain Kilgore on 20th July 2017 +// Copyright 2017 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// + +import QtQuick 2.5 + +import "../../controls-uit" + +Preference { + id: root + + height: control.height + hifi.dimensions.controlInterlineHeight + + Component.onCompleted: { + repeater.itemAt(preference.value).checked = true + } + + function save() { + var value = 0; + for (var i = 0; i < repeater.count; i++) { + if (repeater.itemAt(i).checked) { + value = i; + break; + } + } + preference.value = value; + preference.save(); + } + + Row { + id: control + anchors { + left: parent.left + right: parent.right + bottom: parent.bottom + } + spacing: 5 + + Repeater { + id: repeater + model: preference.items.length + delegate: RadioButton { + text: preference.items[index] + anchors { + verticalCenter: parent.verticalCenter + } + colorScheme: hifi.colorSchemes.dark + } + } + } +} diff --git a/interface/resources/qml/dialogs/preferences/Section.qml b/interface/resources/qml/dialogs/preferences/Section.qml index 4a16036a69..0284af9d9c 100644 --- a/interface/resources/qml/dialogs/preferences/Section.qml +++ b/interface/resources/qml/dialogs/preferences/Section.qml @@ -74,6 +74,7 @@ Preference { property var comboBoxBuilder: Component { ComboBoxPreference { } } property var spinnerSliderBuilder: Component { SpinnerSliderPreference { } } property var primaryHandBuilder: Component { PrimaryHandPreference { } } + property var radioButtonsBuilder: Component { RadioButtonsPreference { } } property var preferences: [] property int checkBoxCount: 0 @@ -140,6 +141,10 @@ Preference { checkBoxCount++; builder = primaryHandBuilder; break; + case Preference.RadioButtons: + checkBoxCount++; + builder = radioButtonsBuilder; + break; }; if (builder) { diff --git a/interface/resources/qml/hifi/tablet/tabletWindows/preferences/Section.qml b/interface/resources/qml/hifi/tablet/tabletWindows/preferences/Section.qml index 5036569031..15db58decc 100644 --- a/interface/resources/qml/hifi/tablet/tabletWindows/preferences/Section.qml +++ b/interface/resources/qml/hifi/tablet/tabletWindows/preferences/Section.qml @@ -82,6 +82,7 @@ Preference { property var comboBoxBuilder: Component { ComboBoxPreference { } } property var spinnerSliderBuilder: Component { SpinnerSliderPreference { } } property var primaryHandBuilder: Component { PrimaryHandPreference { } } + property var radioButtonsBuilder: Component { RadioButtonsPreference { } } property var preferences: [] property int checkBoxCount: 0 @@ -154,6 +155,10 @@ Preference { checkBoxCount++; builder = primaryHandBuilder; break; + case Preference.RadioButtons: + checkBoxCount++; + builder = radioButtonsBuilder; + break; }; if (builder) { diff --git a/interface/src/ui/PreferencesDialog.cpp b/interface/src/ui/PreferencesDialog.cpp index 3d23a371b5..e338c28bed 100644 --- a/interface/src/ui/PreferencesDialog.cpp +++ b/interface/src/ui/PreferencesDialog.cpp @@ -274,9 +274,13 @@ void setupPreferences() { preferences->addPreference(new CheckPreference(MOVEMENT, "Flying & jumping", getter, setter)); } { - auto getter = [=]()->bool { return myAvatar->getSnapTurn(); }; - auto setter = [=](bool value) { myAvatar->setSnapTurn(value); }; - preferences->addPreference(new CheckPreference(MOVEMENT, "Snap turn / Smooth turn", getter, setter)); + auto getter = [=]()->int { return myAvatar->getSnapTurn() ? 0 : 1; }; + auto setter = [=](int value) { myAvatar->setSnapTurn(value == 0); }; + auto preference = new RadioButtonsPreference(MOVEMENT, "Snap turn / Smooth turn", getter, setter); + QStringList items; + items << "Snap turn" << "Smooth turn"; + preference->setItems(items); + preferences->addPreference(preference); } { auto getter = [=]()->float { return myAvatar->getUserHeight(); }; diff --git a/libraries/shared/src/Preferences.h b/libraries/shared/src/Preferences.h index 76d61fe3f6..931508e825 100644 --- a/libraries/shared/src/Preferences.h +++ b/libraries/shared/src/Preferences.h @@ -58,7 +58,8 @@ public: ComboBox, PrimaryHand, // Special casing for an unusual preference - Avatar + Avatar, + RadioButtons }; explicit Preference(QObject* parent = nullptr) : QObject(parent) {} @@ -353,6 +354,20 @@ public: Type getType() override { return PrimaryHand; } }; +class RadioButtonsPreference : public IntPreference { + Q_OBJECT + Q_PROPERTY(QStringList items READ getItems CONSTANT) +public: + RadioButtonsPreference(const QString& category, const QString& name, Getter getter, Setter setter) + : IntPreference(category, name, getter, setter) { } + Type getType() override { return RadioButtons; } + + const QStringList& getItems() { return _items; } + void setItems(const QStringList& items) { _items = items; } + +protected: + QStringList _items; +}; #endif From e676348c4f4bff3ed348eb96a79435abb5f839a5 Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Wed, 16 May 2018 10:40:28 -0700 Subject: [PATCH 42/61] fixing some menu reog bugs --- .../qml/hifi/dialogs/RunningScripts.qml | 4 +- .../qml/hifi/dialogs/TabletRunningScripts.qml | 4 +- interface/src/Menu.cpp | 66 ++--- interface/src/avatar/MyAvatar.cpp | 1 - interface/src/ui/PreferencesDialog.cpp | 11 +- ...oggleAdvancedMovementForHandControllers.js | 246 ++++++++++-------- 6 files changed, 160 insertions(+), 172 deletions(-) diff --git a/interface/resources/qml/hifi/dialogs/RunningScripts.qml b/interface/resources/qml/hifi/dialogs/RunningScripts.qml index 9e3ebcbab0..9a180a66f6 100644 --- a/interface/resources/qml/hifi/dialogs/RunningScripts.qml +++ b/interface/resources/qml/hifi/dialogs/RunningScripts.qml @@ -79,7 +79,7 @@ ScrollingWindow { interval: 1000 repeat: true running: false - onTriggered: developerMenuEnabled = MenuInterface.isMenuEnabled("Developer Menus"); + onTriggered: developerMenuEnabled = MenuInterface.isOptionChecked("Developer Menu"); } Component { @@ -98,7 +98,7 @@ ScrollingWindow { Component.onCompleted: { isHMD = HMD.active; updateRunningScripts(); - developerMenuEnabled = MenuInterface.isMenuEnabled("Developer Menus"); + developerMenuEnabled = MenuInterface.isOptionChecked("Developer Menu"); checkMenu.restart(); } diff --git a/interface/resources/qml/hifi/dialogs/TabletRunningScripts.qml b/interface/resources/qml/hifi/dialogs/TabletRunningScripts.qml index 83f91c78c5..018c8f5737 100644 --- a/interface/resources/qml/hifi/dialogs/TabletRunningScripts.qml +++ b/interface/resources/qml/hifi/dialogs/TabletRunningScripts.qml @@ -65,7 +65,7 @@ Rectangle { interval: 1000 repeat: true running: false - onTriggered: developerMenuEnabled = MenuInterface.isMenuEnabled("Developer Menus"); + onTriggered: developerMenuEnabled = MenuInterface.isOptionChecked("Developer Menu"); } Component { @@ -84,7 +84,7 @@ Rectangle { Component.onCompleted: { isHMD = HMD.active; updateRunningScripts(); - developerMenuEnabled = MenuInterface.isMenuEnabled("Developer Menus"); + developerMenuEnabled = MenuInterface.isOptionChecked("Developer Menu"); checkMenu.restart(); } diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index 5633089019..1cde12a13c 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -100,19 +100,19 @@ Menu::Menu() { addActionToQMenuAndActionHash(editMenu, redoAction); editMenu->addSeparator(); - + // Edit > Cut addActionToQMenuAndActionHash(editMenu, "Cut", Qt::CTRL | Qt::Key_X); - + // Edit > Copy addActionToQMenuAndActionHash(editMenu, "Copy", Qt::CTRL | Qt::Key_C); - + // Edit > Paste addActionToQMenuAndActionHash(editMenu, "Paste", Qt::CTRL | Qt::Key_V); - + // Edit > Delete addActionToQMenuAndActionHash(editMenu, "Delete", Qt::Key_Delete); - + editMenu->addSeparator(); // Edit > Running Scripts @@ -280,7 +280,7 @@ Menu::Menu() { }); // Settings > Notifications - MenuWrapper * notificationsMenu = settingsMenu->addMenu("Notifications"); //This was in notifications.js. The menu needs to be moved here. + MenuWrapper * notificationsMenu = settingsMenu->addMenu("Notifications"); //This was in notifications.js. The menu needs to be moved here. //TODO: Hookup notification actions below. // Settings > Notifications > Play Notification Sounds @@ -308,43 +308,9 @@ Menu::Menu() { settings->setValue(MenuOption::NotificationSoundsTablet, action->isChecked()); }); - //Further sound notificaions disabled until new notification system will be implemented - /* - // Settings > Notifications > Level of Detail - action = addCheckableActionToQMenuAndActionHash(notificationsMenu, "Level of Detail", 0, - settings->getValue("play_notification_sounds_type_1").toBool()); - connect(action, &QAction::triggered, [action, settings] { - settings->setValue("play_notification_sounds_type_1", action->isChecked()); - }); - // Settings > Notifications > Connection - action = addCheckableActionToQMenuAndActionHash(notificationsMenu, "Connection", 0, - settings->getValue("play_notification_sounds_type_2").toBool()); - connect(action, &QAction::triggered, [action, settings] { - settings->setValue("play_notification_sounds_type_2", action->isChecked()); - }); - // Settings > Notifications > Connection Refused - action = addCheckableActionToQMenuAndActionHash(notificationsMenu, "Connection Refused", 0, - settings->getValue("play_notification_sounds_type_3").toBool()); - connect(action, &QAction::triggered, [action, settings] { - settings->setValue("play_notification_sounds_type_3", action->isChecked()); - }); - // Settings > Notifications > Edit Error - action = addCheckableActionToQMenuAndActionHash(notificationsMenu, "Edit Error", 0, - settings->getValue("play_notification_sounds_type_4").toBool()); - connect(action, &QAction::triggered, [action, settings] { - settings->setValue("play_notification_sounds_type_4", action->isChecked()); - }); - // Settings > Notifications > Wallet - addActionToQMenuAndActionHash(notificationsMenu, "Wallet"); - action = addCheckableActionToQMenuAndActionHash(notificationsMenu, "Wallet", 0, - settings->getValue("play_notification_sounds_type_6").toBool()); - connect(action, &QAction::triggered, [action, settings] { - settings->setValue("play_notification_sounds_type_6", action->isChecked()); - }); -*/ // Settings > Developer Menu addCheckableActionToQMenuAndActionHash(settingsMenu, "Developer Menu", 0, false, this, SLOT(toggleDeveloperMenus())); - + // Settings > Ask to Reset Settings addCheckableActionToQMenuAndActionHash(settingsMenu, MenuOption::AskToResetSettings, 0, false); @@ -375,7 +341,7 @@ Menu::Menu() { if (mainViewShadowTaskConfig) { if (action->isChecked()) { mainViewShadowTaskConfig->setPreset("Enabled"); - } else { + } else { mainViewShadowTaskConfig->setPreset("None"); } } @@ -844,7 +810,7 @@ Menu::Menu() { // Help/Application menu ---------------------------------- MenuWrapper * helpMenu = addMenu("Help"); - + // Help > About High Fidelity action = addActionToQMenuAndActionHash(helpMenu, "About High Fidelity"); connect(action, &QAction::triggered, [] { @@ -852,35 +818,35 @@ Menu::Menu() { QString("hifi/dialogs/TabletAboutDialog.qml"), "AboutDialog"); }); helpMenu->addSeparator(); - + // Help > HiFi Docs action = addActionToQMenuAndActionHash(helpMenu, "Online Documentation"); connect(action, &QAction::triggered, qApp, [] { QDesktopServices::openUrl(QUrl("https://docs.highfidelity.com/")); }); - + // Help > HiFi Forum action = addActionToQMenuAndActionHash(helpMenu, "Online Forums"); connect(action, &QAction::triggered, qApp, [] { QDesktopServices::openUrl(QUrl("https://forums.highfidelity.com/")); }); - + // Help > Scripting Reference action = addActionToQMenuAndActionHash(helpMenu, "Online Script Reference"); connect(action, &QAction::triggered, qApp, [] { QDesktopServices::openUrl(QUrl("https://docs.highfidelity.com/api-reference")); }); - + addActionToQMenuAndActionHash(helpMenu, "Controls Reference", 0, qApp, SLOT(showHelp())); - + helpMenu->addSeparator(); - + // Help > Release Notes action = addActionToQMenuAndActionHash(helpMenu, "Release Notes"); connect(action, &QAction::triggered, qApp, [] { QDesktopServices::openUrl(QUrl("http://steamcommunity.com/games/390540/announcements/")); }); - + // Help > Report a Bug! action = addActionToQMenuAndActionHash(helpMenu, "Report a Bug!"); connect(action, &QAction::triggered, qApp, [] { diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index 046dbafcc3..5fb4e80b80 100755 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -2654,7 +2654,6 @@ void MyAvatar::updateMotionBehaviorFromMenu() { } else { _motionBehaviors &= ~AVATAR_MOTION_SCRIPTED_MOTOR_ENABLED; } - setCollisionsEnabled(menu->isOptionChecked(MenuOption::EnableAvatarCollisions)); setProperty("lookAtSnappingEnabled", menu->isOptionChecked(MenuOption::EnableLookAtSnapping)); } diff --git a/interface/src/ui/PreferencesDialog.cpp b/interface/src/ui/PreferencesDialog.cpp index 3e23e57bd0..3af5848d2a 100644 --- a/interface/src/ui/PreferencesDialog.cpp +++ b/interface/src/ui/PreferencesDialog.cpp @@ -266,16 +266,7 @@ void setupPreferences() { static const QString movementsControlChannel = QStringLiteral("Hifi-Advanced-Movement-Disabler"); auto getter = [=]()->bool { return myAvatar->useAdvancedMovementControls(); }; - auto setter = [=](bool value) { - auto messagesClient = DependencyManager::get().data(); - myAvatar->setUseAdvancedMovementControls(value); - if (value) { - messagesClient->sendMessage(movementsControlChannel, QStringLiteral("enable_mappings"), true); - } else { - messagesClient->sendMessage(movementsControlChannel, QStringLiteral("disable_mappings"), true); - } - - }; + auto setter = [=](bool value) { myAvatar->setUseAdvancedMovementControls(value); }; preferences->addPreference(new CheckPreference(MOVEMENT, QStringLiteral("Advanced movement for hand controllers"), getter, setter)); diff --git a/scripts/system/controllers/toggleAdvancedMovementForHandControllers.js b/scripts/system/controllers/toggleAdvancedMovementForHandControllers.js index 40721e7f72..a1b96ac607 100644 --- a/scripts/system/controllers/toggleAdvancedMovementForHandControllers.js +++ b/scripts/system/controllers/toggleAdvancedMovementForHandControllers.js @@ -11,132 +11,164 @@ // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +/* jslint bitwise: true */ + +/* global Script, Quat, MyAvatar, HMD, Controller, Messages*/ + (function() { // BEGIN LOCAL_SCOPE -var mappingName, basicMapping, isChecked; + var TWO_SECONDS_INTERVAL = 2000; + var FLYING_MAPPING_NAME = 'Hifi-Flying-Dev-' + Math.random(); + var DRIVING_MAPPING_NAME = 'Hifi-Driving-Dev-' + Math.random(); -var TURN_RATE = 1000; -var isDisabled = false; -var previousSetting = MyAvatar.useAdvancedMovementControls; -if (previousSetting === false) { - previousSetting = false; - isChecked = false; -} + var flyingMapping = null; + var drivingMapping = null; -if (previousSetting === true) { - previousSetting = true; - isChecked = true; -} + var TURN_RATE = 1000; + var isDisabled = false; -function rotate180() { - var newOrientation = Quat.multiply(MyAvatar.orientation, Quat.angleAxis(180, { - x: 0, - y: 1, - z: 0 - })) - MyAvatar.orientation = newOrientation -} + var previousFlyingState = MyAvatar.getFlyingEnabled(); + var previousDrivingState = MyAvatar.useAdvancedMovementControls; -var inFlipTurn = false; + function rotate180() { + var newOrientation = Quat.multiply(MyAvatar.orientation, Quat.angleAxis(180, { + x: 0, + y: 1, + z: 0 + })); + MyAvatar.orientation = newOrientation; + } -function registerBasicMapping() { - mappingName = 'Hifi-AdvancedMovement-Dev-' + Math.random(); - basicMapping = Controller.newMapping(mappingName); - basicMapping.from(Controller.Standard.LY).to(function(value) { - if (isDisabled) { - return; - } - var stick = Controller.getValue(Controller.Standard.LS); - if (value === 1 && Controller.Hardware.OculusTouch !== undefined) { - rotate180(); - } else if (Controller.Hardware.Vive !== undefined) { - if (value > 0.75 && inFlipTurn === false) { - inFlipTurn = true; + var inFlipTurn = false; + + function registerBasicMapping() { + + drivingMapping = Controller.newMapping(DRIVING_MAPPING_NAME); + drivingMapping.from(Controller.Standard.LY).to(function(value) { + if (isDisabled) { + return; + } + + if (value === 1 && Controller.Hardware.OculusTouch !== undefined) { rotate180(); - Script.setTimeout(function() { - inFlipTurn = false; - }, TURN_RATE) + } else if (Controller.Hardware.Vive !== undefined) { + if (value > 0.75 && inFlipTurn === false) { + inFlipTurn = true; + rotate180(); + Script.setTimeout(function() { + inFlipTurn = false; + }, TURN_RATE); + } + } + return; + }); + + flyingMapping = Controller.newMapping(FLYING_MAPPING_NAME); + flyingMapping.from(Controller.Standard.RY).to(function(value) { + if (isDisabled) { + return; + } + + if (value === 1 && Controller.Hardware.OculusTouch !== undefined) { + rotate180(); + } else if (Controller.Hardware.Vive !== undefined) { + if (value > 0.75 && inFlipTurn === false) { + inFlipTurn = true; + rotate180(); + Script.setTimeout(function() { + inFlipTurn = false; + }, TURN_RATE); + } + } + return; + }); + } + + function scriptEnding() { + Controller.disableMapping(FLYING_MAPPING_NAME); + Controller.disableMapping(DRIVING_MAPPING_NAME); + } + + Script.scriptEnding.connect(scriptEnding); + + registerBasicMapping(); + + Script.setTimeout(function() { + if (MyAvatar.useAdvanceMovementControls) { + Controller.disableMapping(DRIVING_MAPPING_NAME); + } else { + Controller.enableMapping(DRIVING_MAPPING_NAME); + } + + if (MyAvatar.getFyingEnabled()) { + Controller.disableMapping(FLYING_MAPPING_NAME); + } else { + Controller.enableMapping(FLYING_MAPPING_NAME); + } + }, 100); + + + HMD.displayModeChanged.connect(function(isHMDMode) { + if (isHMDMode) { + if (Controller.Hardware.Vive !== undefined || Controller.Hardware.OculusTouch !== undefined) { + if (MyAvatar.useAdvancedMovementControls) { + Controller.disableMapping(DRIVING_MAPPING_NAME); + } else { + Controller.enableMapping(DRIVING_MAPPING_NAME); + } + + if (MyAvatar.getFlyingEnabled()) { + Controller.disableMapping(FLYING_MAPPING_NAME); + } else { + Controller.enableMapping(FLYING_MAPPING_NAME); + } + } } - return; }); - basicMapping.from(Controller.Standard.RY).to(function(value) { - if (isDisabled) { - return; - } - var stick = Controller.getValue(Controller.Standard.RS); - if (value === 1 && Controller.Hardware.OculusTouch !== undefined) { - rotate180(); - } else if (Controller.Hardware.Vive !== undefined) { - if (value > 0.75 && inFlipTurn === false) { - inFlipTurn = true; - rotate180(); - Script.setTimeout(function() { - inFlipTurn = false; - }, TURN_RATE) - } - } - return; - }) -} -function enableMappings() { - Controller.enableMapping(mappingName); -} + function update() { + if ((Controller.Hardware.Vive !== undefined || Controller.Hardware.OculusTouch !== undefined) && HMD.active) { + var flying = MyAvatar.getFlyingEnabled(); + var driving = MyAvatar.useAdvancedMovementControls; -function disableMappings() { - Controller.disableMapping(mappingName); -} + if (flying !== previousFlyingState) { + if (flying) { + Controller.disableMapping(FLYING_MAPPING_NAME); + } else { + Controller.enableMapping(FLYING_MAPPING_NAME); + } -function scriptEnding() { - disableMappings(); -} - -Script.scriptEnding.connect(scriptEnding); - -registerBasicMapping(); - -Script.setTimeout(function() { - if (previousSetting === true) { - disableMappings(); - } else { - enableMappings(); - } -}, 100) - - -HMD.displayModeChanged.connect(function(isHMDMode) { - if (isHMDMode) { - if (Controller.Hardware.Vive !== undefined || Controller.Hardware.OculusTouch !== undefined) { - if (isChecked === true) { - disableMappings(); - } else if (isChecked === false) { - enableMappings(); + previousFlyingState = flying; } + if (driving !== previousDrivingState) { + if (driving) { + Controller.disableMapping(DRIVING_MAPPING_NAME); + } else { + Controller.enableMapping(DRIVING_MAPPING_NAME); + } + previousDrivingState = driving; + } + } + Script.setTimeout(update, TWO_SECONDS_INTERVAL); + } + + Script.setTimeout(update, TWO_SECONDS_INTERVAL); + + var HIFI_ADVANCED_MOVEMENT_DISABLER_CHANNEL = 'Hifi-Advanced-Movement-Disabler'; + function handleMessage(channel, message, sender) { + if (channel === HIFI_ADVANCED_MOVEMENT_DISABLER_CHANNEL) { + if (message === 'disable') { + isDisabled = true; + } else if (message === 'enable') { + isDisabled = false; + } } } -}); - -var HIFI_ADVANCED_MOVEMENT_DISABLER_CHANNEL = 'Hifi-Advanced-Movement-Disabler'; -function handleMessage(channel, message, sender) { - if (channel === HIFI_ADVANCED_MOVEMENT_DISABLER_CHANNEL) { - if (message === 'disable') { - isDisabled = true; - } else if (message === 'enable') { - isDisabled = false; - } else if (message === 'enable_mappings') { - print("enable mappings") - enableMappings(); - } else if (message === 'disable_mappings') { - disableMappings(); - } - } -} - -Messages.subscribe(HIFI_ADVANCED_MOVEMENT_DISABLER_CHANNEL); -Messages.messageReceived.connect(handleMessage); + Messages.subscribe(HIFI_ADVANCED_MOVEMENT_DISABLER_CHANNEL); + Messages.messageReceived.connect(handleMessage); }()); // END LOCAL_SCOPE From 7501b8818e50e3e5ed61fa09ec30121d014d37eb Mon Sep 17 00:00:00 2001 From: vladest Date: Wed, 16 May 2018 21:01:50 +0200 Subject: [PATCH 43/61] removed shadows quality --- interface/src/ui/PreferencesDialog.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/interface/src/ui/PreferencesDialog.cpp b/interface/src/ui/PreferencesDialog.cpp index ca001eb406..2e6c9c8e64 100644 --- a/interface/src/ui/PreferencesDialog.cpp +++ b/interface/src/ui/PreferencesDialog.cpp @@ -79,9 +79,6 @@ void setupPreferences() { wodSlider->setMin(0); wodSlider->setMax(2000); preferences->addPreference(wodSlider); - auto getterSQ = []()->float { return 1.0; }; - auto setterSQ = [](float value) { }; - preferences->addPreference(new SliderPreference(GRAPHICS_QUALITY, "Shadow Quality", getterSQ, setterSQ)); auto getterShadow = []()->bool { bool ret = false; @@ -104,7 +101,7 @@ void setupPreferences() { } } }; - preferences->addPreference(new CheckPreference(GRAPHICS_QUALITY, "Enable/disable shadows", getterShadow, setterShadow)); + preferences->addPreference(new CheckPreference(GRAPHICS_QUALITY, "Show Shadows", getterShadow, setterShadow)); } // UI From 8c146521cf8d5764458bfcf2cdec4c2c9c0340d8 Mon Sep 17 00:00:00 2001 From: vladest Date: Wed, 16 May 2018 21:10:51 +0200 Subject: [PATCH 44/61] remove double crash options --- interface/src/Menu.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index 1cde12a13c..4fe2ce8f04 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -731,9 +731,6 @@ Menu::Menu() { action = addActionToQMenuAndActionHash(crashMenu, MenuOption::CrashNewFaultThreaded); connect(action, &QAction::triggered, qApp, []() { std::thread(crash::newFault).join(); }); - // Developer > Display Crash Options - addCheckableActionToQMenuAndActionHash(developerMenu, MenuOption::DisplayCrashOptions, 0, true); - // Developer > Stats addCheckableActionToQMenuAndActionHash(developerMenu, MenuOption::Stats); From fbc3d97af33c2e8e1599f057ea9c4da13520b6a7 Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Wed, 16 May 2018 13:48:29 -0700 Subject: [PATCH 45/61] adding back overlay menu and avatar size --- interface/src/Application.cpp | 2 +- interface/src/Application.h | 3 +++ interface/src/Menu.cpp | 26 ++++++++++++++++++++++++++ interface/src/ui/OverlayConductor.cpp | 2 +- interface/src/ui/PreferencesDialog.cpp | 12 ++++++++++++ 5 files changed, 43 insertions(+), 2 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index b590a100dc..0bdf358aa2 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -5107,7 +5107,7 @@ void Application::updateThreads(float deltaTime) { void Application::toggleOverlays() {} void Application::setOverlaysVisible(bool visible) { - Q_UNUSED(visible) + _overlaysVisible = visible; } void Application::centerUI() { diff --git a/interface/src/Application.h b/interface/src/Application.h index 5a29dd23e8..4a3bc22de0 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -377,6 +377,7 @@ public slots: void cameraMenuChanged(); void toggleOverlays(); void setOverlaysVisible(bool visible); + bool getOverlaysVisible() { return _overlaysVisible; }; Q_INVOKABLE void centerUI(); void resetPhysicsReadyInformation(); @@ -693,6 +694,8 @@ private: bool _fakedMouseEvent { false }; + bool _overlaysVisible { true }; + void checkChangeCursor(); mutable QMutex _changeCursorLock { QMutex::Recursive }; Qt::CursorShape _desiredCursor{ Qt::BlankCursor }; diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index 1cde12a13c..366494bcac 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -146,6 +146,32 @@ Menu::Menu() { auto avatarManager = DependencyManager::get(); auto avatar = avatarManager->getMyAvatar(); + // Avatar > Size + MenuWrapper* avatarSizeMenu = avatarMenu->addMenu("Size"); + // Avatar > Size > Increase + addActionToQMenuAndActionHash(avatarSizeMenu, + MenuOption::IncreaseAvatarSize, + 0, // QML Qt::Key_Plus, + avatar.get(), SLOT(increaseSize())); + + // Avatar > Size > Decrease + addActionToQMenuAndActionHash(avatarSizeMenu, + MenuOption::DecreaseAvatarSize, + 0, // QML Qt::Key_Minus, + avatar.get(), SLOT(decreaseSize())); + + // Avatar > Size > Reset + addActionToQMenuAndActionHash(avatarSizeMenu, + MenuOption::ResetAvatarSize, + 0, // QML Qt::Key_Equal, + avatar.get(), SLOT(resetSize())); + + // Avatar > Reset Sensors + addActionToQMenuAndActionHash(avatarMenu, + MenuOption::ResetSensors, + 0, // QML Qt::Key_Apostrophe, + qApp, SLOT(resetSensors())); + // Avatar > Attachments... action = addActionToQMenuAndActionHash(avatarMenu, MenuOption::Attachments); connect(action, &QAction::triggered, [] { diff --git a/interface/src/ui/OverlayConductor.cpp b/interface/src/ui/OverlayConductor.cpp index 66789422f4..5393306286 100644 --- a/interface/src/ui/OverlayConductor.cpp +++ b/interface/src/ui/OverlayConductor.cpp @@ -144,7 +144,7 @@ void OverlayConductor::update(float dt) { } - bool targetVisible = (0 == (_flags & SuppressMask)); + bool targetVisible = qApp->getOverlaysVisible() && (0 == (_flags & SuppressMask)); if (targetVisible != currentVisible) { offscreenUi->setPinned(!targetVisible); } diff --git a/interface/src/ui/PreferencesDialog.cpp b/interface/src/ui/PreferencesDialog.cpp index ca001eb406..b5095ab123 100644 --- a/interface/src/ui/PreferencesDialog.cpp +++ b/interface/src/ui/PreferencesDialog.cpp @@ -146,6 +146,18 @@ void setupPreferences() { preferences->addPreference(new CheckPreference(UI_CATEGORY, "Use reticle cursor instead of arrow", getter, setter)); } + { + auto getter = [=]()->bool { return myAvatar->getClearOverlayWhenMoving(); }; + auto setter = [=](bool value) { myAvatar->setClearOverlayWhenMoving(value); }; + preferences->addPreference(new CheckPreference(UI_CATEGORY, "Clear overlays when moving", getter, setter)); + } + + { + auto getter = [=]()->bool { return qApp->getOverlaysVisible(); }; + auto setter = [=](bool value) { qApp->setOverlaysVisible(value); }; + preferences->addPreference(new CheckPreference(UI_CATEGORY, "Show Overlays", getter, setter)); + } + static const QString VIEW_CATEGORY{ "View" }; { auto getter = [=]()->float { return myAvatar->getRealWorldFieldOfView(); }; From 3be4b01d2c7e815bf2781284f2f55c526049a88d Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Wed, 16 May 2018 14:36:55 -0700 Subject: [PATCH 46/61] move overlays menu back --- interface/src/Application.cpp | 8 ++++++-- interface/src/Application.h | 3 --- interface/src/Menu.cpp | 2 ++ interface/src/ui/OverlayConductor.cpp | 2 +- interface/src/ui/PreferencesDialog.cpp | 12 ------------ 5 files changed, 9 insertions(+), 18 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 0bdf358aa2..303089fc14 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -5104,10 +5104,14 @@ void Application::updateThreads(float deltaTime) { } } -void Application::toggleOverlays() {} +void Application::toggleOverlays() { + auto meu = Menu::getInstance(); + menu->setIsOptionChecked(MenuOption::Overlays, !menu->isOptionChecked(menuOption::Overlays)); +} void Application::setOverlaysVisible(bool visible) { - _overlaysVisible = visible; + auto menu = Menu::getInstance(); + menu->setIsOptionChecked(MenuOption::Overlays, visible) } void Application::centerUI() { diff --git a/interface/src/Application.h b/interface/src/Application.h index 4a3bc22de0..5a29dd23e8 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -377,7 +377,6 @@ public slots: void cameraMenuChanged(); void toggleOverlays(); void setOverlaysVisible(bool visible); - bool getOverlaysVisible() { return _overlaysVisible; }; Q_INVOKABLE void centerUI(); void resetPhysicsReadyInformation(); @@ -694,8 +693,6 @@ private: bool _fakedMouseEvent { false }; - bool _overlaysVisible { true }; - void checkChangeCursor(); mutable QMutex _changeCursorLock { QMutex::Recursive }; Qt::CursorShape _desiredCursor{ Qt::BlankCursor }; diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index fe49ec3d8a..9b21a06483 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -239,6 +239,8 @@ Menu::Menu() { addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::CenterPlayerInView, 0, true, qApp, SLOT(rotationModeChanged())); + addCheckableActrionToQMenuActionHash(viewMenu, MenuOption::Overlays, 0, true); + // View > Enter First Person Mode in HMD addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::FirstPersonHMD, 0, true); diff --git a/interface/src/ui/OverlayConductor.cpp b/interface/src/ui/OverlayConductor.cpp index 5393306286..e7e3c91d13 100644 --- a/interface/src/ui/OverlayConductor.cpp +++ b/interface/src/ui/OverlayConductor.cpp @@ -144,7 +144,7 @@ void OverlayConductor::update(float dt) { } - bool targetVisible = qApp->getOverlaysVisible() && (0 == (_flags & SuppressMask)); + bool targetVisible = Menu::getInstance()->isOptionChecked(MenuOption::Overlays) && (0 == (_flags & SuppressMask)); if (targetVisible != currentVisible) { offscreenUi->setPinned(!targetVisible); } diff --git a/interface/src/ui/PreferencesDialog.cpp b/interface/src/ui/PreferencesDialog.cpp index ede02c5016..083ed68090 100644 --- a/interface/src/ui/PreferencesDialog.cpp +++ b/interface/src/ui/PreferencesDialog.cpp @@ -58,18 +58,6 @@ void setupPreferences() { preferences->addPreference(preference); } - static const QString MOUSE_SENSIVITY { "Mouse Sensivity" }; - { - auto getterY = []()->float { return 1.0; }; - auto setterY = [](float value) { }; - preferences->addPreference(new SliderPreference(MOUSE_SENSIVITY, "Mouse Look Y", getterY, setterY)); - auto getterX = []()->float { return 1.0; }; - auto setterX = [](float value) { }; - preferences->addPreference(new SliderPreference(MOUSE_SENSIVITY, "Mouse Look X", getterX, setterX)); - auto getterSW = []()->float { return 1.0; }; - auto setterSW = [](float value) { }; - preferences->addPreference(new SliderPreference(MOUSE_SENSIVITY, "Mouse Look Zoom", getterSW, setterSW)); - } // Graphics quality static const QString GRAPHICS_QUALITY { "Graphics Quality" }; { From f8e9afb115e433af44f9d54120c3dedfc95f7213 Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Wed, 16 May 2018 15:08:09 -0700 Subject: [PATCH 47/61] fixing damn build issues --- interface/src/Application.cpp | 6 +++--- interface/src/Menu.cpp | 2 +- interface/src/ui/PreferencesDialog.cpp | 6 ------ 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 303089fc14..c9afdb3064 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -5105,13 +5105,13 @@ void Application::updateThreads(float deltaTime) { } void Application::toggleOverlays() { - auto meu = Menu::getInstance(); - menu->setIsOptionChecked(MenuOption::Overlays, !menu->isOptionChecked(menuOption::Overlays)); + auto menu = Menu::getInstance(); + menu->setIsOptionChecked(MenuOption::Overlays, !menu->isOptionChecked(MenuOption::Overlays)); } void Application::setOverlaysVisible(bool visible) { auto menu = Menu::getInstance(); - menu->setIsOptionChecked(MenuOption::Overlays, visible) + menu->setIsOptionChecked(MenuOption::Overlays, visible); } void Application::centerUI() { diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index 9b21a06483..6bc93c2e5c 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -239,7 +239,7 @@ Menu::Menu() { addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::CenterPlayerInView, 0, true, qApp, SLOT(rotationModeChanged())); - addCheckableActrionToQMenuActionHash(viewMenu, MenuOption::Overlays, 0, true); + addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::Overlays, 0, true); // View > Enter First Person Mode in HMD addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::FirstPersonHMD, 0, true); diff --git a/interface/src/ui/PreferencesDialog.cpp b/interface/src/ui/PreferencesDialog.cpp index 083ed68090..a7aff4ebe3 100644 --- a/interface/src/ui/PreferencesDialog.cpp +++ b/interface/src/ui/PreferencesDialog.cpp @@ -137,12 +137,6 @@ void setupPreferences() { preferences->addPreference(new CheckPreference(UI_CATEGORY, "Clear overlays when moving", getter, setter)); } - { - auto getter = [=]()->bool { return qApp->getOverlaysVisible(); }; - auto setter = [=](bool value) { qApp->setOverlaysVisible(value); }; - preferences->addPreference(new CheckPreference(UI_CATEGORY, "Show Overlays", getter, setter)); - } - static const QString VIEW_CATEGORY{ "View" }; { auto getter = [=]()->float { return myAvatar->getRealWorldFieldOfView(); }; From 2a6204ca8dca0eda3a5bd9d3ea98ed5fd663b8f6 Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Wed, 16 May 2018 15:47:55 -0700 Subject: [PATCH 48/61] remove option for mouse sensivtity --- .../resources/qml/hifi/dialogs/GeneralPreferencesDialog.qml | 2 +- .../resources/qml/hifi/tablet/TabletGeneralPreferences.qml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/interface/resources/qml/hifi/dialogs/GeneralPreferencesDialog.qml b/interface/resources/qml/hifi/dialogs/GeneralPreferencesDialog.qml index b6441573d8..cb4913f999 100644 --- a/interface/resources/qml/hifi/dialogs/GeneralPreferencesDialog.qml +++ b/interface/resources/qml/hifi/dialogs/GeneralPreferencesDialog.qml @@ -17,7 +17,7 @@ PreferencesDialog { id: root objectName: "GeneralPreferencesDialog" title: "General Settings" - showCategories: ["User Interface", "HMD", "Snapshots", "Privacy", "Mouse Sensivity"] + showCategories: ["User Interface", "HMD", "Snapshots", "Privacy"] property var settings: Settings { category: root.objectName property alias x: root.x diff --git a/interface/resources/qml/hifi/tablet/TabletGeneralPreferences.qml b/interface/resources/qml/hifi/tablet/TabletGeneralPreferences.qml index f754bd4ea5..810f5bb43f 100644 --- a/interface/resources/qml/hifi/tablet/TabletGeneralPreferences.qml +++ b/interface/resources/qml/hifi/tablet/TabletGeneralPreferences.qml @@ -32,6 +32,6 @@ StackView { TabletPreferencesDialog { id: root objectName: "TabletGeneralPreferences" - showCategories: ["UI", "Snapshots", "Scripts", "Privacy", "Octree", "HMD", "Game Controller", "Sixense Controllers", "Perception Neuron", "Kinect", "Leap Motion", "Mouse Sensivity"] + showCategories: ["UI", "Snapshots", "Scripts", "Privacy", "Octree", "HMD", "Game Controller", "Sixense Controllers", "Perception Neuron", "Kinect", "Leap Motion"] } } From 95cd9476c3eea38d0957bd2bf45d68cbefc68e78 Mon Sep 17 00:00:00 2001 From: vladest Date: Thu, 17 May 2018 16:11:28 +0200 Subject: [PATCH 49/61] Fixed modality in Desktop --- interface/resources/qml/desktop/Desktop.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/resources/qml/desktop/Desktop.qml b/interface/resources/qml/desktop/Desktop.qml index a59b9d5ac0..a1b89e1529 100644 --- a/interface/resources/qml/desktop/Desktop.qml +++ b/interface/resources/qml/desktop/Desktop.qml @@ -149,7 +149,7 @@ FocusScope { } function isModalWindow(window) { - return true;//window.modality !== (typeof Qt !== 'undefined' ? Qt.NonModal : 0); + return window.modality !== (typeof Qt !== 'undefined' ? Qt.NonModal : 0); } function getTopLevelWindows(predicate) { From 201b8a51406381fe32221841aefd048dd908cc47 Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Thu, 17 May 2018 11:35:34 -0700 Subject: [PATCH 50/61] fixing the graphics preference --- interface/src/ui/PreferencesDialog.cpp | 61 ++++++++++++++++---------- 1 file changed, 37 insertions(+), 24 deletions(-) diff --git a/interface/src/ui/PreferencesDialog.cpp b/interface/src/ui/PreferencesDialog.cpp index a7aff4ebe3..ac4ee40ebe 100644 --- a/interface/src/ui/PreferencesDialog.cpp +++ b/interface/src/ui/PreferencesDialog.cpp @@ -15,7 +15,6 @@ #include #include #include -#include #include #include @@ -27,9 +26,6 @@ #include "SnapshotAnimated.h" #include "UserActivityLogger.h" -#include "controllers/impl/MappingBuilderProxy.h" -#include "controllers/impl/RouteBuilderProxy.h" - void setupPreferences() { auto preferences = DependencyManager::get(); auto nodeList = DependencyManager::get(); @@ -61,33 +57,50 @@ void setupPreferences() { // Graphics quality static const QString GRAPHICS_QUALITY { "Graphics Quality" }; { - auto getter = []()->float { return DependencyManager::get()->getOctreeSizeScale()/TREE_SCALE; }; - auto setter = [](float value) { DependencyManager::get()->setOctreeSizeScale(value*TREE_SCALE); }; + static const float MAX_DESKTOP_FPS = 60; + static const float MAX_HMD_FPS = 90; + static const float MIN_HMD_FPS = 35; + auto getter = []()->float { + auto lodManager = DependencyManager::get(); + float sliderValue = 0; + bool inHMD = qApp->isHMDMode(); + + if (inHMD) { + float hmdMinFPS = lodManager->getHMDLODDecreaseFPS(); + sliderValue = (MAX_HMD_FPS - hmdMinFPS) / MAX_HMD_FPS; + } else { + float desktopMinFPS = lodManager->getDesktopLODDecreaseFPS(); + sliderValue = (MAX_DESKTOP_FPS - desktopMinFPS) / MAX_DESKTOP_FPS; + } + return sliderValue; + }; + + auto setter = [](float value) { + static const float THRASHING_DIFFERENCE = 10; + auto lodManager = DependencyManager::get(); + if (qApp->isHMDMode()) { + float desiredHMDFPS = (MAX_HMD_FPS - (MAX_HMD_FPS * value)) - THRASHING_DIFFERENCE; + float actualHMDFPS = desiredHMDFPS > MIN_HMD_FPS ? desiredHMDFPS : MIN_HMD_FPS; + lodManager->setHMDLODDecreaseFPS(actualHMDFPS); + } else { + float desiredDesktopFPS = (MAX_DESKTOP_FPS - (MAX_DESKTOP_FPS * value)) - THRASHING_DIFFERENCE; + lodManager->setDesktopLODDecreaseFPS(desiredDesktopFPS); + } + }; + auto wodSlider = new SliderPreference(GRAPHICS_QUALITY, "World Detail", getter, setter); wodSlider->setMin(0); - wodSlider->setMax(2000); + wodSlider->setMax(1); + wodSlider->setStep(0.1); preferences->addPreference(wodSlider); auto getterShadow = []()->bool { - bool ret = false; - auto renderConfig = qApp->getRenderEngine()->getConfiguration(); - if (renderConfig) { - auto mainViewShadowTaskConfig = renderConfig->getConfig("RenderMainView.RenderShadowTask"); - if (mainViewShadowTaskConfig) { - ret = (mainViewShadowTaskConfig->getPreset() == QStringLiteral("Enabled")); - } - } - return ret; + auto menu = Menu::getInstance(); + return menu->isOptionChecked(MenuOption::Shadows); }; auto setterShadow = [](bool value) { - auto renderConfig = qApp->getRenderEngine()->getConfiguration(); - if (renderConfig) { - auto mainViewShadowTaskConfig = renderConfig->getConfig("RenderMainView.RenderShadowTask"); - if (mainViewShadowTaskConfig) { - mainViewShadowTaskConfig->setPreset(value ? QStringLiteral("Enabled") - : QStringLiteral("None")); - } - } + auto menu = Menu::getInstance(); + menu->setIsOptionChecked(MenuOption::Shadows, value); }; preferences->addPreference(new CheckPreference(GRAPHICS_QUALITY, "Show Shadows", getterShadow, setterShadow)); } From eb25601856a707d08e9a890c9e0dd345e21edee1 Mon Sep 17 00:00:00 2001 From: vladest Date: Thu, 17 May 2018 20:41:38 +0200 Subject: [PATCH 51/61] Return back LOD tools --- interface/src/Application.cpp | 13 +++ interface/src/Application.h | 2 + interface/src/LODManager.cpp | 5 +- interface/src/Menu.cpp | 4 + interface/src/Menu.h | 1 + interface/src/ui/DialogsManager.cpp | 11 +++ interface/src/ui/DialogsManager.h | 4 + interface/src/ui/HMDToolsDialog.cpp | 5 +- interface/src/ui/LodToolsDialog.cpp | 132 ++++++++++++++++++++++++++++ interface/src/ui/LodToolsDialog.h | 55 ++++++++++++ 10 files changed, 230 insertions(+), 2 deletions(-) create mode 100644 interface/src/ui/LodToolsDialog.cpp create mode 100644 interface/src/ui/LodToolsDialog.h diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index c9afdb3064..33735ab5f0 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -3705,6 +3705,8 @@ void Application::keyPressEvent(QKeyEvent* event) { Menu::getInstance()->triggerOption(MenuOption::Log); } else if (isMeta) { Menu::getInstance()->triggerOption(MenuOption::AddressBar); + } else if (isShifted) { + Menu::getInstance()->triggerOption(MenuOption::LodTools); } break; @@ -7527,6 +7529,17 @@ SharedSoundPointer Application::getSampleSound() const { return _sampleSound; } +void Application::loadLODToolsDialog() { + auto tabletScriptingInterface = DependencyManager::get(); + auto tablet = dynamic_cast(tabletScriptingInterface->getTablet(SYSTEM_TABLET)); + if (tablet->getToolbarMode() || (!tablet->getTabletRoot() && !isHMDMode())) { + auto dialogsManager = DependencyManager::get(); + dialogsManager->lodTools(); + } else { + tablet->pushOntoStack("hifi/dialogs/TabletLODTools.qml"); + } +} + void Application::loadEntityStatisticsDialog() { auto tabletScriptingInterface = DependencyManager::get(); auto tablet = dynamic_cast(tabletScriptingInterface->getTablet(SYSTEM_TABLET)); diff --git a/interface/src/Application.h b/interface/src/Application.h index 5a29dd23e8..17e28f0e6e 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -65,6 +65,7 @@ #include "scripting/DialogsManagerScriptingInterface.h" #include "ui/ApplicationOverlay.h" #include "ui/EntityScriptServerLogDialog.h" +#include "ui/LodToolsDialog.h" #include "ui/LogDialog.h" #include "ui/OctreeStatsDialog.h" #include "ui/OverlayConductor.h" @@ -402,6 +403,7 @@ public slots: void addAssetToWorldMessageClose(); + void loadLODToolsDialog(); void loadEntityStatisticsDialog(); void loadDomainConnectionDialog(); void showScriptLogs(); diff --git a/interface/src/LODManager.cpp b/interface/src/LODManager.cpp index 090bec89b1..da1f14c450 100644 --- a/interface/src/LODManager.cpp +++ b/interface/src/LODManager.cpp @@ -122,7 +122,10 @@ void LODManager::autoAdjustLOD(float realTimeDelta) { } if (oldOctreeSizeScale != _octreeSizeScale) { - //TODO: check Preferences dialog + auto lodToolsDialog = DependencyManager::get()->getLodToolsDialog(); + if (lodToolsDialog) { + lodToolsDialog->reloadSliders(); + } } } diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index 6bc93c2e5c..499ceae81c 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -479,6 +479,10 @@ Menu::Menu() { }); } + // Developer > Render > LOD Tools + addActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::LodTools, 0, + qApp, SLOT(loadLODToolsDialog())); + // HACK enable texture decimation { auto action = addCheckableActionToQMenuAndActionHash(renderOptionsMenu, "Decimate Textures"); diff --git a/interface/src/Menu.h b/interface/src/Menu.h index 526ca5f88f..4a957fcb69 100644 --- a/interface/src/Menu.h +++ b/interface/src/Menu.h @@ -121,6 +121,7 @@ namespace MenuOption { const QString ActionMotorControl = "Enable Default Motor Control"; const QString LoadScript = "Open and Run Script File..."; const QString LoadScriptURL = "Open and Run Script from URL..."; + const QString LodTools = "LOD Tools"; const QString Login = "Login/Sign Up"; const QString Log = "Log"; const QString LogExtraTimings = "Log Extra Timing Details"; diff --git a/interface/src/ui/DialogsManager.cpp b/interface/src/ui/DialogsManager.cpp index 05fc3e48ba..d01e7d6671 100644 --- a/interface/src/ui/DialogsManager.cpp +++ b/interface/src/ui/DialogsManager.cpp @@ -23,6 +23,7 @@ #include "ConnectionFailureDialog.h" #include "DomainConnectionDialog.h" #include "HMDToolsDialog.h" +#include "LodToolsDialog.h" #include "LoginDialog.h" #include "OctreeStatsDialog.h" #include "PreferencesDialog.h" @@ -125,6 +126,16 @@ void DialogsManager::octreeStatsDetails() { _octreeStatsDialog->raise(); } +void DialogsManager::lodTools() { + if (!_lodToolsDialog) { + maybeCreateDialog(_lodToolsDialog); + + connect(_lodToolsDialog, SIGNAL(closed()), _lodToolsDialog, SLOT(deleteLater())); + _lodToolsDialog->show(); + } + _lodToolsDialog->raise(); +} + void DialogsManager::hmdTools(bool showTools) { if (showTools) { if (!_hmdToolsDialog) { diff --git a/interface/src/ui/DialogsManager.h b/interface/src/ui/DialogsManager.h index c24f0fc4c0..f17ac39a7e 100644 --- a/interface/src/ui/DialogsManager.h +++ b/interface/src/ui/DialogsManager.h @@ -22,6 +22,7 @@ class AnimationsDialog; class AttachmentsDialog; class CachesSizeDialog; +class LodToolsDialog; class OctreeStatsDialog; class ScriptEditorWindow; class TestingDialog; @@ -34,6 +35,7 @@ class DialogsManager : public QObject, public Dependency { public: QPointer getHMDToolsDialog() const { return _hmdToolsDialog; } + QPointer getLodToolsDialog() const { return _lodToolsDialog; } QPointer getOctreeStatsDialog() const { return _octreeStatsDialog; } QPointer getTestingDialog() const { return _testingDialog; } void emitAddressBarShown(bool visible) { emit addressBarShown(visible); } @@ -47,6 +49,7 @@ public slots: void toggleLoginDialog(); void showLoginDialog(); void octreeStatsDetails(); + void lodTools(); void hmdTools(bool showTools); void showDomainConnectionDialog(); void showTestingResults(); @@ -73,6 +76,7 @@ private: QPointer _cachesSizeDialog; QPointer _ircInfoBox; QPointer _hmdToolsDialog; + QPointer _lodToolsDialog; QPointer _octreeStatsDialog; QPointer _testingDialog; QPointer _domainConnectionDialog; diff --git a/interface/src/ui/HMDToolsDialog.cpp b/interface/src/ui/HMDToolsDialog.cpp index d3ff239553..fb49c4f4c4 100644 --- a/interface/src/ui/HMDToolsDialog.cpp +++ b/interface/src/ui/HMDToolsDialog.cpp @@ -83,7 +83,10 @@ HMDToolsDialog::HMDToolsDialog(QWidget* parent) : if (dialogsManager->getOctreeStatsDialog()) { watchWindow(dialogsManager->getOctreeStatsDialog()->windowHandle()); } - + if (dialogsManager->getLodToolsDialog()) { + watchWindow(dialogsManager->getLodToolsDialog()->windowHandle()); + } + connect(_switchModeButton, &QPushButton::clicked, [this]{ toggleHMDMode(); }); diff --git a/interface/src/ui/LodToolsDialog.cpp b/interface/src/ui/LodToolsDialog.cpp new file mode 100644 index 0000000000..e2f2d9e011 --- /dev/null +++ b/interface/src/ui/LodToolsDialog.cpp @@ -0,0 +1,132 @@ +// +// LodToolsDialog.cpp +// interface/src/ui +// +// Created by Brad Hefta-Gaub on 7/19/13. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// + +#include "LodToolsDialog.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "Menu.h" + + +LodToolsDialog::LodToolsDialog(QWidget* parent) : + QDialog(parent, Qt::Window | Qt::WindowCloseButtonHint | Qt::WindowStaysOnTopHint) +{ + this->setWindowTitle("LOD Tools"); + auto lodManager = DependencyManager::get(); + + // Create layouter + QFormLayout* form = new QFormLayout(this); + + // Create a label with feedback... + _feedback = new QLabel(this); + QPalette palette = _feedback->palette(); + const unsigned redish = 0xfff00000; + palette.setColor(QPalette::WindowText, QColor::fromRgb(redish)); + _feedback->setPalette(palette); + _feedback->setText(lodManager->getLODFeedbackText()); + const int FEEDBACK_WIDTH = 350; + _feedback->setFixedWidth(FEEDBACK_WIDTH); + form->addRow("You can see... ", _feedback); + + form->addRow("Manually Adjust Level of Detail:", _manualLODAdjust = new QCheckBox(this)); + _manualLODAdjust->setChecked(!lodManager->getAutomaticLODAdjust()); + connect(_manualLODAdjust, SIGNAL(toggled(bool)), SLOT(updateAutomaticLODAdjust())); + + _lodSize = new QSlider(Qt::Horizontal, this); + const int MAX_LOD_SIZE = 2000; // ~20:4 vision -- really good. + const int MIN_LOD_SIZE = 5; // ~20:1600 vision -- really bad! + const int STEP_LOD_SIZE = 1; + const int PAGE_STEP_LOD_SIZE = 100; + const int SLIDER_WIDTH = 300; + _lodSize->setMaximum(MAX_LOD_SIZE); + _lodSize->setMinimum(MIN_LOD_SIZE); + _lodSize->setSingleStep(STEP_LOD_SIZE); + _lodSize->setTickInterval(PAGE_STEP_LOD_SIZE); + _lodSize->setTickPosition(QSlider::TicksBelow); + _lodSize->setFixedWidth(SLIDER_WIDTH); + _lodSize->setPageStep(PAGE_STEP_LOD_SIZE); + int sliderValue = lodManager->getOctreeSizeScale() / TREE_SCALE; + _lodSize->setValue(sliderValue); + form->addRow("Level of Detail:", _lodSize); + connect(_lodSize,SIGNAL(valueChanged(int)),this,SLOT(sizeScaleValueChanged(int))); + + // Add a button to reset + QPushButton* resetButton = new QPushButton("Reset", this); + form->addRow("", resetButton); + connect(resetButton, SIGNAL(clicked(bool)), this, SLOT(resetClicked(bool))); + + this->QDialog::setLayout(form); + + updateAutomaticLODAdjust(); +} + +void LodToolsDialog::reloadSliders() { + auto lodManager = DependencyManager::get(); + _lodSize->setValue(lodManager->getOctreeSizeScale() / TREE_SCALE); + _feedback->setText(lodManager->getLODFeedbackText()); +} + +void LodToolsDialog::updateAutomaticLODAdjust() { + auto lodManager = DependencyManager::get(); + lodManager->setAutomaticLODAdjust(!_manualLODAdjust->isChecked()); + _lodSize->setEnabled(_manualLODAdjust->isChecked()); +} + +void LodToolsDialog::sizeScaleValueChanged(int value) { + auto lodManager = DependencyManager::get(); + float realValue = value * TREE_SCALE; + lodManager->setOctreeSizeScale(realValue); + + _feedback->setText(lodManager->getLODFeedbackText()); +} + +void LodToolsDialog::resetClicked(bool checked) { + + int sliderValue = DEFAULT_OCTREE_SIZE_SCALE / TREE_SCALE; + _lodSize->setValue(sliderValue); + _manualLODAdjust->setChecked(false); + + updateAutomaticLODAdjust(); // tell our LOD manager about the reset +} + +void LodToolsDialog::reject() { + // Just regularly close upon ESC + this->QDialog::close(); +} + +void LodToolsDialog::closeEvent(QCloseEvent* event) { + this->QDialog::closeEvent(event); + emit closed(); + +#if RESET_TO_AUTOMATIC_WHEN_YOU_CLOSE_THE_DIALOG_BOX + auto lodManager = DependencyManager::get(); + + // always revert back to automatic LOD adjustment when closed + lodManager->setAutomaticLODAdjust(true); + + // if the user adjusted the LOD above "normal" then always revert back to default + if (lodManager->getOctreeSizeScale() > DEFAULT_OCTREE_SIZE_SCALE) { + lodManager->setOctreeSizeScale(DEFAULT_OCTREE_SIZE_SCALE); + } +#endif +} + diff --git a/interface/src/ui/LodToolsDialog.h b/interface/src/ui/LodToolsDialog.h new file mode 100644 index 0000000000..3ae59661dc --- /dev/null +++ b/interface/src/ui/LodToolsDialog.h @@ -0,0 +1,55 @@ +// +// LodToolsDialog.h +// interface/src/ui +// +// Created by Brad Hefta-Gaub on 7/19/13. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// + +#ifndef hifi_LodToolsDialog_h +#define hifi_LodToolsDialog_h + +#include + +class QCheckBox; +class QDoubleSpinBox; +class QLabel; +class QSlider; + +class LodToolsDialog : public QDialog { + Q_OBJECT +public: + // Sets up the UI + LodToolsDialog(QWidget* parent); + +signals: + void closed(); + +public slots: + void reject() override; + void sizeScaleValueChanged(int value); + void resetClicked(bool checked); + void reloadSliders(); + void updateAutomaticLODAdjust(); + +protected: + + // Emits a 'closed' signal when this dialog is closed. + void closeEvent(QCloseEvent* event) override; + +private: + QSlider* _lodSize; + + QCheckBox* _manualLODAdjust; + + QDoubleSpinBox* _desktopLODDecreaseFPS; + + QDoubleSpinBox* _hmdLODDecreaseFPS; + + QLabel* _feedback; +}; + +#endif // hifi_LodToolsDialog_h \ No newline at end of file From e760912fd2f8e1d3ff1b1a4fb4b4cbcfa9233a34 Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Thu, 17 May 2018 13:33:19 -0700 Subject: [PATCH 52/61] fix warning --- interface/src/ui/PreferencesDialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/src/ui/PreferencesDialog.cpp b/interface/src/ui/PreferencesDialog.cpp index ac4ee40ebe..4083c7036f 100644 --- a/interface/src/ui/PreferencesDialog.cpp +++ b/interface/src/ui/PreferencesDialog.cpp @@ -91,7 +91,7 @@ void setupPreferences() { auto wodSlider = new SliderPreference(GRAPHICS_QUALITY, "World Detail", getter, setter); wodSlider->setMin(0); wodSlider->setMax(1); - wodSlider->setStep(0.1); + wodSlider->setStep(0.1f); preferences->addPreference(wodSlider); auto getterShadow = []()->bool { From ea771c232576982e5fdb364a758d2ba90b9608db Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Fri, 18 May 2018 09:21:41 -0700 Subject: [PATCH 53/61] make final changes --- interface/src/CrashHandler.cpp | 2 ++ interface/src/Menu.cpp | 32 -------------------------------- interface/src/Menu.h | 2 +- 3 files changed, 3 insertions(+), 33 deletions(-) diff --git a/interface/src/CrashHandler.cpp b/interface/src/CrashHandler.cpp index f7d71de3fe..d3079b9bf4 100644 --- a/interface/src/CrashHandler.cpp +++ b/interface/src/CrashHandler.cpp @@ -35,6 +35,8 @@ bool CrashHandler::checkForResetSettings(bool wasLikelyCrash, bool suppressPromp QSettings settings; settings.beginGroup("Developer"); QVariant displayCrashOptions = settings.value(MenuOption::DisplayCrashOptions); + settings.endGroup(); + settings.beginGroup("Settings"); QVariant askToResetSettingsOption = settings.value(MenuOption::AskToResetSettings); settings.endGroup(); bool askToResetSettings = askToResetSettingsOption.isValid() && askToResetSettingsOption.toBool(); diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index 499ceae81c..2fed4fc5cd 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -307,35 +307,6 @@ Menu::Menu() { QString("hifi/tablet/TabletAvatarPreferences.qml"), "AvatarPreferencesDialog"); }); - // Settings > Notifications - MenuWrapper * notificationsMenu = settingsMenu->addMenu("Notifications"); //This was in notifications.js. The menu needs to be moved here. - - //TODO: Hookup notification actions below. - // Settings > Notifications > Play Notification Sounds - SettingsScriptingInterface* settings = SettingsScriptingInterface::getInstance(); - action = addCheckableActionToQMenuAndActionHash(notificationsMenu, "Play Notification Sounds", 0, - settings->getValue(MenuOption::NotificationSounds).toBool()); - connect(action, &QAction::triggered, [action, settings] { - settings->setValue(MenuOption::NotificationSounds, action->isChecked()); - }); - notificationsMenu->addSeparator(); - - // Settings > Notifications > Play Sounds for: - addDisabledActionAndSeparator(notificationsMenu, "Show notifications for:"); - - // Settings > Notifications > Snapshot - action = addCheckableActionToQMenuAndActionHash(notificationsMenu, "Snapshot", 0, - settings->getValue(MenuOption::NotificationSoundsSnapshot).toBool()); - connect(action, &QAction::triggered, [action, settings] { - settings->setValue(MenuOption::NotificationSoundsSnapshot, action->isChecked()); - }); - // Settings > Notifications > Tablet - action = addCheckableActionToQMenuAndActionHash(notificationsMenu, "Tablet", 0, - settings->getValue(MenuOption::NotificationSoundsTablet).toBool()); - connect(action, &QAction::triggered, [action, settings] { - settings->setValue(MenuOption::NotificationSoundsTablet, action->isChecked()); - }); - // Settings > Developer Menu addCheckableActionToQMenuAndActionHash(settingsMenu, "Developer Menu", 0, false, this, SLOT(toggleDeveloperMenus())); @@ -722,9 +693,6 @@ Menu::Menu() { addCheckableActionToQMenuAndActionHash(physicsOptionsMenu, MenuOption::PhysicsShowBulletConstraints, 0, false, qApp, SLOT(setShowBulletConstraints(bool))); addCheckableActionToQMenuAndActionHash(physicsOptionsMenu, MenuOption::PhysicsShowBulletConstraintLimits, 0, false, qApp, SLOT(setShowBulletConstraintLimits(bool))); - // Developer > Ask to Reset Settings - addCheckableActionToQMenuAndActionHash(developerMenu, MenuOption::AskToResetSettings, 0, false); - // Developer > Display Crash Options addCheckableActionToQMenuAndActionHash(developerMenu, MenuOption::DisplayCrashOptions, 0, true); // Developer > Crash >>> diff --git a/interface/src/Menu.h b/interface/src/Menu.h index 4a957fcb69..9be24aa1d9 100644 --- a/interface/src/Menu.h +++ b/interface/src/Menu.h @@ -137,7 +137,7 @@ namespace MenuOption { const QString OnlyDisplayTopTen = "Only Display Top Ten"; const QString OpenVrThreadedSubmit = "OpenVR Threaded Submit"; const QString OutputMenu = "Display"; - const QString Overlays = "Overlays"; + const QString Overlays = "Show Overlays"; const QString PackageModel = "Package Model as .fst..."; const QString Pair = "Pair"; const QString PhysicsShowHulls = "Draw Collision Shapes"; From 6eb5a78611f91f4cff73720147077c9e6644350b Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Fri, 18 May 2018 10:33:03 -0700 Subject: [PATCH 54/61] fixing code that breaks andriod build --- interface/src/ui/PreferencesDialog.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/interface/src/ui/PreferencesDialog.cpp b/interface/src/ui/PreferencesDialog.cpp index 4083c7036f..a4e7e49026 100644 --- a/interface/src/ui/PreferencesDialog.cpp +++ b/interface/src/ui/PreferencesDialog.cpp @@ -14,7 +14,6 @@ #include #include #include -#include #include #include From 60dd7e49ab77055d255d8be2c0dc5a58737b3f9f Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Fri, 18 May 2018 16:41:39 -0700 Subject: [PATCH 55/61] making requested changes --- .../resources/qml/controls-uit/Slider.qml | 1 + .../dialogs/preferences/SliderPreference.qml | 1 + .../qml/hifi/tablet/ControllerSettings.qml | 5 +- .../hifi/tablet/TabletGeneralPreferences.qml | 2 +- .../resources/qml/hifi/toolbars/Toolbar.qml | 2 - interface/src/ui/PreferencesDialog.cpp | 48 ++++++++++++------- scripts/system/menu.js | 42 +++++++++++++--- 7 files changed, 75 insertions(+), 26 deletions(-) diff --git a/interface/resources/qml/controls-uit/Slider.qml b/interface/resources/qml/controls-uit/Slider.qml index 5ddd97f3f6..2a5d4c137d 100644 --- a/interface/resources/qml/controls-uit/Slider.qml +++ b/interface/resources/qml/controls-uit/Slider.qml @@ -24,6 +24,7 @@ Slider { property alias minimumValue: slider.from property alias maximumValue: slider.to + property alias step: slider.stepSize property bool tickmarksEnabled: false height: hifi.fontSizes.textFieldInput + 14 // Match height of TextField control. diff --git a/interface/resources/qml/dialogs/preferences/SliderPreference.qml b/interface/resources/qml/dialogs/preferences/SliderPreference.qml index 79c7149f3e..2bdda09fc3 100644 --- a/interface/resources/qml/dialogs/preferences/SliderPreference.qml +++ b/interface/resources/qml/dialogs/preferences/SliderPreference.qml @@ -55,6 +55,7 @@ Preference { value: preference.value minimumValue: preference.min maximumValue: preference.max + step: preference.step width: 130 anchors { right: parent.right diff --git a/interface/resources/qml/hifi/tablet/ControllerSettings.qml b/interface/resources/qml/hifi/tablet/ControllerSettings.qml index 5cad32cf34..da8334f831 100644 --- a/interface/resources/qml/hifi/tablet/ControllerSettings.qml +++ b/interface/resources/qml/hifi/tablet/ControllerSettings.qml @@ -29,7 +29,10 @@ Item { TabBar { id: bar spacing: 0 + anchors.top: controllerSettings.top width: parent.width + height: 40 + z: 10 TabButton { height: parent.height @@ -284,7 +287,7 @@ Item { anchors.fill: stackView id: controllerPrefereneces objectName: "TabletControllerPreferences" - showCategories: ["VR Movement"] + showCategories: ["VR Movement", "Game Controller", "Sixense Controllers", "Perception Neuron", "Leap Motion"] } } } diff --git a/interface/resources/qml/hifi/tablet/TabletGeneralPreferences.qml b/interface/resources/qml/hifi/tablet/TabletGeneralPreferences.qml index 810f5bb43f..63801019b9 100644 --- a/interface/resources/qml/hifi/tablet/TabletGeneralPreferences.qml +++ b/interface/resources/qml/hifi/tablet/TabletGeneralPreferences.qml @@ -32,6 +32,6 @@ StackView { TabletPreferencesDialog { id: root objectName: "TabletGeneralPreferences" - showCategories: ["UI", "Snapshots", "Scripts", "Privacy", "Octree", "HMD", "Game Controller", "Sixense Controllers", "Perception Neuron", "Kinect", "Leap Motion"] + showCategories: ["User Interface", "HMD", "Snapshots", "Privacy"] } } diff --git a/interface/resources/qml/hifi/toolbars/Toolbar.qml b/interface/resources/qml/hifi/toolbars/Toolbar.qml index b31a61e066..b32d9c7428 100644 --- a/interface/resources/qml/hifi/toolbars/Toolbar.qml +++ b/interface/resources/qml/hifi/toolbars/Toolbar.qml @@ -50,8 +50,6 @@ Window { property var proxy: modelData; onClicked: proxy.clicked() Component.onCompleted: updateProperties() - //menu button should be visible only in VR mode - visible: text !== "MENU" Connections { target: proxy; diff --git a/interface/src/ui/PreferencesDialog.cpp b/interface/src/ui/PreferencesDialog.cpp index a4e7e49026..d79ac1c644 100644 --- a/interface/src/ui/PreferencesDialog.cpp +++ b/interface/src/ui/PreferencesDialog.cpp @@ -58,39 +58,55 @@ void setupPreferences() { { static const float MAX_DESKTOP_FPS = 60; static const float MAX_HMD_FPS = 90; - static const float MIN_HMD_FPS = 35; + static const float LOW = 0.25f; + static const float MEDIUM = 0.5f; + static const float HIGH = 0.75f; auto getter = []()->float { auto lodManager = DependencyManager::get(); - float sliderValue = 0; bool inHMD = qApp->isHMDMode(); + float increaseFPS = 0; if (inHMD) { - float hmdMinFPS = lodManager->getHMDLODDecreaseFPS(); - sliderValue = (MAX_HMD_FPS - hmdMinFPS) / MAX_HMD_FPS; + increaseFPS = lodManager->getHMDLODDecreaseFPS(); } else { - float desktopMinFPS = lodManager->getDesktopLODDecreaseFPS(); - sliderValue = (MAX_DESKTOP_FPS - desktopMinFPS) / MAX_DESKTOP_FPS; + increaseFPS = lodManager->getDesktopLODDecreaseFPS(); } - return sliderValue; + float maxFPS = inHMD ? MAX_HMD_FPS : MAX_DESKTOP_FPS; + float percentage = increaseFPS / maxFPS; + + if (percentage >= HIGH) { + return HIGH; + } else if (percentage >= LOW) { + return MEDIUM; + } + return LOW; }; auto setter = [](float value) { static const float THRASHING_DIFFERENCE = 10; auto lodManager = DependencyManager::get(); - if (qApp->isHMDMode()) { - float desiredHMDFPS = (MAX_HMD_FPS - (MAX_HMD_FPS * value)) - THRASHING_DIFFERENCE; - float actualHMDFPS = desiredHMDFPS > MIN_HMD_FPS ? desiredHMDFPS : MIN_HMD_FPS; - lodManager->setHMDLODDecreaseFPS(actualHMDFPS); + + bool isMaxValue = value == HIGH; + bool isHMDMode = qApp->isHMDMode(); + + float maxFPS = isHMDMode ? MAX_HMD_FPS : MAX_DESKTOP_FPS; + float desiredFPS = maxFPS - THRASHING_DIFFERENCE; + + if (!isMaxValue) { + desiredFPS = (maxFPS * value) - THRASHING_DIFFERENCE; + } + + if (isHMDMode) { + lodManager->setHMDLODDecreaseFPS(desiredFPS); } else { - float desiredDesktopFPS = (MAX_DESKTOP_FPS - (MAX_DESKTOP_FPS * value)) - THRASHING_DIFFERENCE; - lodManager->setDesktopLODDecreaseFPS(desiredDesktopFPS); + lodManager->setDesktopLODDecreaseFPS(desiredFPS); } }; auto wodSlider = new SliderPreference(GRAPHICS_QUALITY, "World Detail", getter, setter); - wodSlider->setMin(0); - wodSlider->setMax(1); - wodSlider->setStep(0.1f); + wodSlider->setMin(0.25f); + wodSlider->setMax(0.75f); + wodSlider->setStep(0.25f); preferences->addPreference(wodSlider); auto getterShadow = []()->bool { diff --git a/scripts/system/menu.js b/scripts/system/menu.js index c27dae6780..d669d3d918 100644 --- a/scripts/system/menu.js +++ b/scripts/system/menu.js @@ -9,17 +9,29 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // +/* jslint bitwise: true */ + +/* global Script, HMD, Tablet, Entities */ + var HOME_BUTTON_TEXTURE = "http://hifi-content.s3.amazonaws.com/alan/dev/tablet-with-home-button.fbx/tablet-with-home-button.fbm/button-root.png"; // var HOME_BUTTON_TEXTURE = Script.resourcesPath() + "meshes/tablet-with-home-button.fbx/tablet-with-home-button.fbm/button-root.png"; (function() { - var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); - var button = tablet.addButton({ + var lastHMDStatus = false; + var buttonProperties = { icon: "icons/tablet-icons/menu-i.svg", activeIcon: "icons/tablet-icons/menu-a.svg", text: "MENU", sortOrder: 3 - }); + }; + var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); + var button = null; + + if (HMD.active) { + button = tablet.addButton(buttonProperties); + button.clicked.connect(onClicked); + lastHMDStatus = true; + } var onMenuScreen = false; @@ -35,19 +47,37 @@ var HOME_BUTTON_TEXTURE = "http://hifi-content.s3.amazonaws.com/alan/dev/tablet- } } + HMD.displayModeChanged.connect(function(isHMDMode) { + if (lastHMDStatus !== isHMDMode) { + if (isHMDMode) { + button = tablet.addButton(buttonProperties); + button.clicked.connect(onClicked); + } else if (button) { + button.clicked.disconnect(onClicked); + tablet.removeButton(button); + button = null; + } + lastHMDStatus = isHMDMode; + } + }); + function onScreenChanged(type, url) { onMenuScreen = type === "Menu"; - button.editProperties({isActive: onMenuScreen}); + if (button) { + button.editProperties({isActive: onMenuScreen}); + } } - button.clicked.connect(onClicked); tablet.screenChanged.connect(onScreenChanged); Script.scriptEnding.connect(function () { if (onMenuScreen) { tablet.gotoHomeScreen(); } - button.clicked.disconnect(onClicked); + + if (button) { + button.clicked.disconnect(onClicked); + } tablet.removeButton(button); tablet.screenChanged.disconnect(onScreenChanged); }); From 8a2b54c2b71734f0a9207cc57c6720d66f5aff58 Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Fri, 18 May 2018 17:09:41 -0700 Subject: [PATCH 56/61] fixing mistakes --- interface/src/ui/PreferencesDialog.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/interface/src/ui/PreferencesDialog.cpp b/interface/src/ui/PreferencesDialog.cpp index 54a1a87d0b..3d3c432e92 100644 --- a/interface/src/ui/PreferencesDialog.cpp +++ b/interface/src/ui/PreferencesDialog.cpp @@ -58,6 +58,7 @@ void setupPreferences() { { static const float MAX_DESKTOP_FPS = 60; static const float MAX_HMD_FPS = 90; + static const float MIN_FPS = 10; static const float LOW = 0.25f; static const float MEDIUM = 0.5f; static const float HIGH = 0.75f; @@ -75,25 +76,26 @@ void setupPreferences() { float percentage = increaseFPS / maxFPS; if (percentage >= HIGH) { - return HIGH; + return LOW; } else if (percentage >= LOW) { return MEDIUM; } - return LOW; + return HIGH; }; auto setter = [](float value) { static const float THRASHING_DIFFERENCE = 10; auto lodManager = DependencyManager::get(); - bool isMaxValue = value == HIGH; + bool isLowestValue = value == LOW; bool isHMDMode = qApp->isHMDMode(); float maxFPS = isHMDMode ? MAX_HMD_FPS : MAX_DESKTOP_FPS; float desiredFPS = maxFPS - THRASHING_DIFFERENCE; - if (!isMaxValue) { - desiredFPS = (maxFPS * value) - THRASHING_DIFFERENCE; + if (!isLowestValue) { + float calculatedFPS = (maxFPS - (maxFPS * value)) - THRASHING_DIFFERENCE; + desiredFPS = calculatedFPS < MIN_FPS ? MIN_FPS : calculatedFPS; } if (isHMDMode) { From f2807e38f97e6ce9f1d356b23ec1e9f0065a58ce Mon Sep 17 00:00:00 2001 From: druiz17 Date: Sat, 19 May 2018 17:36:46 -0700 Subject: [PATCH 57/61] fix goto shortcut --- interface/src/Application.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 6e70d4b9ae..1ae9dc6d26 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -3721,7 +3721,8 @@ void Application::keyPressEvent(QKeyEvent* event) { if (isShifted && isMeta) { Menu::getInstance()->triggerOption(MenuOption::Log); } else if (isMeta) { - Menu::getInstance()->triggerOption(MenuOption::AddressBar); + auto dialogsManager = DependencyManager::get(); + dialogsManager->toggleAddressBar(); } else if (isShifted) { Menu::getInstance()->triggerOption(MenuOption::LodTools); } From bd3a9865bfa288703230d87129cc4c8aa03717a4 Mon Sep 17 00:00:00 2001 From: druiz17 Date: Sat, 19 May 2018 18:27:28 -0700 Subject: [PATCH 58/61] moving control speech to developer menu --- interface/src/Menu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index 51fb6443b4..3551a11a0b 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -757,7 +757,7 @@ Menu::Menu() { // Settings > Enable Speech Control API #if defined(Q_OS_MAC) || defined(Q_OS_WIN) auto speechRecognizer = DependencyManager::get(); - QAction* speechRecognizerAction = addCheckableActionToQMenuAndActionHash(settingsMenu, MenuOption::ControlWithSpeech, + QAction* speechRecognizerAction = addCheckableActionToQMenuAndActionHash(developerMenu, MenuOption::ControlWithSpeech, Qt::CTRL | Qt::SHIFT | Qt::Key_C, speechRecognizer->getEnabled(), speechRecognizer.data(), From 5fb08d0d9c8bab16cad63cf5ea2aea5e4ef6d2f2 Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Mon, 21 May 2018 14:21:21 -0700 Subject: [PATCH 59/61] fix speech api not showing up --- interface/src/Menu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index 3551a11a0b..f55c389a1f 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -762,7 +762,7 @@ Menu::Menu() { speechRecognizer->getEnabled(), speechRecognizer.data(), SLOT(setEnabled(bool)), - UNSPECIFIED_POSITION, "Advanced"); + UNSPECIFIED_POSITION); connect(speechRecognizer.data(), SIGNAL(enabledUpdated(bool)), speechRecognizerAction, SLOT(setChecked(bool))); #endif From 9df79462add9c319773150f5bcd02a5375d3962f Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Tue, 22 May 2018 09:06:10 -0700 Subject: [PATCH 60/61] fix snapshot --- scripts/system/snapshot.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/system/snapshot.js b/scripts/system/snapshot.js index 5690c91c76..29089e6597 100644 --- a/scripts/system/snapshot.js +++ b/scripts/system/snapshot.js @@ -450,7 +450,7 @@ function takeSnapshot() { maybeDeleteSnapshotStories(); // update button states - resetOverlays = Menu.isOptionChecked("Overlays"); // For completeness. Certainly true if the button is visible to be clicked. + resetOverlays = Menu.isOptionChecked("Show Overlays"); // For completeness. Certainly true if the button is visible to be clicked. reticleVisible = Reticle.visible; Reticle.visible = false; if (!HMD.active) { @@ -470,7 +470,7 @@ function takeSnapshot() { // hide overlays if they are on if (resetOverlays) { - Menu.setIsOptionChecked("Overlays", false); + Menu.setIsOptionChecked("Show Overlays", false); } var snapActivateSound = SoundCache.getSound(Script.resourcesPath() + "sounds/snapshot/snap.wav"); @@ -527,7 +527,7 @@ function stillSnapshotTaken(pathStillSnapshot, notify) { Reticle.allowMouseCapture = true; // show overlays if they were on if (resetOverlays) { - Menu.setIsOptionChecked("Overlays", true); + Menu.setIsOptionChecked("Show Overlays", true); } Window.stillSnapshotTaken.disconnect(stillSnapshotTaken); if (!buttonConnected) { @@ -583,7 +583,7 @@ function processingGifStarted(pathStillSnapshot) { Reticle.allowMouseCapture = true; // show overlays if they were on if (resetOverlays) { - Menu.setIsOptionChecked("Overlays", true); + Menu.setIsOptionChecked("Show Overlays", true); } Settings.setValue("previousStillSnapPath", pathStillSnapshot); From c4f39841f594dde1e1e64fa77a540dbd0551cfc6 Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Tue, 22 May 2018 10:46:20 -0700 Subject: [PATCH 61/61] fix another menu name changes that broke snapshot --- scripts/system/libraries/accountUtils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/system/libraries/accountUtils.js b/scripts/system/libraries/accountUtils.js index 69092b30fc..9f0d690a5f 100644 --- a/scripts/system/libraries/accountUtils.js +++ b/scripts/system/libraries/accountUtils.js @@ -8,7 +8,7 @@ openLoginWindow = function openLoginWindow() { if ((HMD.active && Settings.getValue("hmdTabletBecomesToolbar", false)) || (!HMD.active && Settings.getValue("desktopTabletBecomesToolbar", true))) { - Menu.triggerOption("Login / Sign Up"); + Menu.triggerOption("Login/Sign Up"); } else { tablet.loadQMLOnTop("dialogs/TabletLoginDialog.qml"); HMD.openTablet();