From: André Date: Tue, 27 Apr 2010 13:03:05 +0000 (+0200) Subject: Premiere Action: newcase :-) X-Git-Tag: V6_4_0rc3~161 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d8a435c50ef9e411c9be9a9b10a98f896aa87e40;p=modules%2Fadao.git Premiere Action: newcase :-) --- diff --git a/src/daSalome/daGUI/daGuiImpl/DATASSIMGUI_impl.py b/src/daSalome/daGUI/daGuiImpl/DATASSIMGUI_impl.py index 76dfa11..883f655 100644 --- a/src/daSalome/daGUI/daGuiImpl/DATASSIMGUI_impl.py +++ b/src/daSalome/daGUI/daGuiImpl/DATASSIMGUI_impl.py @@ -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 diff --git a/src/daSalome/daGUI/daGuiImpl/datassimGuiManager.py b/src/daSalome/daGUI/daGuiImpl/datassimGuiManager.py index 17f1ec7..811ef9d 100644 --- a/src/daSalome/daGUI/daGuiImpl/datassimGuiManager.py +++ b/src/daSalome/daGUI/daGuiImpl/datassimGuiManager.py @@ -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"