From: Pascale Noyret Date: Fri, 11 May 2007 14:35:30 +0000 (+0000) Subject: PN X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=5264973cab405371aa552f63c64cc79640cd3ef2;p=tools%2Feficas.git PN --- diff --git a/Interface/compomclist.py b/Interface/compomclist.py index 79773c3f..8d3e05a2 100644 --- a/Interface/compomclist.py +++ b/Interface/compomclist.py @@ -24,7 +24,6 @@ class Node(browser.JDCNode): else : print "MCList" elif self.item.isMCFact() : - print "d" from monMCFactPanel import MonMCFactPanel return MonMCFactPanel(self,parent=self.editor) else : diff --git a/Interface/desCommande.py b/Interface/desCommande.py deleted file mode 100644 index 76a87727..00000000 --- a/Interface/desCommande.py +++ /dev/null @@ -1,220 +0,0 @@ -# -*- coding: utf-8 -*- - -# Form implementation generated from reading ui file 'desCommande.ui' -# -# Created: jeu mar 15 14:45:27 2007 -# by: The PyQt User Interface Compiler (pyuic) 3.13 -# -# WARNING! All changes made in this file will be lost! - - -from qt import * - -image0_data = \ - "\x89\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d" \ - "\x49\x48\x44\x52\x00\x00\x00\x21\x00\x00\x00\x0e" \ - "\x08\x06\x00\x00\x00\xa1\x1e\x75\x8c\x00\x00\x00" \ - "\xcf\x49\x44\x41\x54\x38\x8d\xd5\x94\xdb\x0e\xc3" \ - "\x20\x0c\x43\xed\xfd\xf8\xd8\x97\xbb\x0f\x34\x5b" \ - "\x48\x08\x45\xd5\x1e\xb6\x48\x88\xf4\x12\xe7\x60" \ - "\x01\xc0\x0f\x04\x6f\xd6\xe9\x9b\xba\x77\x20\x04" \ - "\x80\x92\x4a\x10\x32\xc9\x2e\xfb\xd8\xc7\xd5\xca" \ - "\xbc\xc0\x25\x40\x00\x99\xe9\x57\x84\x95\x68\xfe" \ - "\x7f\x06\xc0\xde\xd1\xde\xb3\x2b\x4a\x1e\xc4\xea" \ - "\x82\x4b\x9e\x74\x09\x71\x65\xbd\x01\xf8\x55\x27" \ - "\xf7\x8a\x72\x01\xe0\xa3\x12\x9f\x34\x5a\x01\x7c" \ - "\x54\x3b\xaf\xdc\x98\x3d\x0f\x71\x09\xd1\x5a\x33" \ - "\x1b\x47\x1f\x47\x07\x2c\x17\x49\x4a\x82\x33\x8f" \ - "\x61\x78\x20\x3a\x88\x17\xe6\x73\x06\xb1\xf0\x8b" \ - "\x07\xba\x03\xe6\x02\xc9\xb8\x31\x07\x7e\x37\xe0" \ - "\x20\x9e\x67\xe3\x38\x67\x10\x97\x7b\x17\xde\x80" \ - "\xc1\x85\xad\x38\x69\x5a\x51\xd5\x22\xc8\x2c\xe7" \ - "\x79\x12\xe2\xfe\xd8\xbe\x83\x76\x20\x92\xf5\x2b" \ - "\x18\x20\xdd\x11\xbb\x10\xe5\x65\xb5\x3a\x5a\x3b" \ - "\xba\xff\x13\x07\x13\xd6\x6f\xa6\x98\x18\x57\x06" \ - "\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82" - -class DComm(QWidget): - def __init__(self,parent = None,name = None,fl = 0): - QWidget.__init__(self,parent,name,fl) - - self.image0 = QPixmap() - self.image0.loadFromData(image0_data,"PNG") - if not name: - self.setName("DComm") - - self.setMinimumSize(QSize(505,0)) - - - self.Commentaire = QLabel(self,"Commentaire") - self.Commentaire.setGeometry(QRect(10,410,490,20)) - self.Commentaire.setFrameShape(QLabel.NoFrame) - self.Commentaire.setFrameShadow(QLabel.Plain) - - self.bSup = QPushButton(self,"bSup") - self.bSup.setGeometry(QRect(320,440,142,30)) - self.bSup.setAutoDefault(1) - - self.bOk = QPushButton(self,"bOk") - self.bOk.setGeometry(QRect(170,440,142,30)) - self.bOk.setAutoDefault(1) - self.bOk.setDefault(1) - - self.bHelp = QPushButton(self,"bHelp") - self.bHelp.setGeometry(QRect(10,440,142,30)) - self.bHelp.setAutoDefault(1) - - self.TWChoix = QTabWidget(self,"TWChoix") - self.TWChoix.setGeometry(QRect(0,0,500,400)) - - self.MotClef = QWidget(self.TWChoix,"MotClef") - - self.textLabel1 = QLabel(self.MotClef,"textLabel1") - self.textLabel1.setGeometry(QRect(50,10,120,20)) - self.textLabel1.setMinimumSize(QSize(0,0)) - - self.textLabel1_2 = QLabel(self.MotClef,"textLabel1_2") - self.textLabel1_2.setGeometry(QRect(360,0,50,37)) - - self.LBMCPermis = QListBox(self.MotClef,"LBMCPermis") - self.LBMCPermis.setGeometry(QRect(10,40,220,290)) - self.LBMCPermis.setMinimumSize(QSize(0,0)) - - self.LBRegles = QListBox(self.MotClef,"LBRegles") - self.LBRegles.setGeometry(QRect(260,40,230,290)) - self.TWChoix.insertTab(self.MotClef,QString("")) - - self.Concept = QWidget(self.TWChoix,"Concept") - - self.groupBox1 = QGroupBox(self.Concept,"groupBox1") - self.groupBox1.setGeometry(QRect(0,10,520,380)) - - self.textLabel1_3 = QLabel(self.groupBox1,"textLabel1_3") - self.textLabel1_3.setGeometry(QRect(80,50,82,31)) - - self.textLabel1_3_2 = QLabel(self.groupBox1,"textLabel1_3_2") - self.textLabel1_3_2.setGeometry(QRect(80,170,82,31)) - - self.textLabel3 = QLabel(self.groupBox1,"textLabel3") - self.textLabel3.setGeometry(QRect(80,200,230,31)) - - self.LENomConcept = QLineEdit(self.groupBox1,"LENomConcept") - self.LENomConcept.setGeometry(QRect(80,110,310,30)) - - self.typeConcept = QLabel(self.groupBox1,"typeConcept") - self.typeConcept.setGeometry(QRect(320,200,100,31)) - self.TWChoix.insertTab(self.Concept,QString("")) - - self.Commande = QWidget(self.TWChoix,"Commande") - - self.textLabel6 = QLabel(self.Commande,"textLabel6") - self.textLabel6.setGeometry(QRect(10,60,60,30)) - - self.textLabel4 = QLabel(self.Commande,"textLabel4") - self.textLabel4.setGeometry(QRect(90,340,300,30)) - - self.LBNouvCommande = QListBox(self.Commande,"LBNouvCommande") - self.LBNouvCommande.setGeometry(QRect(50,100,410,240)) - - self.buttonGroup1 = QButtonGroup(self.Commande,"buttonGroup1") - self.buttonGroup1.setGeometry(QRect(298,17,151,70)) - - self.RBGroupe = QRadioButton(self.buttonGroup1,"RBGroupe") - self.RBGroupe.setGeometry(QRect(20,40,101,20)) - - self.RBalpha = QRadioButton(self.buttonGroup1,"RBalpha") - self.RBalpha.setGeometry(QRect(20,20,101,20)) - self.RBalpha.setChecked(1) - - self.LEFiltre = QLineEdit(self.Commande,"LEFiltre") - self.LEFiltre.setGeometry(QRect(50,60,160,30)) - - self.BNext = QToolButton(self.Commande,"BNext") - self.BNext.setGeometry(QRect(220,60,30,31)) - self.BNext.setIconSet(QIconSet(self.image0)) - - self.textLabel1_4 = QLabel(self.Commande,"textLabel1_4") - self.textLabel1_4.setGeometry(QRect(50,20,171,21)) - self.TWChoix.insertTab(self.Commande,QString("")) - - self.languageChange() - - self.resize(QSize(505,483).expandedTo(self.minimumSizeHint())) - self.clearWState(Qt.WState_Polished) - - self.connect(self.LBNouvCommande,SIGNAL("clicked(QListBoxItem*)"),self.LBNouvCommandeClicked) - self.connect(self.LEFiltre,SIGNAL("textChanged(const QString&)"),self.LEFiltreTextChanged) - self.connect(self.LEFiltre,SIGNAL("returnPressed()"),self.LEfiltreReturnPressed) - self.connect(self.bSup,SIGNAL("pressed()"),self.BSupPressed) - self.connect(self.bOk,SIGNAL("clicked()"),self.BOkPressed) - self.connect(self.LENomConcept,SIGNAL("returnPressed()"),self.LENomConceptReturnPressed) - self.connect(self.RBGroupe,SIGNAL("clicked()"),self.buildTabCommand) - self.connect(self.RBalpha,SIGNAL("clicked()"),self.buildTabCommand) - self.connect(self.bHelp,SIGNAL("clicked()"),self.BHelpPressed) - self.connect(self.BNext,SIGNAL("pressed()"),self.BNextPressed) - - - def languageChange(self): - self.setCaption(self.__tr("DComm")) - self.Commentaire.setText(QString.null) - 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.textLabel1.setText(self.__tr("

Mots Clefs Permis

