From 7d0b41d770a5acd7cac59178307524dcee20c6f0 Mon Sep 17 00:00:00 2001 From: "pascale.noyret" Date: Fri, 16 Sep 2016 11:05:16 +0200 Subject: [PATCH] qques bugs --- InterfaceQT4/eficas_go.py | 3 +-- InterfaceQT4/monChoixCommande.py | 2 +- InterfaceQT4/monRecherche.py | 1 - InterfaceQT4/monWidgetCBSD.py | 1 + InterfaceQT4/monWidgetCommande.py | 40 +++++++++++++++-------------- InterfaceQT4/monWidgetSimpSalome.py | 3 +++ InterfaceQT4/readercata.py | 40 +++++++++++++---------------- InterfaceQT4/viewManager.py | 8 ++++++ 8 files changed, 53 insertions(+), 45 deletions(-) diff --git a/InterfaceQT4/eficas_go.py b/InterfaceQT4/eficas_go.py index ad76ff3d..3323ad79 100755 --- a/InterfaceQT4/eficas_go.py +++ b/InterfaceQT4/eficas_go.py @@ -67,7 +67,6 @@ def lance_eficas_ssIhm(code=None,fichier=None,ssCode=None,version=None): if code == None : code=options.code from qtEficas import Appli - app = QApplication(sys.argv) Eficas=Appli(code=code,ssCode=ssCode,ssIhm=True) from ssIhm import QWParentSSIhm @@ -91,6 +90,7 @@ def lance_eficas_ssIhm_cherche_cr(code=None,fichier=None,ssCode=None,version=Non print monEditeur.jdc.cr def lance_eficas_ssIhm_reecrit(code=None,fichier=None,ssCode=None,version=None,ou=None,cr=False): + #print 'lance_eficas_ssIhm_reecrit', fichier monEditeur=lance_eficas_ssIhm(code,fichier,ssCode,version) if ou == None : fileName=fichier.split(".")[0]+"_reecrit.comm" @@ -108,7 +108,6 @@ def lance_eficas_ssIhm_reecrit(code=None,fichier=None,ssCode=None,version=None,o f.write(str(monEditeur.jdc.report())) f.close() - def lance_eficas_param(code='Adao',fichier=None,version='V0',macro='ASSIMILATION_STUDY'): """ Lance l'appli EFICAS pour trouver les noms des groupes diff --git a/InterfaceQT4/monChoixCommande.py b/InterfaceQT4/monChoixCommande.py index d7c34f06..cdef4528 100644 --- a/InterfaceQT4/monChoixCommande.py +++ b/InterfaceQT4/monChoixCommande.py @@ -110,7 +110,7 @@ class MonChoixCommande(Ui_ChoixCommandes,QWidget): self.affiche_ordre==1; self.RBOrdre.setChecked(True); self.afficheOrdre() - if self.editor.code == "Adao" : self.frameAffichage.close() + if self.editor.closeFrameRechercheCommande == True : self.frameAffichage.close() def afficheRegle(self): self.node.tree.AppelleBuildLBRegles() diff --git a/InterfaceQT4/monRecherche.py b/InterfaceQT4/monRecherche.py index 0f843306..6f30fd41 100644 --- a/InterfaceQT4/monRecherche.py +++ b/InterfaceQT4/monRecherche.py @@ -42,7 +42,6 @@ class DRecherche(Ui_desRecherche ,QDialog): QDialog.__init__(self,parent) self.parentQT=parent self.tree=self.parentQT.tree - self.setModal(True) self.setupUi(self) self.PBSuivant.setDefault(True) self.PBSuivant.setAutoDefault(False) diff --git a/InterfaceQT4/monWidgetCBSD.py b/InterfaceQT4/monWidgetCBSD.py index 14ecd233..6a79f9d5 100644 --- a/InterfaceQT4/monWidgetCBSD.py +++ b/InterfaceQT4/monWidgetCBSD.py @@ -66,6 +66,7 @@ class MonWidgetCB (Ui_WidgetCB,Feuille): if monEnvQT5: self.CBChoix.currentIndexChanged.connect(self.ChoixSaisi) else : + self.connect(self.CBChoix,SIGNAL("currentIndexChanged(int)"),self.ChoixSaisi for choix in self.monSimpDef.into: if not(type(choix) in types.StringTypes) : choix=str(choix) diff --git a/InterfaceQT4/monWidgetCommande.py b/InterfaceQT4/monWidgetCommande.py index c4ba914d..32da3c15 100644 --- a/InterfaceQT4/monWidgetCommande.py +++ b/InterfaceQT4/monWidgetCommande.py @@ -45,7 +45,6 @@ class MonWidgetCommande(Ui_WidgetCommande,Groupe): """ """ def __init__(self,node,editor,etape): - #print "MonWidgetCommande ", self,node.item.get_fr() self.listeAffichageWidget=[] self.inhibe=0 self.ensure=0 @@ -69,27 +68,26 @@ class MonWidgetCommande(Ui_WidgetCommande,Groupe): self.scrollAreaCommandes.focusInEvent=self.focusInEvent - if monEnvQT5 : - if self.editor.code in ['MAP','CARMELCND'] : self.bCatalogue.close() - else : self.bCatalogue.clicked.connect(self.afficheCatalogue) - if self.editor.code in ['Adao','MAP'] : - self.bAvant.close() - self.bApres.close() - else : - self.bAvant.clicked.connect(self.afficheAvant) - self.bApres.clicked.connect(self.afficheApres) + if self.editor.closeFrameRechercheCommande==True : self.closeAutreCommande() + else : + if monEnvQT5 : + try : + self.bCatalogue.clicked.connect(self.afficheCatalogue) + self.bAvant.clicked.connect(self.afficheAvant) + self.bApres.clicked.connect(self.afficheApres) + except : + pass self.LENom.returnPressed.connect(self.nomChange) - else : - if self.editor.code in ['MAP','CARMELCND'] : self.bCatalogue.close() - else : self.connect(self.bCatalogue,SIGNAL("clicked()"), self.afficheCatalogue) - if self.editor.code in ['Adao','MAP'] : - self.bAvant.close() - self.bApres.close() - else : - self.connect(self.bAvant,SIGNAL("clicked()"), self.afficheAvant) - self.connect(self.bApres,SIGNAL("clicked()"), self.afficheApres) + else : + try : + self.connect(self.bCatalogue,SIGNAL("clicked()"), self.afficheCatalogue) + self.connect(self.bAvant,SIGNAL("clicked()"), self.afficheAvant) + self.connect(self.bApres,SIGNAL("clicked()"), self.afficheApres) + except : + pass self.connect(self.LENom,SIGNAL("returnPressed()"),self.nomChange) + if self.editor.code in ['CARMELCND',] : self.closeAutreCommande() self.racine=self.node.tree.racine if self.node.item.GetIconName() == "ast-red-square" : self.LENom.setDisabled(True) @@ -115,6 +113,10 @@ class MonWidgetCommande(Ui_WidgetCommande,Groupe): self.editor.restoreSplitterSizes() #print "fin init de widget Commande" + def closeAutreCommande(self): + self.bCatalogue.close() + self.bAvant.close() + self.bApres.close() def donnePremier(self): #print "dans donnePremier" diff --git a/InterfaceQT4/monWidgetSimpSalome.py b/InterfaceQT4/monWidgetSimpSalome.py index 194ac111..f5299f9a 100644 --- a/InterfaceQT4/monWidgetSimpSalome.py +++ b/InterfaceQT4/monWidgetSimpSalome.py @@ -20,7 +20,10 @@ # Modules Python import string,types,os + # Modules Eficas +from determine import monEnvQT5 + if monEnvQT5: from PyQt5.QtWidgets import QLineEdit from PyQt5.QtCore import Qt diff --git a/InterfaceQT4/readercata.py b/InterfaceQT4/readercata.py index 9137cd3e..91f174dd 100644 --- a/InterfaceQT4/readercata.py +++ b/InterfaceQT4/readercata.py @@ -317,29 +317,24 @@ class READERCATA: self.dicoMC={} listeEtapes=self.cata[0].JdC.commandes for e in self.cata[0].JdC.commandes: - #for e in (self.cata[0].JdC.commandes[0],): - #print e.nom self.traite_entite(e) - #for e in self.cata[0].JdC.commandes: - # self.cree_rubrique(e,self.dico,0) - #print self.dicoInverse - - #from Extensions import localisation - #app=QApplication - # tres dommage A Revoir - #localisation.localise(app,"fr") - self.dicoInverseFrancais={} - self.dicoFrancaisAnglais={} - self.dicoAnglaisFrancais={} - for k in self.dicoInverse.keys(): - listefr=[] - for nom, obj in self.dicoInverse[k] : - listefr.append((tr(nom),obj)) - self.dicoFrancaisAnglais[tr(nom)]=nom - self.dicoAnglaisFrancais[nom]=tr(nom) - self.dicoInverseFrancais[tr(k)]=listefr - #print tr(k),listefr - if self.appliEficas.langue=="ang" : localisation.localise(app,"en") + + #self.dicoFrancaisAnglais={} + #self.dicoAnglaisFrancais={} + #for k in self.dicoInverse.keys(): + # listefr=[] + # for nom, obj in self.dicoInverse[k] : + # listefr.append((tr(nom),obj)) + # self.dicoFrancaisAnglais[tr(nom)]=nom + # self.dicoAnglaisFrancais[nom]=tr(nom) + # self.dicoInverseFrancais[tr(k)]=listefr + # #print tr(k),listefr + if self.appliEficas.langue=="ang" : + from dicoCasEnToCata import DicoCasEnToCata as dicoCasToCata + else : + from dicoCasFrToCata import DicoCasFrToCata as dicoCasToCata + self.dicoCasToCata=dicoCasToCata + @@ -360,6 +355,7 @@ class READERCATA: moi=moi.pere liste.append((moi.nom,moi)) self.dicoInverse[e.nom]=liste + self.dicoInverse[tr(e.nom)]=liste def cree_rubrique(self,e,dico, niveau): from Accas import A_BLOC diff --git a/InterfaceQT4/viewManager.py b/InterfaceQT4/viewManager.py index b75e31a3..186128e1 100644 --- a/InterfaceQT4/viewManager.py +++ b/InterfaceQT4/viewManager.py @@ -139,6 +139,13 @@ class MyTabview: editor=self.dict_editors[index] editor.handleRechercher() + def handleRechercherDsCatalogue(self): + #print "passage dans handleRechercher" + index=self.myQtab.currentIndex() + if index < 0 : return + editor=self.dict_editors[index] + editor.handleRechercherDsCatalogue() + def handleDeplier(self): index=self.myQtab.currentIndex() if index < 0 : return @@ -290,6 +297,7 @@ class MyTabview: else : from editor import JDCEditor editor = JDCEditor(self.appliEficas,fichier, jdc, self.myQtab,units=units,vm = self,include=include) + if double != None : self.doubles[editor]=double if editor.jdc: # le fichier est bien un jdc -- 2.39.2