]> SALOME platform Git repositories - modules/adao.git/commitdiff
Salome HOME
- Multi Etude...
authorAndré <andre.ribes@edf.fr>
Thu, 29 Apr 2010 14:01:45 +0000 (16:01 +0200)
committerAndré <andre.ribes@edf.fr>
Thu, 29 Apr 2010 14:01:45 +0000 (16:01 +0200)
src/daSalome/daGUI/daEficasWrapper/datassimEficasWrapper.py
src/daSalome/daGUI/daGuiImpl/DATASSIMGUI_impl.py
src/daSalome/daGUI/daGuiImpl/datassimGuiManager.py

index 422a0443d1c0f055f436f9be1e12a175272b6838..7a11ae629074a1b51528b259cfd72c0bb2a205e3 100644 (file)
@@ -34,12 +34,11 @@ sys.path[:0]=[DATASSIM_INSTALL_DIR]
 #
 class DatassimEficasWrapper(EficasWrapper):
 
-    __myCallbackId = {}
-    __close_editor = None
-    __file_open_name = ""
-
     def __init__(self, parent, code="DATASSIM"):
         EficasWrapper.__init__(self, parent, code)
+        self.__myCallbackId = {}
+        self.__close_editor = None
+        self.__file_open_name = ""
 
     def init_gui(self):
       EficasWrapper.init_gui(self)
index 6423113010b1428bfb8fe4b0647f3d66affab486..272bd3c377c99becac595811d7399a70b8764eba 100644 (file)
@@ -37,10 +37,13 @@ sgPyQt = SalomePyQt.SalomePyQt()
 
 from daGuiImpl import datassimGuiHelper
 from daGuiImpl.datassimGuiManager import DatassimGuiUiComponentBuilder
+from daGuiImpl.datassimGuiManager import DatassimGuiActionImpl
 class GUIcontext:
     uiComponentBuilder = None
+    actionImpl = None
     def __init__(self):
         self.uiComponentBuilder = DatassimGuiUiComponentBuilder()
+        self.actionImpl = DatassimGuiActionImpl()
 
 
 __study2context__   = {}
@@ -48,13 +51,12 @@ __current_context__ = None
 def _setContext( studyID ):
     global __study2context__, __current_context__
     if not __study2context__.has_key(studyID):
+        print "create new context"
         __study2context__[studyID] = GUIcontext()
         pass
     __current_context__ = __study2context__[studyID]
     return __current_context__
 
-from daGuiImpl.datassimGuiManager import DatassimGuiActionImpl
-actionImpl = DatassimGuiActionImpl()
 # This object does not need to be embedded in a GUI context object. A single
 # instance for all studies is a priori sufficient.
 
@@ -89,7 +91,9 @@ def createPreferences():
 # called when module is activated
 # returns True if activating is successfull and False otherwise
 def activate():
+    print "activate study",  sgPyQt.getStudyId()
     ctx = _setContext( sgPyQt.getStudyId() )
+    ctx.actionImpl.activate()
     return True
 
 # called when module is deactivated
@@ -119,7 +123,8 @@ def OnGUIEvent(actionId) :
     toolbar button). The actionId value is the ID associated to the item.
     """
     pass
-    actionImpl.processAction(actionId)
+    ctx = _setContext( sgPyQt.getStudyId() )
+    ctx.actionImpl.processAction(actionId)
 
     
 # called when module's preferences are changed
index e7ac7217edfef8d5c4c3619d0715bb481154d0e2..ed1b3fbe9f6d9857e0960b01b96ca9b0abde80b9 100644 (file)
@@ -105,8 +105,6 @@ class DatassimGuiActionImpl(EficasObserver):
     This class implements the ui actions concerning the management of oma study
     cases.
     """
-    __dlgEficasWrapper = None
-    __Eficas_viewId = -1
 
     def __init__(self):
         pass
@@ -115,6 +113,7 @@ class DatassimGuiActionImpl(EficasObserver):
         #self.__dlgNewStudyCase = DlgNewStudyCase()
         self.__dlgEficasWrapper = DatassimEficasWrapper(parent=SalomePyQt.SalomePyQt().getDesktop())
         self.__dlgEficasWrapper.addObserver(self)
+        self.__Eficas_viewId = -1
 
     # ==========================================================================
     # Processing of ui actions
@@ -148,6 +147,8 @@ class DatassimGuiActionImpl(EficasObserver):
             self.__dlgEficasWrapper.init_gui()
             self.__Eficas_viewId = SalomePyQt.SalomePyQt().createViewWithMain(self.__dlgEficasWrapper)
 
+    def activate(self):
+      self.showEficas()
 
     def newDatassimCase(self):
       self.showEficas()