QList<QAction*> NewGeom_Module::commandList() const
{
QList<QAction*> aActions;
- for (int i = 0; i < myActionsList.size(); i++)
- aActions.append(action(i));
+ for (int i = 0; i < myActionsList.size(); i++) {
+ QAction* aCmd = action(i);
+ if (aCmd && myActionsList.contains(aCmd->data().toString()))
+ aActions.append(aCmd);
+ }
return aActions;
}
}
SessionPtr aMgr = ModelAPI_Session::get();
if (aMgr->hasModuleDocument()) {
- QAction *aUndoCmd, *aRedoCmd;
foreach(QAction* aCmd, aCommands) {
QString aId = aCmd->data().toString();
if (aId == "UNDO_CMD")
- aUndoCmd = aCmd;
+ aCmd->setEnabled(myModule->canUndo());
else if (aId == "REDO_CMD")
- aRedoCmd = aCmd;
+ aCmd->setEnabled(myModule->canRedo());
else
// Enable all commands
aCmd->setEnabled(true);
}
-
- aUndoCmd->setEnabled(myModule->canUndo());
- aRedoCmd->setEnabled(myModule->canRedo());
updateHistory();
} else {
foreach(QAction* aCmd, aCommands) {