Locale
ModelAPI
ModelGeomAlgo
+ ModuleBase
)
ADD_DEFINITIONS(-DMODELHIGHAPI_EXPORTS -DWNT)
${PROJECT_SOURCE_DIR}/src/Locale
${PROJECT_SOURCE_DIR}/src/ModelAPI
${PROJECT_SOURCE_DIR}/src/ModelGeomAlgo
+ ${PROJECT_SOURCE_DIR}/src/ModuleBase
${PROJECT_SOURCE_DIR}/src/PartSetPlugin
${OpenCASCADE_INCLUDE_DIR}
)
#include <ModelAPI_ResultConstruction.h>
#include <ModelAPI_Events.h>
+#include <ModuleBase_Tools.h>
+
#include <cmath>
#include <sstream>
aNbTransactions = aNbUndo;
++aTransactionID;
}
+ static std::string anOperationPrefix(ModuleBase_Tools::translate("", "Operation").toStdString());
std::ostringstream aTransactionName;
- aTransactionName << "Operation_" << aTransactionID;
+ aTransactionName << anOperationPrefix << "_" << aTransactionID;
ModelAPI_Session::get()->startOperation(aTransactionName.str());
}
#if HAVE_SALOME
// If the python script is being loaded now, the preferences should be used
// to display the required object
- SUIT_Application * app = SUIT_Session::session()->activeApplication();
- QVariant aVar = app->property("IsLoadedScript");
+ SUIT_Session* aSession = SUIT_Session::session();
+ if (!aSession)
+ return;
+ SUIT_Application * anApp = aSession->activeApplication();
+ if (!anApp)
+ return;
+ QVariant aVar = anApp->property("IsLoadedScript");
if (!aVar.isNull() && aVar.toBool()) {
DocumentPtr aRootDoc = ModelAPI_Session::get()->moduleDocument();
int aSize = aRootDoc->size(ModelAPI_ResultPart::group());