}
if (isUseTransaction) {
aMgr->finishOperation();
+ XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(myModule->workshop());
+ XGUI_Workshop* aWorkshop = aConnector->workshop();
+ aWorkshop->updateCommandStatus();
}
+
Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_UPDATED));
myModule->sketchMgr()->restoreSelection();
}
return 0;
}
+QAction* XGUI_ContextMenuMgr::actionByName(const QString& theName) const
+{
+ foreach(QAction* eachAction, myActions) {
+ if (eachAction->text() == theName) {
+ return eachAction;
+ }
+ }
+ return NULL;
+}
+
QStringList XGUI_ContextMenuMgr::actionIds() const
{
return myActions.keys();
/// \param theId an id of an action
QAction* action(const QString& theId) const;
+ QAction* actionByName(const QString& theName) const;
+
/// Returns list of registered actions Ids
QStringList actionIds() const;
{
ModuleBase_IModule* aModule = module();
// 1. allow the module to delete objects, do nothing if it has succeed
- if (aModule->deleteObjects())
+ if (aModule->deleteObjects()) {
+ updateCommandStatus();
return;
+ }
if (!isActiveOperationAborted())
return;
if (isEditing) {
anId.chop(ModuleBase_Operation::EditSuffix().size());
}
- ActionInfo anInfo = myActionsMgr->actionInfoById(anId);
+ ActionInfo anInfo;
+ QAction* aContextMenuAct = myContextMenuMgr->actionByName(anId);
+ if (aContextMenuAct) {
+ anInfo.initFrom(aContextMenuAct);
+ } else {
+ anInfo = myActionsMgr->actionInfoById(anId);
+ }
if (isEditing) {
anInfo.text = anInfo.text.prepend("Modify ");
}