X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModel%2FModel_Session.cpp;h=b80cdd8eaf92737a34e09d233bece4bb6f4f0dc6;hb=06e7f5859095193fc7f498bd89a7d28009794f53;hp=5456d832e98d199aa678f4724d925883d2bfba62;hpb=c0e273c1479a9940dbe4f966853c82a6b8709d88;p=modules%2Fshaper.git diff --git a/src/Model/Model_Session.cpp b/src/Model/Model_Session.cpp index 5456d832e..b80cdd8ea 100644 --- a/src/Model/Model_Session.cpp +++ b/src/Model/Model_Session.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2014-2022 CEA/DEN, EDF R&D +// Copyright (C) 2014-2023 CEA, EDF // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -21,7 +21,6 @@ #include #include #include -#include #include #include #include @@ -60,7 +59,9 @@ static Model_Session* myImpl = new Model_Session(); bool Model_Session::load(const char* theFileName) { + myIsLoading = true; bool aRes = ROOT_DOC->load(theFileName, "root", ROOT_DOC); + myIsLoading = false; return aRes; } @@ -72,11 +73,11 @@ bool Model_Session::save(const char* theFileName, std::list& theRes void Model_Session::closeAll() { Model_Application::getApplication()->deleteAllDocuments(); - static const Events_ID aDocChangeEvent = Events_Loop::eventByName(EVENT_DOCUMENT_CHANGED); + static const Events_ID aDocsCloseEvent = Events_Loop::eventByName(EVENT_DOCUMENTS_CLOSED); myCurrentDoc = NULL; - static std::shared_ptr aMsg(new Events_Message(aDocChangeEvent)); + static std::shared_ptr aMsg(new Events_Message(aDocsCloseEvent)); Events_Loop::loop()->send(aMsg); - Events_Loop::loop()->flush(aDocChangeEvent); + Events_Loop::loop()->flush(aDocsCloseEvent); } void Model_Session::startOperation(const std::string& theId, const bool theAttachedToNested) @@ -179,6 +180,11 @@ std::list Model_Session::redoList() return ROOT_DOC->redoList(); } +void Model_Session::clearUndoRedo() +{ + return ROOT_DOC->clearUndoRedo(); +} + bool Model_Session::checkLicense(const std::string& thePluginName) { return getPlugin(thePluginName); @@ -448,6 +454,7 @@ Model_Session::Model_Session() { myPluginsInfoLoaded = false; myCheckTransactions = true; + myIsLoading = false; ModelAPI_Session::setSession(std::shared_ptr(this)); // register the configuration reading listener Events_Loop* aLoop = Events_Loop::loop(); @@ -674,3 +681,10 @@ void Model_Session::blockAutoUpdate(const bool theBlock) } } } + +#ifdef TINSPECTOR +Handle(TDocStd_Application) Model_Session::application() +{ + return Model_Application::getApplication(); +} +#endif