History

Merge remote-tracking branch 'upstream/master' into plugins

Brad Davis committed 11 years ago

Commit 27587182 parents 912c003 118444638 files · +1519 −920Browse files

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

Unified · Split

interface/src/Menu.cpp+40−36
@@ -71,14 +71,14 @@ Menu::Menu() { · 70 unmodified lines
71 71
72 {72 {
73 addActionToQMenuAndActionHash(fileMenu, MenuOption::Login);73 addActionToQMenuAndActionHash(fileMenu, MenuOption::Login);
74 74
75 // connect to the appropriate signal of the AccountManager so that we can change the Login/Logout menu item75 // connect to the appropriate signal of the AccountManager so that we can change the Login/Logout menu item
76 connect(&accountManager, &AccountManager::profileChanged,76 connect(&accountManager, &AccountManager::profileChanged,
77 dialogsManager.data(), &DialogsManager::toggleLoginDialog);77 dialogsManager.data(), &DialogsManager::toggleLoginDialog);
78 connect(&accountManager, &AccountManager::logoutComplete,78 connect(&accountManager, &AccountManager::logoutComplete,
79 dialogsManager.data(), &DialogsManager::toggleLoginDialog);79 dialogsManager.data(), &DialogsManager::toggleLoginDialog);
80 }80 }
81 81
82 addDisabledActionAndSeparator(fileMenu, "Scripts");82 addDisabledActionAndSeparator(fileMenu, "Scripts");
83 addActionToQMenuAndActionHash(fileMenu, MenuOption::LoadScript, Qt::CTRL | Qt::Key_O,83 addActionToQMenuAndActionHash(fileMenu, MenuOption::LoadScript, Qt::CTRL | Qt::Key_O,
84 qApp, SLOT(loadDialog()));84 qApp, SLOT(loadDialog()));
@@ -92,7 +92,7 @@ Menu::Menu() { · 7 unmodified lines
92 92
93 addDisabledActionAndSeparator(fileMenu, "Location");93 addDisabledActionAndSeparator(fileMenu, "Location");
94 qApp->getBookmarks()->setupMenus(this, fileMenu);94 qApp->getBookmarks()->setupMenus(this, fileMenu);
95 95
96 addActionToQMenuAndActionHash(fileMenu,96 addActionToQMenuAndActionHash(fileMenu,
97 MenuOption::AddressBar,97 MenuOption::AddressBar,
98 Qt::CTRL | Qt::Key_L,98 Qt::CTRL | Qt::Key_L,
@@ -148,8 +148,8 @@ Menu::Menu() { · 49 unmodified lines
148 SLOT(setEnabled(bool)));148 SLOT(setEnabled(bool)));
149 connect(speechRecognizer.data(), SIGNAL(enabledUpdated(bool)), speechRecognizerAction, SLOT(setChecked(bool)));149 connect(speechRecognizer.data(), SIGNAL(enabledUpdated(bool)), speechRecognizerAction, SLOT(setChecked(bool)));
150#endif150#endif
151 151
152 addActionToQMenuAndActionHash(toolsMenu, MenuOption::Chat, 152 addActionToQMenuAndActionHash(toolsMenu, MenuOption::Chat,
153 0, // QML Qt::Key_Backslash,153 0, // QML Qt::Key_Backslash,
154 dialogsManager.data(), SLOT(showIRCLink()));154 dialogsManager.data(), SLOT(showIRCLink()));
155 addActionToQMenuAndActionHash(toolsMenu, MenuOption::AddRemoveFriends, 0,155 addActionToQMenuAndActionHash(toolsMenu, MenuOption::AddRemoveFriends, 0,
@@ -175,7 +175,7 @@ Menu::Menu() { · 19 unmodified lines
175 discoverabilityManager.data(), SLOT(setVisibility()));175 discoverabilityManager.data(), SLOT(setVisibility()));
176 visibilityGroup->addAction(visibleToNoOne);176 visibilityGroup->addAction(visibleToNoOne);
177 177
178 connect(discoverabilityManager.data(), &DiscoverabilityManager::discoverabilityModeChanged, 178 connect(discoverabilityManager.data(), &DiscoverabilityManager::discoverabilityModeChanged,
179 discoverabilityManager.data(), &DiscoverabilityManager::visibilityChanged);179 discoverabilityManager.data(), &DiscoverabilityManager::visibilityChanged);
180 }180 }
181 181
@@ -196,7 +196,7 @@ Menu::Menu() { · 14 unmodified lines
196 0, // QML Qt::Key_Apostrophe,196 0, // QML Qt::Key_Apostrophe,
197 qApp,197 qApp,
198 SLOT(resetSensors()));198 SLOT(resetSensors()));
199 199
200 addActionToQMenuAndActionHash(toolsMenu, MenuOption::PackageModel, 0,200 addActionToQMenuAndActionHash(toolsMenu, MenuOption::PackageModel, 0,
201 qApp, SLOT(packageModel()));201 qApp, SLOT(packageModel()));
202 202
@@ -250,17 +250,17 @@ Menu::Menu() { · 47 unmodified lines
250 qApp,250 qApp,
251 SLOT(setFullscreen(bool)));251 SLOT(setFullscreen(bool)));
252 252
253 addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::FirstPerson, 253 addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::FirstPerson,
254 0, // QML Qt::Key_P, 254 0, // QML Qt::Key_P,
255 true, qApp, SLOT(cameraMenuChanged()));255 true, qApp, SLOT(cameraMenuChanged()));
256 addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::Mirror, 256 addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::Mirror,
257 0, //QML Qt::SHIFT | Qt::Key_H, 257 0, //QML Qt::SHIFT | Qt::Key_H,
258 true);258 true);
259 addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::FullscreenMirror, 259 addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::FullscreenMirror,
260 0, // QML Qt::Key_H, 260 0, // QML Qt::Key_H,
261 false, qApp, SLOT(cameraMenuChanged()));261 false, qApp, SLOT(cameraMenuChanged()));
262 262
263 addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::HMDTools, 263 addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::HMDTools,
264#ifdef Q_OS_MAC264#ifdef Q_OS_MAC
265 Qt::META | Qt::Key_H,265 Qt::META | Qt::Key_H,
266#else266#else
@@ -283,8 +283,8 @@ Menu::Menu() { · 16 unmodified lines
283 addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::TurnWithHead, 0, false);283 addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::TurnWithHead, 0, false);
284 284
285 addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::Stats);285 addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::Stats);
286 addActionToQMenuAndActionHash(viewMenu, MenuOption::Log, 286 addActionToQMenuAndActionHash(viewMenu, MenuOption::Log,
287 Qt::CTRL | Qt::SHIFT | Qt::Key_L, 287 Qt::CTRL | Qt::SHIFT | Qt::Key_L,
288 qApp, SLOT(toggleLogDialog()));288 qApp, SLOT(toggleLogDialog()));
289 addActionToQMenuAndActionHash(viewMenu, MenuOption::BandwidthDetails, 0,289 addActionToQMenuAndActionHash(viewMenu, MenuOption::BandwidthDetails, 0,
290 dialogsManager.data(), SLOT(bandwidthDetails()));290 dialogsManager.data(), SLOT(bandwidthDetails()));
@@ -295,8 +295,8 @@ Menu::Menu() { · 4 unmodified lines
295 MenuWrapper* developerMenu = addMenu("Developer");295 MenuWrapper* developerMenu = addMenu("Developer");
296 296
297 MenuWrapper* renderOptionsMenu = developerMenu->addMenu("Render");297 MenuWrapper* renderOptionsMenu = developerMenu->addMenu("Render");
298 addCheckableActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::Atmosphere, 298 addCheckableActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::Atmosphere,
299 0, // QML Qt::SHIFT | Qt::Key_A, 299 0, // QML Qt::SHIFT | Qt::Key_A,
300 true);300 true);
301 addCheckableActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::AmbientOcclusion);301 addCheckableActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::AmbientOcclusion);
302 addCheckableActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::DontFadeOnOctreeServerChanges);302 addCheckableActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::DontFadeOnOctreeServerChanges);
@@ -315,7 +315,7 @@ Menu::Menu() { · 12 unmodified lines
315 ambientLightGroup->addAction(addCheckableActionToQMenuAndActionHash(ambientLightMenu, MenuOption::RenderAmbientLight7, 0, false));315 ambientLightGroup->addAction(addCheckableActionToQMenuAndActionHash(ambientLightMenu, MenuOption::RenderAmbientLight7, 0, false));
316 ambientLightGroup->addAction(addCheckableActionToQMenuAndActionHash(ambientLightMenu, MenuOption::RenderAmbientLight8, 0, false));316 ambientLightGroup->addAction(addCheckableActionToQMenuAndActionHash(ambientLightMenu, MenuOption::RenderAmbientLight8, 0, false));
317 ambientLightGroup->addAction(addCheckableActionToQMenuAndActionHash(ambientLightMenu, MenuOption::RenderAmbientLight9, 0, false));317 ambientLightGroup->addAction(addCheckableActionToQMenuAndActionHash(ambientLightMenu, MenuOption::RenderAmbientLight9, 0, false));
318 318
319 MenuWrapper* shadowMenu = renderOptionsMenu->addMenu("Shadows");319 MenuWrapper* shadowMenu = renderOptionsMenu->addMenu("Shadows");
320 QActionGroup* shadowGroup = new QActionGroup(shadowMenu);320 QActionGroup* shadowGroup = new QActionGroup(shadowMenu);
321 shadowGroup->addAction(addCheckableActionToQMenuAndActionHash(shadowMenu, "None", 0, true));321 shadowGroup->addAction(addCheckableActionToQMenuAndActionHash(shadowMenu, "None", 0, true));
@@ -349,14 +349,14 @@ Menu::Menu() { · 27 unmodified lines
349 resolutionGroup->addAction(addCheckableActionToQMenuAndActionHash(resolutionMenu, MenuOption::RenderResolutionThird, 0, false));349 resolutionGroup->addAction(addCheckableActionToQMenuAndActionHash(resolutionMenu, MenuOption::RenderResolutionThird, 0, false));
350 resolutionGroup->addAction(addCheckableActionToQMenuAndActionHash(resolutionMenu, MenuOption::RenderResolutionQuarter, 0, false));350 resolutionGroup->addAction(addCheckableActionToQMenuAndActionHash(resolutionMenu, MenuOption::RenderResolutionQuarter, 0, false));
351 351
352 addCheckableActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::Stars, 352 addCheckableActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::Stars,
353 0, // QML Qt::Key_Asterisk,353 0, // QML Qt::Key_Asterisk,
354 true);354 true);
355 addCheckableActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::EnableGlowEffect, 0, true, 355 addCheckableActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::EnableGlowEffect, 0, true,
356 DependencyManager::get<GlowEffect>().data(), SLOT(toggleGlowEffect(bool)));356 DependencyManager::get<GlowEffect>().data(), SLOT(toggleGlowEffect(bool)));
357 357
358 addCheckableActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::Wireframe, Qt::ALT | Qt::Key_W, false);358 addCheckableActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::Wireframe, Qt::ALT | Qt::Key_W, false);
359 addActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::LodTools, 359 addActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::LodTools,
360 0, // QML Qt::SHIFT | Qt::Key_L,360 0, // QML Qt::SHIFT | Qt::Key_L,
361 dialogsManager.data(), SLOT(lodTools()));361 dialogsManager.data(), SLOT(lodTools()));
362 362
@@ -382,7 +382,7 @@ Menu::Menu() { · 19 unmodified lines
382 faceTrackerGroup->addAction(faceshiftFaceTracker);382 faceTrackerGroup->addAction(faceshiftFaceTracker);
383#endif383#endif
384#ifdef HAVE_DDE384#ifdef HAVE_DDE
385 QAction* ddeFaceTracker = addCheckableActionToQMenuAndActionHash(faceTrackingMenu, MenuOption::UseCamera, 385 QAction* ddeFaceTracker = addCheckableActionToQMenuAndActionHash(faceTrackingMenu, MenuOption::UseCamera,
386 0, true,386 0, true,
387 qApp, SLOT(setActiveFaceTracker()));387 qApp, SLOT(setActiveFaceTracker()));
388 faceTrackerGroup->addAction(ddeFaceTracker);388 faceTrackerGroup->addAction(ddeFaceTracker);
@@ -402,13 +402,13 @@ Menu::Menu() { · 13 unmodified lines
402#endif402#endif
403#if defined(HAVE_FACESHIFT) || defined(HAVE_DDE)403#if defined(HAVE_FACESHIFT) || defined(HAVE_DDE)
404 faceTrackingMenu->addSeparator();404 faceTrackingMenu->addSeparator();
405 addCheckableActionToQMenuAndActionHash(faceTrackingMenu, MenuOption::MuteFaceTracking, 405 addCheckableActionToQMenuAndActionHash(faceTrackingMenu, MenuOption::MuteFaceTracking,
406 Qt::CTRL | Qt::SHIFT | Qt::Key_F, true, // DDE face tracking is on by default406 Qt::CTRL | Qt::SHIFT | Qt::Key_F, true, // DDE face tracking is on by default
407 qApp, SLOT(toggleFaceTrackerMute()));407 qApp, SLOT(toggleFaceTrackerMute()));
408 addCheckableActionToQMenuAndActionHash(faceTrackingMenu, MenuOption::AutoMuteAudio, 0, true);408 addCheckableActionToQMenuAndActionHash(faceTrackingMenu, MenuOption::AutoMuteAudio, 0, true);
409#endif409#endif
410 410
411 auto avatarManager = DependencyManager::get<AvatarManager>(); 411 auto avatarManager = DependencyManager::get<AvatarManager>();
412 addCheckableActionToQMenuAndActionHash(avatarDebugMenu, MenuOption::AvatarReceiveStats, 0, false,412 addCheckableActionToQMenuAndActionHash(avatarDebugMenu, MenuOption::AvatarReceiveStats, 0, false,
413 avatarManager.data(), SLOT(setShouldShowReceiveStats(bool)));413 avatarManager.data(), SLOT(setShouldShowReceiveStats(bool)));
414 414
@@ -424,7 +424,7 @@ Menu::Menu() { · 9 unmodified lines
424 addCheckableActionToQMenuAndActionHash(handOptionsMenu, MenuOption::DisplayHands, 0, true);424 addCheckableActionToQMenuAndActionHash(handOptionsMenu, MenuOption::DisplayHands, 0, true);
425 addCheckableActionToQMenuAndActionHash(handOptionsMenu, MenuOption::DisplayHandTargets, 0, false);425 addCheckableActionToQMenuAndActionHash(handOptionsMenu, MenuOption::DisplayHandTargets, 0, false);
426 addCheckableActionToQMenuAndActionHash(handOptionsMenu, MenuOption::ShowIKConstraints, 0, false);426 addCheckableActionToQMenuAndActionHash(handOptionsMenu, MenuOption::ShowIKConstraints, 0, false);
427 427
428 MenuWrapper* sixenseOptionsMenu = handOptionsMenu->addMenu("Sixense");428 MenuWrapper* sixenseOptionsMenu = handOptionsMenu->addMenu("Sixense");
429#ifdef __APPLE__429#ifdef __APPLE__
430 addCheckableActionToQMenuAndActionHash(sixenseOptionsMenu,430 addCheckableActionToQMenuAndActionHash(sixenseOptionsMenu,
@@ -470,7 +470,11 @@ Menu::Menu() { · 39 unmodified lines
470 addActionToQMenuAndActionHash(networkMenu, MenuOption::DiskCacheEditor, 0,470 addActionToQMenuAndActionHash(networkMenu, MenuOption::DiskCacheEditor, 0,
471 dialogsManager.data(), SLOT(toggleDiskCacheEditor()));471 dialogsManager.data(), SLOT(toggleDiskCacheEditor()));
472 472
473 addActionToQMenuAndActionHash(networkMenu, MenuOption::ShowDSConnectTable, 0,
474 dialogsManager.data(), SLOT(showDomainConnectionDialog()));
475
473 MenuWrapper* timingMenu = developerMenu->addMenu("Timing and Stats");476 MenuWrapper* timingMenu = developerMenu->addMenu("Timing and Stats");
477
474 MenuWrapper* perfTimerMenu = timingMenu->addMenu("Performance Timer");478 MenuWrapper* perfTimerMenu = timingMenu->addMenu("Performance Timer");
475 addCheckableActionToQMenuAndActionHash(perfTimerMenu, MenuOption::DisplayDebugTimingDetails, 0, false);479 addCheckableActionToQMenuAndActionHash(perfTimerMenu, MenuOption::DisplayDebugTimingDetails, 0, false);
476 addCheckableActionToQMenuAndActionHash(perfTimerMenu, MenuOption::OnlyDisplayTopTen, 0, true);480 addCheckableActionToQMenuAndActionHash(perfTimerMenu, MenuOption::OnlyDisplayTopTen, 0, true);
@@ -508,7 +512,7 @@ Menu::Menu() { · 31 unmodified lines
508 0,512 0,
509 audioIO.data(),513 audioIO.data(),
510 SLOT(sendMuteEnvironmentPacket()));514 SLOT(sendMuteEnvironmentPacket()));
511 515
512 auto scope = DependencyManager::get<AudioScope>();516 auto scope = DependencyManager::get<AudioScope>();
513 517
514 MenuWrapper* audioScopeMenu = audioDebugMenu->addMenu("Audio Scope");518 MenuWrapper* audioScopeMenu = audioDebugMenu->addMenu("Audio Scope");
@@ -546,7 +550,7 @@ Menu::Menu() { · 31 unmodified lines
546 audioScopeFramesGroup->addAction(twentyFrames);550 audioScopeFramesGroup->addAction(twentyFrames);
547 audioScopeFramesGroup->addAction(fiftyFrames);551 audioScopeFramesGroup->addAction(fiftyFrames);
548 }552 }
549 553
550 auto statsRenderer = DependencyManager::get<AudioIOStatsRenderer>();554 auto statsRenderer = DependencyManager::get<AudioIOStatsRenderer>();
551 addCheckableActionToQMenuAndActionHash(audioDebugMenu, MenuOption::AudioStats,555 addCheckableActionToQMenuAndActionHash(audioDebugMenu, MenuOption::AudioStats,
552 Qt::CTRL | Qt::SHIFT | Qt::Key_A,556 Qt::CTRL | Qt::SHIFT | Qt::Key_A,
@@ -765,7 +769,7 @@ QAction* Menu::getActionFromName(const QString& menuName, MenuWrapper* menu) { · 212 unmodified lines
765 } else {769 } else {
766 menuActions = actions();770 menuActions = actions();
767 }771 }
768 772
769 foreach (QAction* menuAction, menuActions) {773 foreach (QAction* menuAction, menuActions) {
770 QString actionText = menuAction->text();774 QString actionText = menuAction->text();
771 if (menuName == menuAction->text()) {775 if (menuName == menuAction->text()) {
@@ -866,14 +870,14 @@ MenuWrapper* Menu::addMenu(const QString& menuName) { · 94 unmodified lines
866 }870 }
867 addTo = menu;871 addTo = menu;
868 }872 }
869 873
870 QMenuBar::repaint();874 QMenuBar::repaint();
871 return menu;875 return menu;
872}876}
873 877
874void Menu::removeMenu(const QString& menuName) {878void Menu::removeMenu(const QString& menuName) {
875 QAction* action = getMenuAction(menuName);879 QAction* action = getMenuAction(menuName);
876 880
877 // only proceed if the menu actually exists881 // only proceed if the menu actually exists
878 if (action) {882 if (action) {
879 QString finalMenuPart;883 QString finalMenuPart;
@@ -883,14 +887,14 @@ void Menu::removeMenu(const QString& menuName) { · 3 unmodified lines
883 } else {887 } else {
884 QMenuBar::removeAction(action);888 QMenuBar::removeAction(action);
885 }889 }
886 890
887 QMenuBar::repaint();891 QMenuBar::repaint();
888 }892 }
889}893}
890 894
891bool Menu::menuExists(const QString& menuName) {895bool Menu::menuExists(const QString& menuName) {
892 QAction* action = getMenuAction(menuName);896 QAction* action = getMenuAction(menuName);
893 897
894 // only proceed if the menu actually exists898 // only proceed if the menu actually exists
895 if (action) {899 if (action) {
896 return true;900 return true;
@@ -935,7 +939,7 @@ void Menu::addMenuItem(const MenuItemProperties& properties) { · 38 unmodified lines
935 if (!properties.shortcutKeySequence.isEmpty()) {939 if (!properties.shortcutKeySequence.isEmpty()) {
936 shortcut = new QShortcut(properties.shortcutKeySequence, this);940 shortcut = new QShortcut(properties.shortcutKeySequence, this);
937 }941 }
938 942
939 // check for positioning requests943 // check for positioning requests
940 int requestedPosition = properties.position;944 int requestedPosition = properties.position;
941 if (requestedPosition == UNSPECIFIED_POSITION && !properties.beforeItem.isEmpty()) {945 if (requestedPosition == UNSPECIFIED_POSITION && !properties.beforeItem.isEmpty()) {
@@ -949,7 +953,7 @@ void Menu::addMenuItem(const MenuItemProperties& properties) { · 7 unmodified lines
949 requestedPosition = afterPosition + 1;953 requestedPosition = afterPosition + 1;
950 }954 }
951 }955 }
952 956
953 QAction* menuItemAction = NULL;957 QAction* menuItemAction = NULL;
954 if (properties.isSeparator) {958 if (properties.isSeparator) {
955 addDisabledActionAndSeparator(menuObj, properties.menuItemName, requestedPosition);959 addDisabledActionAndSeparator(menuObj, properties.menuItemName, requestedPosition);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t