Salome HOME
Issue #2159 Hide all incomplete behavior
[modules/shaper.git] / src / XGUI / XGUI_Tools.cpp
index a60b1f2190ac49b646281c1a5fd8f4a8ac93d136..cd310eef0b4351b893282063740d80f47618ed6e 100644 (file)
@@ -44,7 +44,8 @@ QString dir(const QString& path, bool isAbs)
 QString file(const QString& path, bool withExt)
 {
   QString fPath = path;
-  while (!fPath.isEmpty() && (fPath[fPath.length() - 1] == '\\' || fPath[fPath.length() - 1] == '/'))
+  while (!fPath.isEmpty() && (fPath[fPath.length() - 1] == '\\' ||
+          fPath[fPath.length() - 1] == '/'))
     fPath.remove(fPath.length() - 1, 1);
 
   if (withExt)
@@ -113,9 +114,10 @@ bool canRemoveOrRename(QWidget* theParent, const std::set<FeaturePtr>& theFeatur
   if (!ModelAPI_Tools::allDocumentsActivated(aNotActivatedNames)) {
     bool aFoundPartSetObject = ModuleBase_Tools::hasModuleDocumentFeature(theFeatures);
     if (aFoundPartSetObject) {
+      const char* aKeyStr = "Selected objects can be used in Part documents which are not loaded: "
+                            "%1. Whould you like to continue?";
       QMessageBox::StandardButton aRes = QMessageBox::warning(theParent, QObject::tr("Warning"),
-               QObject::tr("Selected objects can be used in Part documents which are not loaded: \
-%1. Whould you like to continue?").arg(aNotActivatedNames.c_str()),
+               QObject::tr(aKeyStr).arg(aNotActivatedNames.c_str()),
                QMessageBox::No | QMessageBox::Yes, QMessageBox::No);
       aResult = aRes == QMessageBox::Yes;
     }
@@ -129,11 +131,13 @@ bool canRename(const ObjectPtr& theObject, const QString& theName)
   if (std::dynamic_pointer_cast<ModelAPI_ResultParameter>(theObject).get()) {
     double aValue;
     ResultParameterPtr aParam;
-    if (ModelAPI_Tools::findVariable(theObject->document(), 
+    if (ModelAPI_Tools::findVariable(theObject->document(),
           FeaturePtr(), qPrintable(theName), aValue, aParam)) {
-      QString aErrMsg(QObject::tr("Selected parameter can not be renamed to: %1. \
- There is a parameter with the same name. Its value is: %2.").arg(qPrintable(theName)).arg(aValue));
-      // We can not use here a dialog box for message - it will crash editing process in ObjectBrowser
+      const char* aKeyStr = "Selected parameter can not be renamed to: %1. "
+                            "There is a parameter with the same name. Its value is: %2.";
+      QString aErrMsg(QObject::tr(aKeyStr).arg(qPrintable(theName)).arg(aValue));
+      // We can not use here a dialog box for message -
+      // it will crash editing process in ObjectBrowser
       Events_InfoMessage("XGUI_Tools", aErrMsg.toStdString()).send();
       return false;
     }