Showing the changes to interface/src/Menu.cpp (1 of 330 files). Show all
Unified · Split
| @@ -19,6 +19,7 @@ · 18 unmodified lines | |||
| 19 | #include <AudioClient.h> | 19 | #include <AudioClient.h> |
| 20 | #include <CrashHelpers.h> | 20 | #include <CrashHelpers.h> |
| 21 | #include <DependencyManager.h> | 21 | #include <DependencyManager.h> |
| 22 | #include <ui/TabletScriptingInterface.h> | ||
| 22 | #include <display-plugins/DisplayPlugin.h> | 23 | #include <display-plugins/DisplayPlugin.h> |
| 23 | #include <PathUtils.h> | 24 | #include <PathUtils.h> |
| 24 | #include <SettingHandle.h> | 25 | #include <SettingHandle.h> |
| @@ -37,6 +38,7 @@ · 12 unmodified lines | |||
| 37 | #include "MainWindow.h" | 38 | #include "MainWindow.h" |
| 38 | #include "render/DrawStatus.h" | 39 | #include "render/DrawStatus.h" |
| 39 | #include "scripting/MenuScriptingInterface.h" | 40 | #include "scripting/MenuScriptingInterface.h" |
| 41 | #include "scripting/HMDScriptingInterface.h" | ||
| 40 | #include "ui/DialogsManager.h" | 42 | #include "ui/DialogsManager.h" |
| 41 | #include "ui/StandAloneJSConsole.h" | 43 | #include "ui/StandAloneJSConsole.h" |
| 42 | #include "InterfaceLogging.h" | 44 | #include "InterfaceLogging.h" |
| @@ -119,9 +121,14 @@ Menu::Menu() { · 76 unmodified lines | |||
| 119 | QAction::NoRole, UNSPECIFIED_POSITION, "Advanced"); | 121 | QAction::NoRole, UNSPECIFIED_POSITION, "Advanced"); |
| 120 | 122 | ||
| 121 | // Edit > Reload All Scripts... [advanced] | 123 | // Edit > Reload All Scripts... [advanced] |
| 122 | addActionToQMenuAndActionHash(editMenu, MenuOption::ReloadAllScripts, Qt::CTRL | Qt::Key_R, | 124 | action = addActionToQMenuAndActionHash(editMenu, MenuOption::ReloadAllScripts, Qt::CTRL | Qt::Key_R, |
| 123 | scriptEngines.data(), SLOT(reloadAllScripts()), | 125 | nullptr, nullptr, |
| 124 | QAction::NoRole, UNSPECIFIED_POSITION, "Advanced"); | 126 | QAction::NoRole, UNSPECIFIED_POSITION, "Advanced"); |
| 127 | connect(action, &QAction::triggered, [] { | ||
| 128 | DependencyManager::get<ScriptEngines>()->reloadAllScripts(); | ||
| 129 | DependencyManager::get<OffscreenUi>()->clearCache(); | ||
| 130 | }); | ||
| 131 | |||
| 125 | 132 | ||
| 126 | // Edit > Console... [advanced] | 133 | // Edit > Console... [advanced] |
| 127 | addActionToQMenuAndActionHash(editMenu, MenuOption::Console, Qt::CTRL | Qt::ALT | Qt::Key_J, | 134 | addActionToQMenuAndActionHash(editMenu, MenuOption::Console, Qt::CTRL | Qt::ALT | Qt::Key_J, |
| @@ -190,6 +197,9 @@ Menu::Menu() { · 62 unmodified lines | |||
| 190 | addCheckableActionToQMenuAndActionHash(avatarMenu, MenuOption::EnableAvatarCollisions, 0, true, | 197 | addCheckableActionToQMenuAndActionHash(avatarMenu, MenuOption::EnableAvatarCollisions, 0, true, |
| 191 | avatar.get(), SLOT(updateMotionBehaviorFromMenu())); | 198 | avatar.get(), SLOT(updateMotionBehaviorFromMenu())); |
| 192 | 199 | ||
| 200 | addCheckableActionToQMenuAndActionHash(avatarMenu, MenuOption::EnableFlying, 0, true, | ||
| 201 | avatar.get(), SLOT(setFlyingEnabled(bool))); | ||
| 202 | |||
| 193 | // Avatar > AvatarBookmarks related menus -- Note: the AvatarBookmarks class adds its own submenus here. | 203 | // Avatar > AvatarBookmarks related menus -- Note: the AvatarBookmarks class adds its own submenus here. |
| 194 | auto avatarBookmarks = DependencyManager::get<AvatarBookmarks>(); | 204 | auto avatarBookmarks = DependencyManager::get<AvatarBookmarks>(); |
| 195 | avatarBookmarks->setupMenus(this, avatarMenu); | 205 | avatarBookmarks->setupMenus(this, avatarMenu); |
| @@ -298,7 +308,7 @@ Menu::Menu() { · 102 unmodified lines | |||
| 298 | // Settings > Avatar... | 308 | // Settings > Avatar... |
| 299 | action = addActionToQMenuAndActionHash(settingsMenu, "Avatar..."); | 309 | action = addActionToQMenuAndActionHash(settingsMenu, "Avatar..."); |
| 300 | connect(action, &QAction::triggered, [] { | 310 | connect(action, &QAction::triggered, [] { |
| 301 | qApp->showDialog(QString("hifi/dialogs/AvatarPreferencesDialog.qml"), | 311 | qApp->showDialog(QString("hifi/dialogs/AvatarPreferencesDialog.qml"), |
| 302 | QString("../../hifi/tablet/TabletAvatarPreferences.qml"), "AvatarPreferencesDialog"); | 312 | QString("../../hifi/tablet/TabletAvatarPreferences.qml"), "AvatarPreferencesDialog"); |
| 303 | }); | 313 | }); |
| 304 | 314 | ||
| @@ -309,6 +319,17 @@ Menu::Menu() { · 4 unmodified lines | |||
| 309 | QString("../../hifi/tablet/TabletLodPreferences.qml"), "LodPreferencesDialog"); | 319 | QString("../../hifi/tablet/TabletLodPreferences.qml"), "LodPreferencesDialog"); |
| 310 | }); | 320 | }); |
| 311 | 321 | ||
| 322 | action = addActionToQMenuAndActionHash(settingsMenu, "Controller Settings"); | ||
| 323 | connect(action, &QAction::triggered, [] { | ||
| 324 | auto tablet = DependencyManager::get<TabletScriptingInterface>()->getTablet("com.highfidelity.interface.tablet.system"); | ||
| 325 | auto hmd = DependencyManager::get<HMDScriptingInterface>(); | ||
| 326 | tablet->loadQMLSource("ControllerSettings.qml"); | ||
| 327 | |||
| 328 | if (!hmd->getShouldShowTablet()) { | ||
| 329 | hmd->toggleShouldShowTablet(); | ||
| 330 | } | ||
| 331 | }); | ||
| 332 | |||
| 312 | // Settings > Control with Speech [advanced] | 333 | // Settings > Control with Speech [advanced] |
| 313 | #if defined(Q_OS_MAC) || defined(Q_OS_WIN) | 334 | #if defined(Q_OS_MAC) || defined(Q_OS_WIN) |
| 314 | auto speechRecognizer = DependencyManager::get<SpeechRecognizer>(); | 335 | auto speechRecognizer = DependencyManager::get<SpeechRecognizer>(); |
| @@ -618,7 +639,7 @@ Menu::Menu() { · 303 unmodified lines | |||
| 618 | action = addActionToQMenuAndActionHash(audioDebugMenu, "Stats..."); | 639 | action = addActionToQMenuAndActionHash(audioDebugMenu, "Stats..."); |
| 619 | connect(action, &QAction::triggered, [] { | 640 | connect(action, &QAction::triggered, [] { |
| 620 | auto scriptEngines = DependencyManager::get<ScriptEngines>(); | 641 | auto scriptEngines = DependencyManager::get<ScriptEngines>(); |
| 621 | QUrl defaultScriptsLoc = defaultScriptsLocation(); | 642 | QUrl defaultScriptsLoc = PathUtils::defaultScriptsLocation(); |
| 622 | defaultScriptsLoc.setPath(defaultScriptsLoc.path() + "developer/utilities/audio/stats.js"); | 643 | defaultScriptsLoc.setPath(defaultScriptsLoc.path() + "developer/utilities/audio/stats.js"); |
| 623 | scriptEngines->loadScript(defaultScriptsLoc.toString()); | 644 | scriptEngines->loadScript(defaultScriptsLoc.toString()); |
| 624 | }); | 645 | }); |