# 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]
# 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
ctx = _setContext( sgPyQt.getStudyId() )
pass
-
# called when popup menu is invoked
# popup menu and menu context are passed as parameters
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) :
"""
toolbar button). The actionId value is the ID associated to the item.
"""
pass
- print "OnGUIEvent", actionId
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
# 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