+ a = sgPyQt.createAction(GUIcontext.MULTICATALOG_ID, "Eficas MultiCatalogue","Lancer Eficas" , "Lancer Eficas", "eficas.png")
+ sgPyQt.createMenu(a, self.mid)
+ sgPyQt.createTool(a, self.tid)
+
+ # create actions conditionally and fill menu and toolbar with actions
+ self.addActionConditionally("Aster/prefs.py", GUIcontext.ASTER_ID,
+ "Eficas pour Code_Aster",
+ "Editer un jeu de commande ASTER avec Eficas",
+ "eficaster.png")
+ self.addActionConditionally("Sep/prefs.py", GUIcontext.OM_ID,
+ "Eficas pour Outils Metier",
+ "Editer un jeu de commande Outils Metier avec Eficas",
+ "eficasOM.png")
+ self.addActionConditionally("MAP/prefs.py", GUIcontext.MAP_ID,
+ "Eficas pour Map",
+ "Editer un jeu de commande Map avec Eficas",
+ "plus.png")
+ self.addActionConditionally("Openturns_Study/prefs.py", GUIcontext.OT_STUDY_ID,
+ "Eficas pour Openturns Study",
+ "Editer un jeu de commande Openturns Study avec Eficas",
+ "eficasotstd.png")
+ self.addActionConditionally("Openturns_Wrapper/prefs.py", GUIcontext.OT_WRAPPER_ID,
+ "Eficas pour Openturns Wrapper",
+ "Editer un jeu de commande Openturns Wrapper avec Eficas",
+ "eficasotwrp.png")
+ self.addActionConditionally("Carmel3D/prefs.py", GUIcontext.CARMEL3D_ID,
+ "Eficas pour Carmel3D",
+ "Editer un jeu de commande Carmel3D avec Eficas",
+ "eficascarmel.png")
+
+ def addActionConditionally(self, fileToTest, commandId, menuLabel, tipLabel, icon):
+ global eficasRoot
+ if os.path.isfile(os.path.join(eficasRoot, fileToTest)):
+ a = sgPyQt.createAction(commandId, menuLabel, tipLabel, tipLabel, icon)
+ sgPyQt.createMenu(a, self.mid)
+ sgPyQt.createTool(a, self.tid)