")) - self.textLabel1_2.setText(self.__trUtf8("\x3c\x68\x33\x3e\x3c\x70\x20\x61\x6c\x69\x67\x6e\x3d\x22\x63\x65\x6e\x74\x65\x72\x22\x3e\x3c\x75\x3e\x3c\x62\x3e\x52\xc3\xa9\x67\x6c\x65\x73\x3c\x2f\x62\x3e\x3c\x2f\x75\x3e\x3c\x2f\x70\x3e\x3c\x2f\x68\x33\x3e")) - self.TWChoix.changeTab(self.MotClef,self.__tr("Ajouter Mot-Clef")) - self.groupBox1.setTitle(self.__tr("Concept")) - self.textLabel1_3.setText(self.__tr("Nom du concept :")) - self.textLabel1_3_2.setText(self.__tr("Type du concept :")) - self.textLabel3.setText(self.__trUtf8("\x4c\x27\x6f\x70\xc3\xa9\x72\x61\x74\x65\x75\x72\x20\x63\x6f\x75\x72\x61\x6e\x74\x20\x72\x65\x74\x6f\x75\x72\x6e\x65\x20\x75\x6e\x20\x63\x6f\x6e\x63\x65\x70\x74\x20\x64\x65\x20\x74\x79\x70\x65\x20\x3a")) - self.typeConcept.setText(self.__tr("TypeDuConcept")) - self.TWChoix.changeTab(self.Concept,self.__tr("Nommer Concept")) - self.textLabel6.setText(self.__tr("Filtre")) - self.textLabel4.setText(self.__trUtf8("\x4c\x61\x20\x63\x6f\x6d\x6d\x61\x6e\x64\x65\x20\x63\x68\x6f\x69\x73\x69\x65\x20\x73\x65\x72\x61\x20\x61\x6a\x6f\x75\x74\xc3\xa9\x65\x20\x41\x50\x52\x45\x53\x20\x6c\x61\x20\x63\x6f\x6d\x6d\x61\x6e\x64\x65\x20\x63\x6f\x75\x72\x61\x6e\x74\x65")) - self.buttonGroup1.setTitle(self.__tr("Affichage")) - self.RBGroupe.setText(self.__tr("par groupe")) - self.RBalpha.setText(self.__trUtf8("\x61\x6c\x70\x68\x61\x62\xc3\xa9\x74\x69\x71\x75\x65")) - self.BNext.setText(QString.null) - QToolTip.add(self.BNext,self.__tr("affiche la prochaine occurence")) - self.textLabel1_4.setText(self.__tr("Commandes :")) - self.TWChoix.changeTab(self.Commande,self.__tr("Nouvelle Commande")) - - - def LBNouvCommandeClicked(self): - print "DComm.LBNouvCommandeClicked(): Not implemented yet" - - def LEFiltreTextChanged(self): - print "DComm.LEFiltreTextChanged(): Not implemented yet" - - def LEfiltreReturnPressed(self): - print "DComm.LEfiltreReturnPressed(): Not implemented yet" - - def BSupPressed(self): - print "DComm.BSupPressed(): Not implemented yet" - - def LENomConceptReturnPressed(self): - print "DComm.LENomConceptReturnPressed(): Not implemented yet" - - def BOkPressed(self): - print "DComm.BOkPressed(): Not implemented yet" - - def buildTabCommand(self): - print "DComm.buildTabCommand(): Not implemented yet" - - def BHelpPressed(self): - print "DComm.BHelpPressed(): Not implemented yet" - - def BNextPressed(self): - print "DComm.BNextPressed(): Not implemented yet" - - def __tr(self,s,c = None): - return qApp.translate("DComm",s,c) - - def __trUtf8(self,s,c = None): - return qApp.translate("DComm",s,c,QApplication.UnicodeUTF8) diff --git a/Interface/desInactif.py b/Interface/desInactif.py deleted file mode 100644 index 72b72ff5..00000000 --- a/Interface/desInactif.py +++ /dev/null @@ -1,76 +0,0 @@ -# -*- coding: utf-8 -*- - -# Form implementation generated from reading ui file 'desInactif.ui' -# -# Created: lun mar 5 14:01:29 2007 -# by: The PyQt User Interface Compiler (pyuic) 3.13 -# -# WARNING! All changes made in this file will be lost! - - -from qt import * - - -class DInactif(QWidget): - def __init__(self,parent = None,name = None,fl = 0): - QWidget.__init__(self,parent,name,fl) - - if not name: - self.setName("DInactif") - - self.setMinimumSize(QSize(350,0)) - - - self.textLabel1_4 = QLabel(self,"textLabel1_4") - self.textLabel1_4.setGeometry(QRect(30,240,420,20)) - - self.textLabel1 = QLabel(self,"textLabel1") - self.textLabel1.setGeometry(QRect(30,220,420,20)) - - self.textLabel1_4_2 = QLabel(self,"textLabel1_4_2") - self.textLabel1_4_2.setGeometry(QRect(30,260,420,20)) - - 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(20,130,420,20)) - - 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(QString.null) - self.textLabel1_4.setText(self.__tr("

\n" -" DEBUT / POURSUITE et FIN\n" -"

")) - self.textLabel1.setText(self.__trUtf8("\x3c\x66\x6f\x6e\x74\x20\x73\x69\x7a\x65\x3d\x22\x2b\x32\x22\x3e\x3c\x70\x20\x61\x6c\x69\x67\x6e\x3d\x22\x63\x65\x6e\x74\x65\x72\x22\x3e\x0a\x53\x65\x75\x6c\x65\x73\x20\x6c\x65\x73\x20\x63\x6f\x6d\x6d\x61\x6e\x64\x65\x73\x20\x70\x6c\x61\x63\xc3\xa9\x65\x73\x20\x65\x6e\x74\x72\x65\x20\x3a\x0a\x3c\x2f\x70\x3e\x3c\x2f\x66\x6f\x6e\x74\x3e")) - self.textLabel1_4_2.setText(self.__tr("

\n" -"sont actives\n" -"

")) - 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\x32\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 "DInactif.BSupPressed(): Not implemented yet" - - def ViewDoc(self): - print "DInactif.ViewDoc(): Not implemented yet" - - def BOkPressed(self): - print "DInactif.BOkPressed(): Not implemented yet" - - def __tr(self,s,c = None): - return qApp.translate("DInactif",s,c) - - def __trUtf8(self,s,c = None): - return qApp.translate("DInactif",s,c,QApplication.UnicodeUTF8) diff --git a/Interface/desMacro.py b/Interface/desMacro.py deleted file mode 100644 index 56bb96f0..00000000 --- a/Interface/desMacro.py +++ /dev/null @@ -1,183 +0,0 @@ -# -*- coding: utf-8 -*- - -# Form implementation generated from reading ui file 'desMacro.ui' -# -# Created: lun mar 12 09:37:12 2007 -# by: The PyQt User Interface Compiler (pyuic) 3.13 -# -# WARNING! All changes made in this file will be lost! - - -from qt import * - -image0_data = \ - "\x89\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d" \ - "\x49\x48\x44\x52\x00\x00\x00\x21\x00\x00\x00\x0e" \ - "\x08\x06\x00\x00\x00\xa1\x1e\x75\x8c\x00\x00\x00" \ - "\xcf\x49\x44\x41\x54\x38\x8d\xd5\x94\xdb\x0e\xc3" \ - "\x20\x0c\x43\xed\xfd\xf8\xd8\x97\xbb\x0f\x34\x5b" \ - "\x48\x08\x45\xd5\x1e\xb6\x48\x88\xf4\x12\xe7\x60" \ - "\x01\xc0\x0f\x04\x6f\xd6\xe9\x9b\xba\x77\x20\x04" \ - "\x80\x92\x4a\x10\x32\xc9\x2e\xfb\xd8\xc7\xd5\xca" \ - "\xbc\xc0\x25\x40\x00\x99\xe9\x57\x84\x95\x68\xfe" \ - "\x7f\x06\xc0\xde\xd1\xde\xb3\x2b\x4a\x1e\xc4\xea" \ - "\x82\x4b\x9e\x74\x09\x71\x65\xbd\x01\xf8\x55\x27" \ - "\xf7\x8a\x72\x01\xe0\xa3\x12\x9f\x34\x5a\x01\x7c" \ - "\x54\x3b\xaf\xdc\x98\x3d\x0f\x71\x09\xd1\x5a\x33" \ - "\x1b\x47\x1f\x47\x07\x2c\x17\x49\x4a\x82\x33\x8f" \ - "\x61\x78\x20\x3a\x88\x17\xe6\x73\x06\xb1\xf0\x8b" \ - "\x07\xba\x03\xe6\x02\xc9\xb8\x31\x07\x7e\x37\xe0" \ - "\x20\x9e\x67\xe3\x38\x67\x10\x97\x7b\x17\xde\x80" \ - "\xc1\x85\xad\x38\x69\x5a\x51\xd5\x22\xc8\x2c\xe7" \ - "\x79\x12\xe2\xfe\xd8\xbe\x83\x76\x20\x92\xf5\x2b" \ - "\x18\x20\xdd\x11\xbb\x10\xe5\x65\xb5\x3a\x5a\x3b" \ - "\xba\xff\x13\x07\x13\xd6\x6f\xa6\x98\x18\x57\x06" \ - "\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82" - -class DMacro(QWidget): - def __init__(self,parent = None,name = None,fl = 0): - QWidget.__init__(self,parent,name,fl) - - self.image0 = QPixmap() - self.image0.loadFromData(image0_data,"PNG") - if not name: - self.setName("DMacro") - - self.setMinimumSize(QSize(505,0)) - - - self.Commentaire = QLabel(self,"Commentaire") - self.Commentaire.setGeometry(QRect(10,410,490,20)) - - self.bSup = QPushButton(self,"bSup") - self.bSup.setGeometry(QRect(320,440,142,30)) - self.bSup.setAutoDefault(1) - - self.bOk = QPushButton(self,"bOk") - self.bOk.setGeometry(QRect(170,440,142,30)) - self.bOk.setAutoDefault(1) - self.bOk.setDefault(1) - - self.bHelp = QPushButton(self,"bHelp") - self.bHelp.setGeometry(QRect(10,440,142,30)) - self.bHelp.setAutoDefault(1) - - self.TWChoix = QTabWidget(self,"TWChoix") - self.TWChoix.setGeometry(QRect(0,0,500,400)) - - self.MotClef = QWidget(self.TWChoix,"MotClef") - - self.textLabel1_2 = QLabel(self.MotClef,"textLabel1_2") - self.textLabel1_2.setGeometry(QRect(360,0,50,37)) - - self.LBMCPermis = QListBox(self.MotClef,"LBMCPermis") - self.LBMCPermis.setGeometry(QRect(10,40,220,290)) - self.LBMCPermis.setMinimumSize(QSize(0,0)) - - self.LBRegles = QListBox(self.MotClef,"LBRegles") - self.LBRegles.setGeometry(QRect(260,40,230,290)) - - self.textLabel1 = QLabel(self.MotClef,"textLabel1") - self.textLabel1.setGeometry(QRect(50,10,120,20)) - self.textLabel1.setMinimumSize(QSize(0,0)) - self.TWChoix.insertTab(self.MotClef,QString("")) - - self.Commande = QWidget(self.TWChoix,"Commande") - - self.textLabel6 = QLabel(self.Commande,"textLabel6") - self.textLabel6.setGeometry(QRect(10,60,60,30)) - - self.textLabel4 = QLabel(self.Commande,"textLabel4") - self.textLabel4.setGeometry(QRect(90,340,300,30)) - - self.LBNouvCommande = QListBox(self.Commande,"LBNouvCommande") - self.LBNouvCommande.setGeometry(QRect(50,100,410,240)) - - self.buttonGroup1 = QButtonGroup(self.Commande,"buttonGroup1") - self.buttonGroup1.setGeometry(QRect(300,20,151,70)) - - self.RBGroupe = QRadioButton(self.buttonGroup1,"RBGroupe") - self.RBGroupe.setGeometry(QRect(20,40,101,20)) - - self.RBalpha = QRadioButton(self.buttonGroup1,"RBalpha") - self.RBalpha.setGeometry(QRect(20,20,101,20)) - self.RBalpha.setChecked(1) - - self.LEFiltre = QLineEdit(self.Commande,"LEFiltre") - self.LEFiltre.setGeometry(QRect(50,60,160,30)) - - self.textLabel1_4 = QLabel(self.Commande,"textLabel1_4") - self.textLabel1_4.setGeometry(QRect(50,20,171,21)) - - self.BNext = QToolButton(self.Commande,"BNext") - self.BNext.setGeometry(QRect(220,60,30,31)) - self.BNext.setIconSet(QIconSet(self.image0)) - self.TWChoix.insertTab(self.Commande,QString("")) - - self.languageChange() - - self.resize(QSize(521,499).expandedTo(self.minimumSizeHint())) - self.clearWState(Qt.WState_Polished) - - self.connect(self.LBNouvCommande,SIGNAL("clicked(QListBoxItem*)"),self.LBNouvCommandeClicked) - self.connect(self.LEFiltre,SIGNAL("textChanged(const QString&)"),self.LEFiltreTextChanged) - self.connect(self.LEFiltre,SIGNAL("returnPressed()"),self.LEfiltreReturnPressed) - self.connect(self.bSup,SIGNAL("pressed()"),self.BSupPressed) - self.connect(self.bOk,SIGNAL("clicked()"),self.BOkPressed) - self.connect(self.RBalpha,SIGNAL("clicked()"),self.buildTabCommand) - self.connect(self.RBGroupe,SIGNAL("clicked()"),self.buildTabCommand) - self.connect(self.BNext,SIGNAL("clicked()"),self.BNextPressed) - - - def languageChange(self): - self.setCaption(self.__tr("DMacro")) - self.Commentaire.setText(QString.null) - 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.textLabel1_2.setText(self.__trUtf8("\x3c\x68\x33\x3e\x3c\x70\x20\x61\x6c\x69\x67\x6e\x3d\x22\x63\x65\x6e\x74\x65\x72\x22\x3e\x3c\x75\x3e\x3c\x62\x3e\x52\xc3\xa9\x67\x6c\x65\x73\x3c\x2f\x62\x3e\x3c\x2f\x75\x3e\x3c\x2f\x70\x3e\x3c\x2f\x68\x33\x3e")) - self.textLabel1.setText(self.__tr("

