+
+
+
+ def definitCode(self,code,ssCode) :
+ self.code=code
+ self.ssCode=ssCode
+ if self.code==None :
+ self.cleanPath()
+ from monChoixCode import MonChoixCode
+ widgetChoix = MonChoixCode(self)
+ ret=widgetChoix.exec_()
+ import sys
+ if self.code == None:return # pour le cancel de la fenetre choix code
+ name='prefs_'+self.code
+ prefsCode=__import__(name)
+
+ self.repIni=prefsCode.repIni
+ if ssCode != None :
+ self.format_fichier= ssCode #par defaut
+ prefsCode.NAME_SCHEME=ssCode
+ else :
+ self.format_fichier="python" #par defaut
+
+ nameConf='configuration_'+self.code
+ configuration=__import__(nameConf)
+ self.CONFIGURATION = configuration.make_config(self,prefsCode.repIni)
+ self.CONFIGStyle = None
+ if hasattr(configuration,'make_config_style'):
+ self.CONFIGStyle = configuration.make_config_style(self,prefsCode.repIni)
+ if hasattr(prefsCode,'encoding'):
+ import sys
+ reload(sys)
+ sys.setdefaultencoding(prefsCode.encoding)
+
+ def construitMenu(self):
+ self.initPatrons()
+ self.initRecents()
+ self.initAides()
+ for intituleMenu in ("menuTraduction","menuOptions","menuMesh","menuExecution"):
+ if hasattr(self,intituleMenu):
+ menu=getattr(self,intituleMenu)
+ menu.setAttribute(Qt.WA_DeleteOnClose)
+ menu.close()
+ delattr(self,intituleMenu)
+ for intituleAction in ("actionExecution","actionSaveRun",):
+ if hasattr(self,intituleAction):
+ action=getattr(self,intituleAction)
+ self.toolBar.removeAction(action)
+ if self.code in Appli.__dict__.keys():
+ listeTexte=apply(Appli.__dict__[self.code],(self,))
+
+ def initAides(self):
+ #print "je passe la"
+ repAide=os.path.dirname(os.path.abspath(__file__))
+ fileName='index.html'
+ self.docPath=repAide+"/../Aide"
+ if hasattr(self,'CONFIGURATION') and hasattr(self.CONFIGURATION,'docPath') : self.docPath=self.CONFIGURATION.docPath
+ if hasattr(self,'CONFIGURATION') and hasattr(self.CONFIGURATION,'fileName'):fileName=self.CONFIGURATION.fileName
+ self.fileDoc=os.path.join(self.docPath,fileName)
+ self.actionCode.setText(tr("Aide specifique ")+str(self.code))
+ if not os.path.isfile(self.fileDoc) :
+ self.fileDoc=""
+ self.docPath=""
+ self.actionCode.setEnabled(False)
+ return
+
+ self.actionCode.setEnabled(True)
+ self.menuAide.addAction(self.actionCode)
+
+
+ def ajoutExecution(self):
+ self.menuExecution = self.menubar.addMenu(QApplication.translate("Eficas", "Execution", None, QApplication.UnicodeUTF8))
+ self.actionExecution = QAction(self)
+ icon6 = QIcon(self.repIcon+"/roue.png")
+ self.actionExecution.setIcon(icon6)
+ self.actionExecution.setObjectName("actionExecution")
+ self.menuExecution.addAction(self.actionExecution)
+ if not(self.actionExecution in self.toolBar.actions()):
+ self.toolBar.addAction(self.actionExecution)
+ self.actionExecution.setText(QApplication.translate("Eficas", "Execution ", None, QApplication.UnicodeUTF8))
+ self.connect(self.actionExecution,SIGNAL("activated()"),self.run)
+
+ def ajoutSauveExecution(self):
+ self.actionSaveRun = QAction(self)
+ icon7 = QIcon(self.repIcon+"/export_MAP.png")
+ self.actionSaveRun.setIcon(icon7)
+ self.actionSaveRun.setObjectName("actionSaveRun")
+ self.menuExecution.addAction(self.actionSaveRun)
+ if not(self.actionSaveRun in self.toolBar.actions()):
+ self.toolBar.addAction(self.actionSaveRun)
+ self.actionSaveRun.setText(QApplication.translate("Eficas", "Save Run", None, QApplication.UnicodeUTF8))
+ self.connect(self.actionSaveRun,SIGNAL("activated()"),self.saveRun)
+
+ def griserActionsStructures(self):
+ self.actionCouper.setEnabled(False)
+ self.actionColler.setEnabled(False)
+ self.actionCopier.setEnabled(False)
+ self.actionSupprimer.setEnabled(False)
+
+ def enleverNewInclude(self):
+ self.actionNouvel_Include.setVisible(False)
+
+ def enleverRechercherDsCatalogue(self):
+ self.actionRechercherDsCatalogue.setVisible(False)
+
+ def ZCRACKS(self):
+ self.enleverNewInclude()
+ self.toolBar.addSeparator()
+ self.ajoutExecution()
+
+ self.menuOptions = self.menubar.addMenu("menuOptions")
+ self.menuOptions.addAction(self.actionParametres_Eficas)
+ self.menuOptions.setTitle(tr("Options"))
+
+ def ADAO(self):
+ self.griserActionsStructures()
+ self.enleverNewInclude()
+ self.enleverRechercherDsCatalogue()
+
+ def ASTER(self) :
+ self.menuTraduction = self.menubar.addMenu("menuTraduction")
+ self.menuTraduction.addAction(self.actionTraduitV11V12)
+ self.menuTraduction.addAction(self.actionTraduitV10V11)
+ self.menuTraduction.addAction(self.actionTraduitV9V10)
+ self.menuTraduction.setTitle(tr("Traduction"))
+
+ self.menuFichier.addAction(self.actionSauveLigne)
+
+ self.menuOptions = self.menubar.addMenu("menuOptions")
+ self.menuOptions.addAction(self.actionParametres_Eficas)
+ self.menuOptions.addAction(self.actionLecteur_Pdf)
+ self.menuOptions.setTitle(tr("Options"))
+
+ def CARMEL3D(self):
+ #if self.salome == 0 : return
+ self.enleverNewInclude()
+ self.menuMesh = self.menubar.addMenu("menuMesh")
+ self.menuMesh.setObjectName("Mesh")
+ self.menuMesh.addAction(self.actionChercheGrpMaille)
+ self.griserActionsStructures()
+
+ def CARMELCND(self):
+ self.enleverNewInclude()
+ self.enleverRechercherDsCatalogue()
+ self.ajoutExecution()
+ self.ajoutSauveExecution()
+ self.griserActionsStructures()