From: Pascale Noyret Date: Wed, 22 Aug 2007 07:24:01 +0000 (+0000) Subject: PN X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=965bf28491d03ce5b4d782cd26969d689402148e;p=tools%2Feficas.git PN --- diff --git a/InterfaceQT/browser.py b/InterfaceQT/browser.py index 99e055bd..bb83b5b4 100644 --- a/InterfaceQT/browser.py +++ b/InterfaceQT/browser.py @@ -209,7 +209,7 @@ class JDCNode(QListViewItem): # On traite par une exception le cas ou l'utilisateur final cherche a désactiver # (commentariser) un commentaire. try : - pos=self.parent.children.index( self ) + pos=self.parent.children.index(self) commande_comment = self.item.get_objet_commentarise() # On signale au parent du panel (le JDCDisplay) une modification self.editor.init_modif() @@ -223,12 +223,13 @@ class JDCNode(QListViewItem): """ Realise la decommentarisation de self """ - try: - pos=self.parent.children.index(self.node) + try : + pos=self.parent.children.index(self) commande,nom = self.item.uncomment() + self.editor.init_modif() self.parent.children[pos].select() except Exception,e: - QMessageBox.critical( self.parent, "Erreur !",str(e)) + QMessageBox.critical( self.editor, "Erreur !",str(e)) return def addComment( self, after=True ): diff --git a/InterfaceQT/compobase.py b/InterfaceQT/compobase.py new file mode 100644 index 00000000..a287b7d2 --- /dev/null +++ b/InterfaceQT/compobase.py @@ -0,0 +1,3 @@ +from Editeur import Objecttreeitem +treeitem = Objecttreeitem.ObjectTreeItem +objet = None diff --git a/InterfaceQT/compocomm.py b/InterfaceQT/compocomm.py index 4a12cfeb..4ff1e58c 100644 --- a/InterfaceQT/compocomm.py +++ b/InterfaceQT/compocomm.py @@ -100,7 +100,7 @@ class COMMTreeItem(Objecttreeitem.ObjectTreeItem): surcharge la méthode get_objet_commentarise de la classe Objecttreeitem.ObjectTreeItem elle a pour but d'empecher l'utilisateur final de commentariser un commentaire. """ - raise Exception( 'Citoyen : tu peux "commentariser" une commande MAIS PAS UN COMMENTAIRE' ) + raise Exception( 'Impossible de commentariser un commentaire' ) import Extensions treeitem =COMMTreeItem diff --git a/InterfaceQT/compocommandecomm.py b/InterfaceQT/compocommandecomm.py new file mode 100644 index 00000000..bd17f0bf --- /dev/null +++ b/InterfaceQT/compocommandecomm.py @@ -0,0 +1,95 @@ +# -*- coding: utf-8 -*- +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== +import traceback +import string + +from Editeur import Objecttreeitem +from InterfaceQT import compocomm + +class COMMANDE_COMMTreeItem(Objecttreeitem.ObjectTreeItem): + itemNode=compocomm.Node + + def init(self): + self.setfunction = self.set_valeur + + def GetIconName(self): + """ + Retourne le nom de l'icône associée au noeud qui porte self, + dépendant de la validité de l'objet + NB : une commande commentarisée est toujours valide ... + """ + if self.isvalid(): + return "ast-green-percent" + else: + return "ast-red-percent" + + def GetLabelText(self): + """ Retourne 3 valeurs : + - le texte à afficher dans le noeud représentant l'item + - la fonte dans laquelle afficher ce texte + - la couleur du texte + """ + return 'commantaire' + + def get_valeur(self): + """ + Retourne la valeur de la commande commentarisée cad son texte + """ + return self.object.get_valeur() or '' + + def GetText(self): + texte = self.object.valeur + texte = string.split(texte,'\n')[0] + if len(texte) < 25 : + return texte + else : + return texte[0:24] + + def set_valeur(self,valeur): + """ + Afefcte valeur à l'objet commande commentarisée + """ + self.object.set_valeur(valeur) + + def GetSubList(self): + """ + Retourne la liste des fils de self + """ + return [] + + def uncomment(self): + """ + Demande à l'objet commande commentarisée de se décommentariser. + Si l'opération s'effectue correctement, retourne l'objet commande + et éventuellement le nom de la sd produite, sinon lève une exception + """ + try: + commande,nom = self.object.uncomment() + print "uuuuuuuuuuuuuuuu" + #self.parent.children[pos].select() + except Exception,e: + traceback.print_exc() + raise e + return commande,nom + +import Accas +treeitem =COMMANDE_COMMTreeItem +objet = Accas.COMMANDE_COMM diff --git a/InterfaceQT/compoerror.py b/InterfaceQT/compoerror.py new file mode 100644 index 00000000..2f1821dc --- /dev/null +++ b/InterfaceQT/compoerror.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== +# Modules Python +from Tkinter import Label,Button + +#Modules Eficas +from Noyau.N_OBJECT import ErrorObj +from Editeur import Objecttreeitem +from desError import DError + +class ERRORTreeItem(Objecttreeitem.AtomicObjectTreeItem): + + panel = DError + def GetIconName(self): + return "ast-red-ball" + + +treeitem =ERRORTreeItem +objet = ErrorObj + diff --git a/InterfaceQT/compomclist.py b/InterfaceQT/compomclist.py index 256f0f68..6a3102a0 100644 --- a/InterfaceQT/compomclist.py +++ b/InterfaceQT/compomclist.py @@ -27,7 +27,6 @@ class Node(browser.JDCNode): return MonMCFactPanel(self,parent=self.editor) else : print "MCList" - print "kkkkkkkkkkkkkkkkkkkkk" def doPaste(self,node_selected): objet_a_copier = self.item.get_copie_objet() diff --git a/InterfaceQT/compoparam.py b/InterfaceQT/compoparam.py index 989c79c9..d48b5e66 100644 --- a/InterfaceQT/compoparam.py +++ b/InterfaceQT/compoparam.py @@ -55,8 +55,7 @@ class PARAMTreeItem(Objecttreeitem.ObjectTreeItem): - la fonte dans laquelle afficher ce texte - la couleur du texte """ - return 'Paramêtre',None,None #CS_pbruno todo -## return 'Paramêtre',Fonte_PARAMETRE,None + return 'Parametre',None,None def GetText(self): """ diff --git a/InterfaceQT/editor.py b/InterfaceQT/editor.py index 8a903ed9..9d25046f 100644 --- a/InterfaceQT/editor.py +++ b/InterfaceQT/editor.py @@ -406,7 +406,6 @@ class JDCEditor(QSplitter): del self.panel self.panel = None - print jdcNode.__class__ if jdcNode.item.isactif(): self.panel = jdcNode.getPanel() else: diff --git a/Ui/desError.py b/Ui/desError.py new file mode 100644 index 00000000..816373ef --- /dev/null +++ b/Ui/desError.py @@ -0,0 +1,60 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file 'desError.ui' +# +# Created: lun aoû 20 10:39:18 2007 +# by: The PyQt User Interface Compiler (pyuic) 3.13 +# +# WARNING! All changes made in this file will be lost! + + +from qt import * + + +class DError(QWidget): + def __init__(self,parent = None,name = None,fl = 0): + QWidget.__init__(self,parent,name,fl) + + if not name: + self.setName("DError") + + self.setMinimumSize(QSize(350,0)) + + + self.bSup = QPushButton(self,"bSup") + self.bSup.setGeometry(QRect(170,430,142,30)) + self.bSup.setAutoDefault(1) + + self.textLabel1_3 = QLabel(self,"textLabel1_3") + self.textLabel1_3.setGeometry(QRect(60,110,330,110)) + + self.languageChange() + + self.resize(QSize(482,480).expandedTo(self.minimumSizeHint())) + self.clearWState(Qt.WState_Polished) + + self.connect(self.bSup,SIGNAL("clicked()"),self.BSupPressed) + + + def languageChange(self): + self.setCaption(self.__tr("DInactif")) + self.bSup.setText(self.__tr("&Supprimer")) + self.bSup.setAccel(self.__tr("Alt+S")) + QToolTip.add(self.bSup,self.__tr("suppression du mot clef")) + self.textLabel1_3.setText(self.__trUtf8("\x3c\x66\x6f\x6e\x74\x20\x73\x69\x7a\x65\x3d\x22\x2b\x34\x22\x3e\x3c\x70\x20\x61\x6c\x69\x67\x6e\x3d\x22\x63\x65\x6e\x74\x65\x72\x22\x3e\x4c\x65\x20\x6e\x6f\x65\x75\x64\x20\x73\xc3\xa9\x6c\x65\x63\x74\x69\x6f\x6e\x6e\xc3\xa9\x20\x6e\x65\x20\x63\x6f\x72\x72\x65\x73\x70\x6f\x6e\x64\x20\x70\x61\x73\x20\xc3\xa0\x20\x75\x6e\x20\x6f\x62\x6a\x65\x74\x20\x61\x63\x74\x69\x66\x2e\x3c\x2f\x70\x3e\x3c\x2f\x66\x6f\x6e\x74\x3e")) + + + def BSupPressed(self): + print "DError.BSupPressed(): Not implemented yet" + + def ViewDoc(self): + print "DError.ViewDoc(): Not implemented yet" + + def BOkPressed(self): + print "DError.BOkPressed(): Not implemented yet" + + def __tr(self,s,c = None): + return qApp.translate("DError",s,c) + + def __trUtf8(self,s,c = None): + return qApp.translate("DError",s,c,QApplication.UnicodeUTF8) diff --git a/Ui/desError.ui b/Ui/desError.ui new file mode 100644 index 00000000..370e1760 --- /dev/null +++ b/Ui/desError.ui @@ -0,0 +1,80 @@ + +DError + + + DError + + + + 0 + 0 + 482 + 480 + + + + + 350 + 0 + + + + DInactif + + + + bSup + + + + 170 + 430 + 142 + 30 + + + + &Supprimer + + + Alt+S + + + true + + + suppression du mot clef + + + + + textLabel1_3 + + + + 60 + 110 + 330 + 110 + + + + <font size="+4"><p align="center">Le noeud sélectionné ne correspond pas à un objet actif.</p></font> + + + + + + bSup + clicked() + DError + BSupPressed() + + + + BSupPressed() + ViewDoc() + BOkPressed() + + + diff --git a/Ui/desParam.py b/Ui/desParam.py new file mode 100644 index 00000000..185c7df1 --- /dev/null +++ b/Ui/desParam.py @@ -0,0 +1,106 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file 'desParam.ui' +# +# Created: mar aoû 21 15:48:22 2007 +# by: The PyQt User Interface Compiler (pyuic) 3.13 +# +# WARNING! All changes made in this file will be lost! + + +from qt import * + + +class DParam(QWidget): + def __init__(self,parent = None,name = None,fl = 0): + QWidget.__init__(self,parent,name,fl) + + if not name: + self.setName("DParam") + + self.setMinimumSize(QSize(350,0)) + + + self.tabuniqueinto = QTabWidget(self,"tabuniqueinto") + self.tabuniqueinto.setGeometry(QRect(10,20,460,440)) + + self.Widget8 = QWidget(self.tabuniqueinto,"Widget8") + + self.bSup = QPushButton(self.Widget8,"bSup") + self.bSup.setGeometry(QRect(310,370,142,30)) + self.bSup.setAutoDefault(1) + + self.bOk = QPushButton(self.Widget8,"bOk") + self.bOk.setGeometry(QRect(160,370,142,30)) + self.bOk.setAutoDefault(1) + self.bOk.setDefault(1) + + self.bHelp = QPushButton(self.Widget8,"bHelp") + self.bHelp.setGeometry(QRect(10,370,142,30)) + self.bHelp.setAutoDefault(1) + + self.textLabel2 = QLabel(self.Widget8,"textLabel2") + self.textLabel2.setGeometry(QRect(40,160,50,21)) + + self.lineEditVal = QLineEdit(self.Widget8,"lineEditVal") + self.lineEditVal.setGeometry(QRect(120,150,231,31)) + + self.lineEditNom = QLineEdit(self.Widget8,"lineEditNom") + self.lineEditNom.setGeometry(QRect(118,86,231,31)) + + self.textLabel2_2 = QLabel(self.Widget8,"textLabel2_2") + self.textLabel2_2.setGeometry(QRect(40,90,50,21)) + + self.textLabel2_2_2 = QLabel(self.Widget8,"textLabel2_2_2") + self.textLabel2_2_2.setGeometry(QRect(180,20,90,21)) + + self.Commentaire = QLabel(self.Widget8,"Commentaire") + self.Commentaire.setGeometry(QRect(30,230,400,100)) + self.tabuniqueinto.insertTab(self.Widget8,QString("")) + + self.languageChange() + + self.resize(QSize(482,480).expandedTo(self.minimumSizeHint())) + self.clearWState(Qt.WState_Polished) + + self.connect(self.bHelp,SIGNAL("clicked()"),self.ViewDoc) + self.connect(self.bOk,SIGNAL("clicked()"),self.BOk2Pressed) + self.connect(self.bSup,SIGNAL("clicked()"),self.BSupPressed) + self.connect(self.lineEditVal,SIGNAL("returnPressed()"),self.LEValeurPressed) + + + def languageChange(self): + self.setCaption(self.__tr("DUnIn")) + self.bSup.setText(self.__tr("&Supprimer")) + self.bSup.setAccel(self.__tr("Alt+S")) + QToolTip.add(self.bSup,self.__tr("suppression du mot clef")) + self.bOk.setText(self.__tr("&Valider")) + self.bOk.setAccel(self.__tr("Shift+A, Alt+A, Alt+A, Alt+A")) + QToolTip.add(self.bOk,self.__tr("validation de la saisie")) + self.bHelp.setText(self.__tr("&Documentation")) + self.bHelp.setAccel(self.__tr("Alt+D")) + QToolTip.add(self.bHelp,self.__tr("affichage documentation aster")) + self.textLabel2.setText(self.__tr("

