Salome HOME
Constriction type for all sketch entities
[modules/shaper.git] / src / XGUI / XGUI_ActionsMgr.cpp
index c3613d22b9a9eab202a4cdd7f00502afac90f377..33f1826a792e99d7bcb183d94f35cddb37e78f2d 100644 (file)
@@ -142,9 +142,6 @@ void XGUI_ActionsMgr::updateOnViewSelection()
   foreach(QString aId, nestedCommands(aFeatureId)) {
     std::list<ModelAPI_Validator*> aValidators;
     std::list<std::list<std::string> > anArguments;
-    if (!anArguments.empty()) {
-      std::list<std::string> firstArg = anArguments.front();
-    }
     aFactory->validators(aId.toStdString(), aValidators, anArguments);
     std::list<ModelAPI_Validator*>::iterator aValidator = aValidators.begin();
     std::list<std::list<std::string> >::iterator aValidatorArgs = anArguments.begin();
@@ -228,9 +225,13 @@ QAction* XGUI_ActionsMgr::operationStateAction(OperationStateActionId theId, QOb
         aResult = new QAction(QIcon(":pictures/button_ok.png"), "", theParent);
         break;
       case Abort:
-      case AbortAll:
+      case AbortAll: {
         aResult = new QAction(QIcon(":pictures/button_cancel.png"), "", theParent);
-        break;
+        if(theId == Abort) {
+          aResult->setShortcut(QKeySequence(Qt::Key_Escape));
+        }
+      }
+      break;
       case Help:
         aResult = new QAction(QIcon(":pictures/button_help.png"), "", theParent);
         break;
@@ -242,6 +243,18 @@ QAction* XGUI_ActionsMgr::operationStateAction(OperationStateActionId theId, QOb
   return aResult;
 }
 
+ActionInfo XGUI_ActionsMgr::actionInfoById(const QString& theId)
+{
+  ActionInfo aResult;
+  if(myActions.contains(theId)) {
+    aResult.initFrom(myActions.value(theId));
+  } else {
+   aResult.id = theId;
+   aResult.text = theId;
+  }
+  return aResult;
+}
+
 void XGUI_ActionsMgr::setAllEnabled(bool isEnabled)
 {
   foreach(QString eachAction, myActions.keys())