Salome HOME
Déplacement du logger dans utils
[modules/adao.git] / src / daSalome / daGUI / ADAOGUI.py
1 # -*- coding: utf-8 -*-
2 #  Copyright (C) 2010  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
21 """
22 This python file provides the implementation of the interface of the GUI part of
23 this SALOME module. This interface is required by the SALOME GUI framework.
24 We use here a proxy module named under the alias GuiImpl for at least three
25 reasons:
26 1. To Keep the required interface as clear as possible in this file;
27 2. The concrete implementation can be substituted by an alternative version;
28 3. We could mix several concrete implementations provided by different proxy
29    modules, for example for test purposes.
30 """
31
32 from daGuiImpl import ADAOGUI_impl as GuiImpl
33 from daUtils import adaoLogger
34
35 adaoLogger.debug("Import ADAOGUI")
36
37 # called when module is initialized
38 # perform initialization actions
39 def initialize():
40   adaoLogger.debug("initialize")
41   GuiImpl.initialize()
42
43 # called when module is initialized
44 # return map of popup windows to be used by the module
45 def windows():
46   adaoLogger.debug("windows")
47   return GuiImpl.windows()
48
49 def views():
50   adaoLogger.debug("views")
51   return GuiImpl.views()
52
53 # called when module is initialized
54 # export module's preferences
55 def createPreferences():
56   adaoLogger.debug("createPreferences")
57   GuiImpl.createPreferences()
58
59 # called when module is activated
60 # returns True if activating is successfull and False otherwise
61 def activate():
62   adaoLogger.debug("activate")
63   return GuiImpl.activate()
64
65 # called when module is deactivated
66 def deactivate():
67   adaoLogger.debug("deactivate")
68   GuiImpl.deactivate()
69
70 # called when active study is changed
71 # active study ID is passed as parameter
72 def activeStudyChanged( studyID ):
73   adaoLogger.debug("activeStudyChanged")
74   GuiImpl.activeStudyChanged( studyID )
75
76 # called when popup menu is invoked
77 # popup menu and menu context are passed as parameters
78 def createPopupMenu( popup, context ):
79   adaoLogger.debug("createPopupMenu")
80   GuiImpl.createPopupMenu(popup, context )
81
82 # called when GUI action is activated
83 # action ID is passed as parameter
84 def OnGUIEvent(commandID) :
85   adaoLogger.debug("OnGUIEvent")
86   GuiImpl.OnGUIEvent(commandID)
87
88 # called when module's preferences are changed
89 # preference's resources section and setting name are passed as parameters
90 def preferenceChanged( section, setting ):
91   adaoLogger.debug("preferenceChanged")
92   GuiImpl.preferenceChanged( section, setting )
93
94 def activeViewChanged(myView):
95   adaoLogger.debug("activeViewChanged")
96   GuiImpl.activeViewChanged(myView)