- XGUI_Workbench* aPage = dynamic_cast<XGUI_Workbench*>(myMenuTabs[thePageId]->widget());
- return aPage->addGroup();
+ if (!isChecked) {
+ restoreCommandState();
+ return;
+ }
+
+ saveCommandsState();
+ QStringList aSkippedIds;
+ XGUI_Command* aToggledFeature = dynamic_cast<XGUI_Command*>(sender());
+ aSkippedIds.append(aToggledFeature->unblockableCommands());
+// aSkippedIds.append(aToggledFeature->id());
+ XGUI_Workbench* aGeneralWB = findWorkbench(tr("General"));
+ foreach(XGUI_Command* eachFeature, aGeneralWB->features()) {
+ aSkippedIds.append(eachFeature->id());
+ }
+ QList<XGUI_Command*> allFeatures = features();
+ foreach(XGUI_Command* eachFeature, allFeatures) {
+ QString aFeatureId = eachFeature->id();
+ if (aSkippedIds.removeAll(aFeatureId) > 0) {
+ continue;
+ }
+ eachFeature->setEnabled(false);
+ }