Mots Clefs Permis

")) - self.TWChoix.changeTab(self.MotClef,self.__tr("Ajouter Mot-Clef")) - self.textLabel6.setText(self.__tr("Filtre")) - self.textLabel4.setText(self.__trUtf8("\x4c\x61\x20\x63\x6f\x6d\x6d\x61\x6e\x64\x65\x20\x63\x68\x6f\x69\x73\x69\x65\x20\x73\x65\x72\x61\x20\x61\x6a\x6f\x75\x74\xc3\xa9\x65\x20\x41\x50\x52\x45\x53\x20\x6c\x61\x20\x63\x6f\x6d\x6d\x61\x6e\x64\x65\x20\x63\x6f\x75\x72\x61\x6e\x74\x65")) - self.buttonGroup1.setTitle(self.__tr("Affichage")) - self.RBGroupe.setText(self.__tr("par groupe")) - self.RBalpha.setText(self.__trUtf8("\x61\x6c\x70\x68\x61\x62\xc3\xa9\x74\x69\x71\x75\x65")) - self.textLabel1_4.setText(self.__tr("Commandes :")) - self.BNext.setText(QString.null) - QToolTip.add(self.BNext,self.__tr("affiche la prochaine occurence")) - self.TWChoix.changeTab(self.Commande,self.__tr("Nouvelle Commande")) - - - def LBNouvCommandeClicked(self): - print "DMacro.LBNouvCommandeClicked(): Not implemented yet" - - def LEFiltreTextChanged(self): - print "DMacro.LEFiltreTextChanged(): Not implemented yet" - - def LEfiltreReturnPressed(self): - print "DMacro.LEfiltreReturnPressed(): Not implemented yet" - - def BSupPressed(self): - print "DMacro.BSupPressed(): Not implemented yet" - - def BOkPressed(self): - print "DMacro.BOkPressed(): Not implemented yet" - - def buildTabCommand(self): - print "DMacro.buildTabCommand(): Not implemented yet" - - def BNextPressed(self): - print "DMacro.BNextPressed(): Not implemented yet" - - def __tr(self,s,c = None): - return qApp.translate("DMacro",s,c) - - def __trUtf8(self,s,c = None): - return qApp.translate("DMacro",s,c,QApplication.UnicodeUTF8) diff --git a/Interface/desRacine.py b/Interface/desRacine.py deleted file mode 100644 index 05651fb1..00000000 --- a/Interface/desRacine.py +++ /dev/null @@ -1,155 +0,0 @@ -# -*- coding: utf-8 -*- - -# Form implementation generated from reading ui file 'desRacine.ui' -# -# Created: lun mar 12 10:51:25 2007 -# by: The PyQt User Interface Compiler (pyuic) 3.13 -# -# WARNING! All changes made in this file will be lost! - - -from qt import * - -image0_data = \ - "\x89\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d" \ - "\x49\x48\x44\x52\x00\x00\x00\x21\x00\x00\x00\x0e" \ - "\x08\x06\x00\x00\x00\xa1\x1e\x75\x8c\x00\x00\x00" \ - "\xcf\x49\x44\x41\x54\x38\x8d\xd5\x94\xdb\x0e\xc3" \ - "\x20\x0c\x43\xed\xfd\xf8\xd8\x97\xbb\x0f\x34\x5b" \ - "\x48\x08\x45\xd5\x1e\xb6\x48\x88\xf4\x12\xe7\x60" \ - "\x01\xc0\x0f\x04\x6f\xd6\xe9\x9b\xba\x77\x20\x04" \ - "\x80\x92\x4a\x10\x32\xc9\x2e\xfb\xd8\xc7\xd5\xca" \ - "\xbc\xc0\x25\x40\x00\x99\xe9\x57\x84\x95\x68\xfe" \ - "\x7f\x06\xc0\xde\xd1\xde\xb3\x2b\x4a\x1e\xc4\xea" \ - "\x82\x4b\x9e\x74\x09\x71\x65\xbd\x01\xf8\x55\x27" \ - "\xf7\x8a\x72\x01\xe0\xa3\x12\x9f\x34\x5a\x01\x7c" \ - "\x54\x3b\xaf\xdc\x98\x3d\x0f\x71\x09\xd1\x5a\x33" \ - "\x1b\x47\x1f\x47\x07\x2c\x17\x49\x4a\x82\x33\x8f" \ - "\x61\x78\x20\x3a\x88\x17\xe6\x73\x06\xb1\xf0\x8b" \ - "\x07\xba\x03\xe6\x02\xc9\xb8\x31\x07\x7e\x37\xe0" \ - "\x20\x9e\x67\xe3\x38\x67\x10\x97\x7b\x17\xde\x80" \ - "\xc1\x85\xad\x38\x69\x5a\x51\xd5\x22\xc8\x2c\xe7" \ - "\x79\x12\xe2\xfe\xd8\xbe\x83\x76\x20\x92\xf5\x2b" \ - "\x18\x20\xdd\x11\xbb\x10\xe5\x65\xb5\x3a\x5a\x3b" \ - "\xba\xff\x13\x07\x13\xd6\x6f\xa6\x98\x18\x57\x06" \ - "\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82" - -class DRac(QWidget): - def __init__(self,parent = None,name = None,fl = 0): - QWidget.__init__(self,parent,name,fl) - - self.image0 = QPixmap() - self.image0.loadFromData(image0_data,"PNG") - if not name: - self.setName("DRac") - - self.setMinimumSize(QSize(505,0)) - - - self.bHelp = QPushButton(self,"bHelp") - self.bHelp.setGeometry(QRect(10,440,142,30)) - self.bHelp.setAutoDefault(1) - - self.textLabel6 = QLabel(self,"textLabel6") - self.textLabel6.setGeometry(QRect(10,70,30,30)) - - self.textLabel1_4_2 = QLabel(self,"textLabel1_4_2") - self.textLabel1_4_2.setGeometry(QRect(350,0,50,21)) - - self.LEFiltre = QLineEdit(self,"LEFiltre") - self.LEFiltre.setGeometry(QRect(50,70,140,30)) - - self.BNext = QToolButton(self,"BNext") - self.BNext.setGeometry(QRect(200,70,30,31)) - self.BNext.setIconSet(QIconSet(self.image0)) - - self.textLabel1_4 = QLabel(self,"textLabel1_4") - self.textLabel1_4.setGeometry(QRect(90,0,75,21)) - - self.buttonGroup1 = QButtonGroup(self,"buttonGroup1") - self.buttonGroup1.setGeometry(QRect(10,20,230,40)) - - self.RBGroupe = QRadioButton(self.buttonGroup1,"RBGroupe") - self.RBGroupe.setGeometry(QRect(20,10,101,20)) - - self.RBalpha = QRadioButton(self.buttonGroup1,"RBalpha") - self.RBalpha.setGeometry(QRect(140,10,80,20)) - self.RBalpha.setChecked(1) - - self.bOk = QPushButton(self,"bOk") - self.bOk.setGeometry(QRect(180,440,142,30)) - self.bOk.setAutoDefault(1) - self.bOk.setDefault(1) - - self.bSup = QPushButton(self,"bSup") - self.bSup.setGeometry(QRect(350,440,142,30)) - self.bSup.setAutoDefault(1) - - self.LBNouvCommande = QListBox(self,"LBNouvCommande") - self.LBNouvCommande.setGeometry(QRect(10,110,230,320)) - - self.LBRegles = QListBox(self,"LBRegles") - self.LBRegles.setGeometry(QRect(260,30,230,400)) - - self.languageChange() - - self.resize(QSize(505,499).expandedTo(self.minimumSizeHint())) - self.clearWState(Qt.WState_Polished) - - self.connect(self.LBNouvCommande,SIGNAL("clicked(QListBoxItem*)"),self.LBNouvCommandeClicked) - self.connect(self.LEFiltre,SIGNAL("textChanged(const QString&)"),self.LEFiltreTextChanged) - self.connect(self.LEFiltre,SIGNAL("returnPressed()"),self.LEfiltreReturnPressed) - self.connect(self.bSup,SIGNAL("pressed()"),self.BSupPressed) - self.connect(self.bOk,SIGNAL("clicked()"),self.BOkPressed) - self.connect(self.RBalpha,SIGNAL("clicked()"),self.buildTabCommand) - self.connect(self.RBGroupe,SIGNAL("clicked()"),self.buildTabCommand) - self.connect(self.BNext,SIGNAL("clicked()"),self.BNextPressed) - - - def languageChange(self): - self.setCaption(self.__tr("DMacro")) - self.bHelp.setText(self.__tr("&Documentation")) - self.bHelp.setAccel(self.__tr("Alt+D")) - QToolTip.add(self.bHelp,self.__tr("affichage documentation aster")) - self.textLabel6.setText(self.__tr("Filtre")) - self.textLabel1_4_2.setText(self.__trUtf8("\x3c\x62\x3e\x3c\x75\x3e\x52\xc3\xa9\x67\x6c\x65\x73\x20\x3a\x3c\x2f\x75\x3e\x3c\x2f\x62\x3e")) - self.BNext.setText(QString.null) - QToolTip.add(self.BNext,self.__tr("affiche la prochaine occurence")) - self.textLabel1_4.setText(self.__tr("Commandes :")) - self.buttonGroup1.setTitle(self.__tr("Affichage")) - self.RBGroupe.setText(self.__tr("par groupe")) - self.RBalpha.setText(self.__trUtf8("\x61\x6c\x70\x68\x61\x62\xc3\xa9\x74\x69\x71\x75\x65")) - 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.bSup.setText(self.__tr("&Supprimer")) - self.bSup.setAccel(self.__tr("Alt+S")) - QToolTip.add(self.bSup,self.__tr("suppression du mot clef")) - - - def LBNouvCommandeClicked(self): - print "DRac.LBNouvCommandeClicked(): Not implemented yet" - - def LEFiltreTextChanged(self): - print "DRac.LEFiltreTextChanged(): Not implemented yet" - - def LEfiltreReturnPressed(self): - print "DRac.LEfiltreReturnPressed(): Not implemented yet" - - def BSupPressed(self): - print "DRac.BSupPressed(): Not implemented yet" - - def BOkPressed(self): - print "DRac.BOkPressed(): Not implemented yet" - - def buildTabCommand(self): - print "DRac.buildTabCommand(): Not implemented yet" - - def BNextPressed(self): - print "DRac.BNextPressed(): Not implemented yet" - - def __tr(self,s,c = None): - return qApp.translate("DRac",s,c) - - def __trUtf8(self,s,c = None): - return qApp.translate("DRac",s,c,QApplication.UnicodeUTF8) diff --git a/Interface/desUniqueInto.py b/Interface/desUniqueInto.py deleted file mode 100644 index 41fc10c0..00000000 --- a/Interface/desUniqueInto.py +++ /dev/null @@ -1,92 +0,0 @@ -# -*- coding: utf-8 -*- - -# Form implementation generated from reading ui file 'desUniqueInto.ui' -# -# Created: jeu fév 22 16:32:04 2007 -# by: The PyQt User Interface Compiler (pyuic) 3.13 -# -# WARNING! All changes made in this file will be lost! - - -from qt import * - - -class DUnIn(QWidget): - def __init__(self,parent = None,name = None,fl = 0): - QWidget.__init__(self,parent,name,fl) - - if not name: - self.setName("DUnIn") - - self.setMinimumSize(QSize(350,0)) - - - self.tabuniqueinto = QTabWidget(self,"tabuniqueinto") - self.tabuniqueinto.setGeometry(QRect(20,20,450,440)) - - self.Widget8 = QWidget(self.tabuniqueinto,"Widget8") - - self.textLabel2 = QLabel(self.Widget8,"textLabel2") - self.textLabel2.setGeometry(QRect(170,30,100,21)) - - self.textLabel1 = QLabel(self.Widget8,"textLabel1") - self.textLabel1.setGeometry(QRect(170,-10,90,31)) - - self.Commentaire = QLabel(self.Widget8,"Commentaire") - self.Commentaire.setGeometry(QRect(38,316,381,41)) - - self.bHelp = QPushButton(self.Widget8,"bHelp") - self.bHelp.setGeometry(QRect(0,370,142,30)) - self.bHelp.setAutoDefault(1) - - self.listBoxVal = QListBox(self.Widget8,"listBoxVal") - self.listBoxVal.setGeometry(QRect(80,60,290,240)) - - self.bOk = QPushButton(self.Widget8,"bOk") - self.bOk.setGeometry(QRect(150,370,142,30)) - self.bOk.setAutoDefault(1) - self.bOk.setDefault(1) - - self.bSup = QPushButton(self.Widget8,"bSup") - self.bSup.setGeometry(QRect(300,370,142,30)) - self.bSup.setAutoDefault(1) - 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.BOkPressed) - self.connect(self.bSup,SIGNAL("clicked()"),self.BSupPressed) - - - def languageChange(self): - self.setCaption(self.__tr("DUnIn")) - self.textLabel2.setText(self.__tr("

