From 69ed966e5a75e545b5e9ae71499fd08790819484 Mon Sep 17 00:00:00 2001 From: vsv Date: Mon, 6 Jun 2016 15:56:57 +0300 Subject: [PATCH] Replace of Events_Error by Events_InfoMessage. Provide storing of non translated strings --- src/BuildPlugin/BuildPlugin_Validators.cpp | 29 ++++--- src/BuildPlugin/BuildPlugin_Wire.cpp | 10 ++- src/Config/Config_DataModelReader.cpp | 1 - src/Config/Config_ModuleReader.cpp | 12 +-- src/Config/Config_Translator.cpp | 66 +++++++++++++++ src/Config/Config_Translator.h | 15 ++++ src/Config/Config_ValidatorReader.cpp | 1 - src/Config/Config_XMLReader.cpp | 4 +- .../FeaturesPlugin_Validators.cpp | 2 - src/GeomValidators/GeomValidators_Face.cpp | 4 +- .../GeomValidators_ShapeType.cpp | 4 +- .../InitializationPlugin_Plugin.cpp | 8 +- src/Model/Model_AttributeSelection.cpp | 4 +- src/Model/Model_Data.cpp | 6 +- src/Model/Model_Document.cpp | 54 ++++++------ src/Model/Model_Objects.cpp | 16 ++-- src/Model/Model_SelectionNaming.cpp | 4 +- src/Model/Model_Session.cpp | 20 ++--- src/Model/Model_Update.cpp | 10 +-- src/Model/Model_Validator.cpp | 10 ++- src/ModuleBase/ModuleBase_FilterFactory.cpp | 7 +- src/ModuleBase/ModuleBase_ResultPrs.cpp | 4 +- src/ModuleBase/ModuleBase_Tools.cpp | 4 +- .../ModuleBase_WidgetCreatorFactory.cpp | 14 ++-- .../ModuleBase_WidgetShapeSelector.cpp | 1 - .../ParametersPlugin_EvalListener.cpp | 7 +- src/SketchSolver/SketchSolver_Builder.cpp | 6 +- src/SketchSolver/SketchSolver_Group.cpp | 4 +- src/SketcherPrs/SketcherPrs_Angle.cpp | 2 - src/SketcherPrs/SketcherPrs_Coincident.cpp | 2 - src/SketcherPrs/SketcherPrs_Collinear.cpp | 2 - .../SketcherPrs_DimensionStyleListener.cpp | 1 - src/SketcherPrs/SketcherPrs_Equal.cpp | 2 - src/SketcherPrs/SketcherPrs_HVDirection.cpp | 2 - .../SketcherPrs_LengthDimension.cpp | 2 - src/SketcherPrs/SketcherPrs_Middle.cpp | 2 - src/SketcherPrs/SketcherPrs_Radius.cpp | 2 - src/SketcherPrs/SketcherPrs_SymbolPrs.cpp | 4 +- src/XGUI/XGUI_ActionsMgr.cpp | 4 +- src/XGUI/XGUI_CustomPrs.cpp | 5 +- src/XGUI/XGUI_DataModel.cpp | 1 - src/XGUI/XGUI_ObjectsBrowser.cpp | 1 - src/XGUI/XGUI_Tools.cpp | 4 +- src/XGUI/XGUI_Workshop.cpp | 18 ++-- src/XGUI/XGUI_WorkshopListener.cpp | 2 - src/XGUI/XGUI_msg_fr.ts | 84 +++++++++---------- 46 files changed, 269 insertions(+), 198 deletions(-) diff --git a/src/BuildPlugin/BuildPlugin_Validators.cpp b/src/BuildPlugin/BuildPlugin_Validators.cpp index b3ede6d60..234e697b2 100644 --- a/src/BuildPlugin/BuildPlugin_Validators.cpp +++ b/src/BuildPlugin/BuildPlugin_Validators.cpp @@ -23,7 +23,7 @@ #include #include -#include +#include //================================================================================================= bool BuildPlugin_ValidatorBaseForBuild::isValid(const AttributePtr& theAttribute, @@ -32,9 +32,9 @@ bool BuildPlugin_ValidatorBaseForBuild::isValid(const AttributePtr& theAttribute { // Get base objects list. if(theAttribute->attributeType() != ModelAPI_AttributeSelectionList::typeId()) { - Events_Error::send("Error: BuildPlugin_ValidatorBaseForBuild does not support attribute type \"" - + theAttribute->attributeType() + "\"\n Only \"" + ModelAPI_AttributeSelectionList::typeId() - + "\" supported."); + std::string aMsg = "Error: BuildPlugin_ValidatorBaseForBuild does not support attribute type '%1'\nOnly '%2' is supported."; + Events_InfoMessage("BuildPlugin_Validators", aMsg). + arg(theAttribute->attributeType()).arg(ModelAPI_AttributeSelectionList::typeId()).send(); return false; } AttributeSelectionListPtr aSelectionList = @@ -113,8 +113,8 @@ bool BuildPlugin_ValidatorBaseForWire::isValid(const std::shared_ptrselectionList(theArguments.front()); @@ -158,8 +158,9 @@ bool BuildPlugin_ValidatorBaseForFace::isValid(const std::shared_ptrselectionList(theArguments.front()); @@ -231,16 +232,18 @@ bool BuildPlugin_ValidatorSubShapesSelection::isValid(const AttributePtr& theAtt std::string& theError) const { if(theArguments.size() != 1) { - Events_Error::send("Error: BuildPlugin_ValidatorSubShapesSelection should be used only with " - "1 parameter(Sketch feature id)."); + std::string aMsg = "Error: BuildPlugin_ValidatorSubShapesSelection should be used only with " + "1 parameter(Sketch feature id)."; + Events_InfoMessage("BuildPlugin_Validators", aMsg).send(); return false; } // Get base objects list. if(theAttribute->attributeType() != ModelAPI_AttributeSelectionList::typeId()) { - Events_Error::send("Error: BuildPlugin_ValidatorSubShapesSelection does not support attribute type \"" - + theAttribute->attributeType() + "\"\n Only \"" + ModelAPI_AttributeSelectionList::typeId() - + "\" supported."); + std::string aMsg = "Error: BuildPlugin_ValidatorSubShapesSelection does not support attribute type \"" + "%1\"\n Only \"%2\" supported."; + Events_InfoMessage("BuildPlugin_Validators", aMsg). + arg(theAttribute->attributeType()).arg(ModelAPI_AttributeSelectionList::typeId()).send(); return false; } AttributeSelectionListPtr aSelectionList = diff --git a/src/BuildPlugin/BuildPlugin_Wire.cpp b/src/BuildPlugin/BuildPlugin_Wire.cpp index 523c81a03..f16de3d49 100644 --- a/src/BuildPlugin/BuildPlugin_Wire.cpp +++ b/src/BuildPlugin/BuildPlugin_Wire.cpp @@ -10,7 +10,7 @@ #include #include -#include +#include #include #include @@ -88,7 +88,8 @@ bool BuildPlugin_Wire::customAction(const std::string& theActionId) if(theActionId == "add_contour") { return addContour(); } else { - Events_Error::send("Error: Feature \"" + getKind() + "\" does not support action \"" + theActionId + "\"."); + std::string aMsg = "Error: Feature \"%1\" does not support action \"%2\"."; + Events_InfoMessage("BuildPlugin_Wire", aMsg).arg(getKind()).arg(theActionId).send(); } return false; @@ -100,7 +101,7 @@ bool BuildPlugin_Wire::addContour() // Get base objects list. AttributeSelectionListPtr aSelectionList = selectionList(BASE_OBJECTS_ID()); if(aSelectionList->size() == 0) { - Events_Error::send("Error: Empty selection list."); + Events_InfoMessage("BuildPlugin_Wire", "Error: Empty selection list.").send(); return false; } @@ -188,7 +189,8 @@ bool BuildPlugin_Wire::addContour() } if(!isAnyContourAdded) { - Events_Error::send("Error: Contours already closed or no contours found for selected edges."); + Events_InfoMessage("BuildPlugin_Wire", + "Error: Contours already closed or no contours found for selected edges.").send(); return false; } diff --git a/src/Config/Config_DataModelReader.cpp b/src/Config/Config_DataModelReader.cpp index 22c6608f7..afd688ed5 100644 --- a/src/Config/Config_DataModelReader.cpp +++ b/src/Config/Config_DataModelReader.cpp @@ -11,7 +11,6 @@ #include #include "Config_Common.h" -#include #include diff --git a/src/Config/Config_ModuleReader.cpp b/src/Config/Config_ModuleReader.cpp index 2fd33f6cd..dfd442b7e 100644 --- a/src/Config/Config_ModuleReader.cpp +++ b/src/Config/Config_ModuleReader.cpp @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include @@ -70,9 +70,9 @@ void Config_ModuleReader::addFeature(const std::string& theFeatureName, const std::string& thePluginConfig) { if (myFeaturesInFiles.count(theFeatureName)) { - std::string anErrorMsg = "Can not register feature '" + theFeatureName + "' in plugin '" - + thePluginConfig + "'. There is a feature with the same ID."; - Events_Error::send(anErrorMsg); + std::string anErrorMsg = "Can not register feature '%1' in plugin '%2'." + " There is a feature with the same ID."; + Events_InfoMessage("Config_ModuleReader", anErrorMsg).arg(theFeatureName).arg(thePluginConfig).send(); return; } @@ -194,7 +194,7 @@ void Config_ModuleReader::loadScript(const std::string& theFileName) Py_XDECREF(pvalue); Py_XDECREF(ptraceback); } - Events_Error::send(anErrorMsg); + Events_InfoMessage("Config_ModuleReader", anErrorMsg).send(); } /* release python thread */ @@ -229,7 +229,7 @@ void Config_ModuleReader::loadLibrary(const std::string& theLibName) anErrorMsg += ": " + std::string(dlerror()); #endif std::cerr << anErrorMsg << std::endl; - Events_Error::send(anErrorMsg); + Events_InfoMessage("Config_ModuleReader", anErrorMsg).send(); } } diff --git a/src/Config/Config_Translator.cpp b/src/Config/Config_Translator.cpp index bf105efe4..f21e8f648 100644 --- a/src/Config/Config_Translator.cpp +++ b/src/Config/Config_Translator.cpp @@ -8,6 +8,9 @@ #include "Config_XMLReader.h" #include "Config_Common.h" +#include +#include + class Config_TSReader : public Config_XMLReader { public: @@ -47,6 +50,11 @@ void Config_TSReader::processNode(xmlNodePtr theNode) //****************************************************************************** //****************************************************************************** Config_Translator::Translator Config_Translator::myTranslator; +#ifdef _DEBUG +#ifdef MISSED_TRANSLATION +Config_Translator::Translator Config_Translator::myMissed; +#endif +#endif bool Config_Translator::load(const std::string& theFileName) { @@ -120,5 +128,63 @@ std::string Config_Translator::translate(const std::string& theContext, if (theParams.size() > 0) { aMsg = insertParameters(aMsg, theParams); } +#ifdef _DEBUG +#ifdef MISSED_TRANSLATION + myMissed[theContext][theMessage] = ""; +#endif +#endif return aMsg; } + +#ifdef _DEBUG +#ifdef MISSED_TRANSLATION +void Config_Translator::saveMissedTranslations() +{ + if (myMissed.size() == 0) + return; + + char* aPath = getenv("ROOT_DIR"); +#ifdef WIN32 + std::string aFile = aPath + std::string("\\MissedTranslation.ts"); +#else + std::string aFile = aPath + std::string("/MissedTranslation.ts"); +#endif + std::ofstream oFStream; + + // Delete old file + int aa = remove(aFile.c_str()); + + oFStream.open(aFile, std::ofstream::out | std::ofstream::app); + if (oFStream.is_open()) { + Translator::const_iterator aContIt; + Dictionary::const_iterator aDictIt; + std::string aContext; + std::string aSrc; + Dictionary aDict; + + oFStream << "" << std::endl; + for(aContIt = myMissed.cbegin(); aContIt != myMissed.cend(); aContIt++) { + oFStream << "" << std::endl; + + aContext = aContIt->first; + oFStream << " " << aContext << "" << std::endl; + + aDict = aContIt->second; + for(aDictIt = aDict.cbegin(); aDictIt != aDict.cend(); aDictIt++) { + oFStream << " " << std::endl; + aSrc = aDictIt->first; + + oFStream << " " << aSrc << "" << std::endl; + oFStream << " " << "" << std::endl; + + oFStream << " " << std::endl; + } + oFStream << "" << std::endl; + } + + oFStream << "" << std::endl; + oFStream.close(); + } +} +#endif +#endif diff --git a/src/Config/Config_Translator.h b/src/Config/Config_Translator.h index 4365ec752..706883ffb 100644 --- a/src/Config/Config_Translator.h +++ b/src/Config/Config_Translator.h @@ -13,6 +13,8 @@ #include #include +#define MISSED_TRANSLATION + /** * \class Config_Translator * \ingroup Config @@ -54,8 +56,21 @@ public: const std::string& theMessage, const std::list& theParams = std::list()); +#ifdef _DEBUG +#ifdef MISSED_TRANSLATION + static CONFIG_EXPORT void saveMissedTranslations(); +#endif +#endif + + private: static Translator myTranslator; + +#ifdef _DEBUG +#ifdef MISSED_TRANSLATION + static Translator myMissed; +#endif +#endif }; #endif \ No newline at end of file diff --git a/src/Config/Config_ValidatorReader.cpp b/src/Config/Config_ValidatorReader.cpp index dfeb81cc7..8a7236b21 100644 --- a/src/Config/Config_ValidatorReader.cpp +++ b/src/Config/Config_ValidatorReader.cpp @@ -15,7 +15,6 @@ #include #include -#include #include #include diff --git a/src/Config/Config_XMLReader.cpp b/src/Config/Config_XMLReader.cpp index 1fcc90652..bdfaa583a 100644 --- a/src/Config/Config_XMLReader.cpp +++ b/src/Config/Config_XMLReader.cpp @@ -13,7 +13,7 @@ #include #include -#include +#include #include #include @@ -52,7 +52,7 @@ Config_XMLReader::Config_XMLReader(const std::string& theXmlFileName) myDocumentPath = prefix + FSEP + theXmlFileName; std::ifstream aTestFile(myDocumentPath); if (!aTestFile) - Events_Error::send("Unable to open " + myDocumentPath); + Events_InfoMessage("Config_XMLReader", "Unable to open %1").arg(myDocumentPath).send(); aTestFile.close(); } diff --git a/src/FeaturesPlugin/FeaturesPlugin_Validators.cpp b/src/FeaturesPlugin/FeaturesPlugin_Validators.cpp index b451667ac..73c132e0d 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Validators.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Validators.cpp @@ -14,8 +14,6 @@ #include #include -#include - #include #include #include diff --git a/src/GeomValidators/GeomValidators_Face.cpp b/src/GeomValidators/GeomValidators_Face.cpp index d3b075fde..f91066da2 100644 --- a/src/GeomValidators/GeomValidators_Face.cpp +++ b/src/GeomValidators/GeomValidators_Face.cpp @@ -10,7 +10,7 @@ #include -#include +#include #include #include @@ -28,7 +28,7 @@ GeomAbs_SurfaceType faceType(const std::string& theType) if (MyFaceTypes.find(aType) != MyFaceTypes.end()) return MyFaceTypes[aType]; - Events_Error::send("Face type defined in XML is not implemented!"); + Events_InfoMessage("GeomValidators_Face", "Face type defined in XML is not implemented!").send(); return GeomAbs_Plane; } diff --git a/src/GeomValidators/GeomValidators_ShapeType.cpp b/src/GeomValidators/GeomValidators_ShapeType.cpp index 141839ed1..b4495c2fb 100755 --- a/src/GeomValidators/GeomValidators_ShapeType.cpp +++ b/src/GeomValidators/GeomValidators_ShapeType.cpp @@ -13,7 +13,7 @@ #include #include -#include +#include #include #include @@ -40,7 +40,7 @@ GeomValidators_ShapeType::TypeOfShape GeomValidators_ShapeType::shapeType(const if (MyShapeTypes.find(aType) != MyShapeTypes.end()) return MyShapeTypes[aType]; - Events_Error::send("Shape type defined in XML is not implemented!"); + Events_InfoMessage("Shape type defined in XML is not implemented!").send(); return AnyShape; } diff --git a/src/InitializationPlugin/InitializationPlugin_Plugin.cpp b/src/InitializationPlugin/InitializationPlugin_Plugin.cpp index b896d594b..0c47e2a52 100644 --- a/src/InitializationPlugin/InitializationPlugin_Plugin.cpp +++ b/src/InitializationPlugin/InitializationPlugin_Plugin.cpp @@ -11,7 +11,7 @@ #include #include -#include +#include #include @@ -79,9 +79,9 @@ void InitializationPlugin_Plugin::processEvent(const std::shared_ptrsend(aMsg); } else if (theMessage.get()) { - Events_Error::send( - std::string("InitializationPlugin_Plugin::processEvent: unhandled message caught: ") - + theMessage->eventID().eventText()); + Events_InfoMessage("InitializationPlugin_Plugin", + "InitializationPlugin_Plugin::processEvent: unhandled message caught: %1") + .arg(theMessage->eventID().eventText()).send(); } } diff --git a/src/Model/Model_AttributeSelection.cpp b/src/Model/Model_AttributeSelection.cpp index be028e276..7f90352af 100644 --- a/src/Model/Model_AttributeSelection.cpp +++ b/src/Model/Model_AttributeSelection.cpp @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include @@ -662,7 +662,7 @@ void Model_AttributeSelection::selectBody( if (aResult) { aContext = aResult->shape()->impl(); } else { - Events_Error::send("A result with shape is expected"); + Events_InfoMessage("Model_AttributeSelection", "A result with shape is expected").send(); return; } } diff --git a/src/Model/Model_Data.cpp b/src/Model/Model_Data.cpp index 4dfabe551..1e63282bb 100644 --- a/src/Model/Model_Data.cpp +++ b/src/Model/Model_Data.cpp @@ -36,7 +36,7 @@ #include #include #include -#include +#include #include #include @@ -182,7 +182,7 @@ AttributePtr Model_Data::addAttribute(const std::string& theID, const std::strin anAttr->setObject(myObject); anAttr->setID(theID); } else { - Events_Error::send("Can not create unknown type of attribute " + theAttrType); + Events_InfoMessage("Model_Data", "Can not create unknown type of attribute %1").arg(theAttrType).send(); } return aResult; } @@ -370,7 +370,7 @@ void Model_Data::setError(const std::string& theError, bool theSend) { execState(ModelAPI_StateExecFailed); if (theSend) { - Events_Error::send(theError); + Events_InfoMessage("Model_Data", theError).send(); } TDataStd_AsciiString::Set(myLab, theError.c_str()); } diff --git a/src/Model/Model_Document.cpp b/src/Model/Model_Document.cpp index 88f8bc6cb..ac473ce21 100755 --- a/src/Model/Model_Document.cpp +++ b/src/Model/Model_Document.cpp @@ -18,7 +18,7 @@ #include #include -#include +#include #include #include @@ -119,61 +119,61 @@ bool Model_Document::load(const char* theDirName, const char* theFileName, Docum aStatus = anApp->Open(aPath, aLoaded); } catch (Standard_Failure) { Handle(Standard_Failure) aFail = Standard_Failure::Caught(); - Events_Error::send( - std::string("Exception in opening of document: ") + aFail->GetMessageString()); + Events_InfoMessage("Model_Document", + "Exception in opening of document: %1").arg(aFail->GetMessageString()).send(); return false; } bool isError = aStatus != PCDM_RS_OK; if (isError) { switch (aStatus) { case PCDM_RS_UnknownDocument: - Events_Error::send(std::string("Can not open document")); + Events_InfoMessage("Model_Document", "Can not open document").send(); break; case PCDM_RS_AlreadyRetrieved: - Events_Error::send(std::string("Can not open document: already opened")); + Events_InfoMessage("Model_Document", "Can not open document: already opened").send(); break; case PCDM_RS_AlreadyRetrievedAndModified: - Events_Error::send( - std::string("Can not open document: already opened and modified")); + Events_InfoMessage("Model_Document", + "Can not open document: already opened and modified").send(); break; case PCDM_RS_NoDriver: - Events_Error::send(std::string("Can not open document: driver library is not found")); + Events_InfoMessage("Model_Document", "Can not open document: driver library is not found").send(); break; case PCDM_RS_UnknownFileDriver: - Events_Error::send(std::string("Can not open document: unknown driver for opening")); + Events_InfoMessage("Model_Document", "Can not open document: unknown driver for opening").send(); break; case PCDM_RS_OpenError: - Events_Error::send(std::string("Can not open document: file open error")); + Events_InfoMessage("Model_Document", "Can not open document: file open error").send(); break; case PCDM_RS_NoVersion: - Events_Error::send(std::string("Can not open document: invalid version")); + Events_InfoMessage("Model_Document", "Can not open document: invalid version").send(); break; case PCDM_RS_NoModel: - Events_Error::send(std::string("Can not open document: no data model")); + Events_InfoMessage("Model_Document", "Can not open document: no data model").send(); break; case PCDM_RS_NoDocument: - Events_Error::send(std::string("Can not open document: no document inside")); + Events_InfoMessage("Model_Document", "Can not open document: no document inside").send(); break; case PCDM_RS_FormatFailure: - Events_Error::send(std::string("Can not open document: format failure")); + Events_InfoMessage("Model_Document", "Can not open document: format failure").send(); break; case PCDM_RS_TypeNotFoundInSchema: - Events_Error::send(std::string("Can not open document: invalid object")); + Events_InfoMessage("Model_Document", "Can not open document: invalid object").send(); break; case PCDM_RS_UnrecognizedFileFormat: - Events_Error::send(std::string("Can not open document: unrecognized file format")); + Events_InfoMessage("Model_Document", "Can not open document: unrecognized file format").send(); break; case PCDM_RS_MakeFailure: - Events_Error::send(std::string("Can not open document: make failure")); + Events_InfoMessage("Model_Document", "Can not open document: make failure").send(); break; case PCDM_RS_PermissionDenied: - Events_Error::send(std::string("Can not open document: permission denied")); + Events_InfoMessage("Model_Document", "Can not open document: permission denied").send(); break; case PCDM_RS_DriverFailure: - Events_Error::send(std::string("Can not open document: driver failure")); + Events_InfoMessage("Model_Document", "Can not open document: driver failure").send(); break; default: - Events_Error::send(std::string("Can not open document: unknown error")); + Events_InfoMessage("Model_Document", "Can not open document: unknown error").send(); break; } } @@ -231,22 +231,22 @@ bool Model_Document::save( aStatus = anApp->SaveAs(myDoc, aPath); } catch (Standard_Failure) { Handle(Standard_Failure) aFail = Standard_Failure::Caught(); - Events_Error::send( - std::string("Exception in saving of document: ") + aFail->GetMessageString()); + Events_InfoMessage("Model_Document", + "Exception in saving of document: %1").arg(aFail->GetMessageString()).send(); return false; } bool isDone = aStatus == PCDM_SS_OK || aStatus == PCDM_SS_No_Obj; if (!isDone) { switch (aStatus) { case PCDM_SS_DriverFailure: - Events_Error::send(std::string("Can not save document: save driver-library failure")); + Events_InfoMessage("Model_Document", "Can not save document: save driver-library failure").send(); break; case PCDM_SS_WriteFailure: - Events_Error::send(std::string("Can not save document: file writing failure")); + Events_InfoMessage("Model_Document", "Can not save document: file writing failure").send(); break; case PCDM_SS_Failure: default: - Events_Error::send(std::string("Can not save document")); + Events_InfoMessage("Model_Document", "Can not save document").send(); break; } } @@ -273,8 +273,8 @@ bool Model_Document::save( aFile.Copy(aDestination); theResults.push_back(aDestinationDir.ToCString()); } else { - Events_Error::send( - std::string("Can not open file ") + aSubPath.ToCString() + " for saving"); + Events_InfoMessage("Model_Document", + "Can not open file %1 for saving").arg(aSubPath.ToCString()).send(); } } } else { // simply save opened document diff --git a/src/Model/Model_Objects.cpp b/src/Model/Model_Objects.cpp index 44ab4cf59..0be76f106 100644 --- a/src/Model/Model_Objects.cpp +++ b/src/Model/Model_Objects.cpp @@ -20,7 +20,7 @@ #include #include -#include +#include #include #include @@ -224,8 +224,8 @@ void Model_Objects::refsToFeature(FeaturePtr theFeature, } if (!theRefs.empty() && isSendError) { - Events_Error::send( - "Feature '" + theFeature->data()->name() + "' is used and can not be deleted"); + Events_InfoMessage("Model_Objects", + "Feature '%1' is used and can not be deleted").arg(theFeature->data()->name()).send(); } } @@ -302,10 +302,10 @@ void Model_Objects::moveFeature(FeaturePtr theMoved, FeaturePtr theAfterThis) if (!aPassedMovedFrom || !aPassedMovedTo) {// not found: unknown situation if (!aPassedMovedFrom) { static std::string aMovedFromError("The moved feature is not found"); - Events_Error::send(aMovedFromError); + Events_InfoMessage("Model_Objects", aMovedFromError).send(); } else { static std::string aMovedToError("The 'after' feature for movement is not found"); - Events_Error::send(aMovedToError); + Events_InfoMessage("Model_Objects", aMovedToError).send(); } return; } @@ -643,7 +643,7 @@ void Model_Objects::synchronizeFeatures( TCollection_AsciiString(Handle(TDataStd_Comment)::DownCast(aLabIter.Value())->Get()) .ToCString(), anOwner); if (!aFeature.get()) { // somethig is wrong, most probably, the opened document has invalid structure - Events_Error::send("Invalid type of object in the document"); + Events_InfoMessage("Model_Objects", "Invalid type of object in the document").send(); aLabIter.Value()->Label().ForgetAllAttributes(); continue; } @@ -1082,8 +1082,8 @@ void Model_Objects::updateResults(FeaturePtr theFeature) theFeature->attributeChanged("expression"); // just produce a value break; } else { - Events_Error::send(std::string("Unknown type of result is found in the document:") + - TCollection_AsciiString(aGroup->Get()).ToCString()); + Events_InfoMessage("Model_Objects", "Unknown type of result is found in the document:") + .arg(TCollection_AsciiString(aGroup->Get()).ToCString()).send(); } } if (aNewBody && !aNewBody->data()->isDeleted()) { diff --git a/src/Model/Model_SelectionNaming.cpp b/src/Model/Model_SelectionNaming.cpp index 167d3b935..232834edc 100644 --- a/src/Model/Model_SelectionNaming.cpp +++ b/src/Model/Model_SelectionNaming.cpp @@ -7,7 +7,7 @@ #include "Model_SelectionNaming.h" #include "Model_Document.h" #include -#include +#include #include #include @@ -286,7 +286,7 @@ TopAbs_ShapeEnum translateType (const std::string& theType) } if (MyShapeTypes.find(theType) != MyShapeTypes.end()) return MyShapeTypes[theType]; - Events_Error::send("Shape type defined in XML is not implemented!"); + Events_InfoMessage("Model_SelectionNaming", "Shape type defined in XML is not implemented!").send(); return TopAbs_SHAPE; } diff --git a/src/Model/Model_Session.cpp b/src/Model/Model_Session.cpp index 886bfec9f..fe35df17d 100644 --- a/src/Model/Model_Session.cpp +++ b/src/Model/Model_Session.cpp @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include #include #include @@ -156,9 +156,9 @@ FeaturePtr Model_Session::createFeature(string theFeatureID, Model_Document* the if (myPlugins.find(theFeatureID) != myPlugins.end()) { std::pair& aPlugin = myPlugins[theFeatureID]; // plugin and doc kind if (!aPlugin.second.empty() && aPlugin.second != theDocOwner->kind()) { - Events_Error::send( - string("Feature '") + theFeatureID + "' can be created only in document '" - + aPlugin.second + "' by the XML definition"); + Events_InfoMessage("Model_Session", + "Feature '%1' can be created only in document '%2' by the XML definition") + .arg(theFeatureID).arg(aPlugin.second).send(); return FeaturePtr(); } myCurrentPluginName = aPlugin.first; @@ -169,16 +169,16 @@ FeaturePtr Model_Session::createFeature(string theFeatureID, Model_Document* the if (myPluginObjs.find(myCurrentPluginName) != myPluginObjs.end()) { FeaturePtr aCreated = myPluginObjs[myCurrentPluginName]->createFeature(theFeatureID); if (!aCreated) { - Events_Error::send( - string("Can not initialize feature '") + theFeatureID + "' in plugin '" - + myCurrentPluginName + "'"); + Events_InfoMessage("Model_Session", + "Can not initialize feature '%1' in plugin '%2'") + .arg(theFeatureID).arg(myCurrentPluginName).send(); } return aCreated; } else { - Events_Error::send(string("Can not load plugin '") + myCurrentPluginName + "'"); + Events_InfoMessage("Model_Session","Can not load plugin '%1'").arg(myCurrentPluginName).send(); } } else { - Events_Error::send(string("Feature '") + theFeatureID + "' not found in any plugin"); + Events_InfoMessage("Model_Session","Feature '%1' not found in any plugin").arg(theFeatureID).send(); } return FeaturePtr(); // return nothing @@ -394,7 +394,7 @@ void Model_Session::processEvent(const std::shared_ptr& theMessa } } else { // create/update/delete if (myCheckTransactions && !isOperation()) - Events_Error::send("Modification of data structure outside of the transaction"); + Events_InfoMessage("Model_Session", "Modification of data structure outside of the transaction").send(); // if part is deleted, make the root as the current document (on undo of Parts creations) static const Events_ID kDeletedEvent = Events_Loop::eventByName(EVENT_OBJECT_DELETED); if (theMessage->eventID() == kDeletedEvent) { diff --git a/src/Model/Model_Update.cpp b/src/Model/Model_Update.cpp index 000c377d4..53a308d3c 100755 --- a/src/Model/Model_Update.cpp +++ b/src/Model/Model_Update.cpp @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include using namespace std; @@ -350,8 +350,8 @@ bool Model_Update::processFeature(FeaturePtr theFeature) } else { int aCount = myProcessed[theFeature]; if (aCount > 100) { // too many repetition of processing (in VS it may crash on 330 with stack overflow) - Events_Error::send( - "Feature '" + theFeature->data()->name() + "' is updated in infinitive loop"); + Events_InfoMessage("Model_Update", + "Feature '%1' is updated in infinitive loop").arg(theFeature->data()->name()).send(); return false; } myProcessed[theFeature] = aCount + 1; @@ -725,8 +725,8 @@ void Model_Update::executeFeature(FeaturePtr theFeature) } } catch(...) { aState = ModelAPI_StateExecFailed; - Events_Error::send( - "Feature " + theFeature->getKind() + " has failed during the execution"); + Events_InfoMessage("Model_Update", + "Feature %1 has failed during the execution").arg(theFeature->getKind()).send(); } // The macro feature has to be deleted in any case even its execution is failed myWaitForFinish.insert(theFeature); diff --git a/src/Model/Model_Validator.cpp b/src/Model/Model_Validator.cpp index 6795e43e1..dafa19583 100644 --- a/src/Model/Model_Validator.cpp +++ b/src/Model/Model_Validator.cpp @@ -15,13 +15,13 @@ #include #include -#include +#include void Model_ValidatorsFactory::registerValidator(const std::string& theID, ModelAPI_Validator* theValidator) { if (myIDs.find(theID) != myIDs.end()) { - Events_Error::send(std::string("Validator ") + theID + " is already registered"); + Events_InfoMessage("Model_Validator", "Validator %1 is already registered").arg(theID).send(); } else { myIDs[theID] = theValidator; } @@ -86,7 +86,8 @@ void Model_ValidatorsFactory::validators(const std::string& theFeatureID, AttrValidators::const_iterator aValidatorsIt = aFeatureIt->second.cbegin(); for (; aValidatorsIt != aFeatureIt->second.cend(); aValidatorsIt++) { if (!validator(aValidatorsIt->first)) { - Events_Error::send(std::string("Validator ") + aValidatorsIt->first + " was not registered"); + Events_InfoMessage("Model_Validator", "Validator %1 was not registered") + .arg(aValidatorsIt->first).send(); } else { theValidators.push_back(std::make_pair(aValidatorsIt->first, aValidatorsIt->second)); } @@ -106,7 +107,8 @@ void Model_ValidatorsFactory::validators(const std::string& theFeatureID, const AttrValidators::const_iterator aValidatorsIt = anAttrIt->second.cbegin(); for (; aValidatorsIt != anAttrIt->second.cend(); aValidatorsIt++) { if (!validator(aValidatorsIt->first)) { - Events_Error::send(std::string("Validator ") + aValidatorsIt->first + " was not registered"); + Events_InfoMessage("Model_Validator", "Validator %1 was not registered") + .arg(aValidatorsIt->first).send(); } else { theValidators.push_back(std::make_pair(aValidatorsIt->first, aValidatorsIt->second)); } diff --git a/src/ModuleBase/ModuleBase_FilterFactory.cpp b/src/ModuleBase/ModuleBase_FilterFactory.cpp index e511e5223..4320004af 100644 --- a/src/ModuleBase/ModuleBase_FilterFactory.cpp +++ b/src/ModuleBase/ModuleBase_FilterFactory.cpp @@ -12,14 +12,14 @@ #include #include //#include -#include +#include void ModuleBase_FilterFactory::registerFilter(const std::string& theID, ModuleBase_Filter* theFilter) { if (myIDs.find(theID) != myIDs.end()) { - Events_Error::send(std::string("Filter ") + theID + " is already registered"); + Events_InfoMessage("ModuleBase_FilterFactory", "Filter %1 is already registered").arg(theID).send(); } else { myIDs[theID] = theFilter; } @@ -63,7 +63,8 @@ void ModuleBase_FilterFactory::filters(const std::string& theFeatureID, std::map::const_iterator aFound = myIDs.find( aValIter->first); if (aFound == myIDs.end()) { - Events_Error::send(std::string("Filter ") + aValIter->first + " was not registered"); + Events_InfoMessage("ModuleBase_FilterFactory", "Filter %1 was not registered") + .arg(aValIter->first).send(); } else { ModuleBase_Filter* aFilter = aFound->second; aFilter->setArguments(aValIter->second); diff --git a/src/ModuleBase/ModuleBase_ResultPrs.cpp b/src/ModuleBase/ModuleBase_ResultPrs.cpp index 4085f399e..dfd0d1a63 100755 --- a/src/ModuleBase/ModuleBase_ResultPrs.cpp +++ b/src/ModuleBase/ModuleBase_ResultPrs.cpp @@ -12,7 +12,7 @@ #include #include -#include +#include #include #include @@ -75,7 +75,7 @@ void ModuleBase_ResultPrs::Compute(const Handle(PrsMgr_PresentationManager3d)& t AIS_Shape::Compute(thePresentationManager, thePresentation, theMode); if (!aReadyToDisplay) { - Events_Error::throwException("An empty AIS presentation: ModuleBase_ResultPrs"); + Events_InfoMessage("ModuleBase_ResultPrs", "An empty AIS presentation: ModuleBase_ResultPrs").send(); static const Events_ID anEvent = Events_Loop::eventByName(EVENT_EMPTY_AIS_PRESENTATION); ModelAPI_EventCreator::get()->sendUpdated(myResult, anEvent); } diff --git a/src/ModuleBase/ModuleBase_Tools.cpp b/src/ModuleBase/ModuleBase_Tools.cpp index 37e6500b4..a17f61e4b 100755 --- a/src/ModuleBase/ModuleBase_Tools.cpp +++ b/src/ModuleBase/ModuleBase_Tools.cpp @@ -34,7 +34,7 @@ #include #include -#include +#include #include @@ -323,7 +323,7 @@ TopAbs_ShapeEnum shapeType(const QString& theType) QString aType = theType.toLower(); if (MyShapeTypes.contains(aType)) return MyShapeTypes[aType]; - Events_Error::send("Shape type defined in XML is not implemented!"); + Events_InfoMessage("ModuleBase_Tools", "Shape type defined in XML is not implemented!").send(); return TopAbs_SHAPE; } diff --git a/src/ModuleBase/ModuleBase_WidgetCreatorFactory.cpp b/src/ModuleBase/ModuleBase_WidgetCreatorFactory.cpp index 13c7bf571..2d0ab9e25 100755 --- a/src/ModuleBase/ModuleBase_WidgetCreatorFactory.cpp +++ b/src/ModuleBase/ModuleBase_WidgetCreatorFactory.cpp @@ -9,7 +9,7 @@ #include -#include +#include #include @@ -43,8 +43,8 @@ void ModuleBase_WidgetCreatorFactory::registerCreator(const WidgetCreatorPtr& th if (!myPanelToCreator.contains(aKey)) myPanelToCreator[aKey] = theCreator; else { - Events_Error::send("The" + aKey + " panel XML definition has been already \ -used by another widget creator"); + Events_InfoMessage("ModuleBase_WidgetCreatorFactory", + "The %1 panel XML definition has been already used by another widget creator").arg(aKey).send(); } } @@ -56,8 +56,8 @@ used by another widget creator"); if (!myCreators.contains(aKey)) myCreators[aKey] = theCreator; else { - Events_Error::send("The" + aKey + " widget XML definition has been already \ -used by another widget creator"); + Events_InfoMessage("ModuleBase_WidgetCreatorFactory", + "The %1 widget XML definition has been already used by another widget creator").arg(aKey).send(); } } @@ -69,8 +69,8 @@ used by another widget creator"); if (!myPageToCreator.contains(aKey)) myPageToCreator[aKey] = theCreator; else { - Events_Error::send("The" + aKey + " page XML definition has been already \ -used by another widget creator"); + Events_InfoMessage("ModuleBase_WidgetCreatorFactory", + "The %1 page XML definition has been already used by another widget creator").arg(aKey).send(); } } } diff --git a/src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp b/src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp index 119329071..4652227a8 100644 --- a/src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp +++ b/src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp @@ -39,7 +39,6 @@ #include #include -#include #include diff --git a/src/ParametersPlugin/ParametersPlugin_EvalListener.cpp b/src/ParametersPlugin/ParametersPlugin_EvalListener.cpp index 624b92319..fe2665b10 100644 --- a/src/ParametersPlugin/ParametersPlugin_EvalListener.cpp +++ b/src/ParametersPlugin/ParametersPlugin_EvalListener.cpp @@ -11,7 +11,7 @@ #include #include -#include +#include #include #include @@ -89,8 +89,9 @@ void ParametersPlugin_EvalListener::processEvent( } else if (theMessage->eventID() == kReplaceParameterEvent) { processReplaceParameterEvent(theMessage); } else { - Events_Error::send(std::string("ParametersPlugin python interpreter, unhandled message caught: ") - + theMessage->eventID().eventText()); + Events_InfoMessage("ParametersPlugin_EvalListener", + "ParametersPlugin python interpreter, unhandled message caught: ") + .arg(theMessage->eventID().eventText()).send(); } } diff --git a/src/SketchSolver/SketchSolver_Builder.cpp b/src/SketchSolver/SketchSolver_Builder.cpp index ba7074e50..451e2141f 100644 --- a/src/SketchSolver/SketchSolver_Builder.cpp +++ b/src/SketchSolver/SketchSolver_Builder.cpp @@ -22,7 +22,7 @@ #include #ifdef _DEBUG -#include +#include #include #include #include @@ -61,7 +61,7 @@ SolverConstraintPtr SketchSolver_Builder::createConstraint(ConstraintPtr theCons ResultConstructionPtr aRC = std::dynamic_pointer_cast(aRefAttr->object()); if (!aRC) - Events_Error::send(SketchSolver_Error::NEED_OBJECT_NOT_FEATURE(), this); + Events_InfoMessage("SketchSolver_Builder", SketchSolver_Error::NEED_OBJECT_NOT_FEATURE(), this).send(); } continue; } @@ -73,7 +73,7 @@ SolverConstraintPtr SketchSolver_Builder::createConstraint(ConstraintPtr theCons ResultConstructionPtr aRC = std::dynamic_pointer_cast(*aListIter); if (*aListIter && !aRC) - Events_Error::send(SketchSolver_Error::NEED_OBJECT_NOT_FEATURE(), this); + Events_InfoMessage("SketchSolver_Builder", SketchSolver_Error::NEED_OBJECT_NOT_FEATURE(), this).send(); } } } diff --git a/src/SketchSolver/SketchSolver_Group.cpp b/src/SketchSolver/SketchSolver_Group.cpp index 639af961c..0471488f3 100644 --- a/src/SketchSolver/SketchSolver_Group.cpp +++ b/src/SketchSolver/SketchSolver_Group.cpp @@ -12,7 +12,7 @@ #include #include -#include +#include #include #include #include @@ -166,7 +166,7 @@ bool SketchSolver_Group::changeConstraint( if (!aConstraint->error().empty()) { if (aConstraint->error() == SketchSolver_Error::NOT_INITIALIZED()) return false; // some attribute are not initialized yet, don't show message - Events_Error::send(aConstraint->error(), this); + Events_InfoMessage("SketchSolver_Group", aConstraint->error(), this).send(); } myConstraints[theConstraint] = aConstraint; diff --git a/src/SketcherPrs/SketcherPrs_Angle.cpp b/src/SketcherPrs/SketcherPrs_Angle.cpp index d46643fd9..bbca46d50 100644 --- a/src/SketcherPrs/SketcherPrs_Angle.cpp +++ b/src/SketcherPrs/SketcherPrs_Angle.cpp @@ -25,8 +25,6 @@ #include #include -#include - #define PI 3.1415926535897932 IMPLEMENT_STANDARD_HANDLE(SketcherPrs_Angle, AIS_AngleDimension_); diff --git a/src/SketcherPrs/SketcherPrs_Coincident.cpp b/src/SketcherPrs/SketcherPrs_Coincident.cpp index 2b6c57b84..e7ae5a144 100644 --- a/src/SketcherPrs/SketcherPrs_Coincident.cpp +++ b/src/SketcherPrs/SketcherPrs_Coincident.cpp @@ -18,8 +18,6 @@ #include #include -#include - #include #include diff --git a/src/SketcherPrs/SketcherPrs_Collinear.cpp b/src/SketcherPrs/SketcherPrs_Collinear.cpp index 36c68a41d..8b069825a 100755 --- a/src/SketcherPrs/SketcherPrs_Collinear.cpp +++ b/src/SketcherPrs/SketcherPrs_Collinear.cpp @@ -10,8 +10,6 @@ #include -#include "Events_Error.h" - #include #include diff --git a/src/SketcherPrs/SketcherPrs_DimensionStyleListener.cpp b/src/SketcherPrs/SketcherPrs_DimensionStyleListener.cpp index e8b950f38..4977b3f28 100755 --- a/src/SketcherPrs/SketcherPrs_DimensionStyleListener.cpp +++ b/src/SketcherPrs/SketcherPrs_DimensionStyleListener.cpp @@ -7,7 +7,6 @@ #include "SketcherPrs_DimensionStyleListener.h" #include "SketcherPrs_Tools.h" -#include #include SketcherPrs_DimensionStyleListener::SketcherPrs_DimensionStyleListener() diff --git a/src/SketcherPrs/SketcherPrs_Equal.cpp b/src/SketcherPrs/SketcherPrs_Equal.cpp index 4423ca592..74ed7d4db 100644 --- a/src/SketcherPrs/SketcherPrs_Equal.cpp +++ b/src/SketcherPrs/SketcherPrs_Equal.cpp @@ -10,8 +10,6 @@ #include -#include "Events_Error.h" - #include #include diff --git a/src/SketcherPrs/SketcherPrs_HVDirection.cpp b/src/SketcherPrs/SketcherPrs_HVDirection.cpp index b532887d1..b0a706618 100644 --- a/src/SketcherPrs/SketcherPrs_HVDirection.cpp +++ b/src/SketcherPrs/SketcherPrs_HVDirection.cpp @@ -13,8 +13,6 @@ #include #include -#include - IMPLEMENT_STANDARD_HANDLE(SketcherPrs_HVDirection, SketcherPrs_SymbolPrs); IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_HVDirection, SketcherPrs_SymbolPrs); diff --git a/src/SketcherPrs/SketcherPrs_LengthDimension.cpp b/src/SketcherPrs/SketcherPrs_LengthDimension.cpp index 2dc2a3b3d..fd4ba79e1 100644 --- a/src/SketcherPrs/SketcherPrs_LengthDimension.cpp +++ b/src/SketcherPrs/SketcherPrs_LengthDimension.cpp @@ -15,8 +15,6 @@ #include #include -#include - #include #include #include diff --git a/src/SketcherPrs/SketcherPrs_Middle.cpp b/src/SketcherPrs/SketcherPrs_Middle.cpp index ceca64a9c..b3d224994 100755 --- a/src/SketcherPrs/SketcherPrs_Middle.cpp +++ b/src/SketcherPrs/SketcherPrs_Middle.cpp @@ -10,8 +10,6 @@ #include -#include "Events_Error.h" - #include #include diff --git a/src/SketcherPrs/SketcherPrs_Radius.cpp b/src/SketcherPrs/SketcherPrs_Radius.cpp index e31b3e1d4..9e7e61b65 100644 --- a/src/SketcherPrs/SketcherPrs_Radius.cpp +++ b/src/SketcherPrs/SketcherPrs_Radius.cpp @@ -13,8 +13,6 @@ #include #include -#include - #include #include #include diff --git a/src/SketcherPrs/SketcherPrs_SymbolPrs.cpp b/src/SketcherPrs/SketcherPrs_SymbolPrs.cpp index 590f1abf8..5f5517354 100644 --- a/src/SketcherPrs/SketcherPrs_SymbolPrs.cpp +++ b/src/SketcherPrs/SketcherPrs_SymbolPrs.cpp @@ -12,7 +12,7 @@ #include #include -#include +#include #include #include @@ -294,7 +294,7 @@ Handle(Image_AlienPixMap) SketcherPrs_SymbolPrs::icon() // The icon for constraint is not found static const char aMsg[] = "Error! constraint images are not found"; cout< #include -#include +#include #include #include @@ -175,7 +175,7 @@ QKeySequence XGUI_ActionsMgr::registerShortcut(const QKeySequence& theKeySequenc if (myShortcuts.contains(theKeySequence)) { QString aMessage = tr("Shortcut %1 is already defined. Ignore."); aMessage = aMessage.arg(theKeySequence.toString()); - Events_Error::send(aMessage.toStdString()); + Events_InfoMessage("XGUI_ActionsMgr", aMessage.toStdString()).send(); return QKeySequence(); } myShortcuts.append(theKeySequence); diff --git a/src/XGUI/XGUI_CustomPrs.cpp b/src/XGUI/XGUI_CustomPrs.cpp index 7948325d7..f07582125 100644 --- a/src/XGUI/XGUI_CustomPrs.cpp +++ b/src/XGUI/XGUI_CustomPrs.cpp @@ -14,7 +14,7 @@ #include #include -#include +#include #include #include @@ -50,7 +50,8 @@ void XGUI_CustomPrs::getDefaultColor(ObjectPtr theObject, const bool isEmptyColo // all AIS objects, where the color is not set, are in black. // The color should be defined in XML or set in the attribute theColor = Config_PropManager::color("Visualization", "object_default_color", "#000000"); - Events_Error::send("A default color is not defined in the preferences for this kind of result"); + Events_InfoMessage("XGUI_CustomPrs", + "A default color is not defined in the preferences for this kind of result").send(); } } diff --git a/src/XGUI/XGUI_DataModel.cpp b/src/XGUI/XGUI_DataModel.cpp index d1ccd46ff..cbba9c920 100644 --- a/src/XGUI/XGUI_DataModel.cpp +++ b/src/XGUI/XGUI_DataModel.cpp @@ -22,7 +22,6 @@ #include #include -#include #include #include diff --git a/src/XGUI/XGUI_ObjectsBrowser.cpp b/src/XGUI/XGUI_ObjectsBrowser.cpp index 7d6410a49..147153469 100644 --- a/src/XGUI/XGUI_ObjectsBrowser.cpp +++ b/src/XGUI/XGUI_ObjectsBrowser.cpp @@ -8,7 +8,6 @@ #include #include #include -#include #include diff --git a/src/XGUI/XGUI_Tools.cpp b/src/XGUI/XGUI_Tools.cpp index 9a7556e40..b3e1dca32 100644 --- a/src/XGUI/XGUI_Tools.cpp +++ b/src/XGUI/XGUI_Tools.cpp @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include @@ -137,7 +137,7 @@ bool canRename(const ObjectPtr& theObject, const QString& theName) 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 - Events_Error::send(aErrMsg.toStdString()); + Events_InfoMessage("XGUI_Tools", aErrMsg.toStdString()).send(); return false; } } diff --git a/src/XGUI/XGUI_Workshop.cpp b/src/XGUI/XGUI_Workshop.cpp index 61bb0e22a..d7f38883a 100755 --- a/src/XGUI/XGUI_Workshop.cpp +++ b/src/XGUI/XGUI_Workshop.cpp @@ -52,7 +52,7 @@ //#include #include -#include +#include #include #include @@ -217,6 +217,13 @@ XGUI_Workshop::XGUI_Workshop(XGUI_SalomeConnector* theConnector) //****************************************************** XGUI_Workshop::~XGUI_Workshop(void) { +#ifdef _DEBUG +#ifdef MISSED_TRANSLATION + // Save Missed translations + Config_Translator::saveMissedTranslations(); +#endif +#endif + delete myDisplayer; delete myDataModelXMLReader; } @@ -498,10 +505,9 @@ void XGUI_Workshop::setPropertyPanel(ModuleBase_Operation* theOperation) std::string aFeatureKind = aFeature->getKind(); foreach (ModuleBase_ModelWidget* aWidget, aWidgets) { if (!aWidget->attributeID().empty() && !aFeature->attribute(aWidget->attributeID()).get()) { - std::string anErrorMsg = "The feature '" + aFeatureKind + "' has no attribute '" - + aWidget->attributeID() + "' used by widget '" - + aWidget->metaObject()->className() + "'."; - Events_Error::send(anErrorMsg); + std::string anErrorMsg = "The feature '%1' has no attribute '%2' used by widget '%3'."; + Events_InfoMessage("XGUI_Workshop", anErrorMsg) + .arg(aFeatureKind).arg(aWidget->attributeID()).arg(aWidget->metaObject()->className()).send(); myPropertyPanel->cleanContent(); return; } @@ -1012,7 +1018,7 @@ ModuleBase_IModule* XGUI_Workshop::loadModule(const QString& theModule) if (!err.isEmpty()) { if (desktop()) { - Events_Error::send(err.toStdString()); + Events_InfoMessage("XGUI_Workshop", err.toStdString()).send(); } else { qWarning(qPrintable(err)); } diff --git a/src/XGUI/XGUI_WorkshopListener.cpp b/src/XGUI/XGUI_WorkshopListener.cpp index 567ecc63a..366336a1f 100755 --- a/src/XGUI/XGUI_WorkshopListener.cpp +++ b/src/XGUI/XGUI_WorkshopListener.cpp @@ -29,7 +29,6 @@ #include #include -#include #include #include @@ -83,7 +82,6 @@ void XGUI_WorkshopListener::initializeEventListening() { //Initialize event listening Events_Loop* aLoop = Events_Loop::loop(); - //aLoop->registerListener(this, Events_Error::errorID()); //!< Listening application errors. aLoop->registerListener(this, Events_InfoMessage::errorID()); //!< Listening application errors. aLoop->registerListener(this, Events_Loop::eventByName(EVENT_OPERATION_LAUNCHED)); aLoop->registerListener(this, Events_Loop::eventByName(EVENT_OBJECT_UPDATED)); diff --git a/src/XGUI/XGUI_msg_fr.ts b/src/XGUI/XGUI_msg_fr.ts index a47614eca..070700a9a 100644 --- a/src/XGUI/XGUI_msg_fr.ts +++ b/src/XGUI/XGUI_msg_fr.ts @@ -133,7 +133,7 @@ XGUI_DataTree - + History change @@ -149,7 +149,7 @@ XGUI_ObjectsBrowser - + Part set @@ -185,181 +185,181 @@ XGUI_Workshop - - + + Undo - - + + Undo last command - + INF_DESK_TOOLBAR_STANDARD - - + + Redo - - + + Redo last command - + Export native... - + Export the current document into a native file - + Import native... - + Import native file - - + + Save Title of the dialog which asks user if he wants to save study in existing non-empty folder - + Save the document - + Save as... - + Save the document into a file - + Open... - + Open a new document - + Preferences - + Edit preferences - + Exit - + Exit application - - + + Save current file - + The document is modified, save before opening another? - + Select directory - + Warning - + Unable to open the file. - + The document is modified, save before exit? - + Select directory to save files... - + Directories (*) - + The directory already contains some files, save anyway? - + Information about module "%1" doesn't exist. - + Object browser - + Unused features are the following: %1. These features will be deleted. Would you like to continue? - + All features are relevant, there is nothing to be deleted - + Find results - + Results not found -- 2.30.2