From d10595d2950a6c1ffc0e2572fb8fab09a8737e99 Mon Sep 17 00:00:00 2001 From: "pascale.noyret" Date: Wed, 11 Apr 2018 09:42:11 +0200 Subject: [PATCH] differents bug d affichage + dumpXSD optionnel --- InterfaceQT4/configuration.py | 2 ++ InterfaceQT4/editorSsIhm.py | 20 +++++++++++-------- InterfaceQT4/monGroupeOptionnel.py | 12 ++--------- InterfaceQT4/monWidgetCommande.py | 2 +- .../monWidgetCommandeDeplie1Niveau.py | 3 +++ InterfaceQT4/monWidgetPlusieursBase.py | 14 ++++++------- InterfaceQT4/qtEficasSsIhm.py | 5 +++++ InterfaceQT4/readercata.py | 10 ++-------- 8 files changed, 34 insertions(+), 34 deletions(-) diff --git a/InterfaceQT4/configuration.py b/InterfaceQT4/configuration.py index ccf73063..fe3ad7f6 100644 --- a/InterfaceQT4/configuration.py +++ b/InterfaceQT4/configuration.py @@ -126,6 +126,8 @@ class configBase(object): self.repIcones=None self.differencieSiDefaut=False self.typeDeCata='Python' + self.dumpXSD=False + self.afficheIhm=True diff --git a/InterfaceQT4/editorSsIhm.py b/InterfaceQT4/editorSsIhm.py index ef19a6c2..bcda1c0c 100755 --- a/InterfaceQT4/editorSsIhm.py +++ b/InterfaceQT4/editorSsIhm.py @@ -89,7 +89,6 @@ class JDCEditorSsIhm : from InterfaceQT4 import readercata self.readercata = readercata.ReaderCata( self, self.appliEficas ) self.appliEficas.readercata=self.readercata - self.readercata.dumpToXml() self.appliEficas.code=self.code else : self.readercata=self.appliEficas.readercata @@ -98,6 +97,7 @@ class JDCEditorSsIhm : self.format = self.appliEficas.format_fichier + if self.appliEficas.maConfiguration.dumpXSD==True : self.appliEficas.dumpXsd() self.dict_reels={} self.liste_simp_reel=[] self.dicoNouveauxMC={} @@ -136,12 +136,12 @@ class JDCEditorSsIhm : self.nouveau=0 if self.fichier is not None: # fichier jdc fourni if jdc==None : - print ('PNPN : chgt try en if') - #try : - if 1 : + #print ('PNPN : chgt try en if') + try : + #if 1 : self.jdc = self.readFile(self.fichier) - #except : - # print ("mauvaise lecture") + except : + print ("mauvaise lecture") if self.salome : try : self.appliEficas.addJdcInSalome( self.fichier) @@ -200,7 +200,7 @@ class JDCEditorSsIhm : p.readfile(fn) if p.text=="" : self.nouveau=1 - print ('PNPN --> CIST a faire') + #print ('PNPN --> CIST a faire') pareil,texteNew=self.verifieChecksum(p.text) if not pareil : @@ -254,7 +254,7 @@ class JDCEditorSsIhm : #jdc=self.readercata.cata[0].JdC( procedure =texte, - print (self.readercata.cata) + #print (self.readercata.cata) jdc=self.readercata.cata.JdC( procedure =texte, appli=self, cata=self.readercata.cata, @@ -337,8 +337,11 @@ class JDCEditorSsIhm : #-----------------------# if 'dico' in generator.plugins: self.generator=generator.plugins['dico']() + #print (self.generator) jdc_formate=self.generator.gener(self.jdc) + #print (jdc_formate) dico=self.generator.Dico + #print (dico) return dico #-----------------------# @@ -485,6 +488,7 @@ class JDCEditorSsIhm : #---------------------# if 'dicoImbrique' in generator.plugins: self.generator=generator.plugins['dicoImbrique']() + #print (self.generator) jdc_formate=self.generator.gener(self.jdc) dico=self.generator.Dico return dico diff --git a/InterfaceQT4/monGroupeOptionnel.py b/InterfaceQT4/monGroupeOptionnel.py index 9d6eaa2e..2ebdbc0e 100644 --- a/InterfaceQT4/monGroupeOptionnel.py +++ b/InterfaceQT4/monGroupeOptionnel.py @@ -94,16 +94,8 @@ class MonPBButtonCustom(QWidget,Ui_customPB): QWidget.__init__(self) self.setupUi(self) if couleur != None : - print ( 'je change pour ', texte) self.monPb.setText(texte) - self.monPb.setStyleSheet( "background:rgb(229,62,30);\n" -"border-radius : 10px;\n" -"border-width : 30 px;\n" -"border-color : beige;\n" -"\n" -"") - - + self.monPb.setStyleSheet('QPushButton {background-color: #A3C1DA; color: red;}') #mapalette=self.monPb.palette() #mapalette.setColor( QPalette.ButtonText, Qt.red ) #self.monPb.setPalette( mapalette ) @@ -139,7 +131,7 @@ class MonGroupeOptionnel (QWidget,Ui_groupeOptionnel): """ """ def __init__(self,liste,liste_rouge,parentQt,parentMC): - #print "dans init de monWidgetOptionnel ", parentQt, liste,parentMC + #print ("dans init de monWidgetOptionnel ", parentQt, liste,parentMC) QWidget.__init__(self,None) self.setupUi(self) self.listeChecked=[] diff --git a/InterfaceQT4/monWidgetCommande.py b/InterfaceQT4/monWidgetCommande.py index b28021e4..25fbd3df 100644 --- a/InterfaceQT4/monWidgetCommande.py +++ b/InterfaceQT4/monWidgetCommande.py @@ -117,7 +117,7 @@ class MonWidgetCommande(Ui_WidgetCommande,Groupe): self.editor.inhibeSplitter=0 self.monOptionnel=self.editor.widgetOptionnel self.afficheOptionnel() - spacerItem = QSpacerItem(21, 20, QSizePolicy.Expanding, QSizePolicy.Expanding) + spacerItem = QSpacerItem(21, 500, QSizePolicy.Expanding, QSizePolicy.Expanding) #spacerItem = QSpacerItem(21, 20, QSizePolicy.Preferred, QSizePolicy.Preferred) #self.commandesLayout.addItem(spacerItem) self.verticalLayoutCommande.addItem(spacerItem) diff --git a/InterfaceQT4/monWidgetCommandeDeplie1Niveau.py b/InterfaceQT4/monWidgetCommandeDeplie1Niveau.py index 88a80fd1..9fa4cbd1 100644 --- a/InterfaceQT4/monWidgetCommandeDeplie1Niveau.py +++ b/InterfaceQT4/monWidgetCommandeDeplie1Niveau.py @@ -27,6 +27,7 @@ import traceback from PyQt5.QtGui import QIcon from InterfaceQT4.monWidgetCommande import MonWidgetCommande +from PyQt5.QtWidgets import QSpacerItem, QSizePolicy class MonWidgetCommandeDeplie1Niveau(MonWidgetCommande): # Attention au MCLIST qui ne sont pas des MCFACT @@ -37,6 +38,8 @@ class MonWidgetCommandeDeplie1Niveau(MonWidgetCommande): #print ("debut de ---------------------- init de MonWidgetCommandeDeplie1Niveau ",node.item.nom) MonWidgetCommande.__init__(self,node,editor,etape) self.node.plieToutEtReaffiche=self.plieToutEtReaffiche + spacerItem = QSpacerItem(21, 600, QSizePolicy.Expanding, QSizePolicy.Expanding) + self.verticalLayoutCommande.addItem(spacerItem) def afficheMots(self): # Attention diff --git a/InterfaceQT4/monWidgetPlusieursBase.py b/InterfaceQT4/monWidgetPlusieursBase.py index ff349a9b..0e794877 100644 --- a/InterfaceQT4/monWidgetPlusieursBase.py +++ b/InterfaceQT4/monWidgetPlusieursBase.py @@ -35,13 +35,13 @@ from PyQt5.QtCore import QTimer, QSize, Qt # Modules Eficas from Extensions.i18n import tr -from .feuille import Feuille -from desWidgetPlusieursBase import Ui_WidgetPlusieursBase -from .politiquesValidation import PolitiquePlusieurs -from .qtSaisie import SaisieValeur -from .gereListe import GereListe -from .gereListe import GerePlie -from .gereListe import LECustom +from InterfaceQT4.feuille import Feuille +from UiQT5.desWidgetPlusieursBase import Ui_WidgetPlusieursBase +from InterfaceQT4.politiquesValidation import PolitiquePlusieurs +from InterfaceQT4.qtSaisie import SaisieValeur +from InterfaceQT4.gereListe import GereListe +from InterfaceQT4.gereListe import GerePlie +from InterfaceQT4.gereListe import LECustom dicoLongueur={2:95,3:125,4:154,5:183,6:210,float('inf'):210} hauteurMax=253 diff --git a/InterfaceQT4/qtEficasSsIhm.py b/InterfaceQT4/qtEficasSsIhm.py index 4e5ec872..d068b5f8 100755 --- a/InterfaceQT4/qtEficasSsIhm.py +++ b/InterfaceQT4/qtEficasSsIhm.py @@ -153,6 +153,11 @@ class AppliSsIhm: ok = editor.saveFileAs() print ('ok ',ok) + def dumpXsd(self): + current_cata = CONTEXT.getCurrentCata() + current_cata.dumpXsd() + if self.maConfiguration.afficheIhm==False : exit() + #,self.fileSaveAs #,self.fileClose #,self.fileExit diff --git a/InterfaceQT4/readercata.py b/InterfaceQT4/readercata.py index a1cec75d..a3d54df9 100644 --- a/InterfaceQT4/readercata.py +++ b/InterfaceQT4/readercata.py @@ -230,7 +230,6 @@ class ReaderCata (ReaderCataCommun): if self.appliEficas.ssIhm == False : self.appliEficas.setWindowTitle(self.titre) self.appliEficas.titre=self.titre self.QWParent.titre=self.titre - #self.dumpXsd() def importCata(self,cata): @@ -341,16 +340,11 @@ class ReaderCata (ReaderCataCommun): #else : print (niveau+1)*" ", nom - def dumpToXml(self): + def dumpToXsdEficas(self): + # Pas sur qu on ait jamais besoin de cela pass #from Efi2Xsd import readerEfficas #newSchema= xml = open('Cata_MED_FAM.xml').read() #SchemaMed = efficas.CreateFromDocument(xml) #SchemaMed.alimenteCata(self.cata) - def dumpXsd(self): - from Efi2Xsd.dumpToXsd import dumpXsd - print ('dumpToXsd : ', self) - dumpXsd(self) - - -- 2.39.2