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