Valeur:

")) + self.textLabel2_2.setText(self.__tr("

Nom:

")) + self.textLabel2_2_2.setText(self.__tr("

Parametre

")) + self.Commentaire.setText(self.__trUtf8("\x52\x65\x74\x6f\x75\x72\x20\x43\x68\x61\x72\x69\x6f\x74\x20\x64\x61\x6e\x73\x20\x75\x6e\x65\x20\x73\x6f\x6e\x65\x20\x64\x65\x20\x73\x61\x69\x73\x69\x65\x20\x70\x65\x72\x6d\x65\x74\x20\x64\x65\x20\x76\xc3\xa9\x72\x69\x66\x69\x65\x72\x20\x6c\x61\x20\x76\x61\x6c\x69\x64\x69\x74\xc3\xa9\x20\x64\x65\x20\x6c\x61\x20\x76\x61\x6c\x65\x75\x72\x20\x73\x61\x69\x73\x69\x65\x2e\x0a\x0a\x4c\x65\x73\x20\x6e\x6f\x75\x76\x65\x6c\x6c\x65\x73\x20\x76\x61\x6c\x65\x75\x72\x73\x20\x73\x6f\x6e\x74\x20\x70\x72\x69\x73\x65\x73\x20\x65\x66\x66\x65\x63\x74\x69\x76\x65\x6d\x65\x6e\x74\x20\x65\x6e\x20\x63\x6f\x6d\x70\x74\x65\x20\x61\x70\x72\xc3\xa8\x73\x20\x61\x76\x6f\x69\x72\x20\x61\x70\x70\x75\x79\xc3\xa9\x20\x73\x75\x72\x0a\x20\x6c\x65\x20\x62\x6f\x75\x74\x6f\x6e\x20\x56\x61\x6c\x69\x64\x65\x72\x2e")) + self.tabuniqueinto.changeTab(self.Widget8,self.__tr("Valeur Parametre")) + + + def BSupPressed(self): + print "DParam.BSupPressed(): Not implemented yet" + + def ViewDoc(self): + print "DParam.ViewDoc(): Not implemented yet" + + def BOk2Pressed(self): + print "DParam.BOk2Pressed(): Not implemented yet" + + def LEValeurPressed(self): + print "DParam.LEValeurPressed(): Not implemented yet" + + def __tr(self,s,c = None): + return qApp.translate("DParam",s,c) + + def __trUtf8(self,s,c = None): + return qApp.translate("DParam",s,c,QApplication.UnicodeUTF8) diff --git a/Ui/desUniqueSDCO.ui b/Ui/desUniqueSDCO.ui new file mode 100644 index 00000000..86960b79 --- /dev/null +++ b/Ui/desUniqueSDCO.ui @@ -0,0 +1,229 @@ + +DUnSDCO + + + DUnSDCO + + + + 0 + 0 + 482 + 480 + + + + + 350 + 0 + + + + DUnIn + + + + tabuniqueinto + + + + 10 + 20 + 460 + 440 + + + + + Widget8 + + + Saisir Valeur + + + + bSup + + + + 310 + 370 + 142 + 30 + + + + &Supprimer + + + Alt+S + + + true + + + suppression du mot clef + + + + + bOk + + + + 160 + 370 + 142 + 30 + + + + &Valider + + + Shift+A, Alt+A, Alt+A, Alt+A + + + true + + + true + + + validation de la saisie + + + + + bHelp + + + + 10 + 370 + 142 + 30 + + + + &Documentation + + + Alt+D + + + true + + + affichage documentation aster + + + + + Commentaire + + + + 40 + 311 + 381 + 30 + + + + + + + + + textLabel1_2 + + + + 20 + 150 + 170 + 31 + + + + <font size="+2">Nouveau concept</font> + + + + + textLabel1 + + + + 20 + 40 + 180 + 31 + + + + <font size="+2">Nom du nouveau concept</font> + + + + + + OUI + + + + comboBox1 + + + + 210 + 150 + 110 + 31 + + + + + + LENomConcept + + + + 210 + 40 + 230 + 31 + + + + + + + + + bHelp + clicked() + DUnSDCO + ViewDoc() + + + bOk + clicked() + DUnSDCO + BOkPressed() + + + bSup + clicked() + DUnSDCO + BSupPressed() + + + + BSupPressed() + ViewDoc() + BOkPressed() + + +