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