From d69a7240711c86f39446238c3219164b07667c49 Mon Sep 17 00:00:00 2001 From: nds Date: Tue, 9 Dec 2014 12:23:07 +0300 Subject: [PATCH] =?utf8?q?Issue=20#121=20-=20Copy,=20Paste,=20Duplicate=20?= =?utf8?q?Part,=20Remove=20Part,=20Edit=20=E2=80=93=20Undo,=20Redo=20are?= =?utf8?q?=20enabled=20in=20a=20new=20study?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit It removes actions Copy/Paste and update the initial enabled state of Undo/Redo actions. --- src/NewGeom/NewGeom_Module.cpp | 5 +++++ src/NewGeom/NewGeom_Module.h | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/NewGeom/NewGeom_Module.cpp b/src/NewGeom/NewGeom_Module.cpp index 5755c626f..baeee345d 100644 --- a/src/NewGeom/NewGeom_Module.cpp +++ b/src/NewGeom/NewGeom_Module.cpp @@ -147,9 +147,13 @@ bool NewGeom_Module::activateModule(SUIT_Study* theStudy) myIsOpened = false; QTimer::singleShot(1000, myWorkshop, SLOT(displayAllResults())); } + else + myWorkshop->updateCommandStatus(); } SUIT_ResourceMgr* aResMgr = application()->resourceMgr(); myIsStorePositions = aResMgr->booleanValue("Study", "store_positions", true); + myIsEditEnabled = getApp()->isEditEnabled(); + getApp()->setEditEnabled(false); // this following row is caused by #187 bug. // SALOME saves the dock widget positions before deactivateModule() and @@ -197,6 +201,7 @@ bool NewGeom_Module::deactivateModule(SUIT_Study* theStudy) SUIT_ResourceMgr* aResMgr = application()->resourceMgr(); aResMgr->setValue("Study", "store_positions", myIsStorePositions); + getApp()->setEditEnabled(myIsEditEnabled); return LightApp_Module::deactivateModule(theStudy); } diff --git a/src/NewGeom/NewGeom_Module.h b/src/NewGeom/NewGeom_Module.h index f8fdfb8f9..24f2f7a39 100644 --- a/src/NewGeom/NewGeom_Module.h +++ b/src/NewGeom/NewGeom_Module.h @@ -117,7 +117,9 @@ Q_OBJECT QMap myDocumentType; bool myIsOpened; - bool myIsStorePositions; + // the next parameters should be restored after this module deactivation + bool myIsStorePositions; // the application value of the preferences parameter + bool myIsEditEnabled; // the application value QtxPopupMgr* myPopupMgr; }; -- 2.39.2