]> SALOME platform Git repositories - modules/adao.git/commitdiff
Salome HOME
Premiere Action: newcase :-)
authorAndré <andre.ribes@edf.fr>
Tue, 27 Apr 2010 13:03:05 +0000 (15:03 +0200)
committerAndré <andre.ribes@edf.fr>
Tue, 27 Apr 2010 13:03:05 +0000 (15:03 +0200)
src/daSalome/daGUI/daGuiImpl/DATASSIMGUI_impl.py
src/daSalome/daGUI/daGuiImpl/datassimGuiManager.py

index 76dfa11c7537b3edc42c84f4bbcd4e846e4ca4c8..883f6552872805a4e97b70fbdcea0a709e03f3f4 100644 (file)
@@ -52,8 +52,8 @@ def _setContext( studyID ):
     __current_context__ = __study2context__[studyID]
     return __current_context__
 
-#from oma.salome.omaGuiManager import OmaGuiActionImpl
-#actionImpl = OmaGuiActionImpl()
+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.
 
@@ -120,7 +120,7 @@ def OnGUIEvent(actionId) :
     toolbar button). The actionId value is the ID associated to the item.
     """
     pass
-#    actionImpl.processAction(actionId)
+    actionImpl.processAction(actionId)
 
     
 # called when module's preferences are changed
index 17f1ec77a54330aa5a1d9a94ca0b245e6079a096..811ef9db962e65b2c07d0cd9ecdb02bb256ae5ef 100644 (file)
@@ -38,9 +38,11 @@ from daGuiImpl.enumerate import Enumerate
 #
 UI_ELT_IDS = Enumerate([
         'DATASSIM_MENU_ID',
+        'NEW_DATASSIMCASE_ID',
         ],offset=950)
 
 ACTIONS_MAP={
+    UI_ELT_IDS.NEW_DATASSIMCASE_ID:"newDatassimCase",
 }
 
 class DatassimGuiUiComponentBuilder:
@@ -61,3 +63,41 @@ class DatassimGuiUiComponentBuilder:
         # create toolbar
         tid = sgPyQt.createTool( "DATASSIM" )
 
+        a = sgPyQt.createAction( UI_ELT_IDS.NEW_DATASSIMCASE_ID, "New case", "New case", "Create a new datassim case", "" )
+        sgPyQt.createMenu(a, mid)
+        sgPyQt.createTool(a, tid)
+
+class DatassimGuiActionImpl():
+    """
+    This class implements the ui actions concerning the management of oma study
+    cases.
+    """
+    __dlgNewStudyCase = None
+    __dlgEficasWrapper = None
+
+    def __init__(self):
+        pass
+        # This dialog is created once so that it can be recycled for each call
+        # to newOmaCase().
+        #self.__dlgNewStudyCase = DlgNewStudyCase()
+        #self.__dlgEficasWrapper = OmaEficasWrapper(parent=SalomePyQt.SalomePyQt().getDesktop())
+
+    # ==========================================================================
+    # Processing of ui actions
+    #
+    def processAction(self,actionId):
+        """
+        Main switch function for ui actions processing
+        """
+        if ACTIONS_MAP.has_key(actionId):
+            try:
+                functionName = ACTIONS_MAP[actionId]
+                getattr(self,functionName)()
+            except:
+                traceback.print_exc()
+        else:
+            msg = "The requested action is not implemented: " + str(actionId)
+            print msg
+
+    def newDatassimCase(self):
+      print "newDatassimCase"