History

first cut at adding advanced and developer menu groupings

Brad Hefta-Gaub committed 10 years ago

Commit 2815cb01 parent 63c3f7c7 files · +250 −101Browse files

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

Unified · Split

interface/src/Menu.cpp+164−60
@@ -68,16 +68,22 @@ Menu::Menu() { · 67 unmodified lines
6868 dialogsManager.data(), &DialogsManager::toggleLoginDialog);
6969 }
7070
71− addDisabledActionAndSeparator(fileMenu, "Scripts");
71+ // File Menu > Scripts section -- "Advanced" grouping
72+ addDisabledActionAndSeparator(fileMenu, "Scripts", UNSPECIFIED_POSITION, "Advanced");
7273 addActionToQMenuAndActionHash(fileMenu, MenuOption::LoadScript, Qt::CTRL | Qt::Key_O,
73− qApp, SLOT(loadDialog()));
74+ qApp, SLOT(loadDialog()),
75+ QAction::NoRole, UNSPECIFIED_POSITION, "Advanced");
7476 addActionToQMenuAndActionHash(fileMenu, MenuOption::LoadScriptURL,
75− Qt::CTRL | Qt::SHIFT | Qt::Key_O, qApp, SLOT(loadScriptURLDialog()));
76− addActionToQMenuAndActionHash(fileMenu, MenuOption::StopAllScripts, 0, qApp, SLOT(stopAllScripts()));
77+ Qt::CTRL | Qt::SHIFT | Qt::Key_O, qApp, SLOT(loadScriptURLDialog()),
78+ QAction::NoRole, UNSPECIFIED_POSITION, "Advanced");
79+ addActionToQMenuAndActionHash(fileMenu, MenuOption::StopAllScripts, 0, qApp, SLOT(stopAllScripts()),
80+ QAction::NoRole, UNSPECIFIED_POSITION, "Advanced");
7781 addActionToQMenuAndActionHash(fileMenu, MenuOption::ReloadAllScripts, Qt::CTRL | Qt::Key_R,
78− qApp, SLOT(reloadAllScripts()));
82+ qApp, SLOT(reloadAllScripts()),
83+ QAction::NoRole, UNSPECIFIED_POSITION, "Advanced");
7984 addActionToQMenuAndActionHash(fileMenu, MenuOption::RunningScripts, Qt::CTRL | Qt::Key_J,
80− qApp, SLOT(toggleRunningScriptsWidget()));
85+ qApp, SLOT(toggleRunningScriptsWidget()),
86+ QAction::NoRole, UNSPECIFIED_POSITION, "Advanced");
8187
8288 auto addressManager = DependencyManager::get<AddressManager>();
8389
@@ -112,9 +118,11 @@ Menu::Menu() { · 28 unmodified lines
112118 dialogsManager.data(),
113119 SLOT(toggleAddressBar()));
114120 addActionToQMenuAndActionHash(fileMenu, MenuOption::CopyAddress, 0,
115− addressManager.data(), SLOT(copyAddress()));
121+ addressManager.data(), SLOT(copyAddress()),
122+ QAction::NoRole, UNSPECIFIED_POSITION, "Advanced");
116123 addActionToQMenuAndActionHash(fileMenu, MenuOption::CopyPath, 0,
117− addressManager.data(), SLOT(copyPath()));
124+ addressManager.data(), SLOT(copyPath()),
125+ QAction::NoRole, UNSPECIFIED_POSITION, "Advanced");
118126
119127 addActionToQMenuAndActionHash(fileMenu,
120128 MenuOption::Quit,
@@ -143,11 +151,13 @@ Menu::Menu() { · 22 unmodified lines
143151 QAction::PreferencesRole);
144152
145153 addActionToQMenuAndActionHash(editMenu, MenuOption::Attachments, 0,
146− dialogsManager.data(), SLOT(editAttachments()));
154+ dialogsManager.data(), SLOT(editAttachments()),
155+ QAction::NoRole, UNSPECIFIED_POSITION, "Advanced");
147156
148157 MenuWrapper* toolsMenu = addMenu("Tools");
149158 addActionToQMenuAndActionHash(toolsMenu, MenuOption::ScriptEditor, Qt::ALT | Qt::Key_S,
150− dialogsManager.data(), SLOT(showScriptEditor()));
159+ dialogsManager.data(), SLOT(showScriptEditor()),
160+ QAction::NoRole, UNSPECIFIED_POSITION, "Advanced");
151161
152162 #if defined(Q_OS_MAC) || defined(Q_OS_WIN)
153163 auto speechRecognizer = DependencyManager::get<SpeechRecognizer>();
@@ -155,13 +165,16 @@ Menu::Menu() { · 1 unmodified line
155165 Qt::CTRL | Qt::SHIFT | Qt::Key_C,
156166 speechRecognizer->getEnabled(),
157167 speechRecognizer.data(),
158− SLOT(setEnabled(bool)));
168+ SLOT(setEnabled(bool)),
169+ UNSPECIFIED_POSITION, "Advanced");
159170 connect(speechRecognizer.data(), SIGNAL(enabledUpdated(bool)), speechRecognizerAction, SLOT(setChecked(bool)));
160171 #endif
161172
162173 addActionToQMenuAndActionHash(toolsMenu, MenuOption::Chat,
163174 0, // QML Qt::Key_Backslash,
164− dialogsManager.data(), SLOT(showIRCLink()));
175+ dialogsManager.data(), SLOT(showIRCLink()),
176+ QAction::NoRole, UNSPECIFIED_POSITION, "Advanced");
177+
165178 addActionToQMenuAndActionHash(toolsMenu, MenuOption::AddRemoveFriends, 0,
166179 qApp, SLOT(showFriendsWindow()));
167180
@@ -193,22 +206,26 @@ Menu::Menu() { · 25 unmodified lines
193206 MenuOption::ToolWindow,
194207 Qt::CTRL | Qt::ALT | Qt::Key_T,
195208 dialogsManager.data(),
196− SLOT(toggleToolWindow()));
209+ SLOT(toggleToolWindow()),
210+ QAction::NoRole, UNSPECIFIED_POSITION, "Advanced");
197211
198212 addActionToQMenuAndActionHash(toolsMenu,
199213 MenuOption::Console,
200214 Qt::CTRL | Qt::ALT | Qt::Key_J,
201215 DependencyManager::get<StandAloneJSConsole>().data(),
202− SLOT(toggleConsole()));
216+ SLOT(toggleConsole()),
217+ QAction::NoRole, UNSPECIFIED_POSITION, "Advanced");
203218
204219 addActionToQMenuAndActionHash(toolsMenu,
205220 MenuOption::ResetSensors,
206221 0, // QML Qt::Key_Apostrophe,
207222 qApp,
208− SLOT(resetSensors()));
223+ SLOT(resetSensors()),
224+ QAction::NoRole, UNSPECIFIED_POSITION, "Advanced");
209225
210226 addActionToQMenuAndActionHash(toolsMenu, MenuOption::PackageModel, 0,
211− qApp, SLOT(packageModel()));
227+ qApp, SLOT(packageModel()),
228+ QAction::NoRole, UNSPECIFIED_POSITION, "Advanced");
212229
213230 addMenu(DisplayPlugin::MENU_PATH());
214231 {
@@ -220,7 +237,7 @@ Menu::Menu() { · 5 unmodified lines
220237 MenuWrapper* avatarMenu = addMenu("Avatar");
221238 QObject* avatar = DependencyManager::get<AvatarManager>()->getMyAvatar();
222239
223− MenuWrapper* inputModeMenu = addMenu(MenuOption::InputMenu);
240+ MenuWrapper* inputModeMenu = addMenu(MenuOption::InputMenu, "Advanced");
224241 QActionGroup* inputModeGroup = new QActionGroup(inputModeMenu);
225242 inputModeGroup->setExclusive(false);
226243
@@ -241,17 +258,15 @@ Menu::Menu() { · 14 unmodified lines
241258 avatar,
242259 SLOT(resetSize()));
243260
244− addCheckableActionToQMenuAndActionHash(avatarMenu, MenuOption::KeyboardMotorControl,
245− Qt::CTRL | Qt::SHIFT | Qt::Key_K, true, avatar, SLOT(updateMotionBehaviorFromMenu()));
246− addCheckableActionToQMenuAndActionHash(avatarMenu, MenuOption::ScriptedMotorControl, 0, true,
247− avatar, SLOT(updateMotionBehaviorFromMenu()));
248− addCheckableActionToQMenuAndActionHash(avatarMenu, MenuOption::NamesAboveHeads, 0, true);
249− addCheckableActionToQMenuAndActionHash(avatarMenu, MenuOption::BlueSpeechSphere, 0, true);
250− addCheckableActionToQMenuAndActionHash(avatarMenu, MenuOption::EnableCharacterController, 0, true,
251− avatar, SLOT(updateMotionBehaviorFromMenu()));
261+ addCheckableActionToQMenuAndActionHash(avatarMenu, MenuOption::NamesAboveHeads, 0, true,
262+ NULL, NULL, UNSPECIFIED_POSITION, "Advanced");
263+
264+ addCheckableActionToQMenuAndActionHash(avatarMenu, MenuOption::BlueSpeechSphere, 0, true,
265+ NULL, NULL, UNSPECIFIED_POSITION, "Advanced");
252266
253267 MenuWrapper* viewMenu = addMenu("View");
254− addActionToQMenuAndActionHash(viewMenu, MenuOption::ReloadContent, 0, qApp, SLOT(reloadResourceCaches()));
268+ addActionToQMenuAndActionHash(viewMenu, MenuOption::ReloadContent, 0, qApp, SLOT(reloadResourceCaches()),
269+ QAction::NoRole, UNSPECIFIED_POSITION, "Advanced");
255270
256271 MenuWrapper* cameraModeMenu = viewMenu->addMenu("Camera Mode");
257272 QActionGroup* cameraModeGroup = new QActionGroup(cameraModeMenu);
@@ -275,30 +290,29 @@ Menu::Menu() { · 17 unmodified lines
275290 addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::Mirror,
276291 0, //QML Qt::SHIFT | Qt::Key_H,
277292 true);
278− addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::FullscreenMirror,
279− 0, // QML Qt::Key_H,
280− false, qApp, SLOT(cameraMenuChanged()));
281293
282294 addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::CenterPlayerInView,
283− 0, false, qApp, SLOT(rotationModeChanged()));
284−
285− addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::TurnWithHead, 0, false);
295+ 0, false, qApp, SLOT(rotationModeChanged()),
296+ UNSPECIFIED_POSITION, "Advanced");
286297
287− addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::WorldAxes);
288−
289− addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::Stats);
298+ addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::WorldAxes, 0, false, NULL, NULL, UNSPECIFIED_POSITION, "Developer");
299+ addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::Stats, 0, false, NULL, NULL, UNSPECIFIED_POSITION, "Developer");
290300 addActionToQMenuAndActionHash(viewMenu, MenuOption::Log,
291− Qt::CTRL | Qt::SHIFT | Qt::Key_L,
292− qApp, SLOT(toggleLogDialog()));
301+ Qt::CTRL | Qt::SHIFT | Qt::Key_L,
302+ qApp, SLOT(toggleLogDialog()), QAction::NoRole, UNSPECIFIED_POSITION, "Developer");
303+
293304 addActionToQMenuAndActionHash(viewMenu, MenuOption::AudioNetworkStats, 0,
294− dialogsManager.data(), SLOT(audioStatsDetails()));
305+ dialogsManager.data(), SLOT(audioStatsDetails()), QAction::NoRole, UNSPECIFIED_POSITION, "Developer");
306+
295307 addActionToQMenuAndActionHash(viewMenu, MenuOption::BandwidthDetails, 0,
296− dialogsManager.data(), SLOT(bandwidthDetails()));
308+ dialogsManager.data(), SLOT(bandwidthDetails()), QAction::NoRole, UNSPECIFIED_POSITION, "Developer");
297309 addActionToQMenuAndActionHash(viewMenu, MenuOption::OctreeStats, 0,
298− dialogsManager.data(), SLOT(octreeStatsDetails()));
310+ dialogsManager.data(), SLOT(octreeStatsDetails()), QAction::NoRole, UNSPECIFIED_POSITION, "Developer");
299311
312+ addCheckableActionToQMenuAndActionHash(viewMenu, "Advanced Menus", 0, false, this, SLOT(toggleAdvancedMenus()));
313+ addCheckableActionToQMenuAndActionHash(viewMenu, "Developer Menus", 0, false, this, SLOT(toggleDeveloperMenus()));
300314
301− MenuWrapper* developerMenu = addMenu("Developer");
315+ MenuWrapper* developerMenu = addMenu("Developer", "Developer");
302316
303317 MenuWrapper* renderOptionsMenu = developerMenu->addMenu("Render");
304318 addCheckableActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::Atmosphere,
@@ -447,9 +461,23 @@ Menu::Menu() { · 142 unmodified lines
447461 addCheckableActionToQMenuAndActionHash(avatarDebugMenu, MenuOption::MeshVisible, 0, true,
448462 avatar, SLOT(setEnableMeshVisible(bool)));
449463 addCheckableActionToQMenuAndActionHash(avatarDebugMenu, MenuOption::DisableEyelidAdjustment, 0, false);
450−
464+ addCheckableActionToQMenuAndActionHash(avatarDebugMenu, MenuOption::TurnWithHead, 0, false);
451465 addCheckableActionToQMenuAndActionHash(avatarDebugMenu, MenuOption::ComfortMode, 0, true);
452466
467+ addCheckableActionToQMenuAndActionHash(avatarDebugMenu, MenuOption::KeyboardMotorControl,
468+ Qt::CTRL | Qt::SHIFT | Qt::Key_K, true, avatar, SLOT(updateMotionBehaviorFromMenu()),
469+ UNSPECIFIED_POSITION, "Developer");
470+
471+ addCheckableActionToQMenuAndActionHash(avatarDebugMenu, MenuOption::ScriptedMotorControl, 0, true,
472+ avatar, SLOT(updateMotionBehaviorFromMenu()),
473+ UNSPECIFIED_POSITION, "Developer");
474+
475+ addCheckableActionToQMenuAndActionHash(avatarDebugMenu, MenuOption::EnableCharacterController, 0, true,
476+ avatar, SLOT(updateMotionBehaviorFromMenu()),
477+ UNSPECIFIED_POSITION, "Developer");
478+
479+
480+
453481 MenuWrapper* handOptionsMenu = developerMenu->addMenu("Hands");
454482 addCheckableActionToQMenuAndActionHash(handOptionsMenu, MenuOption::DisplayHandTargets, 0, false);
455483 addCheckableActionToQMenuAndActionHash(handOptionsMenu, MenuOption::EnableHandMouseInput, 0, false);
@@ -573,6 +601,14 @@ Menu::Menu() { · 117 unmodified lines
573601 #endif
574602 }
575603
604+void Menu::toggleAdvancedMenus() {
605+ setGroupingIsVisible("Advanced", !getGroupingIsVisible("Advanced"));
606+}
607+
608+void Menu::toggleDeveloperMenus() {
609+ setGroupingIsVisible("Developer", !getGroupingIsVisible("Developer"));
610+}
611+
576612 void Menu::loadSettings() {
577613 scanMenuBar(&Menu::loadAction);
578614 }
@@ -610,23 +646,36 @@ void Menu::scanMenu(QMenu& menu, settingsAction modifySetting, Settings& setting · 31 unmodified lines
610646 settings.endGroup();
611647 }
612648
613−void Menu::addDisabledActionAndSeparator(MenuWrapper* destinationMenu, const QString& actionName, int menuItemLocation) {
649+void Menu::addDisabledActionAndSeparator(MenuWrapper* destinationMenu, const QString& actionName,
650+ int menuItemLocation, const QString& grouping) {
614651 QAction* actionBefore = NULL;
652+ QAction* separator;
653+ QAction* separatorText;
654+
615655 if (menuItemLocation >= 0 && destinationMenu->actions().size() > menuItemLocation) {
616656 actionBefore = destinationMenu->actions()[menuItemLocation];
617657 }
618658 if (actionBefore) {
619− QAction* separator = new QAction("",destinationMenu);
659+ separator = new QAction("",destinationMenu);
620660 destinationMenu->insertAction(actionBefore, separator);
621661 separator->setSeparator(true);
622662
623− QAction* separatorText = new QAction(actionName,destinationMenu);
663+ separatorText = new QAction(actionName,destinationMenu);
624664 separatorText->setEnabled(false);
625665 destinationMenu->insertAction(actionBefore, separatorText);
626666
627667 } else {
628− destinationMenu->addSeparator();
629− (destinationMenu->addAction(actionName))->setEnabled(false);
668+ separator = destinationMenu->addSeparator();
669+ separatorText = destinationMenu->addAction(actionName);
670+ separatorText->setEnabled(false);
671+ }
672+
673+ if (isValidGrouping(grouping)) {
674+ _groupingActions[grouping] << separator;
675+ _groupingActions[grouping] << separatorText;
676+ bool isVisible = getGroupingIsVisible(grouping);
677+ separator->setVisible(isVisible);
678+ separatorText->setVisible(isVisible);
630679 }
631680 }
632681
@@ -636,7 +685,8 @@ QAction* Menu::addActionToQMenuAndActionHash(MenuWrapper* destinationMenu, · 3 unmodified lines
636685 const QObject* receiver,
637686 const char* member,
638687 QAction::MenuRole role,
639− int menuItemLocation) {
688+ int menuItemLocation,
689+ const QString& grouping) {
640690 QAction* action = NULL;
641691 QAction* actionBefore = NULL;
642692
@@ -664,6 +714,11 @@ QAction* Menu::addActionToQMenuAndActionHash(MenuWrapper* destinationMenu, · 21 unmodified lines
664714
665715 _actionHash.insert(actionName, action);
666716
717+ if (isValidGrouping(grouping)) {
718+ _groupingActions[grouping] << action;
719+ action->setVisible(getGroupingIsVisible(grouping));
720+ }
721+
667722 return action;
668723 }
669724
@@ -672,7 +727,8 @@ QAction* Menu::addActionToQMenuAndActionHash(MenuWrapper* destinationMenu, · 2 unmodified lines
672727 const QString& actionName,
673728 const QKeySequence& shortcut,
674729 QAction::MenuRole role,
675− int menuItemLocation) {
730+ int menuItemLocation,
731+ const QString& grouping) {
676732 QAction* actionBefore = NULL;
677733
678734 if (menuItemLocation >= 0 && destinationMenu->actions().size() > menuItemLocation) {
@@ -699,6 +755,11 @@ QAction* Menu::addActionToQMenuAndActionHash(MenuWrapper* destinationMenu, · 20 unmodified lines
699755
700756 _actionHash.insert(action->text(), action);
701757
758+ if (isValidGrouping(grouping)) {
759+ _groupingActions[grouping] << action;
760+ action->setVisible(getGroupingIsVisible(grouping));
761+ }
762+
702763 return action;
703764 }
704765
@@ -708,19 +769,29 @@ QAction* Menu::addCheckableActionToQMenuAndActionHash(MenuWrapper* destinationMe · 3 unmodified lines
708769 const bool checked,
709770 const QObject* receiver,
710771 const char* member,
711− int menuItemLocation) {
772+ int menuItemLocation,
773+ const QString& grouping) {
712774
713775 QAction* action = addActionToQMenuAndActionHash(destinationMenu, actionName, shortcut, receiver, member,
714776 QAction::NoRole, menuItemLocation);
715777 action->setCheckable(true);
716778 action->setChecked(checked);
717779
780+ if (isValidGrouping(grouping)) {
781+ _groupingActions[grouping] << action;
782+ action->setVisible(getGroupingIsVisible(grouping));
783+ }
784+
718785 return action;
719786 }
720787
721788 void Menu::removeAction(MenuWrapper* menu, const QString& actionName) {
722− menu->removeAction(_actionHash.value(actionName));
789+ auto action = _actionHash.value(actionName);
790+ menu->removeAction(action);
723791 _actionHash.remove(actionName);
792+ for (auto& grouping : _groupingActions) {
793+ grouping.remove(action);
794+ }
724795 }
725796
726797 void Menu::setIsOptionChecked(const QString& menuOption, bool isChecked) {
@@ -850,7 +921,7 @@ int Menu::positionBeforeSeparatorIfNeeded(MenuWrapper* menu, int requestedPositi · 123 unmodified lines
850921 }
851922
852923
853−MenuWrapper* Menu::addMenu(const QString& menuName) {
924+MenuWrapper* Menu::addMenu(const QString& menuName, const QString& grouping) {
854925 QStringList menuTree = menuName.split(">");
855926 MenuWrapper* addTo = NULL;
856927 MenuWrapper* menu = NULL;
@@ -866,6 +937,14 @@ MenuWrapper* Menu::addMenu(const QString& menuName) { · 9 unmodified lines
866937 addTo = menu;
867938 }
868939
940+ if (isValidGrouping(grouping)) {
941+ auto action = getMenuAction(menuName);
942+ if (action) {
943+ _groupingActions[grouping] << action;
944+ action->setVisible(getGroupingIsVisible(grouping));
945+ }
946+ }
947+
869948 QMenuBar::repaint();
870949 return menu;
871950 }
@@ -897,7 +976,7 @@ bool Menu::menuExists(const QString& menuName) { · 25 unmodified lines
897976 return false;
898977 }
899978
900−void Menu::addSeparator(const QString& menuName, const QString& separatorName) {
979+void Menu::addSeparator(const QString& menuName, const QString& separatorName, const QString& grouping) {
901980 MenuWrapper* menuObj = getMenu(menuName);
902981 if (menuObj) {
903982 addDisabledActionAndSeparator(menuObj, separatorName);
@@ -952,15 +1031,16 @@ void Menu::addMenuItem(const MenuItemProperties& properties) { · 48 unmodified lines
9521031
9531032 QAction* menuItemAction = NULL;
9541033 if (properties.isSeparator) {
955− addDisabledActionAndSeparator(menuObj, properties.menuItemName, requestedPosition);
1034+ addDisabledActionAndSeparator(menuObj, properties.menuItemName, requestedPosition, properties.grouping);
9561035 } else if (properties.isCheckable) {
9571036 menuItemAction = addCheckableActionToQMenuAndActionHash(menuObj, properties.menuItemName,
9581037 properties.shortcutKeySequence, properties.isChecked,
959− MenuScriptingInterface::getInstance(), SLOT(menuItemTriggered()), requestedPosition);
1038+ MenuScriptingInterface::getInstance(), SLOT(menuItemTriggered()),
1039+ requestedPosition, properties.grouping);
9601040 } else {
9611041 menuItemAction = addActionToQMenuAndActionHash(menuObj, properties.menuItemName, properties.shortcutKeySequence,
9621042 MenuScriptingInterface::getInstance(), SLOT(menuItemTriggered()),
963− QAction::NoRole, requestedPosition);
1043+ QAction::NoRole, requestedPosition, properties.grouping);
9641044 }
9651045 if (shortcut && menuItemAction) {
9661046 connect(shortcut, SIGNAL(activated()), menuItemAction, SLOT(trigger()));
@@ -975,7 +1055,7 @@ void Menu::removeMenuItem(const QString& menu, const QString& menuitem) { · 8 unmodified lines
9751055 removeAction(menuObj, menuitem);
9761056 QMenuBar::repaint();
9771057 }
978−};
1058+}
9791059
9801060 bool Menu::menuItemExists(const QString& menu, const QString& menuitem) {
9811061 QAction* menuItemAction = _actionHash.value(menuitem);
@@ -983,7 +1063,31 @@ bool Menu::menuItemExists(const QString& menu, const QString& menuitem) { · 1 unmodified line
9831063 return (getMenu(menu) != NULL);
9841064 }
9851065 return false;
986−};
1066+}
1067+
1068+bool Menu::getGroupingIsVisible(const QString& grouping) {
1069+ if (grouping.isEmpty() || grouping.isNull()) {
1070+ return true;
1071+ }
1072+ if (_groupingVisible.contains(grouping)) {
1073+ return _groupingVisible[grouping];
1074+ }
1075+ return false;
1076+}
1077+
1078+void Menu::setGroupingIsVisible(const QString& grouping, bool isVisible) {
1079+ // NOTE: Default grouping always visible
1080+ if (grouping.isEmpty() || grouping.isNull()) {
1081+ return;
1082+ }
1083+ _groupingVisible[grouping] = isVisible;
1084+
1085+ for (auto action: _groupingActions[grouping]) {
1086+ action->setVisible(isVisible);
1087+ }
1088+
1089+ QMenuBar::repaint();
1090+}
9871091
9881092
9891093 MenuWrapper::MenuWrapper(QMenu* menu) : _realMenu(menu) {
@@ -1005,8 +1109,8 @@ void MenuWrapper::setEnabled(bool enabled) { · 15 unmodified lines
10051109 _realMenu->setEnabled(enabled);
10061110 }
10071111
1008−void MenuWrapper::addSeparator() {
1009− _realMenu->addSeparator();
1112+QAction* MenuWrapper::addSeparator() {
1113+ return _realMenu->addSeparator();
10101114 }
10111115
10121116 void MenuWrapper::addAction(QAction* action) {