1 # -*- coding: utf-8 -*-
3 # Copyright (C) 2008-2020 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.
37 from daGuiImpl import ADAOGUI_impl as GuiImpl
38 from daUtils import adaoLogger
40 adaoLogger.debug("Import ADAOGUI")
42 # called when module is initialized
43 # perform initialization actions
45 adaoLogger.debug("initialize")
48 # called when module is initialized
49 # return map of popup windows to be used by the module
51 adaoLogger.debug("windows")
52 return GuiImpl.windows()
55 adaoLogger.debug("views")
56 return GuiImpl.views()
58 # called when module is initialized
59 # export module's preferences
60 def createPreferences():
61 adaoLogger.debug("createPreferences")
62 GuiImpl.createPreferences()
64 # called when module is activated
65 # returns True if activating is successfull and False otherwise
67 adaoLogger.debug("activate")
68 return GuiImpl.activate()
70 # called when module is deactivated
72 adaoLogger.debug("deactivate")
75 # called when active study is changed
76 # active study ID is passed as parameter
77 #~ def activeStudyChanged( studyID ):
78 #~ adaoLogger.debug("activeStudyChanged")
79 #~ GuiImpl.activeStudyChanged( studyID )
81 # called when popup menu is invoked
82 # popup menu and menu context are passed as parameters
83 def createPopupMenu( popup, context ):
84 adaoLogger.debug("createPopupMenu")
85 GuiImpl.createPopupMenu(popup, context )
87 # called when GUI action is activated
88 # action ID is passed as parameter
89 def OnGUIEvent(commandID) :
90 adaoLogger.debug("OnGUIEvent")
91 GuiImpl.OnGUIEvent(commandID)
93 # called when module's preferences are changed
94 # preference's resources section and setting name are passed as parameters
95 def preferenceChanged( section, setting ):
96 adaoLogger.debug("preferenceChanged")
97 GuiImpl.preferenceChanged( section, setting )
99 def activeViewChanged(myView):
100 adaoLogger.debug("activeViewChanged")
101 GuiImpl.activeViewChanged(myView)