From 3b2aa4435996023b38c1c749799a956909684b7c Mon Sep 17 00:00:00 2001 From: "pascale.noyret" Date: Thu, 11 May 2017 11:00:54 +0200 Subject: [PATCH] gestion des liste et bugs --- InterfaceQT4/compofact.py | 4 ++++ InterfaceQT4/composimp.py | 6 ++++-- InterfaceQT4/editor.py | 4 ++-- InterfaceQT4/eficas_go.py | 2 +- InterfaceQT4/gereListe.py | 10 +++++++++- InterfaceQT4/gereRegles.py | 3 ++- InterfaceQT4/monWidgetCommande.py | 2 +- InterfaceQT4/monWidgetFact.py | 11 ++++++++++- InterfaceQT4/monWidgetPlusieursBase.py | 8 ++++++++ InterfaceQT4/monWidgetPlusieursIntoOrdonne.py | 5 +++-- InterfaceQT4/monWidgetPlusieursPlie.py | 18 ++++++++++++++++++ InterfaceQT4/monWidgetPlusieursTuple.py | 6 +++++- UiQT5/desWidgetVide.ui | 6 +++--- 13 files changed, 70 insertions(+), 15 deletions(-) diff --git a/InterfaceQT4/compofact.py b/InterfaceQT4/compofact.py index 6dfe3584..ce43add5 100644 --- a/InterfaceQT4/compofact.py +++ b/InterfaceQT4/compofact.py @@ -38,6 +38,10 @@ class Node(browser.JDCNode,typeNode.PopUpMenuNodePartiel): if hasattr(parentQt,'niveau'): self.niveau=parentQt.niveau+1 else : self.niveau=1 #if hasattr(self,'plie') :print self.item.nom, self.plie + #if maDefinition.sensLayout == 'horizontal': + # from .monWidgetFact import MonWidgetFactHorizontal + # widget=MonWidgetFactHorizontal(self,self.editor,parentQt,maDefinition,monObjet,self.niveau,maCommande) + #elif hasattr(self,'plie') and self.plie==True : if hasattr(self,'plie') and self.plie==True : from .monWidgetFactPlie import MonWidgetFactPlie widget=MonWidgetFactPlie(self,self.editor,parentQt,maDefinition,monObjet,self.niveau,maCommande) diff --git a/InterfaceQT4/composimp.py b/InterfaceQT4/composimp.py index 88a18a27..19b48c74 100644 --- a/InterfaceQT4/composimp.py +++ b/InterfaceQT4/composimp.py @@ -174,9 +174,12 @@ class Node(browser.JDCNode,typeNode.PopUpMenuNodeMinimal): if len(listeAAfficher) == 0: from .monWidgetVide import MonWidgetVide widget = MonWidgetVide(self,maDefinition,monNom,monObjet,parentQt,maCommande) - else : + elif self.item in self.editor.listeDesListesOuvertes or not(self.editor.afficheListesPliees) : from .monWidgetPlusieursASSDIntoOrdonne import MonWidgetPlusieursASSDIntoOrdonne widget=MonWidgetPlusieursASSDIntoOrdonne(self,maDefinition,monNom,monObjet,parentQt,maCommande) + else : + from .monWidgetPlusieursPlie import MonWidgetPlusieursPlieASSD + widget=MonWidgetPlusieursPlieASSD(self,maDefinition,monNom,monObjet,parentQt,maCommande) elif self.item.wait_tuple() : if self.item.object.definition.type[0].ntuple == 2: from .monWidgetPlusieursTuple2 import MonWidgetPlusieursTuple2 @@ -197,7 +200,6 @@ class Node(browser.JDCNode,typeNode.PopUpMenuNodeMinimal): from .monWidgetPlusieursPlie import MonWidgetPlusieursPlie widget=MonWidgetPlusieursPlie(self,maDefinition,monNom,monObjet,parentQt,maCommande) else : -# tres vite pour le tag mais devra etre gere dans configuration if self.item in self.editor.listeDesListesOuvertes or not(self.editor.afficheListesPliees) : from .monWidgetPlusieursIntoOrdonne import MonWidgetPlusieursIntoOrdonne widget=MonWidgetPlusieursIntoOrdonne(self,maDefinition,monNom,monObjet,parentQt,maCommande) diff --git a/InterfaceQT4/editor.py b/InterfaceQT4/editor.py index 74e86fab..0a9efa1a 100755 --- a/InterfaceQT4/editor.py +++ b/InterfaceQT4/editor.py @@ -972,13 +972,13 @@ class JDCEditor(Ui_baseWidget,QWidget): #------------# fonction="run"+self.code #print fonction - if fonction in JDCEditor.__dict__: JDCEditor.__dict__[fonction],(self,) + if fonction in JDCEditor.__dict__: JDCEditor.__dict__[fonction](self,) #------------# def saveRun(self): #------------# fonction="saveRun"+self.code - if fonction in JDCEditor.__dict__: JDCEditor.__dict__[fonction],(self,) + if fonction in JDCEditor.__dict__: JDCEditor.__dict__[fonction](self,) #---------------# def runMAP(self): diff --git a/InterfaceQT4/eficas_go.py b/InterfaceQT4/eficas_go.py index ee02d304..8ca631a5 100755 --- a/InterfaceQT4/eficas_go.py +++ b/InterfaceQT4/eficas_go.py @@ -49,7 +49,7 @@ def lance_eficas(code=None,fichier=None,ssCode=None,multi=False,langue='en'): if options.code!= None : code=options.code if options.ssCode!= None : ssCode=options.ssCode - from .qtEficas import Appli + from InterfaceQT4.qtEficas import Appli app = QApplication(sys.argv) Eficas=Appli(code=code,ssCode=ssCode,multi=multi,langue=langue) Eficas.show() diff --git a/InterfaceQT4/gereListe.py b/InterfaceQT4/gereListe.py index 6b568d25..f08adac3 100644 --- a/InterfaceQT4/gereListe.py +++ b/InterfaceQT4/gereListe.py @@ -48,9 +48,11 @@ class LECustom(QLineEdit): Constructor """ QLineEdit.__init__(self,parent) + self.parentQt=parentQt self.num=i self.dansUnTuple=False + self.numDsLaListe=-1 def focusInEvent(self,event): #print "dans focusInEvent de LECustom" @@ -61,11 +63,16 @@ class LECustom(QLineEdit): QLineEdit.focusInEvent(self,event) def focusOutEvent(self,event): - #print "dans focusOutEvent de LECustom" self.setStyleSheet("border: 0px") if self.dansUnTuple : self.setStyleSheet("background:rgb(235,235,235); border: 0px;") elif self.num % 2 == 1 : self.setStyleSheet("background:rgb(210,210,210)") else : self.setStyleSheet("background:rgb(235,235,235)") + + + if isinstance(self,LECustomTuple) and not self.tupleCustomParent.inFocusOutEvent: + self.tupleCustomParent.inFocusOutEvent=True + self.tupleCustomParent.valueChange() + self.tupleCustomParent.inFocusOutEvent=False QLineEdit.focusOutEvent(self,event) def clean(self): @@ -86,6 +93,7 @@ class LECustomTuple(LECustom): # index sera mis a jour par TupleCustom parentQt=parent.parent().parent().parent() LECustom. __init__(self,parent,parentQt,0) + #print (dir(self)) # ---------------------------- # class MonLabelListeClic(QLabel): diff --git a/InterfaceQT4/gereRegles.py b/InterfaceQT4/gereRegles.py index 0e303918..78a5893a 100644 --- a/InterfaceQT4/gereRegles.py +++ b/InterfaceQT4/gereRegles.py @@ -25,6 +25,7 @@ except : pass from PyQt5.QtCore import Qt from .monViewRegles import ViewRegles +from Extensions.i18n import tr class GereRegles(object) : @@ -60,7 +61,7 @@ class GereRegles(object) : else : self.liste.append((ligne,Qt.red)) self.liste.append(("",Qt.red)) - if self.liste==[] : self.liste(tr("pas de regle de construction pour ce jeu de commandes",Qt.black)) + if self.liste==[] : self.liste.append(("pas de regle de construction pour ce jeu de commandes",Qt.black)) def AfficheRegles(self): diff --git a/InterfaceQT4/monWidgetCommande.py b/InterfaceQT4/monWidgetCommande.py index becfee22..0543e61a 100644 --- a/InterfaceQT4/monWidgetCommande.py +++ b/InterfaceQT4/monWidgetCommande.py @@ -71,7 +71,7 @@ class MonWidgetCommande(Ui_WidgetCommande,Groupe): self.labelNomCommande.setText(tr(self.obj.nom)) - if self.editor.closeFrameRechercheCommande==True : self.closeAutreCommande() + if self.editor.closeAutreCommande==True : self.closeAutreCommande() else : try : self.bCatalogue.clicked.connect(self.afficheCatalogue) diff --git a/InterfaceQT4/monWidgetFact.py b/InterfaceQT4/monWidgetFact.py index 012afc11..ad2b42d8 100644 --- a/InterfaceQT4/monWidgetFact.py +++ b/InterfaceQT4/monWidgetFact.py @@ -26,10 +26,11 @@ from PyQt5.QtWidgets import QWidget from .groupe import Groupe from desWidgetFact import Ui_WidgetFact +from desWidgetFactHorizon import Ui_WidgetFactHorizon from Extensions.i18n import tr # Import des panels -class MonWidgetFact(Ui_WidgetFact,Groupe): +class MonWidgetFactCommun(Groupe): """ """ def __init__(self,node,editor,parentQt,definition, obj, niveau,commande): @@ -55,3 +56,11 @@ class MonWidgetFact(Ui_WidgetFact,Groupe): def delayAffiche(self): #print "delayAffiche, self.doitAfficherOptionnel = ", self.doitAfficherOptionnel if self.doitAfficherOptionnel and self.editor.code != "CARMELCND" :self.afficheOptionnel() + +class MonWidgetFact(Ui_WidgetFact,MonWidgetFactCommun): + def __init__(self,node,editor,parentQt,definition, obj, niveau,commande): + MonWidgetFactCommun.__init__(self,node,editor,parentQt, definition,obj,niveau,commande) + +class MonWidgetFactHorizontal(Ui_WidgetFactHorizon,MonWidgetFactCommun): + def __init__(self,node,editor,parentQt,definition, obj, niveau,commande): + MonWidgetFactCommun.__init__(self,node,editor,parentQt, definition,obj,niveau,commande) diff --git a/InterfaceQT4/monWidgetPlusieursBase.py b/InterfaceQT4/monWidgetPlusieursBase.py index edd81e45..a9fe5511 100644 --- a/InterfaceQT4/monWidgetPlusieursBase.py +++ b/InterfaceQT4/monWidgetPlusieursBase.py @@ -73,6 +73,14 @@ class MonWidgetPlusieursBase (Ui_WidgetPlusieursBase,Feuille,GereListe,GerePlie) icon3 = QIcon(fichier2) self.BSelectFichier.setIcon(icon3) self.BSelectFichier.setIconSize(QSize(32, 32)) + if self.editor.salome : + icon=QIcon(self.repIcon+"/MoinsBleu.png") + self.RBMoins.setIcon(icon) + icon=QIcon(self.repIcon+"/PlusBleu.png") + self.RBPlus.setIcon(icon) + icon=QIcon(self.repIcon+"/verre-loupe-icone-6087-64.png") + self.RBVoisListe.setIcon(icon) + self.listeValeursCourantes=self.node.item.GetListeValeurs() if self.monSimpDef.max != "**" and self.monSimpDef.max < 7: diff --git a/InterfaceQT4/monWidgetPlusieursIntoOrdonne.py b/InterfaceQT4/monWidgetPlusieursIntoOrdonne.py index d02ff471..c51ff7b8 100644 --- a/InterfaceQT4/monWidgetPlusieursIntoOrdonne.py +++ b/InterfaceQT4/monWidgetPlusieursIntoOrdonne.py @@ -54,7 +54,7 @@ class MonWidgetPlusieursIntoOrdonne (Ui_WidgetPlusieursIntoOrdonne, Feuille,Gere self.filtre="" Feuille.__init__(self,node,monSimpDef,nom,objSimp,parent,commande) GereListe.__init__(self) - self.finCommentaireListe() + #self.finCommentaireListe() self.gereIconePlier() self.listeValeursCourantes=self.node.item.GetListeValeurs() try : @@ -63,7 +63,8 @@ class MonWidgetPlusieursIntoOrdonne (Ui_WidgetPlusieursIntoOrdonne, Feuille,Gere # cas ou on ne peut rien ajouter pass self.prepareListeResultat() - if len(self.listeAAfficher) < 8 : self.frameRecherche2.close() + if len(self.listeAAfficher) < 20 : self.frameRecherche2.close() + if len(self.listeAAfficher) < 8 : self.frameRecherche.close() self.adjustSize() if sys.platform[0:5]!="linux": repIcon=self.node.editor.appliEficas.repIcon diff --git a/InterfaceQT4/monWidgetPlusieursPlie.py b/InterfaceQT4/monWidgetPlusieursPlie.py index 60f96104..5a515f58 100644 --- a/InterfaceQT4/monWidgetPlusieursPlie.py +++ b/InterfaceQT4/monWidgetPlusieursPlie.py @@ -102,3 +102,21 @@ class MonWidgetPlusieursPlie (Ui_WidgetPlusieursPlie,Feuille): self.editor.affiche_infos(str(listeValeur) + ' ' +comm,Qt.red) self.lineEditVal.setText('') +class MonWidgetPlusieursPlieASSD (MonWidgetPlusieursPlie): + + def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande): + MonWidgetPlusieursPlie.__init__(self,node,monSimpDef,nom,objSimp,parentQt,commande) + self.lineEditVal.setReadOnly(True) + + def setValeurs(self): + self.listeValeursCourantes=self.node.item.GetListeValeurs() + self.politique=PolitiquePlusieurs(self.node,self.editor) + if self.listeValeursCourantes == [] : self.lineEditVal.setText(""); return + txt="[" + for elt in self.listeValeursCourantes : + txt= txt+ (str(elt)) + "," + txt= txt + "]" + self.lineEditVal.setText(txt) + + def valeurEntree(self): + pass diff --git a/InterfaceQT4/monWidgetPlusieursTuple.py b/InterfaceQT4/monWidgetPlusieursTuple.py index 742d69f8..b4b9408d 100644 --- a/InterfaceQT4/monWidgetPlusieursTuple.py +++ b/InterfaceQT4/monWidgetPlusieursTuple.py @@ -53,6 +53,7 @@ class TupleCustom(object) : self.parentQt=parentQt self.valeur=None self.index=index + self.inFocusOutEvent=False for i in range(self.tailleTuple): @@ -61,6 +62,8 @@ class TupleCustom(object) : courant.num=index courant.dansUnTuple=True courant.returnPressed.connect(self.valueChange) + courant.numDsLaListe = i+1 + courant.tupleCustomParent=self def valueChange(self): @@ -70,8 +73,9 @@ class TupleCustom(object) : nomLE="lineEditVal_"+str(i+1) courant=getattr(self,nomLE) val=str(courant.text()) + if str(val)=="" or val==None : - courant.setFocus() + if not self.inFocusOutEvent : courant.setFocus() return try : valeur=eval(val,{}) diff --git a/UiQT5/desWidgetVide.ui b/UiQT5/desWidgetVide.ui index 03a815f7..8c0217bb 100644 --- a/UiQT5/desWidgetVide.ui +++ b/UiQT5/desWidgetVide.ui @@ -7,7 +7,7 @@ 0 0 1069 - 55 + 60 @@ -33,13 +33,13 @@ 0 - 2 + 8 0 - 0 + 8 -- 2.39.2