Showing the changes to interface/src/Menu.cpp (1 of 14 files). Show all
Unified · Split
| @@ -87,7 +87,7 @@ Menu::Menu() : · 86 unmodified lines | ||
| 87 | 87 | _loginAction(NULL) |
| 88 | 88 | { |
| 89 | 89 | Application *appInstance = Application::getInstance(); |
| 90 | − | |
| 90 | + | |
| 91 | 91 | QMenu* fileMenu = addMenu("File"); |
| 92 | 92 | |
| 93 | 93 | #ifdef Q_OS_MAC |
| @@ -100,23 +100,24 @@ Menu::Menu() : · 6 unmodified lines | ||
| 100 | 100 | #endif |
| 101 | 101 | |
| 102 | 102 | AccountManager& accountManager = AccountManager::getInstance(); |
| 103 | − | |
| 103 | + | |
| 104 | 104 | _loginAction = addActionToQMenuAndActionHash(fileMenu, MenuOption::Logout); |
| 105 | − | |
| 105 | + | |
| 106 | 106 | // call our toggle login function now so the menu option is setup properly |
| 107 | 107 | toggleLoginMenuItem(); |
| 108 | − | |
| 108 | + | |
| 109 | 109 | // connect to the appropriate slots of the AccountManager so that we can change the Login/Logout menu item |
| 110 | 110 | connect(&accountManager, &AccountManager::accessTokenChanged, this, &Menu::toggleLoginMenuItem); |
| 111 | 111 | connect(&accountManager, &AccountManager::logoutComplete, this, &Menu::toggleLoginMenuItem); |
| 112 | 112 | |
| 113 | 113 | addDisabledActionAndSeparator(fileMenu, "Scripts"); |
| 114 | 114 | addActionToQMenuAndActionHash(fileMenu, MenuOption::LoadScript, Qt::CTRL | Qt::Key_O, appInstance, SLOT(loadDialog())); |
| 115 | − addActionToQMenuAndActionHash(fileMenu, MenuOption::LoadScriptURL, | |
| 115 | + addActionToQMenuAndActionHash(fileMenu, MenuOption::LoadScriptURL, | |
| 116 | 116 | Qt::CTRL | Qt::SHIFT | Qt::Key_O, appInstance, SLOT(loadScriptURLDialog())); |
| 117 | 117 | addActionToQMenuAndActionHash(fileMenu, MenuOption::StopAllScripts, 0, appInstance, SLOT(stopAllScripts())); |
| 118 | 118 | addActionToQMenuAndActionHash(fileMenu, MenuOption::ReloadAllScripts, 0, appInstance, SLOT(reloadAllScripts())); |
| 119 | − _activeScriptsMenu = fileMenu->addMenu("Running Scripts"); | |
| 119 | + addActionToQMenuAndActionHash(fileMenu, MenuOption::RunningScripts, Qt::CTRL | Qt::Key_J, | |
| 120 | + appInstance, SLOT(toggleRunningScriptsWidget())); | |
| 120 | 121 | |
| 121 | 122 | addDisabledActionAndSeparator(fileMenu, "Go"); |
| 122 | 123 | addActionToQMenuAndActionHash(fileMenu, |
| @@ -147,7 +148,7 @@ Menu::Menu() : · 24 unmodified lines | ||
| 147 | 148 | |
| 148 | 149 | addDisabledActionAndSeparator(fileMenu, "Upload Avatar Model"); |
| 149 | 150 | addActionToQMenuAndActionHash(fileMenu, MenuOption::UploadFST, 0, Application::getInstance(), SLOT(uploadFST())); |
| 150 | − | |
| 151 | + | |
| 151 | 152 | addDisabledActionAndSeparator(fileMenu, "Settings"); |
| 152 | 153 | addActionToQMenuAndActionHash(fileMenu, MenuOption::SettingsImport, 0, this, SLOT(importSettings())); |
| 153 | 154 | addActionToQMenuAndActionHash(fileMenu, MenuOption::SettingsExport, 0, this, SLOT(exportSettings())); |
| @@ -172,8 +173,8 @@ Menu::Menu() : · 18 unmodified lines | ||
| 172 | 173 | addDisabledActionAndSeparator(editMenu, "Physics"); |
| 173 | 174 | addCheckableActionToQMenuAndActionHash(editMenu, MenuOption::Gravity, Qt::SHIFT | Qt::Key_G, false); |
| 174 | 175 | |
| 175 | − | |
| 176 | − | |
| 176 | + | |
| 177 | + | |
| 177 | 178 | |
| 178 | 179 | addAvatarCollisionSubMenu(editMenu); |
| 179 | 180 | |
| @@ -207,7 +208,7 @@ Menu::Menu() : · 27 unmodified lines | ||
| 207 | 208 | addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::Mirror, Qt::SHIFT | Qt::Key_H, true); |
| 208 | 209 | addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::FullscreenMirror, Qt::Key_H, false, |
| 209 | 210 | appInstance, SLOT(cameraMenuChanged())); |
| 210 | − | |
| 211 | + | |
| 211 | 212 | addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::Enable3DTVMode, 0, |
| 212 | 213 | false, |
| 213 | 214 | appInstance, |
| @@ -333,16 +334,16 @@ Menu::Menu() : · 119 unmodified lines | ||
| 333 | 334 | addCheckableActionToQMenuAndActionHash(renderDebugMenu, MenuOption::PipelineWarnings, Qt::CTRL | Qt::SHIFT | Qt::Key_P); |
| 334 | 335 | addCheckableActionToQMenuAndActionHash(renderDebugMenu, MenuOption::SuppressShortTimings, Qt::CTRL | Qt::SHIFT | Qt::Key_S); |
| 335 | 336 | |
| 336 | − addCheckableActionToQMenuAndActionHash(renderDebugMenu, | |
| 337 | − MenuOption::CullSharedFaces, | |
| 338 | − Qt::CTRL | Qt::SHIFT | Qt::Key_C, | |
| 337 | + addCheckableActionToQMenuAndActionHash(renderDebugMenu, | |
| 338 | + MenuOption::CullSharedFaces, | |
| 339 | + Qt::CTRL | Qt::SHIFT | Qt::Key_C, | |
| 339 | 340 | false, |
| 340 | 341 | appInstance->getVoxels(), |
| 341 | 342 | SLOT(cullSharedFaces())); |
| 342 | 343 | |
| 343 | − addCheckableActionToQMenuAndActionHash(renderDebugMenu, | |
| 344 | − MenuOption::ShowCulledSharedFaces, | |
| 345 | − Qt::CTRL | Qt::SHIFT | Qt::Key_X, | |
| 344 | + addCheckableActionToQMenuAndActionHash(renderDebugMenu, | |
| 345 | + MenuOption::ShowCulledSharedFaces, | |
| 346 | + Qt::CTRL | Qt::SHIFT | Qt::Key_X, | |
| 346 | 347 | false, |
| 347 | 348 | appInstance->getVoxels(), |
| 348 | 349 | SLOT(showCulledSharedFaces())); |
| @@ -360,14 +361,14 @@ Menu::Menu() : · 11 unmodified lines | ||
| 360 | 361 | false, |
| 361 | 362 | appInstance->getAudio(), |
| 362 | 363 | SLOT(toggleMute())); |
| 363 | − | |
| 364 | + | |
| 364 | 365 | addActionToQMenuAndActionHash(developerMenu, MenuOption::PasteToVoxel, |
| 365 | 366 | Qt::CTRL | Qt::SHIFT | Qt::Key_V, |
| 366 | 367 | this, |
| 367 | 368 | SLOT(pasteToVoxel())); |
| 368 | 369 | |
| 369 | 370 | connect(appInstance->getAudio(), SIGNAL(muteToggled()), this, SLOT(audioMuteToggled())); |
| 370 | − | |
| 371 | + | |
| 371 | 372 | #ifndef Q_OS_MAC |
| 372 | 373 | QMenu* helpMenu = addMenu("Help"); |
| 373 | 374 | QAction* helpAction = helpMenu->addAction(MenuOption::AboutApp); |
| @@ -571,7 +572,7 @@ void Menu::addDisabledActionAndSeparator(QMenu* destinationMenu, const QString& · 197 unmodified lines | ||
| 571 | 572 | QAction* separatorText = new QAction(actionName,destinationMenu); |
| 572 | 573 | separatorText->setEnabled(false); |
| 573 | 574 | destinationMenu->insertAction(actionBefore, separatorText); |
| 574 | − | |
| 575 | + | |
| 575 | 576 | } else { |
| 576 | 577 | destinationMenu->addSeparator(); |
| 577 | 578 | (destinationMenu->addAction(actionName))->setEnabled(false); |
| @@ -623,7 +624,7 @@ QAction* Menu::addCheckableActionToQMenuAndActionHash(QMenu* destinationMenu, · 45 unmodified lines | ||
| 623 | 624 | const char* member, |
| 624 | 625 | int menuItemLocation) { |
| 625 | 626 | |
| 626 | − QAction* action = addActionToQMenuAndActionHash(destinationMenu, actionName, shortcut, receiver, member, | |
| 627 | + QAction* action = addActionToQMenuAndActionHash(destinationMenu, actionName, shortcut, receiver, member, | |
| 627 | 628 | QAction::NoRole, menuItemLocation); |
| 628 | 629 | action->setCheckable(true); |
| 629 | 630 | action->setChecked(checked); |
| @@ -677,35 +678,35 @@ const float DIALOG_RATIO_OF_WINDOW = 0.30f; · 47 unmodified lines | ||
| 677 | 678 | void Menu::loginForCurrentDomain() { |
| 678 | 679 | QDialog loginDialog(Application::getInstance()->getWindow()); |
| 679 | 680 | loginDialog.setWindowTitle("Login"); |
| 680 | − | |
| 681 | + | |
| 681 | 682 | QBoxLayout* layout = new QBoxLayout(QBoxLayout::TopToBottom); |
| 682 | 683 | loginDialog.setLayout(layout); |
| 683 | 684 | loginDialog.setWindowFlags(Qt::Sheet); |
| 684 | − | |
| 685 | + | |
| 685 | 686 | QFormLayout* form = new QFormLayout(); |
| 686 | 687 | layout->addLayout(form, 1); |
| 687 | − | |
| 688 | + | |
| 688 | 689 | QLineEdit* loginLineEdit = new QLineEdit(); |
| 689 | 690 | loginLineEdit->setMinimumWidth(QLINE_MINIMUM_WIDTH); |
| 690 | 691 | form->addRow("Login:", loginLineEdit); |
| 691 | − | |
| 692 | + | |
| 692 | 693 | QLineEdit* passwordLineEdit = new QLineEdit(); |
| 693 | 694 | passwordLineEdit->setMinimumWidth(QLINE_MINIMUM_WIDTH); |
| 694 | 695 | passwordLineEdit->setEchoMode(QLineEdit::Password); |
| 695 | 696 | form->addRow("Password:", passwordLineEdit); |
| 696 | − | |
| 697 | + | |
| 697 | 698 | QDialogButtonBox* buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); |
| 698 | 699 | loginDialog.connect(buttons, SIGNAL(accepted()), SLOT(accept())); |
| 699 | 700 | loginDialog.connect(buttons, SIGNAL(rejected()), SLOT(reject())); |
| 700 | 701 | layout->addWidget(buttons); |
| 701 | − | |
| 702 | + | |
| 702 | 703 | int dialogReturn = loginDialog.exec(); |
| 703 | − | |
| 704 | + | |
| 704 | 705 | if (dialogReturn == QDialog::Accepted && !loginLineEdit->text().isEmpty() && !passwordLineEdit->text().isEmpty()) { |
| 705 | 706 | // attempt to get an access token given this username and password |
| 706 | 707 | AccountManager::getInstance().requestAccessToken(loginLineEdit->text(), passwordLineEdit->text()); |
| 707 | 708 | } |
| 708 | − | |
| 709 | + | |
| 709 | 710 | sendFakeEnterEvent(); |
| 710 | 711 | } |
| 711 | 712 | |
| @@ -713,19 +714,19 @@ void Menu::editPreferences() { · 1 unmodified line | ||
| 713 | 714 | Application* applicationInstance = Application::getInstance(); |
| 714 | 715 | ModelBrowser headBrowser(Head); |
| 715 | 716 | ModelBrowser skeletonBrowser(Skeleton); |
| 716 | − | |
| 717 | + | |
| 717 | 718 | const QString BROWSE_BUTTON_TEXT = "Browse"; |
| 718 | 719 | |
| 719 | 720 | QDialog dialog(applicationInstance->getWindow()); |
| 720 | 721 | dialog.setWindowTitle("Interface Preferences"); |
| 721 | − | |
| 722 | + | |
| 722 | 723 | QBoxLayout* layout = new QBoxLayout(QBoxLayout::TopToBottom); |
| 723 | 724 | dialog.setLayout(layout); |
| 724 | − | |
| 725 | + | |
| 725 | 726 | QFormLayout* form = new QFormLayout(); |
| 726 | 727 | layout->addLayout(form, 1); |
| 727 | 728 | |
| 728 | − | |
| 729 | + | |
| 729 | 730 | QHBoxLayout headModelLayout; |
| 730 | 731 | QString faceURLString = applicationInstance->getAvatar()->getHead()->getFaceModel().getURL().toString(); |
| 731 | 732 | QLineEdit headURLEdit(faceURLString); |
| @@ -737,7 +738,7 @@ void Menu::editPreferences() { · 5 unmodified lines | ||
| 737 | 738 | headModelLayout.addWidget(&headURLEdit); |
| 738 | 739 | headModelLayout.addWidget(&headBrowseButton); |
| 739 | 740 | form->addRow("Head URL:", &headModelLayout); |
| 740 | − | |
| 741 | + | |
| 741 | 742 | QHBoxLayout skeletonModelLayout; |
| 742 | 743 | QString skeletonURLString = applicationInstance->getAvatar()->getSkeletonModel().getURL().toString(); |
| 743 | 744 | QLineEdit skeletonURLEdit(skeletonURLString); |
| @@ -749,7 +750,7 @@ void Menu::editPreferences() { · 5 unmodified lines | ||
| 749 | 750 | skeletonModelLayout.addWidget(&skeletonURLEdit); |
| 750 | 751 | skeletonModelLayout.addWidget(&SkeletonBrowseButton); |
| 751 | 752 | form->addRow("Skeleton URL:", &skeletonModelLayout); |
| 752 | − | |
| 753 | + | |
| 753 | 754 | |
| 754 | 755 | QString displayNameString = applicationInstance->getAvatar()->getDisplayName(); |
| 755 | 756 | QLineEdit* displayNameEdit = new QLineEdit(displayNameString); |
| @@ -826,12 +827,12 @@ void Menu::editPreferences() { · 70 unmodified lines | ||
| 826 | 827 | } |
| 827 | 828 | |
| 828 | 829 | QString displayNameStr(displayNameEdit->text()); |
| 829 | − | |
| 830 | + | |
| 830 | 831 | if (displayNameStr != displayNameString) { |
| 831 | 832 | applicationInstance->getAvatar()->setDisplayName(displayNameStr); |
| 832 | 833 | shouldDispatchIdentityPacket = true; |
| 833 | 834 | } |
| 834 | − | |
| 835 | + | |
| 835 | 836 | if (shouldDispatchIdentityPacket) { |
| 836 | 837 | applicationInstance->getAvatar()->sendIdentityPacket(); |
| 837 | 838 | } |
| @@ -864,10 +865,10 @@ void Menu::editPreferences() { · 26 unmodified lines | ||
| 864 | 865 | |
| 865 | 866 | void Menu::goToDomain(const QString newDomain) { |
| 866 | 867 | if (NodeList::getInstance()->getDomainInfo().getHostname() != newDomain) { |
| 867 | − | |
| 868 | + | |
| 868 | 869 | // send a node kill request, indicating to other clients that they should play the "disappeared" effect |
| 869 | 870 | Application::getInstance()->getAvatar()->sendKillAvatar(); |
| 870 | − | |
| 871 | + | |
| 871 | 872 | // give our nodeList the new domain-server hostname |
| 872 | 873 | NodeList::getInstance()->getDomainInfo().setHostname(newDomain); |
| 873 | 874 | } |
| @@ -897,7 +898,7 @@ void Menu::goToDomainDialog() { · 23 unmodified lines | ||
| 897 | 898 | // the user input a new hostname, use that |
| 898 | 899 | newHostname = domainDialog.textValue(); |
| 899 | 900 | } |
| 900 | − | |
| 901 | + | |
| 901 | 902 | goToDomain(newHostname); |
| 902 | 903 | } |
| 903 | 904 | |
| @@ -913,7 +914,7 @@ bool Menu::goToDestination(QString destination) { · 9 unmodified lines | ||
| 913 | 914 | } |
| 914 | 915 | |
| 915 | 916 | void Menu::goTo() { |
| 916 | − | |
| 917 | + | |
| 917 | 918 | QInputDialog gotoDialog(Application::getInstance()->getWindow()); |
| 918 | 919 | gotoDialog.setWindowTitle("Go to"); |
| 919 | 920 | gotoDialog.setLabelText("Destination:"); |
| @@ -921,7 +922,7 @@ void Menu::goTo() { · 1 unmodified line | ||
| 921 | 922 | gotoDialog.setTextValue(destination); |
| 922 | 923 | gotoDialog.setWindowFlags(Qt::Sheet); |
| 923 | 924 | gotoDialog.resize(gotoDialog.parentWidget()->size().width() * DIALOG_RATIO_OF_WINDOW, gotoDialog.size().height()); |
| 924 | − | |
| 925 | + | |
| 925 | 926 | int dialogReturn = gotoDialog.exec(); |
| 926 | 927 | if (dialogReturn == QDialog::Accepted && !gotoDialog.textValue().isEmpty()) { |
| 927 | 928 | goToUser(gotoDialog.textValue()); |
| @@ -1070,7 +1071,7 @@ void Menu::toggleLoginMenuItem() { · 142 unmodified lines | ||
| 1070 | 1071 | AccountManager& accountManager = AccountManager::getInstance(); |
| 1071 | 1072 | |
| 1072 | 1073 | disconnect(_loginAction, 0, 0, 0); |
| 1073 | − | |
| 1074 | + | |
| 1074 | 1075 | if (accountManager.isLoggedIn()) { |
| 1075 | 1076 | // change the menu item to logout |
| 1076 | 1077 | _loginAction->setText("Logout " + accountManager.getUsername()); |
| @@ -1078,7 +1079,7 @@ void Menu::toggleLoginMenuItem() { · 1 unmodified line | ||
| 1078 | 1079 | } else { |
| 1079 | 1080 | // change the menu item to login |
| 1080 | 1081 | _loginAction->setText("Login"); |
| 1081 | − | |
| 1082 | + | |
| 1082 | 1083 | connect(_loginAction, &QAction::triggered, this, &Menu::loginForCurrentDomain); |
| 1083 | 1084 | } |
| 1084 | 1085 | } |
| @@ -1185,7 +1186,7 @@ QString Menu::getLODFeedbackText() { · 100 unmodified lines | ||
| 1185 | 1186 | } break; |
| 1186 | 1187 | } |
| 1187 | 1188 | |
| 1188 | − // distance feedback | |
| 1189 | + // distance feedback | |
| 1189 | 1190 | float voxelSizeScale = getVoxelSizeScale(); |
| 1190 | 1191 | float relativeToDefault = voxelSizeScale / DEFAULT_OCTREE_SIZE_SCALE; |
| 1191 | 1192 | QString result; |
| @@ -1200,7 +1201,7 @@ QString Menu::getLODFeedbackText() { · 8 unmodified lines | ||
| 1200 | 1201 | } |
| 1201 | 1202 | |
| 1202 | 1203 | void Menu::autoAdjustLOD(float currentFPS) { |
| 1203 | − // NOTE: our first ~100 samples at app startup are completely all over the place, and we don't | |
| 1204 | + // NOTE: our first ~100 samples at app startup are completely all over the place, and we don't | |
| 1204 | 1205 | // really want to count them in our average, so we will ignore the real frame rates and stuff |
| 1205 | 1206 | // our moving average with simulated good data |
| 1206 | 1207 | const int IGNORE_THESE_SAMPLES = 100; |
| @@ -1212,7 +1213,7 @@ void Menu::autoAdjustLOD(float currentFPS) { · 5 unmodified lines | ||
| 1212 | 1213 | _fastFPSAverage.updateAverage(currentFPS); |
| 1213 | 1214 | |
| 1214 | 1215 | quint64 now = usecTimestampNow(); |
| 1215 | − | |
| 1216 | + | |
| 1216 | 1217 | const quint64 ADJUST_AVATAR_LOD_DOWN_DELAY = 1000 * 1000; |
| 1217 | 1218 | if (_fastFPSAverage.getAverage() < ADJUST_LOD_DOWN_FPS) { |
| 1218 | 1219 | if (now - _lastAvatarDetailDrop > ADJUST_AVATAR_LOD_DOWN_DELAY) { |
| @@ -1231,11 +1232,11 @@ void Menu::autoAdjustLOD(float currentFPS) { · 12 unmodified lines | ||
| 1231 | 1232 | _avatarLODDistanceMultiplier = qMax(MINIMUM_DISTANCE_MULTIPLIER, |
| 1232 | 1233 | _avatarLODDistanceMultiplier - DISTANCE_DECREASE_RATE); |
| 1233 | 1234 | } |
| 1234 | − | |
| 1235 | + | |
| 1235 | 1236 | bool changed = false; |
| 1236 | 1237 | quint64 elapsed = now - _lastAdjust; |
| 1237 | 1238 | |
| 1238 | − if (elapsed > ADJUST_LOD_DOWN_DELAY && _fpsAverage.getAverage() < ADJUST_LOD_DOWN_FPS | |
| 1239 | + if (elapsed > ADJUST_LOD_DOWN_DELAY && _fpsAverage.getAverage() < ADJUST_LOD_DOWN_FPS | |
| 1239 | 1240 | && _voxelSizeScale > ADJUST_LOD_MIN_SIZE_SCALE) { |
| 1240 | 1241 | |
| 1241 | 1242 | _voxelSizeScale *= ADJUST_LOD_DOWN_BY; |
| @@ -1248,7 +1249,7 @@ void Menu::autoAdjustLOD(float currentFPS) { · 6 unmodified lines | ||
| 1248 | 1249 | << "_voxelSizeScale=" << _voxelSizeScale; |
| 1249 | 1250 | } |
| 1250 | 1251 | |
| 1251 | − if (elapsed > ADJUST_LOD_UP_DELAY && _fpsAverage.getAverage() > ADJUST_LOD_UP_FPS | |
| 1252 | + if (elapsed > ADJUST_LOD_UP_DELAY && _fpsAverage.getAverage() > ADJUST_LOD_UP_FPS | |
| 1252 | 1253 | && _voxelSizeScale < ADJUST_LOD_MAX_SIZE_SCALE) { |
| 1253 | 1254 | _voxelSizeScale *= ADJUST_LOD_UP_BY; |
| 1254 | 1255 | if (_voxelSizeScale > ADJUST_LOD_MAX_SIZE_SCALE) { |
| @@ -1259,7 +1260,7 @@ void Menu::autoAdjustLOD(float currentFPS) { · 4 unmodified lines | ||
| 1259 | 1260 | qDebug() << "adjusting LOD up... average fps for last approximately 5 seconds=" << _fpsAverage.getAverage() |
| 1260 | 1261 | << "_voxelSizeScale=" << _voxelSizeScale; |
| 1261 | 1262 | } |
| 1262 | − | |
| 1263 | + | |
| 1263 | 1264 | if (changed) { |
| 1264 | 1265 | if (_lodToolsDialog) { |
| 1265 | 1266 | _lodToolsDialog->reloadSliders(); |
| @@ -1337,13 +1338,13 @@ void Menu::addAvatarCollisionSubMenu(QMenu* overMenu) { · 71 unmodified lines | ||
| 1337 | 1338 | |
| 1338 | 1339 | Application* appInstance = Application::getInstance(); |
| 1339 | 1340 | QObject* avatar = appInstance->getAvatar(); |
| 1340 | − addCheckableActionToQMenuAndActionHash(subMenu, MenuOption::CollideWithEnvironment, | |
| 1341 | + addCheckableActionToQMenuAndActionHash(subMenu, MenuOption::CollideWithEnvironment, | |
| 1341 | 1342 | 0, false, avatar, SLOT(updateCollisionFlags())); |
| 1342 | − addCheckableActionToQMenuAndActionHash(subMenu, MenuOption::CollideWithAvatars, | |
| 1343 | + addCheckableActionToQMenuAndActionHash(subMenu, MenuOption::CollideWithAvatars, | |
| 1343 | 1344 | 0, true, avatar, SLOT(updateCollisionFlags())); |
| 1344 | − addCheckableActionToQMenuAndActionHash(subMenu, MenuOption::CollideWithVoxels, | |
| 1345 | + addCheckableActionToQMenuAndActionHash(subMenu, MenuOption::CollideWithVoxels, | |
| 1345 | 1346 | 0, false, avatar, SLOT(updateCollisionFlags())); |
| 1346 | − addCheckableActionToQMenuAndActionHash(subMenu, MenuOption::CollideWithParticles, | |
| 1347 | + addCheckableActionToQMenuAndActionHash(subMenu, MenuOption::CollideWithParticles, | |
| 1347 | 1348 | 0, true, avatar, SLOT(updateCollisionFlags())); |
| 1348 | 1349 | } |
| 1349 | 1350 | |
| @@ -1352,9 +1353,9 @@ QAction* Menu::getActionFromName(const QString& menuName, QMenu* menu) { · 2 unmodified lines | ||
| 1352 | 1353 | if (menu) { |
| 1353 | 1354 | menuActions = menu->actions(); |
| 1354 | 1355 | } else { |
| 1355 | − menuActions = actions(); | |
| 1356 | + menuActions = actions(); | |
| 1356 | 1357 | } |
| 1357 | − | |
| 1358 | + | |
| 1358 | 1359 | foreach (QAction* menuAction, menuActions) { |
| 1359 | 1360 | if (menuName == menuAction->text()) { |
| 1360 | 1361 | return menuAction; |
| @@ -1461,7 +1462,7 @@ QMenu* Menu::addMenu(const QString& menuName) { · 100 unmodified lines | ||
| 1461 | 1462 | |
| 1462 | 1463 | void Menu::removeMenu(const QString& menuName) { |
| 1463 | 1464 | QAction* action = getMenuAction(menuName); |
| 1464 | − | |
| 1465 | + | |
| 1465 | 1466 | // only proceed if the menu actually exists |
| 1466 | 1467 | if (action) { |
| 1467 | 1468 | QString finalMenuPart; |
| @@ -1513,7 +1514,7 @@ void Menu::addMenuItem(const MenuItemProperties& properties) { · 45 unmodified lines | ||
| 1513 | 1514 | if (!properties.shortcutKeySequence.isEmpty()) { |
| 1514 | 1515 | shortcut = new QShortcut(properties.shortcutKeySequence, this); |
| 1515 | 1516 | } |
| 1516 | − | |
| 1517 | + | |
| 1517 | 1518 | // check for positioning requests |
| 1518 | 1519 | int requestedPosition = properties.position; |
| 1519 | 1520 | if (requestedPosition == UNSPECIFIED_POSITION && !properties.beforeItem.isEmpty()) { |
| @@ -1527,13 +1528,13 @@ void Menu::addMenuItem(const MenuItemProperties& properties) { · 7 unmodified lines | ||
| 1527 | 1528 | requestedPosition = afterPosition + 1; |
| 1528 | 1529 | } |
| 1529 | 1530 | } |
| 1530 | − | |
| 1531 | + | |
| 1531 | 1532 | QAction* menuItemAction = NULL; |
| 1532 | 1533 | if (properties.isSeparator) { |
| 1533 | 1534 | addDisabledActionAndSeparator(menuObj, properties.menuItemName, requestedPosition); |
| 1534 | 1535 | } else if (properties.isCheckable) { |
| 1535 | 1536 | menuItemAction = addCheckableActionToQMenuAndActionHash(menuObj, properties.menuItemName, |
| 1536 | − properties.shortcutKeySequence, properties.isChecked, | |
| 1537 | + properties.shortcutKeySequence, properties.isChecked, | |
| 1537 | 1538 | MenuScriptingInterface::getInstance(), SLOT(menuItemTriggered()), requestedPosition); |
| 1538 | 1539 | } else { |
| 1539 | 1540 | menuItemAction = addActionToQMenuAndActionHash(menuObj, properties.menuItemName, properties.shortcutKeySequence, |