From e372daa9c4cad967c0e7a547343043174682761e Mon Sep 17 00:00:00 2001 From: vsr Date: Mon, 22 Dec 2014 11:15:31 +0300 Subject: [PATCH] Fix bug for "light" modules: when running in "full" mode, Copy/Paste actions' state is not properly updated on selection change --- src/SalomeApp/SalomeApp_Application.cxx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/SalomeApp/SalomeApp_Application.cxx b/src/SalomeApp/SalomeApp_Application.cxx index c142eca0b..3eaa957a8 100644 --- a/src/SalomeApp/SalomeApp_Application.cxx +++ b/src/SalomeApp/SalomeApp_Application.cxx @@ -688,11 +688,13 @@ void SalomeApp_Application::onSelectionChanged() LightApp_SelectionMgr* mgr = selectionMgr(); mgr->selectedObjects(list); + LightApp_Module* m = dynamic_cast( activeModule() ); + bool canCopy = false; bool canPaste = false; SalomeApp_Study* study = dynamic_cast(activeStudy()); - if (study != NULL) { + if (study) { _PTR(Study) stdDS = study->studyDS(); if (stdDS) { @@ -702,8 +704,12 @@ void SalomeApp_Application::onSelectionChanged() _PTR(SObject) so = stdDS->FindObjectID(it.Value()->getEntry()); if ( so ) { - canCopy = studyMgr()->CanCopy(so); - canPaste = studyMgr()->CanPaste(so); + canCopy = studyMgr()->CanCopy(so); + canPaste = studyMgr()->CanPaste(so); + } + else if ( m ) { + canCopy = m->canCopy(); + canPaste = m->canPaste(); } } } -- 2.39.2