Salome HOME
Auto Arrange Schema when loading it in YACS GUI
[modules/adao.git] / src / daSalome / daGUI / daGuiImpl / ADAOGUI_impl.py
index 8168608acc9fc36bf1a6ec5470bd04ee58a1ef29..21f055f86431d279f52af1a721b2ae6c201de3b3 100644 (file)
@@ -36,22 +36,18 @@ sgPyQt = SalomePyQt.SalomePyQt()
 # creates the menu and toolbar items (must be created for every study)
 
 from daGuiImpl import adaoGuiHelper
-from daGuiImpl.adaoGuiManager import AdaoGuiUiComponentBuilder
-from daGuiImpl.adaoGuiManager import AdaoGuiActionImpl
+from daGuiImpl.adaoGuiManager import AdaoCaseManager
+
 class GUIcontext:
-    uiComponentBuilder = None
-    actionImpl = None
+    adaoCaseManager = None
     def __init__(self):
-        self.uiComponentBuilder = AdaoGuiUiComponentBuilder()
-        self.actionImpl = AdaoGuiActionImpl()
-
+        self.adaoCaseManager = AdaoCaseManager()
 
 __study2context__   = {}
 __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]
@@ -80,7 +76,8 @@ def windows():
 # called when module is initialized
 # return list of 2d/3d views to be used ny the module
 def views():
-    return []
+  print "views"
+  return []
 
 def createPreferences():
     """
@@ -91,15 +88,14 @@ 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()
+    ctx.adaoCaseManager.activate()
     return True
 
 # called when module is deactivated
 def deactivate():
     ctx = _setContext( sgPyQt.getStudyId() )
-    ctx.actionImpl.deactivate()
+    ctx.adaoCaseManager.deactivate()
     pass
 
 # called when active study is changed
@@ -108,7 +104,6 @@ def activeStudyChanged( studyID ):
     ctx = _setContext( sgPyQt.getStudyId() )
     pass
 
-
 # called when popup menu is invoked
 # popup menu and menu context are passed as parameters
 def createPopupMenu( popup, context ):
@@ -117,7 +112,7 @@ def createPopupMenu( popup, context ):
   selcount, selected = adaoGuiHelper.getAllSelected(activeStudyId)
   if selcount == 1:
     selectedItem = adaoGuiHelper.getSelectedItem(activeStudyId)
-    popup = ctx.uiComponentBuilder.createPopupMenuOnItem(popup, activeStudyId, selectedItem)
+    popup = ctx.adaoCaseManager.salome_manager.createPopupMenuOnItem(popup, activeStudyId, selectedItem)
 
 def OnGUIEvent(actionId) :
     """
@@ -126,7 +121,7 @@ def OnGUIEvent(actionId) :
     """
     pass
     ctx = _setContext( sgPyQt.getStudyId() )
-    ctx.actionImpl.processAction(actionId)
+    ctx.adaoCaseManager.processGUIEvent(actionId)
 
 # called when module's preferences are changed
 # preference's resources section and setting name are passed as parameters
@@ -136,7 +131,7 @@ def preferenceChanged( section, setting ):
 # called when active view is changed
 # view ID is passed as parameter
 def activeViewChanged( viewID ):
-    pass
+  pass
 
 # called when active view is cloned
 # cloned view ID is passed as parameter