From c88d3b912d1bf052c1011a97dd250185d35dde8d Mon Sep 17 00:00:00 2001 From: jfa Date: Mon, 8 Aug 2005 08:27:24 +0000 Subject: [PATCH] Update state of Save button after Rename and Create Presentation on mesh --- src/VISUGUI/VisuGUI.cxx | 17 ++++++++++------- src/VISUGUI/VisuGUI_Tools.cxx | 2 ++ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/VISUGUI/VisuGUI.cxx b/src/VISUGUI/VisuGUI.cxx index 403a4612..fcaf2a00 100644 --- a/src/VISUGUI/VisuGUI.cxx +++ b/src/VISUGUI/VisuGUI.cxx @@ -1512,8 +1512,9 @@ OnRename() if (!aSObj) return; //TEST DU PARENT == VISU - _PTR(GenericAttribute) anAttr; - if (aSObj->FindAttribute(anAttr, "AttributeName")) { + _PTR(StudyBuilder) aBuilder = aCStudy->NewBuilder(); + _PTR(GenericAttribute) anAttr = aBuilder->FindOrCreateAttribute(aSObj, "AttributeName"); + if (anAttr) { _PTR(AttributeName) aName (anAttr); QString Name = VisuGUI_NameDlg::getName( GetDesktop( this ), aName->Value().c_str() ); if (!Name.isEmpty()) { @@ -2642,11 +2643,13 @@ void VisuGUI::contextMenuPopup( const QString& theClient, QPopupMenu* theMenu, Q action( VISU_SHOW_ANIMATION )->addTo(theMenu); } else if (IsSObjectTable(SO)) { - action( VISU_SHOW_TABLE )->addTo(theMenu); - action( VISU_CREATE_CURVES )->addTo(theMenu); - action( VISU_EXPORT_TABLE )->addTo(theMenu); - theMenu->insertSeparator(); - + OB_Browser* ob = getApp()->objectBrowser(); + if (ob && theClient == ob->popupClientType()) { + action( VISU_SHOW_TABLE )->addTo(theMenu); + action( VISU_CREATE_CURVES )->addTo(theMenu); + action( VISU_EXPORT_TABLE )->addTo(theMenu); + theMenu->insertSeparator(); + } } else { if (!CORBA::is_nil(anObject)) { SALOME_MED::MED_var aMED = SALOME_MED::MED::_narrow(anObject); diff --git a/src/VISUGUI/VisuGUI_Tools.cxx b/src/VISUGUI/VisuGUI_Tools.cxx index d340ba36..4606134b 100644 --- a/src/VISUGUI/VisuGUI_Tools.cxx +++ b/src/VISUGUI/VisuGUI_Tools.cxx @@ -1047,6 +1047,8 @@ namespace VISU timer.Show(); #endif theModule->application()->putInfo(QObject::tr("INF_DONE")); + // Make "Save" button active + theModule->getApp()->updateActions(); } catch (std::runtime_error& exc) { INFOS(exc.what()); SUIT_MessageBox::warn1 (GetDesktop(theModule), -- 2.39.2