1 # -*- coding: utf-8 -*-
3 # Copyright (C) 2008-2017 EDF R&D
5 # This file is part of SALOME ADAO module
7 # This library is free software; you can redistribute it and/or
8 # modify it under the terms of the GNU Lesser General Public
9 # License as published by the Free Software Foundation; either
10 # version 2.1 of the License.
12 # This library is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # Lesser General Public License for more details.
17 # You should have received a copy of the GNU Lesser General Public
18 # License along with this library; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 # Author: André Ribes, andre.ribes@edf.fr, EDF R&D
26 This python file provides the implementation of the interface of the GUI part of
27 this SALOME module. This interface is required by the SALOME GUI framework.
28 We use here a proxy module named under the alias GuiImpl for at least three
30 1. To Keep the required interface as clear as possible in this file;
31 2. The concrete implementation can be substituted by an alternative version;
32 3. We could mix several concrete implementations provided by different proxy
33 modules, for example for test purposes.
36 from daGuiImpl import ADAOGUI_impl as GuiImpl
37 from daUtils import adaoLogger
39 adaoLogger.debug("Import ADAOGUI")
41 # called when module is initialized
42 # perform initialization actions
44 adaoLogger.debug("initialize")
47 # called when module is initialized
48 # return map of popup windows to be used by the module
50 adaoLogger.debug("windows")
51 return GuiImpl.windows()
54 adaoLogger.debug("views")
55 return GuiImpl.views()
57 # called when module is initialized
58 # export module's preferences
59 def createPreferences():
60 adaoLogger.debug("createPreferences")
61 GuiImpl.createPreferences()
63 # called when module is activated
64 # returns True if activating is successfull and False otherwise
66 adaoLogger.debug("activate")
67 return GuiImpl.activate()
69 # called when module is deactivated
71 adaoLogger.debug("deactivate")
74 # called when active study is changed
75 # active study ID is passed as parameter
76 def activeStudyChanged( studyID ):
77 adaoLogger.debug("activeStudyChanged")
78 GuiImpl.activeStudyChanged( studyID )
80 # called when popup menu is invoked
81 # popup menu and menu context are passed as parameters
82 def createPopupMenu( popup, context ):
83 adaoLogger.debug("createPopupMenu")
84 GuiImpl.createPopupMenu(popup, context )
86 # called when GUI action is activated
87 # action ID is passed as parameter
88 def OnGUIEvent(commandID) :
89 adaoLogger.debug("OnGUIEvent")
90 GuiImpl.OnGUIEvent(commandID)
92 # called when module's preferences are changed
93 # preference's resources section and setting name are passed as parameters
94 def preferenceChanged( section, setting ):
95 adaoLogger.debug("preferenceChanged")
96 GuiImpl.preferenceChanged( section, setting )
98 def activeViewChanged(myView):
99 adaoLogger.debug("activeViewChanged")
100 GuiImpl.activeViewChanged(myView)