Valeurs possibles

")) - self.textLabel1.setText(self.__tr("

Choisir une valeur

")) - self.Commentaire.setText(QString.null) - self.bHelp.setText(self.__tr("&Documentation")) - self.bHelp.setAccel(self.__tr("Alt+D")) - QToolTip.add(self.bHelp,self.__tr("affichage documentation aster")) - 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.bSup.setText(self.__tr("&Supprimer")) - self.bSup.setAccel(self.__tr("Alt+S")) - QToolTip.add(self.bSup,self.__tr("suppression du mot clef")) - self.tabuniqueinto.changeTab(self.Widget8,self.__tr("Saisir Valeur")) - - - def BSupPressed(self): - print "DUnIn.BSupPressed(): Not implemented yet" - - def ViewDoc(self): - print "DUnIn.ViewDoc(): Not implemented yet" - - def BOkPressed(self): - print "DUnIn.BOkPressed(): Not implemented yet" - - def __tr(self,s,c = None): - return qApp.translate("DUnIn",s,c) diff --git a/Interface/monCommandePanel.py b/Interface/monCommandePanel.py index 7bf73fb6..a15cc8a1 100644 --- a/Interface/monCommandePanel.py +++ b/Interface/monCommandePanel.py @@ -53,8 +53,8 @@ class MonCommandePanel(DComm,QTPanelTBW1,QTPanelTBW2,QTPanelTBW3): def BNextPressed(self): QTPanelTBW2.BNextPressed(self) - def buildTabCommand(self): - QTPanelTBW2.buildLBNouvCommande(self) + def BuildTabCommand(self): + QTPanelTBW2.BuildLBNouvCommande(self) def LEFiltreTextChanged(self): QTPanelTBW2.LEFiltreTextChanged(self) diff --git a/Interface/monCommentairePanel.py b/Interface/monCommentairePanel.py new file mode 100644 index 00000000..d1c0c170 --- /dev/null +++ b/Interface/monCommentairePanel.py @@ -0,0 +1,54 @@ +# -*- 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 +import string,types,os + +# Modules Eficas +import prefs + +from qt import * + +from desCommentaire import DComment +from qtCommun import QTPanel + +# Import des panels + +class MonCommentairePanel(DComment,QTPanel): + """ + Classe définissant le panel associé aux mots-clés qui demandent + à l'utilisateur de choisir une seule valeur parmi une liste de valeurs + discrètes + """ + def __init__(self,node, parent = None,name = None,fl = 0): + QTPanel.__init__(self,node,parent) + DComment.__init__(self,parent,name,fl) + self.RemplitPanel() + + def RemplitPanel(self): + texte=self.node.item.get_valeur() + self.textCommentaire.setText(texte) + + def TexteCommentaireEntre(self): + texte=self.textCommentaire.text().latin1() + self.editor.init_modif() + self.node.item.set_valeur(texte) + self.node.onValid() + diff --git a/Interface/monFonctionPanel.py b/Interface/monFonctionPanel.py new file mode 100644 index 00000000..65dd0128 --- /dev/null +++ b/Interface/monFonctionPanel.py @@ -0,0 +1,117 @@ +# -*- 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 +import string,types,os +from qt import * + +# Modules Eficas + +from monPlusieursBasePanel import MonPlusieursBasePanel + +# Import des panels + +class MonFonctionPanel(MonPlusieursBasePanel): + """ + Classe définissant le panel associé aux mots-clés qui demandent + à l'utilisateur de choisir une seule valeur parmi une liste de valeurs + discrètes + """ + def __init__(self,node, parent = None,name = None,fl = 0): + self.node=node + self.SetNbValeurs() + MonPlusieursBasePanel.__init__(self,node,parent,name,fl) + + def SetNbValeurs(self): + genea=self.node.item.get_genealogie() + if "VALE" in genea: + self.nbValeurs=2 + if "VALE_C" in genea: + self.nbValeurs=3 + + + def DecoupeListeValeurs(self,liste): + #decoupe la liste des valeurs en n ( les x puis les y) + l_valeurs=[] + if (len(liste)% self.nbValeurs != 0): + message="La cardinalité n'est pas correcte, la dernière valeur est ignorée" + self.Commentaire.setText(QString(commentaire)) + for i in range(len(liste)/ self.nbValeurs) : + if (self.nbValeurs==2): + t=(liste[i*self.nbValeurs], liste[i*self.nbValeurs+1]) + else: + t=(liste[i*self.nbValeurs], liste[i*self.nbValeurs+1], liste[i*self.nbValeurs+2]) + l_valeurs.append(t) + return l_valeurs + + def BuildLBValeurs(self): + self.LBValeurs.clear() + listeValeurs=self.node.item.GetListeValeurs() + for valeur in self.DecoupeListeValeurs(listeValeurs): + self.LBValeurs.insertItem(str(valeur)) + + def Ajout1Valeur(self): + liste,validite=self.TraiteLEValeur() + if validite == 0 : return + if liste ==[] : return + + if len(liste) != self.nbValeurs : + commentaire = QString(str(liste)) + commentaire += QString(" n est pas un tuple de ") + commentaire += QString(str(self.nbValeurs)) + commentaire += QString(" valeurs") + self.Commentaire.setText(commentaire) + return + + index=self.LBValeurs.currentItem() +1 + indexListe=index*self.nbValeurs + if index == 0 : + index = -1 + indexListe=len(self.listeValeursCourantes) + listeVal=[] + for valeur in self.listeValeursCourantes : + listeVal.append(valeur) + validite,comm,comm2,listeRetour=self.politique.AjoutValeurs(liste,index,listeVal) + self.Commentaire.setText(comm2) + if not validite : + self.editor.affiche_infos(comm) + else: + self.LEValeur.setText(QString("")) + l1=self.listeValeursCourantes[:indexListe] + l3=self.listeValeursCourantes[indexListe:] + print l1 + print l3 + for valeur in self.DecoupeListeValeurs(listeRetour): + self.LBValeurs.insertItem(QString(str(valeur)),index) + index=index+1 + self.listeValeursCourantes=l1+listeRetour+l3 + + + def Sup1Valeur(self): + index=self.LBValeurs.currentItem() + self.LBValeurs.removeItem(self.LBValeurs.currentItem()) + listeVal=[] + i=0 + for valeur in self.listeValeursCourantes : + if i != index : listeVal.append(valeur) + i = i+1 + self.listeValeursCourantes=listeVal + SaisieValeur.RemplitPanel(self,self.listeValeursCourantes) + diff --git a/Interface/monMCFactPanel.py b/Interface/monMCFactPanel.py new file mode 100644 index 00000000..ccd3f6e3 --- /dev/null +++ b/Interface/monMCFactPanel.py @@ -0,0 +1,48 @@ +# -*- 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 +# Modules Eficas + +from desMCFact import DMCFact +from qtCommun import QTPanel +from qtCommun import QTPanelTBW1 +from qt import * + + +# Import des panels + +class MonMCFactPanel(DMCFact,QTPanelTBW1): + """ + Classe définissant le panel associé aux mots-clés qui demandent + à l'utilisateur de choisir une seule valeur parmi une liste de valeurs + discrètes + """ + def __init__(self,node, parent = None,name = None,fl = 0): + DMCFact.__init__(self,parent,name,fl) + QTPanel.__init__(self,node,parent) + QTPanelTBW1.__init__(self,node,parent) + + def BSupPressed(self): + QTPanel.BSupPressed(self) + + def BOkPressed(self): + QTPanel.BOkPressed(self) + diff --git a/Interface/monMCListAjoutPanel.py b/Interface/monMCListAjoutPanel.py new file mode 100644 index 00000000..622deab5 --- /dev/null +++ b/Interface/monMCListAjoutPanel.py @@ -0,0 +1,49 @@ +# -*- 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 +# Modules Eficas + +from desMCListAjout import DMCListAjout +from qtCommun import QTPanel +from qt import * + + +# Import des panels + +class MonMCListAjoutPanel(DMCListAjout,QTPanel): + """ + Classe définissant le panel associé aux mots-clés qui demandent + à l'utilisateur de choisir une seule valeur parmi une liste de valeurs + discrètes + """ + def __init__(self,node,parent = None,name = None,fl = 0): + DMCListAjout.__init__(self,parent,name,fl) + QTPanel.__init__(self,node,parent) + monMCFact=self.node.item.get_nom() + self.MCFacteur.setText(QString(monMCFact)) + self.MCFacteur.setAlignment(Qt.AlignHCenter) + + def BSupPressed(self): + QTPanel.BSupPressed(self) + + def BAjoutClicked(self): + self.node.parent.append_child(self.node.item.get_nom()) + diff --git a/Interface/monMacroPanel.py b/Interface/monMacroPanel.py index 2796a5bf..b7905c2c 100644 --- a/Interface/monMacroPanel.py +++ b/Interface/monMacroPanel.py @@ -51,8 +51,8 @@ class MonMacroPanel(DMacro,QTPanelTBW1,QTPanelTBW2): def BNextPressed(self): QTPanelTBW2.BNextPressed(self) - def buildTabCommand(self): - QTPanelTBW2.buildLBNouvCommande(self) + def BuildTabCommand(self): + QTPanelTBW2.BuildLBNouvCommande(self) def LEFiltreTextChanged(self): QTPanelTBW2.LEFiltreTextChanged(self) diff --git a/Interface/monPlusieursBasePanel.py b/Interface/monPlusieursBasePanel.py new file mode 100644 index 00000000..6bdf67dc --- /dev/null +++ b/Interface/monPlusieursBasePanel.py @@ -0,0 +1,97 @@ +# -*- 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 +import string,types,os + +# Modules Eficas +import prefs + +from qt import * + +from desPlusieursBase import DPlusBase +from qtCommun import QTPanel +from qtSaisie import SaisieValeur +from politiquesValidation import PolitiquePlusieurs + +# Import des panels + +class MonPlusieursBasePanel(DPlusBase,QTPanel,SaisieValeur): + """ + Classe définissant le panel associé aux mots-clés qui demandent + à l'utilisateur de choisir une seule valeur parmi une liste de valeurs + discrètes + """ + def __init__(self,node, parent = None,name = None,fl = 0): + QTPanel.__init__(self,node,parent) + DPlusBase.__init__(self,parent,name,fl) + self.politique=PolitiquePlusieurs(node,parent) + self.BuildLBValeurs() + self.listeValeursCourantes=self.node.item.GetListeValeurs() + + def BuildLBValeurs(self): + # redefinit en raison de l heritage par monFonctionPanel + SaisieValeur.BuildLBValeurs(self) + + def BOkPourListePressed(self): + self.node.item.set_valeur(self.listeValeursCourantes) + self.editor.affiche_infos("Valeur Acceptée") + + def BSupPressed(self): + QTPanel.BSupPressed(self) + + def LEValeurPressed(self): + self.Ajout1Valeur() + + def Sup1Valeur(self): + index=self.LBValeurs.currentItem() + self.LEValeur.setText(self.LBValeurs.currentText()) + self.LBValeurs.removeItem(self.LBValeurs.currentItem()) + listeVal=[] + i=0 + for valeur in self.listeValeursCourantes : + if i != index : listeVal.append(valeur) + i = i+1 + self.listeValeursCourantes=listeVal + + + def Ajout1Valeur(self): + liste,validite=SaisieValeur.TraiteLEValeur(self) + if validite == 0 : return + if liste ==[] : return + + index=self.LBValeurs.currentItem() + 1 + if index == 0 : index = -1 + listeVal=[] + for valeur in self.listeValeursCourantes : + listeVal.append(valeur) + validite,comm,comm2,listeRetour=self.politique.AjoutValeurs(liste,index,listeVal) + self.Commentaire.setText(comm2) + if not validite : + self.editor.affiche_infos(comm) + else: + self.LEValeur.setText(QString("")) + l1=self.listeValeursCourantes[:index] + l3=self.listeValeursCourantes[index:] + for valeur in listeRetour: + self.LBValeurs.insertItem(QString(str(valeur)),index) + index=index+1 + self.listeValeursCourantes=l1+listeRetour+l3 + diff --git a/Interface/monPlusieursIntoPanel.py b/Interface/monPlusieursIntoPanel.py new file mode 100644 index 00000000..c68647b1 --- /dev/null +++ b/Interface/monPlusieursIntoPanel.py @@ -0,0 +1,89 @@ +# -*- 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 +import string,types,os + +# Modules Eficas +import prefs + +from qt import * + +from desPlusieursInto import DPlusInto +from qtCommun import QTPanel +from qtSaisie import SaisieValeur +from politiquesValidation import PolitiquePlusieurs + +# Import des panels + +class MonPlusieursIntoPanel(DPlusInto,QTPanel,SaisieValeur): + """ + Classe définissant le panel associé aux mots-clés qui demandent + à l'utilisateur de choisir une seule valeur parmi une liste de valeurs + discrètes + """ + def __init__(self,node, parent = None,name = None,fl = 0): + QTPanel.__init__(self,node,parent) + DPlusInto.__init__(self,parent,name,fl) + self.politique=PolitiquePlusieurs(node,parent) + SaisieValeur.BuildLBValeurs(self) + self.listeValeursCourantes=self.node.item.GetListeValeurs() + SaisieValeur.RemplitPanel(self,self.listeValeursCourantes) + QObject.connect(self.listBoxVal, SIGNAL("doubleClicked(QListBoxItem*)" ), self.Ajout1Valeur ) + + def BOkPourListePressed(self): + self.node.item.set_valeur(self.listeValeursCourantes) + self.editor.affiche_infos("Valeur Acceptée") + + def BSupPressed(self): + QTPanel.BSupPressed(self) + + def Sup1Valeur(self): + index=self.LBValeurs.currentItem() + self.LBValeurs.removeItem(self.LBValeurs.currentItem()) + listeVal=[] + i=0 + for valeur in self.listeValeursCourantes : + if i != index : listeVal.append(valeur) + i = i+1 + self.listeValeursCourantes=listeVal + SaisieValeur.RemplitPanel(self,self.listeValeursCourantes) + + def Ajout1Valeur(self): + liste=[] + liste.append(self.listBoxVal.currentText().latin1()) + index=self.LBValeurs.currentItem() + 1 + if index==0 : index = -1 + listeVal=[] + for valeur in self.listeValeursCourantes : + listeVal.append(valeur) + validite,comm,comm2,listeRetour=self.politique.AjoutValeurs(liste,index,listeVal) + self.Commentaire.setText(comm2) + if not validite : + self.editor.affiche_infos(comm) + else: + l1=self.listeValeursCourantes[:index] + l3=self.listeValeursCourantes[index:] + for valeur in listeRetour: + self.LBValeurs.insertItem(QString(str(valeur)),index) + index=index+1 + self.listeValeursCourantes=l1+listeRetour+l3 + SaisieValeur.RemplitPanel(self,self.listeValeursCourantes) + diff --git a/Interface/monRacinePanel.py b/Interface/monRacinePanel.py index eff3f16f..4d8179ab 100644 --- a/Interface/monRacinePanel.py +++ b/Interface/monRacinePanel.py @@ -51,7 +51,7 @@ class MonRacinePanel(DRac,QTPanelTBW2): QTPanelTBW2.BNextPressed(self) def buildTabCommand(self): - QTPanelTBW2.buildLBNouvCommande(self) + QTPanelTBW2.BuildLBNouvCommande(self) def LEFiltreTextChanged(self): QTPanelTBW2.LEFiltreTextChanged(self) @@ -62,12 +62,12 @@ class MonRacinePanel(DRac,QTPanelTBW2): def LBNouvCommandeClicked(self): QTPanelTBW2.LBNouvCommandeClicked(self) - def appelleBuildLBRegles(self): + def AppelleBuildLBRegles(self): listeRegles=self.node.item.get_regles() listeNomsEtapes = self.node.item.get_l_noms_etapes() - self.buildLBRegles(listeRegles,listeNomsEtapes) + self.BuildLBRegles(listeRegles,listeNomsEtapes) - def defCmd(self): + def DefCmd(self): name=str(self.LBNouvCommande.selectedItem().text()) if name==QString(" "): return if name.find("GROUPE :")==0 : return diff --git a/Interface/monUniqueASSDPanel.py b/Interface/monUniqueASSDPanel.py new file mode 100644 index 00000000..2527e3a4 --- /dev/null +++ b/Interface/monUniqueASSDPanel.py @@ -0,0 +1,53 @@ +# -*- 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 +import string,types,os + +# Modules Eficas +import prefs + +from qt import * + +from desUniqueASSD import DUnASSD +from qtCommun import QTPanel +from qtSaisie import SaisieValeur +from politiquesValidation import PolitiqueUnique + +# Import des panels + +class MonUniqueASSDPanel(DUnASSD,QTPanel,SaisieValeur): + """ + Classe définissant le panel associé aux mots-clés qui demandent + à l'utilisateur de choisir une seule valeur parmi une liste de valeurs + discrètes + """ + def __init__(self,node, parent = None,name = None,fl = 0): + QTPanel.__init__(self,node,parent) + DUnASSD.__init__(self,parent,name,fl) + self.politique=PolitiqueUnique(node,parent) + self.InitListBoxASSD() + + def BOkPressed(self): + self.clicASSD() + + def BSupPressed(self): + QTPanel.BSupPressed(self) + diff --git a/Interface/monUniqueBasePanel.py b/Interface/monUniqueBasePanel.py new file mode 100644 index 00000000..478462b7 --- /dev/null +++ b/Interface/monUniqueBasePanel.py @@ -0,0 +1,65 @@ +# -*- 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 +import string,types,os + +# Modules Eficas +import prefs + +from qt import * + +from desUniqueBase import DUnBase +from qtCommun import QTPanel +from qtSaisie import SaisieValeur +from politiquesValidation import PolitiqueUnique + +# Import des panels + +class MonUniqueBasePanel(DUnBase,QTPanel,SaisieValeur): + """ + Classe définissant le panel associé aux mots-clés qui demandent + à l'utilisateur de choisir une seule valeur parmi une liste de valeurs + discrètes + """ + def __init__(self,node, parent = None,name = None,fl = 0): + QTPanel.__init__(self,node,parent) + DUnBase.__init__(self,parent,name,fl) + self.politique=PolitiqueUnique(node,parent) + self.InitLineEditVal() + + def InitLineEditVal(self): + valeur=self.node.item.get_valeur() + valeurTexte=self.politique.GetValeurTexte(valeur) + if valeurTexte != None: + try : + str=QString("").setNum(valeurTexte) + except : + str=QString(valeurTexte) + self.lineEditVal.setText(str) + + def BOk2Pressed(self): + SaisieValeur.BOk2Pressed(self) + + def BSupPressed(self): + QTPanel.BSupPressed(self) + + def LEValeurPressed(self): + SaisieValeur.LEValeurPressed(self) diff --git a/Interface/monUniqueIntoPanel.py b/Interface/monUniqueIntoPanel.py index c7b0fe91..2c454dba 100644 --- a/Interface/monUniqueIntoPanel.py +++ b/Interface/monUniqueIntoPanel.py @@ -42,15 +42,16 @@ class MonUniqueIntoPanel(DUnIn,QTPanel,SaisieValeur): def __init__(self,node, parent = None,name = None,fl = 0): QTPanel.__init__(self,node,parent) DUnIn.__init__(self,parent,name,fl) - SaisieValeur.remplitPannel(self) + SaisieValeur.RemplitPanel(self) self.politique=PolitiqueUnique(node,parent) + QObject.connect(self.listBoxVal, SIGNAL("doubleClicked(QListBoxItem*)" ), self.ClicValeur ) - def clicValeur(self): - SaisieValeur.clicValeur(self) + def ClicValeur(self): + SaisieValeur.ClicValeur(self) def BOkPressed(self): SaisieValeur.BOkPressed(self) def BSupPressed(self): - QTPanel.BSupPressed(self) + QTPanel.BSupPressed(self) diff --git a/Interface/politiquesValidation.py b/Interface/politiquesValidation.py index 8335b4fd..0ee0a953 100644 --- a/Interface/politiquesValidation.py +++ b/Interface/politiquesValidation.py @@ -29,7 +29,7 @@ class Validation : self.node=node self.parent=parent - def testeUneValeur(self,valeurentree): + def TesteUneValeur(self,valeurentree): valeur,validite=self.node.item.eval_valeur(valeurentree) if not validite : commentaire = "impossible d'évaluer : %s " %`valeurentree` @@ -54,7 +54,7 @@ class Validation : # Méthodes utilisées pour la manipulation des items en notation scientifique # a mettre au point # ---------------------------------------------------------------------------------------- - def setValeurTexte(self,texteValeur) : + def SetValeurTexte(self,texteValeur) : try : if "R" in self.node.item.object.definition.type: if texteValeur[0] != "'": @@ -70,7 +70,7 @@ class Validation : except: pass - def getValeurTexte(self,valeur) : + def GetValeurTexte(self,valeur) : valeurTexte=valeur if "R" in self.node.item.object.definition.type: clefobj=self.node.item.object.GetNomConcept() @@ -88,16 +88,18 @@ class PolitiqueUnique(Validation) : def __init__(self,node,parent): Validation.__init__(self,node,parent) - def recordValeur(self,valeurentree): + def RecordValeur(self,valeurentree): if self.parent.modified == 'n' : self.parent.init_modif() ancienne_val = self.node.item.get_valeur() - valeur,validite,commentaire =self.testeUneValeur(valeurentree) + valeur,validite,commentaire =self.TesteUneValeur(valeurentree) if validite : validite=self.node.item.set_valeur(valeur) if self.node.item.isvalid(): + print "a" commentaire = "Valeur du mot-clé enregistrée" - self.setValeurTexte(str(valeurentree)) + self.SetValeurTexte(str(valeurentree)) else: + print "b" cr = self.node.item.get_cr() commentaire = "Valeur du mot-clé non autorisée "+cr.get_mess_fatal() self.node.item.set_valeur(ancienne_val) @@ -115,66 +117,34 @@ class PolitiquePlusieurs: self.parent=parent - def AjoutValeurs(self,listevaleur): + def AjoutValeurs(self,listevaleur,index,listecourante): + listeRetour=[] + commentaire="Nouvelle valeur acceptée" + commentaire2="" + valide=1 for valeur in listevaleur : # On teste le type de la valeur valide=self.node.item.valide_item(valeur) if not valide: commentaire="Valeur "+str(valeur)+ "incorrecte : ajout à la liste refusé" commentaire2=self.node.item.info_erreur_item() - return valide,commentaire,commentaire2 + return valide,commentaire,commentaire2,listeRetour + + # On valide la liste obtenue encorevalide=self.node.item.valide_liste_partielle(valeur,listecourante) if not encorevalide : commentaire2=self.node.item.info_erreur_liste() # On traite le cas ou la liste n est pas valide pour un pb de cardinalite min,max = self.node.item.GetMinMax() - if len(self.Liste_valeurs.get_liste()) >= max : + if len(listecourante) + 1 >= max : commentaire="La liste a déjà atteint le nombre maximum d'éléments,ajout refusé" + return valide,commentaire,commentaire2,listeRetour + if len(listecourante) + 1 > min : + return valide,commentaire,commentaire2,listeRetour + + # On ajoute la valeur testee a la liste courante et a la liste acceptee + listecourante.insert(index,valeur) + index=index+1 + listeRetour.append(valeur) - listecourante=self.node.item.GetListeValeurs() - return 1,"","" -# self.add_valeur_sans_into(valeur,encorevalide) -# -# -# encorevalide vaut 1 si le validateur trouve l item et la liste correctes -# 0 si le validateur trouve la valeur de l item incorrecte -# -1 si le validateur trouve la liste incorrecte -# """ -# valeur = name -# commentaire="Valeur incorrecte : ajout à la liste refusé" -# testvalide=1 -# -# -# if (encorevalide ==0) : -# commentaire=self.node.item.info_erreur_item() -# -# if (encorevalide == -1) : -# commentaire=self.node.item.info_erreur_liste() -# # On traite le cas ou la liste n est pas valide pour un pb de cardinalite -# min,max = self.node.item.GetMinMax() -# if len(self.Liste_valeurs.get_liste()) >= max : -# commentaire="La liste a déjà atteint le nombre maximum d'éléments,ajout refusé" -# -# if testvalide and (encorevalide == 1): -# min,max = self.node.item.GetMinMax() -# -# if testtype : -# liste_valeurs = self.Liste_valeurs.get_liste() -# if len(liste_valeurs) >= max : -# commentaire="La liste a déjà atteint le nombre maximum d'éléments,ajout refusé" -# else : -# if (self.Liste_valeurs.selection != None): -# ligne=self.Liste_valeurs.cherche_selected_item() -# liste_valeurs.insert(ligne,valeur) -# else : -# liste_valeurs.append(valeur) -# try : -# self.set_valeur_texte(str(self.entry.get())) -# except : -# pass -# self.Liste_valeurs.put_liste(liste_valeurs) -# self.erase_valeur() -# commentaire="Nouvelle valeur acceptée" -# else : -# commentaire ="Type de la valeur incorrecte" -# return validité,commentaire + return valide,commentaire,commentaire2,listeRetour diff --git a/Interface/qtCommun.py b/Interface/qtCommun.py index 726471bd..05e8ba76 100644 --- a/Interface/qtCommun.py +++ b/Interface/qtCommun.py @@ -50,21 +50,21 @@ class QTPanel: """ Impossible d utiliser les vrais labels avec designer ?? """ label=self.TWChoix.tabLabel(self.TWChoix.currentPage()) if label==QString("Nouvelle Commande"): - self.defCmd() + self.DefCmd() if label==QString("Nommer Concept"): self.LENomConceptReturnPressed() if label==QString("Ajouter Mot-Clef"): - self.defMC() + self.DefMC() if label==QString("Définition Formule"): print "hhhhhhhhhhhhhhh" - def appelleBuildLBRegles(self): + def AppelleBuildLBRegles(self): listeRegles = self.node.item.get_regles() listeNomsEtapes = self.node.item.get_mc_presents() - self.buildLBRegles(listeRegles,listeNomsEtapes) + self.BuildLBRegles(listeRegles,listeNomsEtapes) - def buildLBRegles(self,listeRegles,listeNomsEtapes): + def BuildLBRegles(self,listeRegles,listeNomsEtapes): if len(listeRegles) > 0: for regle in listeRegles : texteRegle=regle.gettext() @@ -93,18 +93,18 @@ class QTPanelTBW1(QTPanel): print "appel __init__ QTPanelTBW1" self.editor = parent self.node = node - self.buildLBMCPermis() - self.appelleBuildLBRegles() + self.BuildLBMCPermis() + self.AppelleBuildLBRegles() - def buildLBMCPermis(self): + def BuildLBMCPermis(self): self.LBMCPermis.clear() try : - QObject.disconnect(self.LBMCPermis,SIGNAL("doubleClicked(QListBoxItem*)"),self.defMC) + QObject.disconnect(self.LBMCPermis,SIGNAL("doubleClicked(QListBoxItem*)"),self.DefMC) except : # normal pour la première fois qu on passe # peut-etre inutile selon le connect ?? pass - QObject.connect(self.LBMCPermis,SIGNAL("doubleClicked(QListBoxItem*)"),self.defMC) + QObject.connect(self.LBMCPermis,SIGNAL("doubleClicked(QListBoxItem*)"),self.DefMC) jdc = self.node.item.get_jdc() genea =self.node.item.get_genealogie() @@ -113,7 +113,7 @@ class QTPanelTBW1(QTPanel): self.LBMCPermis.insertItem( aMc) - def defMC(self): + def DefMC(self): """ On ajoute un mot-clé à la commande : subnode """ name=str(self.LBMCPermis.selectedItem().text()) self.editor.init_modif() @@ -132,14 +132,14 @@ class QTPanelTBW2(QTPanel): print "appel __init__ QTPanelTBW2" self.editor = parent self.node = node - self.buildLBNouvCommande() - self.appelleBuildLBRegles() + self.BuildLBNouvCommande() + self.AppelleBuildLBRegles() - def buildLBNouvCommande(self): + def BuildLBNouvCommande(self): self.LBNouvCommande.clear() try : - QObject.disconnect(self.LBNouvCommande,SIGNAL("doubleClicked(QListBoxItem*)"),self.defCmd) + QObject.disconnect(self.LBNouvCommande,SIGNAL("doubleClicked(QListBoxItem*)"),self.DefCmd) except : # normal pour la première fois qu on passe # peut-etre inutile selon le connect ?? @@ -161,9 +161,9 @@ class QTPanelTBW2(QTPanel): for aCmd in listeCmd: self.LBNouvCommande.insertItem( aCmd) self.LBNouvCommande.insertItem( " " ) - QObject.connect( self.LBNouvCommande, SIGNAL("doubleClicked(QListBoxItem*)"),self.defCmd ) + QObject.connect( self.LBNouvCommande, SIGNAL("doubleClicked(QListBoxItem*)"),self.DefCmd ) - def defCmd(self): + def DefCmd(self): name=str(self.LBNouvCommande.selectedItem().text()) if name==QString(" "): return @@ -180,7 +180,7 @@ class QTPanelTBW2(QTPanel): self.LBNouvCommande.setSelected(MonItem,1) def LEfiltreReturnPressed(self): - self.defCmd() + self.DefCmd() def BNextPressed(self): self.LBNouvCommande.setCurrentItem(self.LBNouvCommande.currentItem()+1) diff --git a/Interface/qtSaisie.py b/Interface/qtSaisie.py new file mode 100644 index 00000000..e3bd8960 --- /dev/null +++ b/Interface/qtSaisie.py @@ -0,0 +1,137 @@ +# -*- 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 +import string,types,os +from qt import * + +# Import des panels + +class SaisieValeur: + """ + Classe contenant les méthodes communes aux panels + permettant de choisir des valeurs + """ + def __init__(self): + pass + + def InitListBoxASSD(self): + listeNomsSD = self.node.item.get_sd_avant_du_bon_type() + for aSD in listeNomsSD: + self.listBoxASSD.insertItem( aSD) + QObject.connect(self.listBoxASSD, SIGNAL("doubleClicked(QListBoxItem*)" ), self.ClicASSD ) + min,max = self.node.item.GetMinMax() + if (min == 1 and min == max and len(listeNomsSD)==1 ): + if ('R' not in self.node.item.get_type()) : + self.listBoxASSD.setCurrentItem(0) + self.ClicASSD() + + def BuildLBValeurs(self): + self.LBValeurs.clear() + listeValeurs=self.node.item.GetListeValeurs() + for valeur in listeValeurs: + self.LBValeurs.insertItem(str(valeur)) + + + def RemplitPanel(self,listeDejaLa=[]): + self.listBoxVal.clear() + lChoix=self.node.item.get_liste_possible(listeDejaLa) + for valeur in lChoix : + self.listBoxVal.insertItem( valeur ) + + def ClicASSD(self): + valeurQstring=self.listBoxASSD.selectedItem().text() + commentaire = QString("Valeur selectionnée : ") + commentaire.append(valeurQstring) + self.Commentaire.setText(commentaire) + valeur=valeurQstring.latin1() + validite,commentaire=self.politique.RecordValeur(valeur) + self.Commentaire.setText(QString(commentaire)) + + def ClicValeur(self): + valeurQstring=self.listBoxVal.selectedItem().text() + valeur=valeurQstring.latin1() + validite,commentaire=self.politique.RecordValeur(valeur) + self.Commentaire.setText(QString(commentaire)) + + def BOkPressed(self): + if self.listBoxVal.selectedItem()==None : + commentaire = "Pas de valeur selectionnée" + self.Commentaire.setText(QString(commentaire)) + else : + self.ClicValeur() + + def BOk2Pressed(self): + if str(self.lineEditVal.text())== "" : + commentaire = "Pas de valeur entrée " + self.Commentaire.setText(QString(commentaire)) + else : + self.LEValeurPressed() + + def LEValeurPressed(self): + nouvelleValeur=str(self.lineEditVal.text()) + validite,commentaire=self.politique.RecordValeur(nouvelleValeur) + if commentaire != "" : + self.Commentaire.setText(QString(commentaire)) + + def BParametresPressed(self): + print "a faire" + + + def TraiteLEValeur(self) : + # lit la chaine entree dans le line edit + # et la tranforme en chaine de valeurs + # a traiter. renvoie eventuellement des complexes + listeValeurs=[] + valeurBrute=str(self.LEValeur.text()) + if valeurBrute == str("") : return 1, listeValeurs + try : + valeur=eval(valeurBrute,{}) + except : + valeur=valeurBrute + if type(valeur) in (types.ListType,types.TupleType) : + indice = 0 + while (indice < len(valeur)): + v=valeur[indice] + if self.node.item.wait_complex() : + if (v== 'RI' or v == 'MP'): + try : + t=tuple([v,valeur[indice+1],valeur[indice+2]]) + listeValeurs.append(t) + indice=indice+3 + except : + commentaire = "Veuillez entrer le complexe sous forme aster ou sous forme python" + self.editor.affiche_infos(commentaire) + return listeValeurs,0 + + + else : # ce n'est pas un tuple à la mode aster + listeValeurs.append(v) + indice = indice + 1 + + else: # on n'attend pas un complexe + listeValeurs.append(v) + indice=indice+1 + elif type(valeur) == types.StringType: + listeValeurs=valeur.split(',') + else: + listeValeurs.append(valeur) + + return listeValeurs,1 diff --git a/Interface/qtcommun.py b/Interface/qtcommun.py deleted file mode 100644 index 592354c3..00000000 --- a/Interface/qtcommun.py +++ /dev/null @@ -1,270 +0,0 @@ -# -*- 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 -import string,types,os -import traceback - -from qt import * -from prefs import lang - -# Import des panels - -# ---------- # -class QTPanel: -# ---------- # - """ - Classe contenant les méthodes Qt communes a tous les panneaux droits - Tous les panneaux Mon...Panel héritent de cette classe - Gére plus précisement : - - l affichage de la doc - - le bouton Suppression (BSupPressed) - """ - def __init__(self,node, parent = None): - self.editor = parent - self.node = node - - def BSupPressed(self): - self.editor.init_modif() - self.node.delete() - -# ----------------------- # -class QTPanelTBW1(QTPanel): -# ----------------------- # - """ - Classe contenant les méthodes nécessaires a l onglet "Ajouter Mot-Clef" - hérite de QTPanel - Gére plus précisement : - """ - def __init__(self,node, parent = None): - QTPanel.__init__(self,node,parent) - self.buildLBMCPermis() - - def buildLBMCPermis(self): - self.LBMCPermis.clear() - try : - QObject.disconnect(self.LBMCPermis,SIGNAL("doubleClicked(QListBoxItem*)"),self.defMC) - except : - # normal pour la première fois qu on passe - # peut-etre inutile selon le connect ?? - pass - QObject.connect(self.LBMCPermis,SIGNAL("doubleClicked(QListBoxItem*)"),self.defMC) - - jdc = self.node.item.get_jdc() - genea =self.node.item.get_genealogie() - liste_mc=self.node.item.get_liste_mc_ordonnee(genea,jdc.cata_ordonne_dico) - for aMc in liste_mc: - self.LBMCPermis.insertItem( aMc) - - - def defMC(self): - """ On ajoute un mot-clé Ã| la commande : subnode """ - name=str(self.LBMCPermis.selectedItem().text()) - self.editor.init_modif() - self.node.append_child(name) - - def BOkPressed(self): - """ Impossible d utiliser les vrais labels avec designer ?? """ - label=self.TWChoix.tabLabel(self.TWChoix.currentPage()) - if label==QString("Nouvelle Commande"): - self.defCmd() - if label==QString("Nommer Concept"): - self.defConcept() - if label==QString("Ajouter Mot-Clef"): - self.defMC() - -# ---------------------------- # -class QTPanelTBW2(QTPanelTBW1): -# ---------------------------- # - """ - Classe contenant les méthodes nécessaires a l onglet "Nouvelle Commande" - hérite de QTPanelTBW1 (donc de QTPanel) - Gére plus précisement : - """ - - def __init__(self,node, parent = None): - QTPanelTBW1.__init__(self,node,parent) - self.buildLBNouvCommande() - self.buildLBRegles() - - def buildLBNouvCommande(self): - self.LBNouvCommande.clear() - try : - QObject.disconnect(self.LBNouvCommande,SIGNAL("doubleClicked(QListBoxItem*)"),self.defCmd) - except : - # normal pour la première fois qu on passe - # peut-etre inutile selon le connect ?? - pass - - jdc=self.node.item.object.get_jdc_root() - if self.RBalpha.isOn(): - listeCmd = jdc.get_liste_cmd() - for aCmd in listeCmd: - self.LBNouvCommande.insertItem( aCmd ) - else : - listeGroupes,dictGroupes=jdc.get_groups() - for grp in listeGroupes: - if grp == "CACHE":continue - listeCmd=dictGroupes[grp] - texte="GROUPE : "+grp - self.LBNouvCommande.insertItem( texte ) - self.LBNouvCommande.insertItem( " " ) - for aCmd in listeCmd: - self.LBNouvCommande.insertItem( aCmd) - self.LBNouvCommande.insertItem( " " ) - QObject.connect( self.LBNouvCommande, SIGNAL("doubleClicked(QListBoxItem*)"),self.defCmd ) - - def buildLBRegles(self): - regles = self.node.item.get_regles() - dictionnaire = self.node.item.get_mc_presents() - if len(regles) > 0: - for regle in regles : - texteRegle=regle.gettext() - texte,test = regle.verif(dictionnaire) - if test == 0 : - self.LBNouvCommande.insertItem(texteRegle) - else : - self.LBNouvCommande.insertItem(texteRegle) - - - - def defCmd(self): - name=str(self.LBNouvCommande.selectedItem().text()) - if name==QString(" "): - return - if name.find("GROUPE :")==0 : - return - self.editor.init_modif() - new_node = self.node.append_brother(name,'after') - - - def LEFiltreTextChanged(self): - MonItem=self.LBNouvCommande.findItem(self.LEFiltre.text().upper(),Qt.Contains) - if MonItem != None : - self.LBNouvCommande.setCurrentItem(MonItem) - self.LBNouvCommande.setSelected(MonItem,1) - - def LEfiltreReturnPressed(self): - self.defCmd() - - def BNextPressed(self): - self.LBNouvCommande.setCurrentItem(self.LBNouvCommande.currentItem()+1) - self.LEFiltreTextChanged() - - def LBNouvCommandeClicked(self): - name=str(self.LBNouvCommande.currentText()) - texte_infos=getattr(self.editor.jdc.get_cmd(name),lang) - if self.editor: - self.editor.affiche_infos(texte_infos) - - -# ---------------------------- # -class QTPanelTBW3(QTPanelTBW2): -# ---------------------------- # - - """ - Classe contenant les méthodes nécessaires a l onglet "Nommer Concept" - hérite de QTPanelTBW2 (donc de QTPanelTBW1 et de QTPanel) - Gére plus précisement : - """ - - def __init__(self,node, parent = None): - QTPanel.__init__(self,node,parent) - - - def defConcept(self): - """ - Nomme le concept SD retourne par l'etape - """ - nom = str(self.lENomConcept.text()) - nom = string.strip(nom) - - if nom == '' : return # si pas de nom, on ressort sans rien faire - - self.editor.init_modif() - test,mess = self.node.item.nomme_sd(nom) - self.editor.affiche_infos(mess) - -# ----------------------- # -class ViewText(QDialog): -# ----------------------- # - """ - Classe permettant la visualisation de texte - """ - def __init__(self,parent = None,name = None,modal = 0,fl = 0): - QDialog.__init__(self,parent,name,modal,fl) - - l1 = QVBoxLayout(self,11,6,) - self.view = QTextEdit(self) - self.view.setReadOnly(True) - - l2 = QHBoxLayout(None,0,6) - Horizontal_Spacing2 = QSpacerItem(220,20,QSizePolicy.Expanding,QSizePolicy.Minimum) - bclose= QPushButton(self) - bclose.setText(self.trUtf8( "Fermer")) - bsave= QPushButton(self) - bsave.setText(self.trUtf8( "Sauver")) - l2.addItem(Horizontal_Spacing2) - l2.addWidget(bsave) - l2.addWidget(bclose) - - l1.addWidget(self.view) - l1.addLayout(l2) - - self.resize( QSize(600,507).expandedTo(self.minimumSizeHint()) ) - self.connect( bclose,SIGNAL("clicked()"), self, SLOT("close()") ) - self.connect( bsave,SIGNAL("clicked()"), self.saveFile ) - - def setText(self, txt ): - self.view.setText(txt) - - def saveFile(self): - #recuperation du nom du fichier - fn = QFileDialog.getSaveFileName(None, - self.trUtf8("All Files (*)"), self, None, - self.trUtf8("Save File"), '', 0) - if not fn.isNull(): - if QFileInfo(fn).exists(): - abort = QMessageBox.warning(self, - self.trUtf8("Save File"), - self.trUtf8("The file %1 already exists.") - .arg(fn), - self.trUtf8("&Overwrite"), - self.trUtf8("&Abort"), None, 1) - if abort: - print 'AAAAAAAAAAA' - return - fn = unicode(QDir.convertSeparators(fn)) - else: - print 'BBBBBBBBBBB' - return - - #ecriture du fichier - try: - print 'CCCCCCCCCCCCC' - f = open(fn, 'wb') - f.write(str(self.view.text())) - f.close() - return 1 - except IOError, why: - QMessageBox.critical(self, self.trUtf8('Save File'), - self.trUtf8('The file %1 could not be saved.
Reason: %2') - .arg(unicode(fn)).arg(str(why))) - return