History

Merge remote-tracking branch 'upstream/master' into fb18302-deprecated-package-model

humbletim committed 7 years ago

Commit 21030fb2 parents 2cf633c ef3acae1046 files · +28471 −18165Browse files

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

Unified · Split

interface/src/Menu.cpp+88−51
@@ -226,6 +226,14 @@ Menu::Menu() { · 225 unmodified lines
226 addActionToQMenuAndActionHash(navigateMenu, MenuOption::CopyPath, 0,226 addActionToQMenuAndActionHash(navigateMenu, MenuOption::CopyPath, 0,
227 addressManager.data(), SLOT(copyPath()));227 addressManager.data(), SLOT(copyPath()));
228 228
229 // Navigate > Start-up Location
230 MenuWrapper* startupLocationMenu = navigateMenu->addMenu(MenuOption::StartUpLocation);
231 QActionGroup* startupLocatiopnGroup = new QActionGroup(startupLocationMenu);
232 startupLocatiopnGroup->setExclusive(true);
233 startupLocatiopnGroup->addAction(addCheckableActionToQMenuAndActionHash(startupLocationMenu, MenuOption::HomeLocation, 0,
234 false));
235 startupLocatiopnGroup->addAction(addCheckableActionToQMenuAndActionHash(startupLocationMenu, MenuOption::LastLocation, 0,
236 true));
229 237
230 // Settings menu ----------------------------------238 // Settings menu ----------------------------------
231 MenuWrapper* settingsMenu = addMenu("Settings");239 MenuWrapper* settingsMenu = addMenu("Settings");
@@ -265,6 +273,18 @@ Menu::Menu() { · 33 unmodified lines
265 QString("hifi/tablet/TabletGraphicsPreferences.qml"), "GraphicsPreferencesDialog");273 QString("hifi/tablet/TabletGraphicsPreferences.qml"), "GraphicsPreferencesDialog");
266 });274 });
267 275
276 // Settings > Security...
277 action = addActionToQMenuAndActionHash(settingsMenu, "Security...");
278 connect(action, &QAction::triggered, [] {
279 auto tablet = DependencyManager::get<TabletScriptingInterface>()->getTablet("com.highfidelity.interface.tablet.system");
280 auto hmd = DependencyManager::get<HMDScriptingInterface>();
281 tablet->pushOntoStack("hifi/dialogs/security/Security.qml");
282
283 if (!hmd->getShouldShowTablet()) {
284 hmd->toggleShouldShowTablet();
285 }
286 });
287
268 // Settings > Developer Menu288 // Settings > Developer Menu
269 addCheckableActionToQMenuAndActionHash(settingsMenu, "Developer Menu", 0, false, this, SLOT(toggleDeveloperMenus()));289 addCheckableActionToQMenuAndActionHash(settingsMenu, "Developer Menu", 0, false, this, SLOT(toggleDeveloperMenus()));
270 290
@@ -273,21 +293,79 @@ Menu::Menu() { · 2 unmodified lines
273 293
274 // Developer menu ----------------------------------294 // Developer menu ----------------------------------
275 MenuWrapper* developerMenu = addMenu("Developer", "Developer");295 MenuWrapper* developerMenu = addMenu("Developer", "Developer");
296
297 // Developer > Scripting >>>
298 MenuWrapper* scriptingOptionsMenu = developerMenu->addMenu("Scripting");
299
300 // Developer > Scripting > Console...
301 addActionToQMenuAndActionHash(scriptingOptionsMenu, MenuOption::Console, Qt::CTRL | Qt::ALT | Qt::Key_J,
302 DependencyManager::get<StandAloneJSConsole>().data(),
303 SLOT(toggleConsole()),
304 QAction::NoRole,
305 UNSPECIFIED_POSITION);
276 306
307 // Developer > Scripting > API Debugger
308 action = addActionToQMenuAndActionHash(scriptingOptionsMenu, "API Debugger");
309 connect(action, &QAction::triggered, [] {
310 QUrl defaultScriptsLoc = PathUtils::defaultScriptsLocation();
311 defaultScriptsLoc.setPath(defaultScriptsLoc.path() + "developer/utilities/tools/currentAPI.js");
312 DependencyManager::get<ScriptEngines>()->loadScript(defaultScriptsLoc.toString());
313 });
314
315 // Developer > Scripting > Entity Script Server Log
316 auto essLogAction = addActionToQMenuAndActionHash(scriptingOptionsMenu, MenuOption::EntityScriptServerLog, 0,
317 qApp, SLOT(toggleEntityScriptServerLogDialog()));
318 {
319 auto nodeList = DependencyManager::get<NodeList>();
320 QObject::connect(nodeList.data(), &NodeList::canRezChanged, essLogAction, [essLogAction] {
321 auto nodeList = DependencyManager::get<NodeList>();
322 essLogAction->setEnabled(nodeList->getThisNodeCanRez());
323 });
324 essLogAction->setEnabled(nodeList->getThisNodeCanRez());
325 }
326
327 // Developer > Scripting > Script Log (HMD friendly)...
328 addActionToQMenuAndActionHash(scriptingOptionsMenu, "Script Log (HMD friendly)...", Qt::NoButton,
329 qApp, SLOT(showScriptLogs()));
330
331 // Developer > Scripting > Verbose Logging
332 addCheckableActionToQMenuAndActionHash(scriptingOptionsMenu, MenuOption::VerboseLogging, 0, false,
333 qApp, SLOT(updateVerboseLogging()));
334
335 // Developer > Scripting > Enable Speech Control API
336#if defined(Q_OS_MAC) || defined(Q_OS_WIN)
337 auto speechRecognizer = DependencyManager::get<SpeechRecognizer>();
338 QAction* speechRecognizerAction = addCheckableActionToQMenuAndActionHash(scriptingOptionsMenu, MenuOption::ControlWithSpeech,
339 Qt::CTRL | Qt::SHIFT | Qt::Key_C,
340 speechRecognizer->getEnabled(),
341 speechRecognizer.data(),
342 SLOT(setEnabled(bool)),
343 UNSPECIFIED_POSITION);
344 connect(speechRecognizer.data(), SIGNAL(enabledUpdated(bool)), speechRecognizerAction, SLOT(setChecked(bool)));
345#endif
346
277 // Developer > UI >>>347 // Developer > UI >>>
278 MenuWrapper* uiOptionsMenu = developerMenu->addMenu("UI");348 MenuWrapper* uiOptionsMenu = developerMenu->addMenu("UI");
279 action = addCheckableActionToQMenuAndActionHash(uiOptionsMenu, MenuOption::DesktopTabletToToolbar, 0,349 action = addCheckableActionToQMenuAndActionHash(uiOptionsMenu, MenuOption::DesktopTabletToToolbar, 0,
280 qApp->getDesktopTabletBecomesToolbarSetting());350 qApp->getDesktopTabletBecomesToolbarSetting());
351
352 // Developer > UI > Show Overlays
353 addCheckableActionToQMenuAndActionHash(uiOptionsMenu, MenuOption::Overlays, 0, true);
354
355 // Developer > UI > Desktop Tablet Becomes Toolbar
281 connect(action, &QAction::triggered, [action] {356 connect(action, &QAction::triggered, [action] {
282 qApp->setDesktopTabletBecomesToolbarSetting(action->isChecked());357 qApp->setDesktopTabletBecomesToolbarSetting(action->isChecked());
283 });358 });
284 359
360 // Developer > UI > HMD Tablet Becomes Toolbar
285 action = addCheckableActionToQMenuAndActionHash(uiOptionsMenu, MenuOption::HMDTabletToToolbar, 0,361 action = addCheckableActionToQMenuAndActionHash(uiOptionsMenu, MenuOption::HMDTabletToToolbar, 0,
286 qApp->getHmdTabletBecomesToolbarSetting());362 qApp->getHmdTabletBecomesToolbarSetting());
287 connect(action, &QAction::triggered, [action] {363 connect(action, &QAction::triggered, [action] {
288 qApp->setHmdTabletBecomesToolbarSetting(action->isChecked());364 qApp->setHmdTabletBecomesToolbarSetting(action->isChecked());
289 });365 });
290 366
367 addCheckableActionToQMenuAndActionHash(uiOptionsMenu, MenuOption::Use3DKeyboard, 0, true);
368
291 // Developer > Render >>>369 // Developer > Render >>>
292 MenuWrapper* renderOptionsMenu = developerMenu->addMenu("Render");370 MenuWrapper* renderOptionsMenu = developerMenu->addMenu("Render");
293 371
@@ -570,6 +648,8 @@ Menu::Menu() { · 276 unmodified lines
570 avatar.get(), SLOT(updateMotionBehaviorFromMenu()),648 avatar.get(), SLOT(updateMotionBehaviorFromMenu()),
571 UNSPECIFIED_POSITION, "Developer");649 UNSPECIFIED_POSITION, "Developer");
572 650
651 addCheckableActionToQMenuAndActionHash(avatarDebugMenu, MenuOption::ShowTrackedObjects, 0, false, qApp, SLOT(setShowTrackedObjects(bool)));
652
573 // Developer > Hands >>>653 // Developer > Hands >>>
574 MenuWrapper* handOptionsMenu = developerMenu->addMenu("Hands");654 MenuWrapper* handOptionsMenu = developerMenu->addMenu("Hands");
575 addCheckableActionToQMenuAndActionHash(handOptionsMenu, MenuOption::DisplayHandTargets, 0, false,655 addCheckableActionToQMenuAndActionHash(handOptionsMenu, MenuOption::DisplayHandTargets, 0, false,
@@ -684,10 +764,11 @@ Menu::Menu() { · 108 unmodified lines
684 addCheckableActionToQMenuAndActionHash(pickingOptionsMenu, MenuOption::ForceCoarsePicking, 0, false,764 addCheckableActionToQMenuAndActionHash(pickingOptionsMenu, MenuOption::ForceCoarsePicking, 0, false,
685 DependencyManager::get<PickManager>().data(), SLOT(setForceCoarsePicking(bool)));765 DependencyManager::get<PickManager>().data(), SLOT(setForceCoarsePicking(bool)));
686 766
687 // Developer > Display Crash Options
688 addCheckableActionToQMenuAndActionHash(developerMenu, MenuOption::DisplayCrashOptions, 0, true);
689 // Developer > Crash >>>767 // Developer > Crash >>>
690 MenuWrapper* crashMenu = developerMenu->addMenu("Crash");768 MenuWrapper* crashMenu = developerMenu->addMenu("Crash");
769
770 // Developer > Crash > Display Crash Options
771 addCheckableActionToQMenuAndActionHash(crashMenu, MenuOption::DisplayCrashOptions, 0, true);
691 772
692 addActionToQMenuAndActionHash(crashMenu, MenuOption::DeadlockInterface, 0, qApp, SLOT(deadlockApplication()));773 addActionToQMenuAndActionHash(crashMenu, MenuOption::DeadlockInterface, 0, qApp, SLOT(deadlockApplication()));
693 addActionToQMenuAndActionHash(crashMenu, MenuOption::UnresponsiveInterface, 0, qApp, SLOT(unresponsiveApplication()));774 addActionToQMenuAndActionHash(crashMenu, MenuOption::UnresponsiveInterface, 0, qApp, SLOT(unresponsiveApplication()));
@@ -722,59 +803,15 @@ Menu::Menu() { · 28 unmodified lines
722 action = addActionToQMenuAndActionHash(crashMenu, MenuOption::CrashNewFaultThreaded);803 action = addActionToQMenuAndActionHash(crashMenu, MenuOption::CrashNewFaultThreaded);
723 connect(action, &QAction::triggered, qApp, []() { std::thread(crash::newFault).join(); });804 connect(action, &QAction::triggered, qApp, []() { std::thread(crash::newFault).join(); });
724 805
725 // Developer > Stats806 // Developer > Show Statistics
726 addCheckableActionToQMenuAndActionHash(developerMenu, MenuOption::Stats);807 addCheckableActionToQMenuAndActionHash(developerMenu, MenuOption::Stats);
727 addCheckableActionToQMenuAndActionHash(developerMenu, MenuOption::AnimStats);
728 808
729 // Settings > Enable Speech Control API809 // Developer > Show Animation Statistics
730#if defined(Q_OS_MAC) || defined(Q_OS_WIN)810 addCheckableActionToQMenuAndActionHash(developerMenu, MenuOption::AnimStats);
731 auto speechRecognizer = DependencyManager::get<SpeechRecognizer>();
732 QAction* speechRecognizerAction = addCheckableActionToQMenuAndActionHash(developerMenu, MenuOption::ControlWithSpeech,
733 Qt::CTRL | Qt::SHIFT | Qt::Key_C,
734 speechRecognizer->getEnabled(),
735 speechRecognizer.data(),
736 SLOT(setEnabled(bool)),
737 UNSPECIFIED_POSITION);
738 connect(speechRecognizer.data(), SIGNAL(enabledUpdated(bool)), speechRecognizerAction, SLOT(setChecked(bool)));
739#endif
740
741 // console
742 addActionToQMenuAndActionHash(developerMenu, MenuOption::Console, Qt::CTRL | Qt::ALT | Qt::Key_J,
743 DependencyManager::get<StandAloneJSConsole>().data(),
744 SLOT(toggleConsole()),
745 QAction::NoRole,
746 UNSPECIFIED_POSITION);
747
748 // Developer > API Debugger
749 action = addActionToQMenuAndActionHash(developerMenu, "API Debugger");
750 connect(action, &QAction::triggered, [] {
751 QUrl defaultScriptsLoc = PathUtils::defaultScriptsLocation();
752 defaultScriptsLoc.setPath(defaultScriptsLoc.path() + "developer/utilities/tools/currentAPI.js");
753 DependencyManager::get<ScriptEngines>()->loadScript(defaultScriptsLoc.toString());
754 });
755 811
756 // Developer > Log...812 // Developer > Log
757 addActionToQMenuAndActionHash(developerMenu, MenuOption::Log, Qt::CTRL | Qt::SHIFT | Qt::Key_L,813 addActionToQMenuAndActionHash(developerMenu, MenuOption::Log, Qt::CTRL | Qt::SHIFT | Qt::Key_L,
758 qApp, SLOT(toggleLogDialog()));814 qApp, SLOT(toggleLogDialog()));
759 auto essLogAction = addActionToQMenuAndActionHash(developerMenu, MenuOption::EntityScriptServerLog, 0,
760 qApp, SLOT(toggleEntityScriptServerLogDialog()));
761 {
762 auto nodeList = DependencyManager::get<NodeList>();
763 QObject::connect(nodeList.data(), &NodeList::canRezChanged, essLogAction, [essLogAction] {
764 auto nodeList = DependencyManager::get<NodeList>();
765 essLogAction->setEnabled(nodeList->getThisNodeCanRez());
766 });
767 essLogAction->setEnabled(nodeList->getThisNodeCanRez());
768 }
769
770 addActionToQMenuAndActionHash(developerMenu, "Script Log (HMD friendly)...", Qt::NoButton,
771 qApp, SLOT(showScriptLogs()));
772
773 addCheckableActionToQMenuAndActionHash(developerMenu, MenuOption::VerboseLogging, 0, false,
774 qApp, SLOT(updateVerboseLogging()));
775
776 // Developer > Show Overlays
777 addCheckableActionToQMenuAndActionHash(developerMenu, MenuOption::Overlays, 0, true);
778 815
779#if 0 /// -------------- REMOVED FOR NOW --------------816#if 0 /// -------------- REMOVED FOR NOW --------------
780 addDisabledActionAndSeparator(navigateMenu, "History");817 addDisabledActionAndSeparator(navigateMenu, "History");