Salome HOME
Update state of Save button after Rename and Create Presentation on mesh
authorjfa <jfa@opencascade.com>
Mon, 8 Aug 2005 08:27:24 +0000 (08:27 +0000)
committerjfa <jfa@opencascade.com>
Mon, 8 Aug 2005 08:27:24 +0000 (08:27 +0000)
src/VISUGUI/VisuGUI.cxx
src/VISUGUI/VisuGUI_Tools.cxx

index 403a46121e12cda86b2fe516780347bd7093f08c..fcaf2a00f79f9f29f5cd7f0ca9843d6a9f6b2a34 100644 (file)
@@ -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);
index d340ba369af5561be75615d907aee1c1fcb31dfa..4606134bce3fa591e69b75e922ec4b656bd2a48e 100644 (file)
@@ -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),