From: vsv Date: Thu, 10 Nov 2016 07:49:33 +0000 (+0300) Subject: Issue #1863: Edit multi-lines X-Git-Tag: V_2.6.0~99 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=7569b92a8570dab734c5336241457bec4f2cdb1c;p=modules%2Fshaper.git Issue #1863: Edit multi-lines --- diff --git a/cpplint.cfg b/cpplint.cfg index e4c091ed6..0b65a5f2b 100644 --- a/cpplint.cfg +++ b/cpplint.cfg @@ -1,5 +1,6 @@ linelength=100 -filter=-whitespace,+whitespace/empty_loop_body,-readability,-build,-runtime +filter=-,+readability/multiline_string root=src -#+whitespace/line_length -#+whitespace/end_of_line +# whitespace/line_length +# whitespace/end_of_line +# whitespace/empty_loop_body diff --git a/src/FeaturesPlugin/FeaturesPlugin_ValidatorTransform.cpp b/src/FeaturesPlugin/FeaturesPlugin_ValidatorTransform.cpp index d64b506b0..c7a92abe0 100755 --- a/src/FeaturesPlugin/FeaturesPlugin_ValidatorTransform.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_ValidatorTransform.cpp @@ -48,8 +48,8 @@ bool FeaturesPlugin_ValidatorTransform::isValid(const AttributePtr& theAttribute if (!aValid) { std::string aResultGroupName = isPartSetDocument ? ModelAPI_ResultPart::group() : ModelAPI_ResultBody::group(); - theError = "Objects from the %1 group can be selected in the %2 document, \ - but an objects from the %3 group is selected."; + theError = "Objects from the %1 group can be selected in the %2 document, " + "but an objects from the %3 group is selected."; theError.arg(aResultGroupName).arg(aDocument->kind()).arg(anErrorGroupName); } return aValid; diff --git a/src/FeaturesPlugin/FeaturesPlugin_Validators.cpp b/src/FeaturesPlugin/FeaturesPlugin_Validators.cpp index be031014b..107815387 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Validators.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Validators.cpp @@ -187,8 +187,8 @@ bool FeaturesPlugin_ValidatorBaseForGeneration::isValid(const AttributePtr& theA // Whole sketch selected. if(aSelectedSketchesFromObjects.find(aResultConstruction) != aSelectedSketchesFromObjects.cend()) { - theError = "Error: Object from this sketch is already selected. \ - Sketch is not allowed for selection."; + theError = "Error: Object from this sketch is already selected. " + "Sketch is not allowed for selection."; return false; } @@ -196,8 +196,8 @@ bool FeaturesPlugin_ValidatorBaseForGeneration::isValid(const AttributePtr& theA } else { // Object from sketch selected. if(aSelectedSketches.find(aResultConstruction) != aSelectedSketches.cend()) { - theError = "Error: Whole sketch with this object is already selected. \ - Don't allow to select this object."; + theError = "Error: Whole sketch with this object is already selected. " + "Don't allow to select this object."; return false; } @@ -299,9 +299,9 @@ bool FeaturesPlugin_ValidatorBaseForGeneration::isValidAttribute(const Attribute // Check that object is a shape with allowed type. GeomValidators_ShapeType aShapeTypeValidator; if(!aShapeTypeValidator.isValid(anAttr, theArguments, theError)) { - theError = "Error: Selected shape has unacceptable type. Acceptable types are: faces or \ - wires on sketch, whole sketch(if it has at least one face), \ - and whole objects with shape types: %1"; + theError = "Error: Selected shape has unacceptable type. Acceptable types are: faces or " + "wires on sketch, whole sketch(if it has at least one face), " + "and whole objects with shape types: %1"; std::string anArgumentString; for(auto anIt = theArguments.cbegin(); anIt != theArguments.cend(); ++anIt) { if (!anArgumentString.empty()) @@ -401,8 +401,8 @@ bool FeaturesPlugin_ValidatorExtrusionDir::isValid( if(!aDirShape.get()) { // Check that dir can be empty. if(!isShapesCanBeEmpty(aCheckAttribute, theError)) { - theError = "Error: Base objects list contains vertex or edge, so attribute \"%1\" \ - can not be used with default value. Select direction for extrusion."; + theError = "Error: Base objects list contains vertex or edge, so attribute \"%1\" " + "can not be used with default value. Select direction for extrusion."; theError.arg(*anArgsIt); return false; } else { diff --git a/src/GeomValidators/GeomValidators_ShapeType.cpp b/src/GeomValidators/GeomValidators_ShapeType.cpp index 022704317..4a417818a 100755 --- a/src/GeomValidators/GeomValidators_ShapeType.cpp +++ b/src/GeomValidators/GeomValidators_ShapeType.cpp @@ -91,8 +91,8 @@ bool GeomValidators_ShapeType::isValid(const AttributePtr& theAttribute, if (!aTypes.empty()) aTypes += ", "; } - theError = "It does not contain element with acceptable shape type. \ - The type should be one of the next: %1"; + theError = "It does not contain element with acceptable shape type. " + "The type should be one of the next: %1"; theError.arg(aTypes); } diff --git a/src/ModuleBase/ModuleBase_Tools.cpp b/src/ModuleBase/ModuleBase_Tools.cpp index ae98b8a18..adf14c58a 100755 --- a/src/ModuleBase/ModuleBase_Tools.cpp +++ b/src/ModuleBase/ModuleBase_Tools.cpp @@ -1151,14 +1151,14 @@ bool askToDelete(const std::set theFeatures, if (!aNotActivatedDocWrn.isEmpty()) aText += aNotActivatedDocWrn; if (!anOtherFeatureNames.empty()) { - const char* aMsg = "Features are used in the following features: %1.\nThese \ - features will be deleted.\n"; + const char* aMsg = "Features are used in the following features: %1.\nThese " + "features will be deleted.\n"; aText += QString(QObject::tr(aMsg)) .arg(anOtherFeatureNames.join(aSep)); } if (!aParamFeatureNames.empty()) { - const char* aMsg = "Parameters are used in the following features: %1.\nThese features will \ - be deleted.\nOr parameters could be replaced by their values.\n"; + const char* aMsg = "Parameters are used in the following features: %1.\nThese features will " + "be deleted.\nOr parameters could be replaced by their values.\n"; aText += QString(QObject::tr(aMsg)) .arg(aParamFeatureNames.join(aSep)); QPushButton *aReplaceButton = diff --git a/src/ParametersPlugin/ParametersPlugin_EvalListener.cpp b/src/ParametersPlugin/ParametersPlugin_EvalListener.cpp index b3a1d73ec..791af81bf 100644 --- a/src/ParametersPlugin/ParametersPlugin_EvalListener.cpp +++ b/src/ParametersPlugin/ParametersPlugin_EvalListener.cpp @@ -392,8 +392,8 @@ void ParametersPlugin_EvalListener::processObjectRenamedEvent( std::string aNotActivatedNames; if (!ModelAPI_Tools::allDocumentsActivated(aNotActivatedNames)) { QMessageBox::StandardButton aRes = QMessageBox::warning(0, 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("Selected objects can be used in Part documents which are not loaded: " + "%1. Whould you like to continue?").arg(aNotActivatedNames.c_str()), QMessageBox::No | QMessageBox::Yes, QMessageBox::No); if (aRes != QMessageBox::Yes) { setParameterName(aResultParameter, aMessage->oldName()); diff --git a/src/PartSet/PartSet_OverconstraintListener.cpp b/src/PartSet/PartSet_OverconstraintListener.cpp index 769c54bca..39ee53259 100755 --- a/src/PartSet/PartSet_OverconstraintListener.cpp +++ b/src/PartSet/PartSet_OverconstraintListener.cpp @@ -63,8 +63,8 @@ void PartSet_OverconstraintListener::processEvent( QString aCurrentInfoStr = getObjectsInfo(myConflictingObjects); - QString aMsg("PartSet_OverconstraintListener::processEvent: %1,\nobjects \ - count = %2:%3\ncurrent objects count = %4:%5"); + QString aMsg("PartSet_OverconstraintListener::processEvent: %1,\nobjects " + "count = %2:%3\ncurrent objects count = %4:%5"); qDebug(aMsg.arg(isRepaired ? "REPAIRED" : "FAILED") .arg(aCount).arg(anInfoStr).arg(myConflictingObjects.size()) .arg(aCurrentInfoStr).toStdString().c_str()); diff --git a/src/SketchSolver/SketchSolver_Error.h b/src/SketchSolver/SketchSolver_Error.h index 148e5de06..8423eb52e 100644 --- a/src/SketchSolver/SketchSolver_Error.h +++ b/src/SketchSolver/SketchSolver_Error.h @@ -20,8 +20,8 @@ class SketchSolver_Error /// The value parameter for the constraint inline static const std::string& CONSTRAINTS() { - static const std::string MY_ERROR_VALUE("The constraint is conflicting with others. \ - To fix this, you can either undo your operation or remove a conflicting constraint."); + static const std::string MY_ERROR_VALUE("The constraint is conflicting with others. " + "To fix this, you can either undo your operation or remove a conflicting constraint."); return MY_ERROR_VALUE; } /// Constraints should use objects instead of features as attributes diff --git a/src/XGUI/XGUI_Tools.cpp b/src/XGUI/XGUI_Tools.cpp index e1aa82f7c..02beb1150 100644 --- a/src/XGUI/XGUI_Tools.cpp +++ b/src/XGUI/XGUI_Tools.cpp @@ -114,9 +114,10 @@ bool canRemoveOrRename(QWidget* theParent, const std::set& 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; } @@ -132,9 +133,9 @@ bool canRename(const ObjectPtr& theObject, const QString& theName) ResultParameterPtr aParam; 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)); + 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(); diff --git a/src/XGUI/XGUI_Workshop.cpp b/src/XGUI/XGUI_Workshop.cpp index 8f01c2d62..45db946d5 100755 --- a/src/XGUI/XGUI_Workshop.cpp +++ b/src/XGUI/XGUI_Workshop.cpp @@ -1488,8 +1488,9 @@ void XGUI_Workshop::cleanHistory() aMessageBox.setStandardButtons(QMessageBox::No | QMessageBox::Yes); aMessageBox.setDefaultButton(QMessageBox::No); - QString aText = QString(tr("Unused features are the following: \ -%1.\nThese features will be deleted.\nWould you like to continue?").arg(anUnusedNames)); + const char* aKeyStr = "Unused features are the following: " + "%1.\nThese features will be deleted.\nWould you like to continue?"; + QString aText = QString(tr(aKeyStr).arg(anUnusedNames)); aMessageBox.setText(aText); if (aMessageBox.exec() == QMessageBox::No) return;