]> SALOME platform Git repositories - modules/adao.git/commitdiff
Salome HOME
Synchro etat etude etat cas dans eficas
authorAndré Ribes <andre.ribes@edf.fr>
Thu, 24 Feb 2011 16:22:26 +0000 (17:22 +0100)
committerAndré Ribes <andre.ribes@edf.fr>
Thu, 24 Feb 2011 16:22:26 +0000 (17:22 +0100)
src/daSalome/daGUI/ADAOGUI.py
src/daSalome/daGUI/daEficasWrapper/adaoEficasWrapper.py
src/daSalome/daGUI/daGuiImpl/ADAOGUI_impl.py
src/daSalome/daGUI/daGuiImpl/adaoCase.py
src/daSalome/daGUI/daGuiImpl/adaoStudyEditor.py

index 24ae044285151a84a48edf23d91ff026302632d1..43b361ec2d7471c9d52a8c6271e6fdcfd874a5d0 100644 (file)
@@ -91,5 +91,6 @@ def preferenceChanged( section, setting ):
   adaoLogger.debug("preferenceChanged")
   GuiImpl.preferenceChanged( section, setting )
 
-def activeViewChanged(toto, myView):
+def activeViewChanged(myView):
   adaoLogger.debug("activeViewChanged")
+  GuiImpl.activeViewChanged(myView)
index 3806147f8d1c244c8e3b151ebfc640fea1de5e9c..8538879d685d9f91e7c2b7278231e14f5e00482f 100644 (file)
@@ -84,7 +84,7 @@ class AdaoEficasWrapper(eficasSalome.MyEficas):
       qtEficas.Appli.fileNew(self)
       index = self.viewmanager.myQtab.currentIndex()
       adao_case.name          = str(self.viewmanager.myQtab.tabText(index))
-      adao_case.eficas_editor = self.viewmanager.dict_editors[index]
+      adao_case.setEditor(self.viewmanager.dict_editors[index])
       self.notifyObserver(EficasEvent.EVENT_TYPES.NEW, callbackId=adao_case)
 
     def adaoFileSave(self, adao_case):
@@ -94,7 +94,7 @@ class AdaoEficasWrapper(eficasSalome.MyEficas):
         index = self.viewmanager.myQtab.currentIndex()
         adao_case.name          = str(self.viewmanager.myQtab.tabText(index))
         adao_case.filename      = str(self.viewmanager.dict_editors[index].fichier)
-        adao_case.eficas_editor = self.viewmanager.dict_editors[index]
+        adao_case.setEditor(self.viewmanager.dict_editors[index])
         self.notifyObserver(EficasEvent.EVENT_TYPES.SAVE, callbackId=adao_case)
 
     def adaoFileSaveAs(self, adao_case):
@@ -104,7 +104,7 @@ class AdaoEficasWrapper(eficasSalome.MyEficas):
         index = self.viewmanager.myQtab.currentIndex()
         adao_case.name          = str(self.viewmanager.myQtab.tabText(index))
         adao_case.filename      = str(self.viewmanager.dict_editors[index].fichier)
-        adao_case.eficas_editor = self.viewmanager.dict_editors[index]
+        adao_case.setEditor(self.viewmanager.dict_editors[index])
         self.notifyObserver(EficasEvent.EVENT_TYPES.SAVE, callbackId=adao_case)
 
     def adaoFileOpen(self, adao_case):
@@ -117,7 +117,7 @@ class AdaoEficasWrapper(eficasSalome.MyEficas):
           index = self.viewmanager.myQtab.currentIndex()
           adao_case.name          = str(self.viewmanager.myQtab.tabText(index))
           adao_case.filename      = str(self.viewmanager.dict_editors[index].fichier)
-          adao_case.eficas_editor = self.viewmanager.dict_editors[index]
+          adao_case.setEditor(self.viewmanager.dict_editors[index])
           self.notifyObserver(EficasEvent.EVENT_TYPES.OPEN, callbackId=adao_case)
 
     def adaoFileClose(self, adao_case):
index 363d2434f34b8caf4d685d6b96205c4d3af7c4bb..21f055f86431d279f52af1a721b2ae6c201de3b3 100644 (file)
@@ -131,7 +131,6 @@ def preferenceChanged( section, setting ):
 # called when active view is changed
 # view ID is passed as parameter
 def activeViewChanged( viewID ):
-  print "activeViewChanged", viewID
   pass
 
 # called when active view is cloned
index ca2e2c00068a094fde008999e078f59cdb826877..cd0beb6f6cb10f7d83dbaf98902e796488fd360c 100644 (file)
@@ -23,6 +23,11 @@ import subprocess
 import traceback
 import SalomePyQt
 
+import eficasSalome
+from Ihm import CONNECTOR
+import adaoGuiHelper
+import adaoStudyEditor
+
 class AdaoCase:
 
   def __init__(self):
@@ -37,6 +42,21 @@ class AdaoCase:
 
     self.eficas_editor = None               # Editor object from Eficas
 
+  def setEditor(self, editor):
+    if editor is not self.eficas_editor:
+      self.eficas_editor = editor
+      # Connect to the jdc
+      print self.eficas_editor.jdc
+      CONNECTOR.Connect(self.eficas_editor.jdc, "valid", self.editorValidEvent, ())
+
+  # Rq on notera que l'on utilise isvalid dans isOk
+  #    et que isOk appelle editorValidEvent
+  #    il n'y a pas de boucle infini car isvalid n'émet
+  #    son signal que si l'état a changé
+  def editorValidEvent(self):
+    adaoStudyEditor.updateItem(self.salome_study_id, self.salome_study_item, self)
+    adaoGuiHelper.refreshObjectBrowser()
+
   def isOk(self):
     if self.eficas_editor.jdc:
       return self.eficas_editor.jdc.isvalid()
index b4d539175a4e6da13fc58ffd7e30e837030d420c..52bb64c47c356f3f67478a781e656e60eb30669f 100644 (file)
@@ -25,7 +25,6 @@ from enumerate import Enumerate
 from salome.kernel import studyedit
 
 import adaoModuleHelper
-from daGuiImpl.adaoCase import AdaoCase
 
 #
 # ==============================================================================