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
226226 addActionToQMenuAndActionHash(navigateMenu, MenuOption::CopyPath, 0,
227227 addressManager.data(), SLOT(copyPath()));
228228
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));
229237
230238 // Settings menu ----------------------------------
231239 MenuWrapper* settingsMenu = addMenu("Settings");
@@ -265,6 +273,18 @@ Menu::Menu() { · 33 unmodified lines
265273 QString("hifi/tablet/TabletGraphicsPreferences.qml"), "GraphicsPreferencesDialog");
266274 });
267275
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+
268288 // Settings > Developer Menu
269289 addCheckableActionToQMenuAndActionHash(settingsMenu, "Developer Menu", 0, false, this, SLOT(toggleDeveloperMenus()));
270290
@@ -273,21 +293,79 @@ Menu::Menu() { · 2 unmodified lines
273293
274294 // Developer menu ----------------------------------
275295 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);
276306
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+
277347 // Developer > UI >>>
278348 MenuWrapper* uiOptionsMenu = developerMenu->addMenu("UI");
279349 action = addCheckableActionToQMenuAndActionHash(uiOptionsMenu, MenuOption::DesktopTabletToToolbar, 0,
280350 qApp->getDesktopTabletBecomesToolbarSetting());
351+
352+ // Developer > UI > Show Overlays
353+ addCheckableActionToQMenuAndActionHash(uiOptionsMenu, MenuOption::Overlays, 0, true);
354+
355+ // Developer > UI > Desktop Tablet Becomes Toolbar
281356 connect(action, &QAction::triggered, [action] {
282357 qApp->setDesktopTabletBecomesToolbarSetting(action->isChecked());
283358 });
284−
359+
360+ // Developer > UI > HMD Tablet Becomes Toolbar
285361 action = addCheckableActionToQMenuAndActionHash(uiOptionsMenu, MenuOption::HMDTabletToToolbar, 0,
286362 qApp->getHmdTabletBecomesToolbarSetting());
287363 connect(action, &QAction::triggered, [action] {
288364 qApp->setHmdTabletBecomesToolbarSetting(action->isChecked());
289365 });
290366
367+ addCheckableActionToQMenuAndActionHash(uiOptionsMenu, MenuOption::Use3DKeyboard, 0, true);
368+
291369 // Developer > Render >>>
292370 MenuWrapper* renderOptionsMenu = developerMenu->addMenu("Render");
293371
@@ -570,6 +648,8 @@ Menu::Menu() { · 276 unmodified lines
570648 avatar.get(), SLOT(updateMotionBehaviorFromMenu()),
571649 UNSPECIFIED_POSITION, "Developer");
572650
651+ addCheckableActionToQMenuAndActionHash(avatarDebugMenu, MenuOption::ShowTrackedObjects, 0, false, qApp, SLOT(setShowTrackedObjects(bool)));
652+
573653 // Developer > Hands >>>
574654 MenuWrapper* handOptionsMenu = developerMenu->addMenu("Hands");
575655 addCheckableActionToQMenuAndActionHash(handOptionsMenu, MenuOption::DisplayHandTargets, 0, false,
@@ -684,10 +764,11 @@ Menu::Menu() { · 108 unmodified lines
684764 addCheckableActionToQMenuAndActionHash(pickingOptionsMenu, MenuOption::ForceCoarsePicking, 0, false,
685765 DependencyManager::get<PickManager>().data(), SLOT(setForceCoarsePicking(bool)));
686766
687− // Developer > Display Crash Options
688− addCheckableActionToQMenuAndActionHash(developerMenu, MenuOption::DisplayCrashOptions, 0, true);
689767 // Developer > Crash >>>
690768 MenuWrapper* crashMenu = developerMenu->addMenu("Crash");
769+
770+ // Developer > Crash > Display Crash Options
771+ addCheckableActionToQMenuAndActionHash(crashMenu, MenuOption::DisplayCrashOptions, 0, true);
691772
692773 addActionToQMenuAndActionHash(crashMenu, MenuOption::DeadlockInterface, 0, qApp, SLOT(deadlockApplication()));
693774 addActionToQMenuAndActionHash(crashMenu, MenuOption::UnresponsiveInterface, 0, qApp, SLOT(unresponsiveApplication()));
@@ -722,59 +803,15 @@ Menu::Menu() { · 28 unmodified lines
722803 action = addActionToQMenuAndActionHash(crashMenu, MenuOption::CrashNewFaultThreaded);
723804 connect(action, &QAction::triggered, qApp, []() { std::thread(crash::newFault).join(); });
724805
725− // Developer > Stats
806+ // Developer > Show Statistics
726807 addCheckableActionToQMenuAndActionHash(developerMenu, MenuOption::Stats);
727− addCheckableActionToQMenuAndActionHash(developerMenu, MenuOption::AnimStats);
728808
729− // Settings > Enable Speech Control API
730−#if defined(Q_OS_MAC) || defined(Q_OS_WIN)
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− });
809+ // Developer > Show Animation Statistics
810+ addCheckableActionToQMenuAndActionHash(developerMenu, MenuOption::AnimStats);
755811
756− // Developer > Log...
812+ // Developer > Log
757813 addActionToQMenuAndActionHash(developerMenu, MenuOption::Log, Qt::CTRL | Qt::SHIFT | Qt::Key_L,
758814 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);
778815
779816 #if 0 /// -------------- REMOVED FOR NOW --------------
780817 addDisabledActionAndSeparator(navigateMenu, "History");