Showing the changes to interface/src/Menu.cpp (1 of 476 files). Show all
Unified · Split
| @@ -158,46 +158,6 @@ Menu::Menu() { · 157 unmodified lines | |||
| 158 | // Edit > Reload All Content | 158 | // Edit > Reload All Content |
| 159 | addActionToQMenuAndActionHash(editMenu, MenuOption::ReloadContent, 0, qApp, SLOT(reloadResourceCaches())); | 159 | addActionToQMenuAndActionHash(editMenu, MenuOption::ReloadContent, 0, qApp, SLOT(reloadResourceCaches())); |
| 160 | 160 | ||
| 161 | |||
| 162 | MenuWrapper* avatarMenu = addMenu("Avatar"); | ||
| 163 | auto avatarManager = DependencyManager::get<AvatarManager>(); | ||
| 164 | auto avatar = avatarManager->getMyAvatar(); | ||
| 165 | |||
| 166 | // Avatar > Size | ||
| 167 | MenuWrapper* avatarSizeMenu = avatarMenu->addMenu("Size"); | ||
| 168 | // Avatar > Size > Increase | ||
| 169 | addActionToQMenuAndActionHash(avatarSizeMenu, | ||
| 170 | MenuOption::IncreaseAvatarSize, | ||
| 171 | 0, // QML Qt::Key_Plus, | ||
| 172 | avatar.get(), SLOT(increaseSize())); | ||
| 173 | |||
| 174 | // Avatar > Size > Decrease | ||
| 175 | addActionToQMenuAndActionHash(avatarSizeMenu, | ||
| 176 | MenuOption::DecreaseAvatarSize, | ||
| 177 | 0, // QML Qt::Key_Minus, | ||
| 178 | avatar.get(), SLOT(decreaseSize())); | ||
| 179 | |||
| 180 | // Avatar > Size > Reset | ||
| 181 | addActionToQMenuAndActionHash(avatarSizeMenu, | ||
| 182 | MenuOption::ResetAvatarSize, | ||
| 183 | 0, // QML Qt::Key_Equal, | ||
| 184 | avatar.get(), SLOT(resetSize())); | ||
| 185 | |||
| 186 | // Avatar > Reset Sensors | ||
| 187 | addActionToQMenuAndActionHash(avatarMenu, | ||
| 188 | MenuOption::ResetSensors, | ||
| 189 | 0, // QML Qt::Key_Apostrophe, | ||
| 190 | qApp, SLOT(resetSensors())); | ||
| 191 | |||
| 192 | // Avatar > Attachments... | ||
| 193 | action = addActionToQMenuAndActionHash(avatarMenu, MenuOption::Attachments); | ||
| 194 | connect(action, &QAction::triggered, [] { | ||
| 195 | qApp->showDialog(QString("hifi/dialogs/AttachmentsDialog.qml"), | ||
| 196 | QString("hifi/tablet/TabletAttachmentsDialog.qml"), "AttachmentsDialog"); | ||
| 197 | }); | ||
| 198 | |||
| 199 | auto avatarBookmarks = DependencyManager::get<AvatarBookmarks>(); | ||
| 200 | avatarBookmarks->setupMenus(this, avatarMenu); | ||
| 201 | // Display menu ---------------------------------- | 161 | // Display menu ---------------------------------- |
| 202 | // FIXME - this is not yet matching Alan's spec because it doesn't have | 162 | // FIXME - this is not yet matching Alan's spec because it doesn't have |
| 203 | // menus for "2D"/"3D" - we need to add support for detecting the appropriate | 163 | // menus for "2D"/"3D" - we need to add support for detecting the appropriate |
| @@ -315,11 +275,11 @@ Menu::Menu() { · 111 unmodified lines | |||
| 315 | QString("hifi/tablet/TabletGraphicsPreferences.qml"), "GraphicsPreferencesDialog"); | 275 | QString("hifi/tablet/TabletGraphicsPreferences.qml"), "GraphicsPreferencesDialog"); |
| 316 | }); | 276 | }); |
| 317 | 277 | ||
| 318 | // Settings > Avatar... | 278 | // Settings > Attachments... |
| 319 | action = addActionToQMenuAndActionHash(settingsMenu, "Avatar..."); | 279 | action = addActionToQMenuAndActionHash(settingsMenu, MenuOption::Attachments); |
| 320 | connect(action, &QAction::triggered, [] { | 280 | connect(action, &QAction::triggered, [] { |
| 321 | qApp->showDialog(QString("hifi/dialogs/AvatarPreferencesDialog.qml"), | 281 | qApp->showDialog(QString("hifi/dialogs/AttachmentsDialog.qml"), |
| 322 | QString("hifi/tablet/TabletAvatarPreferences.qml"), "AvatarPreferencesDialog"); | 282 | QString("hifi/tablet/TabletAttachmentsDialog.qml"), "AttachmentsDialog"); |
| 323 | }); | 283 | }); |
| 324 | 284 | ||
| 325 | // Settings > Developer Menu | 285 | // Settings > Developer Menu |
| @@ -580,6 +540,9 @@ Menu::Menu() { · 254 unmodified lines | |||
| 580 | action = addCheckableActionToQMenuAndActionHash(avatarDebugMenu, MenuOption::ShowOtherLookAtVectors, 0, false); | 540 | action = addCheckableActionToQMenuAndActionHash(avatarDebugMenu, MenuOption::ShowOtherLookAtVectors, 0, false); |
| 581 | connect(action, &QAction::triggered, [this]{ Avatar::setShowOtherLookAtVectors(isOptionChecked(MenuOption::ShowOtherLookAtVectors)); }); | 541 | connect(action, &QAction::triggered, [this]{ Avatar::setShowOtherLookAtVectors(isOptionChecked(MenuOption::ShowOtherLookAtVectors)); }); |
| 582 | 542 | ||
| 543 | auto avatarManager = DependencyManager::get<AvatarManager>(); | ||
| 544 | auto avatar = avatarManager->getMyAvatar(); | ||
| 545 | |||
| 583 | action = addCheckableActionToQMenuAndActionHash(avatarDebugMenu, MenuOption::EnableLookAtSnapping, 0, true); | 546 | action = addCheckableActionToQMenuAndActionHash(avatarDebugMenu, MenuOption::EnableLookAtSnapping, 0, true); |
| 584 | connect(action, &QAction::triggered, [this, avatar]{ | 547 | connect(action, &QAction::triggered, [this, avatar]{ |
| 585 | avatar->setProperty("lookAtSnappingEnabled", isOptionChecked(MenuOption::EnableLookAtSnapping)); | 548 | avatar->setProperty("lookAtSnappingEnabled", isOptionChecked(MenuOption::EnableLookAtSnapping)); |