From: pascale.noyret Date: Mon, 10 Apr 2017 14:53:36 +0000 (+0200) Subject: commentaire X-Git-Tag: V8_3_0~56 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=9f4ff7ed9afd87c96e11d61e442e39e5511f60d1;p=tools%2Feficas.git commentaire --- diff --git a/Ihm/I_JDC.py b/Ihm/I_JDC.py index 67a14414..96f3808f 100644 --- a/Ihm/I_JDC.py +++ b/Ihm/I_JDC.py @@ -35,7 +35,7 @@ from Noyau.N_ASSD import ASSD #from Noyau.N_LASSD import LASSD from Noyau.N_ETAPE import ETAPE from Noyau.N_Exception import AsException -from Extensions import commentaire,parametre,parametre_eval +from Extensions import commentaire ,parametre ,parametre_eval from . import CONNECTOR import Validation @@ -213,11 +213,11 @@ class JDC(I_OBJECT.OBJECT): self.init_modif() self.editmode=1 if name == "COMMENTAIRE" : + from Extensions import commentaire # ajout d'un commentaire self.set_current_step() ind = 1 for child in self.etapes : - from Extensions import commentaire if isinstance(child,commentaire.COMMENTAIRE): ind = ind+1 objet = commentaire.COMMENTAIRE('',parent=self) diff --git a/InterfaceQT4/composimp.py b/InterfaceQT4/composimp.py index 3f3e5a6e..6a357912 100644 --- a/InterfaceQT4/composimp.py +++ b/InterfaceQT4/composimp.py @@ -72,14 +72,6 @@ class Node(browser.JDCNode,typeNode.PopUpMenuNodeMinimal): if type(maDefinition.into) ==types.FunctionType : monInto=maDefinition.into() else : monInto = maDefinition.into - # a faire ailleurs - #if maDefinition.intoExe != None : - # print (self.item) - # monInto = maDefinition.intoExe(self.item) - # maDefinition.into = monInto - # from Noyau.N_VALIDATOR import IntoProtocol - # monObjet.intoProto = IntoProtocol("into", into=maDefinition.into, val_min=maDefinition.val_min, val_max=maDefinition.val_max) - if maDefinition.max == 1 : @@ -136,7 +128,7 @@ class Node(browser.JDCNode,typeNode.PopUpMenuNodeMinimal): if len(self.item.get_sd_avant_du_bon_type()) == 0 : from .monWidgetVide import MonWidgetVide widget=MonWidgetVide(self,maDefinition,monNom,monObjet,parentQt,maCommande) - if len(self.item.get_sd_avant_du_bon_type()) < 4 : + elif len(self.item.get_sd_avant_du_bon_type()) < 4 : from .monWidgetRadioButton import MonWidgetRadioButtonSD widget=MonWidgetRadioButtonSD(self,maDefinition,monNom,monObjet,parentQt,maCommande) elif len(self.item.get_sd_avant_du_bon_type()) < 7 : @@ -167,11 +159,21 @@ class Node(browser.JDCNode,typeNode.PopUpMenuNodeMinimal): #widget=MonWidgetPlusieursTuple2(self,maDefinition,monNom,monObjet,parentQt,maCommande) # pass #else : - from .monWidgetPlusieursInto import MonWidgetPlusieursInto - widget=MonWidgetPlusieursInto(self,maDefinition,monNom,monObjet,parentQt,maCommande) + listeAAfficher = self.item.get_sd_avant_du_bon_type() + if len(listeAAfficher) == 0: + from .monWidgetVide import MonWidgetVide + widget = MonWidgetVide(self,maDefinition,monNom,monObjet,parentQt,maCommande) + else : + from .monWidgetPlusieursInto import MonWidgetPlusieursInto + widget=MonWidgetPlusieursInto(self,maDefinition,monNom,monObjet,parentQt,maCommande) elif self.item.wait_assd() : - from .monWidgetPlusieursASSDIntoOrdonne import MonWidgetPlusieursASSDIntoOrdonne - widget=MonWidgetPlusieursASSDIntoOrdonne(self,maDefinition,monNom,monObjet,parentQt,maCommande) + listeAAfficher = self.item.get_sd_avant_du_bon_type() + if len(listeAAfficher) == 0: + from .monWidgetVide import MonWidgetVide + widget = MonWidgetVide(self,maDefinition,monNom,monObjet,parentQt,maCommande) + else : + from .monWidgetPlusieursASSDIntoOrdonne import MonWidgetPlusieursASSDIntoOrdonne + widget=MonWidgetPlusieursASSDIntoOrdonne(self,maDefinition,monNom,monObjet,parentQt,maCommande) elif self.item.wait_tuple() : if self.item.object.definition.type[0].ntuple == 2: from .monWidgetPlusieursTuple2 import MonWidgetPlusieursTuple2 diff --git a/InterfaceQT4/editor.py b/InterfaceQT4/editor.py index 34f26de9..e1d6f68f 100755 --- a/InterfaceQT4/editor.py +++ b/InterfaceQT4/editor.py @@ -319,6 +319,18 @@ class JDCEditor(Ui_baseWidget,QWidget): #return self.get_Dico() + #--------------------------------# + def ajoutCommentaire(self): + #--------------------------------# + if self.tree.selectedItems()==[] : + QMessageBox.warning( self, tr("Pas de noeud selectionne"),tr("Selectionnez un Noeud \nLe commentaire sera place apres le noeud selectionne")) + return + noeudAvantCommentaire=self.tree.selectedItems()[0] + if noeudAvantCommentaire ==self.tree.racine : + self.tree.racine.append_child("COMMENTAIRE",pos=0) + return + noeudAvantCommentaire.addComment(True) + #--------------------------------# @@ -1231,7 +1243,6 @@ class JDCEditor(Ui_baseWidget,QWidget): the name of the saved file """ - print (self.generDico()) self.modified=1 if not self.modified and not saveas: return (0, None) # do nothing if text wasn't changed diff --git a/InterfaceQT4/monWidgetVide.py b/InterfaceQT4/monWidgetVide.py index 99f3d46a..39c3dd4a 100644 --- a/InterfaceQT4/monWidgetVide.py +++ b/InterfaceQT4/monWidgetVide.py @@ -26,14 +26,15 @@ from Extensions.i18n import tr from .feuille import Feuille from desWidgetVide import Ui_WidgetVide -from .politiquesValidation import PolitiqueUnique class MonWidgetVide (Ui_WidgetVide,Feuille): def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande): + Feuille.__init__(self,node,monSimpDef,nom,objSimp,parentQt,commande) - self.politique=PolitiqueUnique(self.node,self.editor) - + t=self.node.item.object.definition.type[0].__name__ + self.lineEditVal.setText('Attend un objet de type '+t+'. Il faut en créer') + self.parentQt.commandesLayout.insertWidget(-1,self) #PN il faut remplir le type diff --git a/InterfaceQT4/qtEficas.py b/InterfaceQT4/qtEficas.py index 8180a54c..ec5afe0a 100755 --- a/InterfaceQT4/qtEficas.py +++ b/InterfaceQT4/qtEficas.py @@ -557,6 +557,7 @@ class Appli(Ui_Eficas,QMainWindow): self.actionEficas.triggered.connect(self.aidePPal) self.actionVersion.triggered.connect(self.version) self.actionParametres.triggered.connect(self.gestionParam) + self.actionCommentaire.triggered.connect(self.ajoutCommentaire) self.actionCouper.triggered.connect(self.editCut) self.actionCopier.triggered.connect(self.editCopy) @@ -610,6 +611,9 @@ class Appli(Ui_Eficas,QMainWindow): def Deplier(self): self.viewmanager.handleDeplier() + def ajoutCommentaire(self): + self.viewmanager.ajoutCommentaire() + def ouvreFichiers(self) : # Ouverture des fichiers de commandes donnes sur la ligne de commande cwd=os.getcwd() diff --git a/InterfaceQT4/viewManager.py b/InterfaceQT4/viewManager.py index 3b83d341..e75c8a9b 100644 --- a/InterfaceQT4/viewManager.py +++ b/InterfaceQT4/viewManager.py @@ -199,6 +199,12 @@ class MyTabview(object): if index < 0 : return self.dict_editors[index].fermeArbre() + def ajoutCommentaire(self): + index=self.myQtab.currentIndex() + if index < 0 : return + editor=self.dict_editors[index] + editor.ajoutCommentaire() + def handleViewJdcRegles(self): index=self.myQtab.currentIndex() if index < 0 : return