From de1e130ad38a13409f8c9164681439704e4c3ba6 Mon Sep 17 00:00:00 2001 From: Pascale Noyret Date: Fri, 10 Aug 2007 14:05:03 +0000 Subject: [PATCH] *** empty log message *** --- Aster/editeur.ini | 2 +- Aster/eficas_aster.py | 2 +- Aster/prefs.py | 58 +- Editeur/Objecttreeitem.py | 2 +- Editeur/Patrons/limaillage.comm | 7 +- Editeur/__init__.py | 4 + Editeur/comploader.py | 8 +- Editeur/configuration.py | 20 +- Editeur/icons/__init__.py | 24 + Editeur/icons/empty.png | Bin 0 -> 70 bytes Editeur/import_code.py | 3 +- Editeur/listePatrons.py | 29 +- Editeur/session.py | 2 +- Extensions/etape_niveau.py | 2 +- Ihm/I_FORM_ETAPE.py | 15 - InterfaceQT/__init__.py | 24 + InterfaceQT/browser.py | 474 +++ InterfaceQT/compobloc.py | 31 + InterfaceQT/compocomm.py | 107 + InterfaceQT/compofact.py | 136 + InterfaceQT/compoformule.py | 175 ++ InterfaceQT/compojdc.py | 116 + InterfaceQT/compomacro.py | 170 ++ InterfaceQT/compomclist.py | 206 ++ InterfaceQT/componiveau.py | 98 + InterfaceQT/componuplet.py | 85 + InterfaceQT/compooper.py | 247 ++ InterfaceQT/compoparam.py | 118 + InterfaceQT/compoparameval.py | 153 + InterfaceQT/compoproc.py | 22 + InterfaceQT/composimp.py | 639 +++++ InterfaceQT/editor.py | 668 +++++ InterfaceQT/eficas.py | 66 + InterfaceQT/monChoixCata.py | 57 + InterfaceQT/monCommandePanel.py | 69 + InterfaceQT/monCommentairePanel.py | 54 + InterfaceQT/monFonctionPanel.py | 124 + InterfaceQT/monFormulePanel.py | 140 + InterfaceQT/monMCFactPanel.py | 48 + InterfaceQT/monMCListAjoutPanel.py | 49 + InterfaceQT/monMacroPanel.py | 65 + InterfaceQT/monPlusieursASSDPanel.py | 112 + InterfaceQT/monPlusieursBasePanel.py | 96 + InterfaceQT/monPlusieursIntoPanel.py | 89 + InterfaceQT/monRacinePanel.py | 75 + InterfaceQT/monUniqueASSDPanel.py | 53 + InterfaceQT/monUniqueBasePanel.py | 65 + InterfaceQT/monUniqueCompPanel.py | 152 + InterfaceQT/monUniqueIntoPanel.py | 57 + InterfaceQT/myMain_ui.py | 516 ++++ InterfaceQT/panelsQT.py | 28 + InterfaceQT/politiquesValidation.py | 148 + InterfaceQT/prefsQT.py | 25 + InterfaceQT/qtCommun.py | 296 ++ InterfaceQT/qtEficas.py | 206 ++ InterfaceQT/qtSaisie.py | 144 + InterfaceQT/readercata.py | 405 +++ InterfaceQT/typeNode.py | 54 + InterfaceQT/utilIcons.py | 52 + InterfaceQT/viewManager.py | 2543 +++++++++++++++++ InterfaceQT/visualisation.py | 59 + {Editeur => InterfaceTK}/Interp.py | 0 InterfaceTK/Objecttreeitem.py | 505 ++++ {Editeur => InterfaceTK}/TroisDPal.py | 0 InterfaceTK/__init__.py | 20 + {Editeur => InterfaceTK}/appli.py | 46 +- {Editeur => InterfaceTK}/basestyle.py | 0 {Editeur => InterfaceTK}/browser.py | 0 {Editeur => InterfaceTK}/bureau.py | 4 +- {Editeur => InterfaceTK}/catabrowser.py | 8 +- {Editeur => InterfaceTK}/cataediteur.py | 8 +- {Editeur => InterfaceTK}/centerwindow.py | 0 {Editeur => InterfaceTK}/change_comm.py | 10 +- {Editeur => InterfaceTK}/compobase.py | 2 +- {Editeur => InterfaceTK}/compobloc.py | 2 +- {Editeur => InterfaceTK}/compocomm.py | 4 +- {Editeur => InterfaceTK}/compocommandecomm.py | 4 +- {Editeur => InterfaceTK}/compoerror.py | 2 +- {Editeur => InterfaceTK}/compofact.py | 2 +- {Editeur => InterfaceTK}/compoformule.py | 2 +- {Editeur => InterfaceTK}/compojdc.py | 2 +- {Editeur => InterfaceTK}/compomacro.py | 8 +- {Editeur => InterfaceTK}/compomclist.py | 2 +- {Editeur => InterfaceTK}/componiveau.py | 4 +- {Editeur => InterfaceTK}/componuplet.py | 6 +- {Editeur => InterfaceTK}/compooper.py | 4 +- {Editeur => InterfaceTK}/compoparam.py | 4 +- {Editeur => InterfaceTK}/compoparameval.py | 4 +- {Editeur => InterfaceTK}/compoproc.py | 4 +- {Editeur => InterfaceTK}/composimp.py | 6 +- {Editeur => InterfaceTK}/definition_cata.py | 0 {Editeur => InterfaceTK}/eficas.py | 0 {Editeur => InterfaceTK}/eficas_go.py | 10 +- {Editeur => InterfaceTK}/eficas_test.py | 7 +- {Editeur => InterfaceTK}/faq.py | 4 +- {Editeur => InterfaceTK}/faqs.txt | 0 .../fenetre_mc_inconnus.py | 0 {Editeur => InterfaceTK}/fonctionpanel.py | 6 +- {Editeur => InterfaceTK}/fontes.py | 0 {Editeur => InterfaceTK}/images.py | 5 +- {Editeur => InterfaceTK}/jdcdisplay.py | 0 {Editeur => InterfaceTK}/listeFichiers.py | 0 InterfaceTK/listePatronsTK.py | 27 + {Editeur => InterfaceTK}/macrodisplay.py | 2 +- {Editeur => InterfaceTK}/menubar.py | 0 {Editeur => InterfaceTK}/newsimppanel.py | 6 +- {Editeur => InterfaceTK}/options.py | 0 {Editeur => InterfaceTK}/panels.py | 2 +- {Editeur => InterfaceTK}/panelsSalome.py | 0 {Editeur => InterfaceTK}/patches.py | 0 .../plusieursassdpanel.py | 6 +- .../plusieursbasepanel.py | 8 +- .../plusieursintopanel.py | 6 +- {Editeur => InterfaceTK}/plusieurspanel.py | 6 +- InterfaceTK/prefsTK.py | 66 + {Editeur => InterfaceTK}/readercata.py | 60 +- {Editeur => InterfaceTK}/shellpanel.py | 4 +- {Editeur => InterfaceTK}/splash.py | 2 +- {Editeur => InterfaceTK}/statusbar.py | 0 {Editeur => InterfaceTK}/styles.py | 6 +- {Editeur => InterfaceTK}/toolbar.py | 0 {Editeur => InterfaceTK}/tooltip.py | 0 {Editeur => InterfaceTK}/treeitemincanvas.py | 2 +- {Editeur => InterfaceTK}/treewidget.py | 6 +- {Editeur => InterfaceTK}/uniqueassdpanel.py | 6 +- {Editeur => InterfaceTK}/uniquebasepanel.py | 6 +- {Editeur => InterfaceTK}/uniquecomppanel.py | 6 +- {Editeur => InterfaceTK}/uniqueintopanel.py | 6 +- {Editeur => InterfaceTK}/uniquepanel.py | 6 +- {Editeur => InterfaceTK}/uniquesdcopanel.py | 6 +- {Editeur => InterfaceTK}/widgets.py | 6 +- Ui/desChoixCata.py | 79 + Ui/desChoixCata.ui | 168 ++ Ui/desCommande.py | 220 ++ Ui/desCommande.ui | 551 ++++ Ui/desCommentaire.py | 70 + Ui/desCommentaire.ui | 150 + Ui/desFormule.py | 226 ++ Ui/desFormule.ui | 577 ++++ Ui/desInactif.py | 76 + Ui/desInactif.ui | 134 + Ui/desMCFact.py | 111 + Ui/desMCFact.ui | 234 ++ Ui/desMCListAjout.py | 91 + Ui/desMCListAjout.ui | 220 ++ Ui/desMacro.py | 183 ++ Ui/desMacro.ui | 430 +++ Ui/desPlusieursBase.py | 194 ++ Ui/desPlusieursBase.ui | 361 +++ Ui/desPlusieursInto.py | 169 ++ Ui/desPlusieursInto.ui | 296 ++ Ui/desRacine.py | 155 + Ui/desRacine.ui | 328 +++ Ui/desUniqueASSD.py | 91 + Ui/desUniqueASSD.ui | 196 ++ Ui/desUniqueBase.py | 99 + Ui/desUniqueBase.ui | 219 ++ Ui/desUniqueComp.py | 121 + Ui/desUniqueComp.ui | 290 ++ Ui/desUniqueInto.ui | 211 ++ Ui/desUniqueIntoPanel.py | 90 + Ui/myMain.ui | 607 ++++ 162 files changed, 17123 insertions(+), 264 deletions(-) create mode 100644 Editeur/icons/__init__.py create mode 100644 Editeur/icons/empty.png create mode 100644 InterfaceQT/__init__.py create mode 100644 InterfaceQT/browser.py create mode 100644 InterfaceQT/compobloc.py create mode 100644 InterfaceQT/compocomm.py create mode 100644 InterfaceQT/compofact.py create mode 100644 InterfaceQT/compoformule.py create mode 100644 InterfaceQT/compojdc.py create mode 100644 InterfaceQT/compomacro.py create mode 100644 InterfaceQT/compomclist.py create mode 100644 InterfaceQT/componiveau.py create mode 100644 InterfaceQT/componuplet.py create mode 100644 InterfaceQT/compooper.py create mode 100644 InterfaceQT/compoparam.py create mode 100644 InterfaceQT/compoparameval.py create mode 100644 InterfaceQT/compoproc.py create mode 100644 InterfaceQT/composimp.py create mode 100644 InterfaceQT/editor.py create mode 100644 InterfaceQT/eficas.py create mode 100644 InterfaceQT/monChoixCata.py create mode 100644 InterfaceQT/monCommandePanel.py create mode 100644 InterfaceQT/monCommentairePanel.py create mode 100644 InterfaceQT/monFonctionPanel.py create mode 100644 InterfaceQT/monFormulePanel.py create mode 100644 InterfaceQT/monMCFactPanel.py create mode 100644 InterfaceQT/monMCListAjoutPanel.py create mode 100644 InterfaceQT/monMacroPanel.py create mode 100644 InterfaceQT/monPlusieursASSDPanel.py create mode 100644 InterfaceQT/monPlusieursBasePanel.py create mode 100644 InterfaceQT/monPlusieursIntoPanel.py create mode 100644 InterfaceQT/monRacinePanel.py create mode 100644 InterfaceQT/monUniqueASSDPanel.py create mode 100644 InterfaceQT/monUniqueBasePanel.py create mode 100644 InterfaceQT/monUniqueCompPanel.py create mode 100644 InterfaceQT/monUniqueIntoPanel.py create mode 100644 InterfaceQT/myMain_ui.py create mode 100644 InterfaceQT/panelsQT.py create mode 100644 InterfaceQT/politiquesValidation.py create mode 100644 InterfaceQT/prefsQT.py create mode 100644 InterfaceQT/qtCommun.py create mode 100644 InterfaceQT/qtEficas.py create mode 100644 InterfaceQT/qtSaisie.py create mode 100644 InterfaceQT/readercata.py create mode 100644 InterfaceQT/typeNode.py create mode 100644 InterfaceQT/utilIcons.py create mode 100644 InterfaceQT/viewManager.py create mode 100644 InterfaceQT/visualisation.py rename {Editeur => InterfaceTK}/Interp.py (100%) create mode 100644 InterfaceTK/Objecttreeitem.py rename {Editeur => InterfaceTK}/TroisDPal.py (100%) create mode 100644 InterfaceTK/__init__.py rename {Editeur => InterfaceTK}/appli.py (91%) rename {Editeur => InterfaceTK}/basestyle.py (100%) rename {Editeur => InterfaceTK}/browser.py (100%) rename {Editeur => InterfaceTK}/bureau.py (99%) rename {Editeur => InterfaceTK}/catabrowser.py (98%) rename {Editeur => InterfaceTK}/cataediteur.py (99%) rename {Editeur => InterfaceTK}/centerwindow.py (100%) rename {Editeur => InterfaceTK}/change_comm.py (96%) rename {Editeur => InterfaceTK}/compobase.py (60%) rename {Editeur => InterfaceTK}/compobloc.py (97%) rename {Editeur => InterfaceTK}/compocomm.py (98%) rename {Editeur => InterfaceTK}/compocommandecomm.py (98%) rename {Editeur => InterfaceTK}/compoerror.py (97%) rename {Editeur => InterfaceTK}/compofact.py (99%) rename {Editeur => InterfaceTK}/compoformule.py (99%) rename {Editeur => InterfaceTK}/compojdc.py (99%) rename {Editeur => InterfaceTK}/compomacro.py (98%) rename {Editeur => InterfaceTK}/compomclist.py (99%) rename {Editeur => InterfaceTK}/componiveau.py (98%) rename {Editeur => InterfaceTK}/componuplet.py (97%) rename {Editeur => InterfaceTK}/compooper.py (99%) rename {Editeur => InterfaceTK}/compoparam.py (99%) rename {Editeur => InterfaceTK}/compoparameval.py (99%) rename {Editeur => InterfaceTK}/compoproc.py (96%) rename {Editeur => InterfaceTK}/composimp.py (99%) rename {Editeur => InterfaceTK}/definition_cata.py (100%) rename {Editeur => InterfaceTK}/eficas.py (100%) rename {Editeur => InterfaceTK}/eficas_go.py (92%) rename {Editeur => InterfaceTK}/eficas_test.py (97%) rename {Editeur => InterfaceTK}/faq.py (97%) rename {Editeur => InterfaceTK}/faqs.txt (100%) rename {Editeur => InterfaceTK}/fenetre_mc_inconnus.py (100%) rename {Editeur => InterfaceTK}/fonctionpanel.py (99%) rename {Editeur => InterfaceTK}/fontes.py (100%) rename {Editeur => InterfaceTK}/images.py (97%) rename {Editeur => InterfaceTK}/jdcdisplay.py (100%) rename {Editeur => InterfaceTK}/listeFichiers.py (100%) create mode 100644 InterfaceTK/listePatronsTK.py rename {Editeur => InterfaceTK}/macrodisplay.py (99%) rename {Editeur => InterfaceTK}/menubar.py (100%) rename {Editeur => InterfaceTK}/newsimppanel.py (98%) rename {Editeur => InterfaceTK}/options.py (100%) rename {Editeur => InterfaceTK}/panels.py (99%) rename {Editeur => InterfaceTK}/panelsSalome.py (100%) rename {Editeur => InterfaceTK}/patches.py (100%) rename {Editeur => InterfaceTK}/plusieursassdpanel.py (98%) rename {Editeur => InterfaceTK}/plusieursbasepanel.py (99%) rename {Editeur => InterfaceTK}/plusieursintopanel.py (98%) rename {Editeur => InterfaceTK}/plusieurspanel.py (98%) create mode 100644 InterfaceTK/prefsTK.py rename {Editeur => InterfaceTK}/readercata.py (93%) rename {Editeur => InterfaceTK}/shellpanel.py (97%) rename {Editeur => InterfaceTK}/splash.py (99%) rename {Editeur => InterfaceTK}/statusbar.py (100%) rename {Editeur => InterfaceTK}/styles.py (88%) rename {Editeur => InterfaceTK}/toolbar.py (100%) rename {Editeur => InterfaceTK}/tooltip.py (100%) rename {Editeur => InterfaceTK}/treeitemincanvas.py (98%) rename {Editeur => InterfaceTK}/treewidget.py (99%) rename {Editeur => InterfaceTK}/uniqueassdpanel.py (98%) rename {Editeur => InterfaceTK}/uniquebasepanel.py (98%) rename {Editeur => InterfaceTK}/uniquecomppanel.py (98%) rename {Editeur => InterfaceTK}/uniqueintopanel.py (97%) rename {Editeur => InterfaceTK}/uniquepanel.py (96%) rename {Editeur => InterfaceTK}/uniquesdcopanel.py (99%) rename {Editeur => InterfaceTK}/widgets.py (99%) create mode 100644 Ui/desChoixCata.py create mode 100644 Ui/desChoixCata.ui create mode 100644 Ui/desCommande.py create mode 100644 Ui/desCommande.ui create mode 100644 Ui/desCommentaire.py create mode 100644 Ui/desCommentaire.ui create mode 100644 Ui/desFormule.py create mode 100644 Ui/desFormule.ui create mode 100644 Ui/desInactif.py create mode 100644 Ui/desInactif.ui create mode 100644 Ui/desMCFact.py create mode 100644 Ui/desMCFact.ui create mode 100644 Ui/desMCListAjout.py create mode 100644 Ui/desMCListAjout.ui create mode 100644 Ui/desMacro.py create mode 100644 Ui/desMacro.ui create mode 100644 Ui/desPlusieursBase.py create mode 100644 Ui/desPlusieursBase.ui create mode 100644 Ui/desPlusieursInto.py create mode 100644 Ui/desPlusieursInto.ui create mode 100644 Ui/desRacine.py create mode 100644 Ui/desRacine.ui create mode 100644 Ui/desUniqueASSD.py create mode 100644 Ui/desUniqueASSD.ui create mode 100644 Ui/desUniqueBase.py create mode 100644 Ui/desUniqueBase.ui create mode 100644 Ui/desUniqueComp.py create mode 100644 Ui/desUniqueComp.ui create mode 100644 Ui/desUniqueInto.ui create mode 100644 Ui/desUniqueIntoPanel.py create mode 100644 Ui/myMain.ui diff --git a/Aster/editeur.ini b/Aster/editeur.ini index de8d11dd..77ef4249 100644 --- a/Aster/editeur.ini +++ b/Aster/editeur.ini @@ -20,7 +20,7 @@ import os -import prefs +from Aster import prefs rep_cata = os.path.join(prefs.REPINI,'Cata') rep_Pmw = os.path.join(prefs.REPINI,'../Pmw') diff --git a/Aster/eficas_aster.py b/Aster/eficas_aster.py index 1d298b58..deaa5455 100755 --- a/Aster/eficas_aster.py +++ b/Aster/eficas_aster.py @@ -27,6 +27,6 @@ # Modules Eficas import prefs -from Editeur import eficas_go +from InterfaceTK import eficas_go eficas_go.lance_eficas() diff --git a/Aster/prefs.py b/Aster/prefs.py index 13b16d0d..bb3ff194 100644 --- a/Aster/prefs.py +++ b/Aster/prefs.py @@ -34,75 +34,33 @@ INSTALLDIR=os.path.join(REPINI,'..') # Par défaut on utilise les modules de INSTALLDIR # Peut valoir None (defaut) CODE_PATH = None -#CODE_PATH = os.path.join(REPINI,'../../Superv') # la variable code donne le nom du code a selectionner code="ASTER" -# ICONDIR sert à localiser le répertoire contenant les icones -# Par défaut on utilise le répertoire icons dans Editeur -ICONDIR=os.path.join(INSTALLDIR,'Editeur','icons') - # lang indique la langue utilisée pour les chaines d'aide : fr ou ang lang='fr' # Codage des strings qui accepte les accents (en remplacement de 'ascii') encoding='iso-8859-1' -labels= ('Fichier','Edition','Jeu de commandes', - 'Options', - 'Aide', - 'Traduction', - ) -appli_composants=['readercata','bureau', -# 'browser', - 'options', - ] +EditeurDir=INSTALLDIR+"/Editeur" +sys.path[:0]=[EditeurDir] +sys.path[:0]=[INSTALLDIR] -menu_defs={ 'bureau': [ - ('Fichier',[ - ('Nouveau','newJDC','','Ctrl+N'), - ('Nouvel INCLUDE','newJDC_include'), - ('Ouvrir','openJDC','','Ctrl+O'), - ('Enregistrer','saveJDC','','Ctrl+S'), - ('Enregistrer sous','saveasJDC','','Ctrl+E'), - None, - ('Fermer','closeJDC','','Ctrl+W'), - ('Quitter','exitEFICAS','','Ctrl+Q'), - ] - ), - ('Edition',[ - ('Copier','copy','','Ctrl+C'), - ('Couper','cut','','Ctrl+X'), - ('Coller','paste','','Ctrl+V'), - ] - ), - ('Jeu de commandes',[ - ('Rapport de validation','visuCRJDC','','Ctrl+R'), - ('Fichier source','visu_txt_brut_JDC','','Ctrl+B'), - #('Paramètres Eficas','affichage_fichier_ini'), - ] - ), - ('Traduction',[ - ('Traduction v7 en v8','TraduitFichier','','Ctrl+T'), - ] - ), - ('Aide',[ - ('Aide EFICAS','aideEFICAS','','Ctrl+A'), - ] - ), - ] - } +# Imports pour l IHM TK +from InterfaceTK import prefsTK +ICONDIR=os.path.join(INSTALLDIR,'Editeur','icons') +# Preference if os.name == 'nt': userprefs = os.sep.join( [ os.environ['HOMEDRIVE'], os.environ['HOMEPATH'], 'Eficas_install', 'prefs.py' ]) else : userprefs=os.path.expanduser("~/Eficas_install/prefs.py") + if os.path.isfile(userprefs): try: execfile(userprefs) except: pass - -sys.path[:0]=[INSTALLDIR] diff --git a/Editeur/Objecttreeitem.py b/Editeur/Objecttreeitem.py index 21998b57..e8067302 100644 --- a/Editeur/Objecttreeitem.py +++ b/Editeur/Objecttreeitem.py @@ -27,7 +27,7 @@ from copy import copy,deepcopy # import du chargeur de composants from comploader import make_objecttreeitem -import treewidget +from InterfaceTK import treewidget from Ihm import CONNECTOR myrepr = Repr() diff --git a/Editeur/Patrons/limaillage.comm b/Editeur/Patrons/limaillage.comm index bb12c443..c3817331 100644 --- a/Editeur/Patrons/limaillage.comm +++ b/Editeur/Patrons/limaillage.comm @@ -1,11 +1,12 @@ - DEBUT(CODE=_F(NOM='VIDE', NIV_PUB_WEB='INTERNET',),); -# -MA=LIRE_MAILLAGE(); +# +MA1=LIRE_MAILLAGE(); FIN(); + # + diff --git a/Editeur/__init__.py b/Editeur/__init__.py index 28da2d3d..1260b69a 100644 --- a/Editeur/__init__.py +++ b/Editeur/__init__.py @@ -18,3 +18,7 @@ # # # ====================================================================== +""" + Ce package contient les fonctionnalités COMMUNES nécessaires + aux deux éditeurs graphiques QT et TK +""" diff --git a/Editeur/comploader.py b/Editeur/comploader.py index c5a7c846..e49bc50a 100644 --- a/Editeur/comploader.py +++ b/Editeur/comploader.py @@ -38,13 +38,17 @@ import os,glob,types # Ce dictionnaire est renseigné par la méthode charger_composants composants = {} -def charger_composants(): +def charger_composants(Ihm="TK"): """ Cette fonction a pour but de charger tous les modules composants graphiques (fichiers compo*.py dans le même répertoire que ce module ) et de remplir le dictionnaire composants utilisé par make_objecttreeitem """ - repertoire=os.path.dirname(__file__) + reper=os.path.dirname(__file__) + if Ihm == "TK" : + repertoire=reper+"/../InterfaceTK" + else : + repertoire=reper+"/../InterfaceQT" listfich=glob.glob(os.path.join(repertoire, "compo*.py")) for fichier in listfich: m= os.path.basename(fichier)[:-3] diff --git a/Editeur/configuration.py b/Editeur/configuration.py index 91697925..cca88569 100644 --- a/Editeur/configuration.py +++ b/Editeur/configuration.py @@ -26,8 +26,7 @@ import os,sys,string,types import traceback # Modules Eficas -from widgets import showinfo,showerror,askretrycancel -import utils +from Editeur import utils class CONFIGbase: @@ -60,8 +59,9 @@ class CONFIGbase: # Verifie l'existence du fichier "standard" # appelle la lecture de ce fichier if not os.path.isfile(self.fic_ini): - print self.fic_ini - showerror("Erreur","Pas de fichier de configuration" + self.fic_ini+"\n") + if self.appli.ihm=="TK" : + from widgets import showerror + showerror("Erreur","Pas de fichier de configuration" + self.fic_ini+"\n") print "Erreur à la lecture du fichier de configuration : %s" % self.fic_ini sys.exit(0) self.lecture_fichier(self.fic_ini) @@ -73,13 +73,15 @@ class CONFIGbase: # les transforme en attribut de l 'objet # utilisation du dictionnaire local pour récuperer style txt = utils.read_file(fic) - from styles import style + from InterfaceTK.styles import style d=locals() try: exec txt in d except: l=traceback.format_exception(sys.exc_info()[0],sys.exc_info()[1],sys.exc_info()[2]) - showerror("Erreur","Une erreur s'est produite lors de la lecture du fichier : " + fic + "\n") + if self.appli.ihm=="TK" : + from widgets import showerror + showerror("Erreur","Une erreur s'est produite lors de la lecture du fichier : " + fic + "\n") print "Erreur à la lecture du fichier de configuration : %s" % fic sys.exit() @@ -176,7 +178,10 @@ class CONFIGbase: mode='query') if not result.resultat : if mode == 'considerer_annuler': - test = askretrycancel("Erreur","Données incorrectes !") + test=0 + if self.appli.ihm=="TK" : + from widgets import showerror,askretrycancel + test = askretrycancel("Erreur","Données incorrectes !") if not test: # XXX On sort d'EFICAS, je suppose self.appli.exitEFICAS() @@ -260,7 +265,6 @@ class CONFIGStyle(CONFIGbase): self.titre = "Paramètres d affichage" self.texte_ini = "Voici les paramètres configurables : " self.commande = self.creation_fichier_ini_si_possible - self.pref="style." self.labels={"background":"couleur du fonds", "foreground":"couleur de la police standard" , "standard":" police et taille standard", diff --git a/Editeur/icons/__init__.py b/Editeur/icons/__init__.py new file mode 100644 index 00000000..1260b69a --- /dev/null +++ b/Editeur/icons/__init__.py @@ -0,0 +1,24 @@ +# -*- 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. +# +# +# ====================================================================== +""" + Ce package contient les fonctionnalités COMMUNES nécessaires + aux deux éditeurs graphiques QT et TK +""" diff --git a/Editeur/icons/empty.png b/Editeur/icons/empty.png new file mode 100644 index 0000000000000000000000000000000000000000..ff59051fd8e619f8bb82baabe674e9ed0aa5405e GIT binary patch literal 70 zcmeAS@N?(olHy`uVBq!ia0vp^j3CUx1|;Q0k92}1TpU9x<|JE`y^&yMVEfG!ynt)E Q4p4%@)78&qol`;+0Hpj5e*gdg literal 0 HcmV?d00001 diff --git a/Editeur/import_code.py b/Editeur/import_code.py index 942c6b4a..5dc27ac5 100644 --- a/Editeur/import_code.py +++ b/Editeur/import_code.py @@ -23,7 +23,8 @@ les imports de modules Python """ import sys -import prefs +from Aster import prefs + # Ce chemin permet d'importer les modules Noyau et Validation # représentant le code utilisé (si fourni) if prefs.CODE_PATH: diff --git a/Editeur/listePatrons.py b/Editeur/listePatrons.py index 307abbbe..690adb40 100644 --- a/Editeur/listePatrons.py +++ b/Editeur/listePatrons.py @@ -1,24 +1,15 @@ import os import re -import Tkinter - -# le dictionnaire sous menu est indexe parceque l'ordre des -# recherches est important sous_menu={0:{"3D":"3D.comm"},1:{"poutre":"pou.comm"},2:{"salome":"salome.comm"},3:{"divers":"comm"}} class listePatrons : - def __init__(self,appli): - self.appli=appli - rep_ini=self.appli.CONFIGURATION.rep_ini - if self.appli.code != "ASTER" : - return - self.rep_patrons=rep_ini+"/../Editeur/Patrons" + def __init__(self): + repIni=os.path.dirname(os.path.abspath(__file__)) + self.rep_patrons=repIni+"/Patrons" self.liste={} self.traite_liste() - self.ajout_menu() - def traite_liste(self): for file in os.listdir(self.rep_patrons): @@ -31,17 +22,3 @@ class listePatrons : else : self.liste[clef]=[file] break - - def ajout_menu(self): - menuFichier=self.appli.menubar.menubar - menu_cascade=Tkinter.Menu(menuFichier,tearoff=0) - menuFichier.add_cascade(label="Patrons",menu=menu_cascade) - for ss_menu in self.liste.keys(): - ssmenu=Tkinter.Menu(menu_cascade,tearoff=0) - menu_cascade.add_cascade(label=ss_menu,menu=ssmenu) - for fichier in self.liste[ss_menu]: - ssmenu.add_command(label=fichier,command= lambda self=self, l=fichier:self.ouvre(l)); - - def ouvre(self,label): - fichier=self.rep_patrons+"/"+label - self.appli.bureau.openJDC(file=fichier,enregistre="non") diff --git a/Editeur/session.py b/Editeur/session.py index 421584a5..980af6cd 100644 --- a/Editeur/session.py +++ b/Editeur/session.py @@ -46,8 +46,8 @@ except: import os,traceback import ConfigParser -import prefs import re +from Aster import prefs # Les valeurs decodees par optparse sont mises dans un objet dictionnaire-like. # On l'utilise comme environnement de session. diff --git a/Extensions/etape_niveau.py b/Extensions/etape_niveau.py index a51c5fff..2db15130 100644 --- a/Extensions/etape_niveau.py +++ b/Extensions/etape_niveau.py @@ -25,7 +25,7 @@ import traceback from Noyau import N_OBJECT -import prefs +from Aster import prefs class ETAPE_NIVEAU(N_OBJECT.OBJECT): diff --git a/Ihm/I_FORM_ETAPE.py b/Ihm/I_FORM_ETAPE.py index d228980c..79044d6b 100644 --- a/Ihm/I_FORM_ETAPE.py +++ b/Ihm/I_FORM_ETAPE.py @@ -110,21 +110,6 @@ class FORM_ETAPE(MACRO_ETAPE): test = 1 arguments = arguments[1:-1] # on enlève les parenthèses ouvrante et fermante l_arguments = string.split(arguments,',') - #for argument in l_arguments: - # argument = string.strip(argument) - # try: - # nom=argument - # typ,nom = string.split(argument,':') - # #pas de vérification sur le nom de l'argument - # #vérification du type de l'argument - # typ = string.strip(typ) - # if typ not in self.l_types_autorises : - # test = 0 - # erreur = erreur + "Le type "+typ+" n'est pas un type permis pour "+nom+'\n' - # except: - # # l'argument ne respecte pas la syntaxe : typ_arg : nom_arg - # test = 0 - # erreur = erreur+"Syntaxe argument non valide : "+argument+'\n' return test,erreur def verif_corps(self,corps=None,arguments=None): diff --git a/InterfaceQT/__init__.py b/InterfaceQT/__init__.py new file mode 100644 index 00000000..21d22fbc --- /dev/null +++ b/InterfaceQT/__init__.py @@ -0,0 +1,24 @@ +# -*- 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. +# +# +# ====================================================================== +""" + Ce package contient les fonctionnalités nécessaires + pour l'éditeur graphique QT +""" diff --git a/InterfaceQT/browser.py b/InterfaceQT/browser.py new file mode 100644 index 00000000..99e055bd --- /dev/null +++ b/InterfaceQT/browser.py @@ -0,0 +1,474 @@ +# -*- coding: utf-8 -*- +import os,sys,string,re,types,traceback + +from qt import * + + +from InterfaceQT import utilIcons + + +class JDCTree( QListView ): + def __init__( self, jdc_item, parent = None ): + QListView.__init__( self, parent ) + + self.item = jdc_item + self.tree = self + self.editor = parent + self.racine = self + self.node_selected = None + self.children = self.build_children() + + self.setCaption(self.trUtf8('Browser')) + self.setRootIsDecorated(1) + self.setSorting(-1) + self.addColumn(self.trUtf8('Name')) + self.addColumn(self.trUtf8('Value')) + + self.setMinimumSize(QSize(400,500)) + self.connect(self,SIGNAL('contextMenuRequested(QListViewItem *, const QPoint &, int)'), + self.handleContextMenu) + + self.connect(self, SIGNAL("onItem ( QListViewItem * ) "), self.handleOnItem) + + + def handleContextMenu(self,itm,coord,col): + """ + Private slot to show the context menu of the listview. + + @param itm the selected listview item (QListViewItem) + @param coord the position of the mouse pointer (QPoint) + @param col the column of the mouse pointer (int) + """ + try: + if itm.menu: + itm.menu.popup(coord) + except: + pass + + def handleOnItem(self, item ): + fr = item.item.get_fr() + if self.editor: + self.editor.affiche_infos(fr) + + def build_children(self): + """ Construit la liste des enfants de self """ + children = [] + child = self.item.itemNode(self,self.item) + children.append(child) + child.state='expanded' + return children + + def supprime(self): + """ supprime tous les elements de l'arbre """ + raise RuntimeError, 'Not implemented' + self.tree = None + self.racine = None + self.node_selected = None + self.item = None + self.scrolledcanvas = None + for child in self.children: + child.supprime() + self.children=[] + + def showEvent(self, event): + """ QT : pour afficher le 1er niveau d'arborescence de l''arbre""" + self.children[0].select() + + def update(self): + """ Update tous les elements de l'arbre """ + print 'TREE update' + for child in self.children: + child.update() + + def update_valid(self) : + """Cette methode a pour but de mettre a jour la validite du noeud + et de propager la demande de mise a jour a son parent + """ + print 'TREE update_valid' + +# type de noeud +COMMENT = "COMMENTAIRE" +PARAMETERS = "PARAMETRE" + + +class JDCNode(QListViewItem): + def __init__( self, parent, item, after=None, bold=0): + """ + Constructor + + @param parent parent Browser or BrowserNode + @param text text to be displayed by this node (string or QString) + @param after sibling this node is positioned after + @param bold flag indicating a highlighted font + """ + self.item = item + self.parent = parent + self.tree = self.parent.tree + self.editor = self.parent.tree.editor + self.bold = bold + + name = self.tree.trUtf8( str( item.GetLabelText()[0] ) ) + value = self.tree.trUtf8( str( item.GetText() ) ) + + if after is None: + QListViewItem.__init__(self,parent) + self.setText(0, name ) + self.setText(1, value ) + else: + QListViewItem.__init__(self,parent, after) + self.setText(0, name ) + self.setText(1, value) + + p = utilIcons.getPixmap(item.GetIconName() + ".gif") + self.setPixmap(0,p) + self.setExpandable(item.IsExpandable()) + + self.connect() + self.init() + self.createPopUpMenu() + + + def paintCell(self, p, cg, column, width, alignment): + """ + Overwritten class to set a different text color, if bold is true. + + @param p the painter (QPainter) + @param cg the color group (QColorGroup) + @param column the column (int) + @param width width of the cell (int) + @param alignment alignment of the cell (int) + """ + _cg = QColorGroup(cg) + c = _cg.text() + + if self.bold and column == 0: + _cg.setColor(QColorGroup.Text, Qt.red) + + QListViewItem.paintCell(self, p, _cg, column, width, alignment) + + _cg.setColor(QColorGroup.Text, c) + + + def setOpen(self, o): + """ + Public slot to set/reset the open state. + + @param o flag indicating the open state + """ + if o: + if not self.children : + self.build_children() + self.selected = 1 + self.tree.node_selected = self + else: + + for child in self.children: + self.takeItem(child) + del child + self.children = [] + QListViewItem.setOpen(self,o) + self.tree.setSelected(self,o) + + + #---------------------------------------------------------- + # interface a implementer par les noeuds derives (debut) + #---------------------------------------------------------- + def getPanel(self): + print self.__class__ + return None + + def createPopUpMenu(self): + pass + + #---------------------------------------------------- + # interface a implementer par les noeuds derives (fin) + #---------------------------------------------------- + + def init(self): #CS_pbruno toclean + self.state='collapsed' + self.displayed = 0 + self.selected = 0 + self.x = self.y =None + self.lasty = 0 + self.children = [] + self.id = [] + if self.parent is self.tree: + self.racine=self + else: + self.racine = self.parent.racine + + def connect(self): + self.item.connect("add",self.onAdd,()) + self.item.connect("supp",self.onSupp,()) + self.item.connect("valid",self.onValid,()) + + def commentIt(self): + """ + Cette methode a pour but de commentariser la commande pointee par self + """ + # 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 ) + commande_comment = self.item.get_objet_commentarise() + # On signale au parent du panel (le JDCDisplay) une modification + self.editor.init_modif() + self.parent.children[pos].select() + except Exception,e: + traceback.print_exc() + QMessageBox.critical( self.parent, "TOO BAD",str(e)) + return + + def unCommentIt(self): + """ + Realise la decommentarisation de self + """ + try: + pos=self.parent.children.index(self.node) + commande,nom = self.item.uncomment() + self.parent.children[pos].select() + except Exception,e: + QMessageBox.critical( self.parent, "Erreur !",str(e)) + return + + def addComment( self, after=True ): + """ + Ajoute un commentaire a l'interieur du JDC : + """ + self.editor.init_modif() + if after: + pos = 'after' + else: + pos = 'before' + return self.append_brother( COMMENT, pos ) + + def addParameters( self, after=True ): + """ + Ajoute un parametre a l'interieur du JDC : + """ + self.editor.init_modif() + if after: + pos = 'after' + else: + pos = 'before' + return self.append_brother( PARAMETERS, pos ) + + + + def select( self ): + """ + Rend le noeud courant (self) selectionne et deselectionne + tous les autres + """ + self.setOpen( True ) + + #------------------------------------------------------------------ + # Methodes de creation et destruction de noeuds + # Certaines de ces methodes peuvent etre appelees depuis l'externe + #------------------------------------------------------------------ + def append_brother(self,name,pos='after',retour='non'): + """ + Permet d'ajouter un objet frere a l'objet associe au noeud self + par defaut on l'ajoute immediatement apres + Methode externe + """ + # on veut ajouter le frere de nom name directement avant ou apres self +## print "*********** append_brother ", self.item.GetLabelText() + index = self.parent.children.index(self) + if pos == 'before': + index = index + elif pos == 'after': + index = index +1 + else: + print str(pos)," n'est pas un index valide pour append_brother" + return 0 + return self.parent.append_child(name,pos=index) + + def append_child(self,name,pos=None,verif='oui',retour='non'): + """ + Methode pour ajouter un objet fils a l'objet associe au noeud self. + On peut l'ajouter en debut de liste (pos='first'), en fin (pos='last') + ou en position intermediaire. + Si pos vaut None, on le place a la position du catalogue. + """ +## print "************** append_child ",self.item.GetLabelText() + if pos == 'first': + index = 0 + elif pos == 'last': + index = len(self.children) + elif type(pos) == types.IntType : + # position fixee + index = pos + elif type(pos) == types.InstanceType: + # pos est un item. Il faut inserer name apres pos + index = self.item.get_index(pos) +1 + elif type(name) == types.InstanceType: + index = self.item.get_index_child(name.nom) + else: + index = self.item.get_index_child(name) + obj=self.item.additem(name,index) #CS_pbruno emet le signal 'add' + #print obj + if obj is None:obj=0 + if obj == 0:return 0 + #print "append_child",index,self.children + child=self.children[index] + child.select() + return child + + def delete(self): + """ + Methode externe pour la destruction de l'objet associe au noeud + La mise a jour des noeuds est faite par onSupp sur notification + """ + self.editor.init_modif() + index = self.parent.children.index(self) - 1 + if index < 0 : index =0 + + parent=self.parent + ret=parent.item.suppitem(self.item) + if ret == 0:return + + brothers=parent.children + if brothers: + toselect=brothers[index] + else: + toselect=parent + toselect.select() + + #------------------------------------------------------------------ + def onValid(self): + self.update_node_valid() + self.update_node_label() + self.update_node_texte() + + + def onAdd(self,objet): + #print "NODE onAdd : un objet a ete ajoute aux fils de l'item ",self.item.GetLabelText() + old_nodes=self.children + self.update_nodes() + #self.select() + + def onSupp(self,objet): + #print "NODE onSupp : un objet a ete supprime des fils de l'item ",self.item.object,objet + old_nodes=self.children + self.update_nodes() + #self.select() + + def update_node_valid(self): + """Cette methode remet a jour la validite du noeud (icone) + Elle appelle isvalid + """ + #print 'NODE update_node_valid', self.item.GetLabelText() + p = utilIcons.getPixmap(self.item.GetIconName() + ".gif") + self.setPixmap(0,p) + + def update_node_label(self): #CS_pbruno todo + """ Met a jour le label du noeud """ + #print "NODE update_node_label", self.item.GetLabelText() + labeltext,fonte,couleur = self.item.GetLabelText() + self.setText(0, labeltext) + + def update_node_texte(self): + """ Met a jour les noms des SD et valeurs des mots-cles """ + #print "NODE update_node_texte", self.item.GetLabelText() + value = self.item.GetText() + self.setText(1, value) + + def update_nodes(self): + #print "NODE update_nodes ", self.item.GetLabelText() + self.setOpen( False ) + self.setOpen( True ) + #self.select() + + def update_texte(self): + """ Met a jour les noms des SD et valeurs des mots-cles """ + #print "NODE update_texte", self.item.GetLabelText() + self.update_node_texte() + if self.state == 'expanded' : + for child in self.children: + if child.displayed != 0 : child.update_texte() + + def update_valid(self) : + """Cette methode a pour but de mettre a jour la validite du noeud + et de propager la demande de mise a jour a son parent + """ + #print "NODE update_valid", self.item.GetLabelText() + self.update_node_valid() + self.parent.update_valid() + + def supprime(self): + #print "NODE supprime",self.item.GetLabelText() + self.efface_node() + self.racine = None + if not self.children : return + for child in self.children: + child.supprime() + self.children=None + + def build_children(self): + """ Construit la liste des enfants de self """ + #print "NODE : Construit la liste des enfants de", self.item.GetLabelText() + self.children = [] + sublist = self.item._GetSubList() + if sublist : + last = None + for item in sublist : + child = item.itemNode(self, item, last) + last = child + self.children.append(child) + + + + +if __name__=='__main__': + from qt import * + + + sys.path[:0]=['..','../Aster','../Aster/Cata' ] + + app = QApplication(sys.argv) + + fn = 'azAster.comm' + jdcName = os.path.basename(fn) + f=open(fn,'r') + text=f.read() + f.close() + print 'text',text + + from autre_analyse_cata import analyse_catalogue + from Cata import cataSTA8 + cata=cataSTA8 + fic_cata="../../Aster/Cata/cataSTA8/cata.py" + cata_ordonne ,list_simp_reel = analyse_catalogue(cata) + + + + j=cata.JdC( procedure=text, cata=cata, nom=jdcName, + cata_ord_dico=cata_ordonne ) + + j.compile() + if not j.cr.estvide(): + print j.cr + sys.exit() + + j.exec_compile() + if not j.cr.estvide(): + print j.cr + sys.exit() + + from Editeur import comploader + comploader.charger_composants(QT) + from Editeur import Objecttreeitem + jdc_item=Objecttreeitem.make_objecttreeitem( app, "nom", j) + + if jdc_item: + tree = JDCTree( jdc_item, None ) + + app.setMainWidget(tree) + app.connect(app, SIGNAL("lastWindowClosed()"), app, SLOT("quit()")) + tree.show() + + res = app.exec_loop() + sys.exit(res) + + diff --git a/InterfaceQT/compobloc.py b/InterfaceQT/compobloc.py new file mode 100644 index 00000000..ff386c51 --- /dev/null +++ b/InterfaceQT/compobloc.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- + +from Editeur import Objecttreeitem +from InterfaceQT import compofact +from InterfaceQT import browser +from qt import * + + +class Node(browser.JDCNode): + def getPanel(self): + """ + """ + from monMCFactPanel import MonMCFactPanel + return MonMCFactPanel(self,parent=self.editor) + + +class BLOCTreeItem(compofact.FACTTreeItem): + itemNode=Node + + def get_objet(self,name) : + for v in self.object.mc_liste: + if v.nom == name : return v + return None + + def iscopiable(self): + return 0 + + +import Accas +treeitem = BLOCTreeItem +objet = Accas.MCBLOC diff --git a/InterfaceQT/compocomm.py b/InterfaceQT/compocomm.py new file mode 100644 index 00000000..4a12cfeb --- /dev/null +++ b/InterfaceQT/compocomm.py @@ -0,0 +1,107 @@ +# -*- 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 string +from qt import * + +from Editeur import Objecttreeitem +from InterfaceQT import browser +from InterfaceQT import typeNode + + +class Node(browser.JDCNode,typeNode.PopUpMenuNodePartiel): + def getPanel( self ): + """ + """ + from monCommentairePanel import MonCommentairePanel + return MonCommentairePanel(self,parent=self.editor) + + def createPopUpMenu(self): + typeNode.PopUpMenuNodePartiel.createPopUpMenu(self) + self.menu.insertItem( qApp.translate('Browser','Uncomment'), self.unCommentIt ) + + def update_node_label(self) : + """ + """ + debComm=self.item.GetText() + self.setText(1,debComm) + + +class COMMTreeItem(Objecttreeitem.ObjectTreeItem): + itemNode=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 : un commentaire est toujours valide ... + """ + return "ast-white-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 'commentaire' #CS_pbruno,Fonte_Commentaire,None + + def get_valeur(self): + """ + Retourne la valeur de l'objet Commentaire 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): + """ + Afecte valeur à l'objet COMMENTAIRE + """ + self.object.set_valeur(valeur) + + def GetSubList(self): + """ + Retourne la liste des fils de self + """ + return [] + + + def get_objet_commentarise(self): + """ + La méthode get_objet_commentarise() de la classe compocomm.COMMTreeItem + 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' ) + +import Extensions +treeitem =COMMTreeItem +objet = Extensions.commentaire.COMMENTAIRE diff --git a/InterfaceQT/compofact.py b/InterfaceQT/compofact.py new file mode 100644 index 00000000..26f97a77 --- /dev/null +++ b/InterfaceQT/compofact.py @@ -0,0 +1,136 @@ +# -*- 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. +# +# +# ====================================================================== + +from Editeur import Objecttreeitem +from InterfaceQT import browser +from qt import * + + +class Node(browser.JDCNode): + def getPanel(self): + """ + """ + from monMCFactPanel import MonMCFactPanel + return MonMCFactPanel(self,parent=self.editor) + + def doPaste(self,node_selected): + objetACopier = self.item.get_copie_objet() + child=node_selected.doPasteMCF(objetACopier) + return child + + def doPaste_MCF(self,objetACopier): + child = self.parent.append_child(objetACopier, + pos=self.item, + retour='oui') + return child + + +class FACTTreeItem(Objecttreeitem.ObjectTreeItem): + itemNode=Node + + def IsExpandable(self): + return 1 + + def GetText(self): + return '' + + 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 + """ + # None --> fonte et couleur par défaut + return self.object.getlabeltext(),None,None + + def isvalid(self): + return self.object.isvalid() + + def iscopiable(self): + return 1 + + def GetIconName(self): + if self.object.isvalid(): + return "ast-green-los" + elif self.object.isoblig(): + return "ast-red-los" + else: + return "ast-yel-los" + + def keys(self): + keys=self.object.mc_dict.keys() + return keys + + def GetSubList(self): + """ + Reactualise la liste des items fils stockes dans self.sublist + """ + liste=self.object.mc_liste + sublist=[None]*len(liste) + # suppression des items lies aux objets disparus + for item in self.sublist: + old_obj=item.getObject() + if old_obj in liste: + pos=liste.index(old_obj) + sublist[pos]=item + else: + pass # objets supprimes ignores + # ajout des items lies aux nouveaux objets + pos=0 + for obj in liste: + if sublist[pos] is None: + # nouvel objet : on cree un nouvel item + def setfunction(value, object=obj): + object.setval(value) + item = self.make_objecttreeitem(self.appli, obj.nom + " : ", obj, setfunction) + sublist[pos]=item + pos=pos+1 + + self.sublist=sublist + return self.sublist + + def additem(self,name,pos): + objet = self.object.addentite(name,pos) + return objet + + def suppitem(self,item) : + """ + Cette methode a pour fonction de supprimer l'item passee en argument + des fils de l'item FACT qui est son pere + - item = item du MOCLE a supprimer du MOCLE pere + - item.getObject() = MCSIMP ou MCBLOC + """ + itemobject=item.getObject() + if itemobject.isoblig() : + self.appli.affiche_infos('Impossible de supprimer un mot-clé obligatoire ') + return 0 + + if self.object.suppentite(itemobject): + message = "Mot-clé " + itemobject.nom + " supprimé" + self.appli.affiche_infos(message) + return 1 + else: + self.appli.affiche_infos('Pb interne : impossible de supprimer ce mot-clé') + return 0 + +import Accas +objet = Accas.MCFACT +treeitem = FACTTreeItem diff --git a/InterfaceQT/compoformule.py b/InterfaceQT/compoformule.py new file mode 100644 index 00000000..d314ba1e --- /dev/null +++ b/InterfaceQT/compoformule.py @@ -0,0 +1,175 @@ +# -*- coding: utf-8 -*- + +""" +Ce module contient les classes permettant de définir les objets graphiques +représentant un objet de type FORMULE, cad le panneau et l'item de l'arbre +d'EFICAS +""" + +import string +from qt import * +from InterfaceQT import compooper +from InterfaceQT import browser +from InterfaceQT import typeNode + + +class FormuleNode(browser.JDCNode,typeNode.PopUpMenuNode): + + def getPanel(self): + + from monFormulePanel import MonFormulePanel + return MonFormulePanel(self,parent=self.editor) + + +class FORMULETreeItem(compooper.EtapeTreeItem): + """ + Classe servant a définir l'item porté par le noeud de l'arbre d'EFICAS + qui représente la FORMULE + """ + itemNode=Node =FormuleNode + + def init(self): + self.setfunction = self.set_valeur + +# --------------------------------------------------------------------------- +# API de FORMULE pour l'arbre +# --------------------------------------------------------------------------- + def GetSubList(self): + """ + Retourne la liste des fils de self + On considére que FORMULE n'a pas de fils + --> modification par rapport a MACRO classique + """ + # dans EFICAS on ne souhaite pas afficher les mots-clés fils de FORMULE + # de façon traditionnelle + return [] + + def GetIconName(self): + """ + Retourne le nom de l'icone à afficher dans l'arbre + Ce nom dépend de la validité de l'objet + """ + if self.object.isactif(): + self.object.state="modified" + if self.object.isvalid(): + return "ast-green-square" + else: + return "ast-red-square" + else: + return "ast-white-text" + + def GetLabelText(self): + """ Retourne 3 valeurs : + - le texte a afficher dans le noeud représentant l'item + - la fonte dans laquelle afficher ce texte + - la couleur du texte + """ + if self.object.isactif(): + # None --> fonte et couleur par défaut + return self.labeltext,None,None + else: + return self.labeltext,fontes.standard_italique,None + +# --------------------------------------------------------------------------- +# Méthodes permettant la modification et la lecture des attributs +# du paramètre = API graphique de la FORMULE pour Panel et EFICAS +# --------------------------------------------------------------------------- + + def get_nom(self): + """ + Retourne le nom de la FORMULE + """ + return self.object.get_nom() + + def get_type(self): + """ + Retourne le type de la valeur retournée par la FORMULE + """ + return self.object.type_retourne + + def get_args(self): + """ + Retourne les arguments de la FORMULE + """ + args="" + for mot in self.object.mc_liste: + if mot.nom == 'NOM_PARA': + args=mot.valeur + break + if args : + if args[0] == "(" and args[-1] ==")": + args=args[1:-1] + # transforme en tuple si ce n est pas déja le casa + try : + args=string.split(args,',') + except : + pass + return args + + def get_corps(self): + """ + Retourne le corps de la FORMULE + """ + corps="" + for mot in self.object.mc_liste: + if mot.nom == 'VALE': + corps=mot.valeur + break + return corps + + + def get_liste_types_autorises(self): + """ + Retourne la liste des types autorises pour les valeurs de sortie + d'une FORMULE + """ + return self.object.l_types_autorises + + def save_formule(self,new_nom,new_typ,new_arg,new_exp): + """ + Vérifie si (new_nom,new_typ,new_arg,new_exp) définit bien une FORMULE + licite : + - si oui, stocke ces paramètres comme nouveaux paramètres de la + FORMULE courante et retourne 1 + - si non, laisse les paramètres anciens de la FORMULE inchangés et + retourne 0 + """ + test,erreur = self.object.verif_formule_python(formule=(new_nom,new_typ,new_arg, + new_exp)) + if test : + # la formule est bien correcte : on sauve les nouveaux paramètres + test=self.object.update_formule_python(formule=(new_nom,new_typ,new_exp,new_arg)) + return test,erreur + +# --------------------------------------------------------------------------- +# Accès aux méthodes de vérification de l'objet FORM_ETAPE +# --------------------------------------------------------------------------- + + def verif_nom(self,nom): + """ + Lance la vérification du nom passé en argument + """ + return self.object.verif_nom(nom) + + def verif_arguments(self,arguments): + """ + Lance la vérification des arguments passés en argument + """ + return self.object.verif_arguments('('+arguments+')') + + def verif_formule(self,formule): + """ + Lance la vérification de FORMULE passée en argument + """ + return self.object.verif_formule(formule=formule) + + + def verif_formule_python(self,formule): + """ + Lance la vérification de FORMULE passée en argument + """ + return self.object.verif_formule_python(formule=formule) + +import Accas +treeitem =FORMULETreeItem +objet = Accas.FORM_ETAPE diff --git a/InterfaceQT/compojdc.py b/InterfaceQT/compojdc.py new file mode 100644 index 00000000..288e4bec --- /dev/null +++ b/InterfaceQT/compojdc.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- + +from qt import * +from Editeur import Objecttreeitem +from InterfaceQT import browser + + +class Node(browser.JDCNode): + def getPanel(self): + """ + """ + from monRacinePanel import MonRacinePanel + return MonRacinePanel(self,parent=self.editor) + + def doPasteCommande(self,objet_a_copier): + """ + Réalise la copie de l'objet passé en argument qui est nécessairement + une commande + """ + child = self.append_child(objet_a_copier,pos='first',retour='oui') + return child + + +class JDCTreeItem(Objecttreeitem.ObjectTreeItem): + itemNode=Node + + def IsExpandable(self): + return 1 + + def GetText(self): + return " " + + def GetLabelText(self): + # None --> fonte et couleur par défaut + return self.object.nom,None,None + + def get_jdc(self): + """ + Retourne l'objet pointé par self + """ + return self.object + + def GetIconName(self): + if self.object.isvalid(): + return "ast-green-square" + else: + return "ast-red-square" + + def keys(self): + if self.object.etapes_niveaux != []: + return range(len(self.object.etapes_niveaux)) + else: + return range(len(self.object.etapes)) + + def additem(self,name,pos): + cmd = self._object.addentite(name,pos) + return cmd + + def suppitem(self,item) : + # item = item de l'ETAPE à supprimer du JDC + # item.getObject() = ETAPE ou COMMENTAIRE + # self.object = JDC + + itemobject=item.getObject() + if self.object.suppentite(itemobject): + if itemobject.nature == "COMMENTAIRE" : + message = "Commentaire supprimé" + else : + message = "Commande " + itemobject.nom + " supprimée" + self.appli.affiche_infos(message) + return 1 + else: + self.appli.affiche_infos("Pb interne : impossible de supprimer cet objet") + return 0 + + def GetSubList(self): + """ + Retourne la liste des items fils de l'item jdc. + Cette liste est conservee et mise a jour a chaque appel + """ + if self.object.etapes_niveaux != []: + liste = self.object.etapes_niveaux + else: + liste = self.object.etapes + sublist=[None]*len(liste) + # suppression des items lies aux objets disparus + for item in self.sublist: + old_obj=item.getObject() + if old_obj in liste: + pos=liste.index(old_obj) + sublist[pos]=item + else: + pass # objets supprimes ignores + # ajout des items lies aux nouveaux objets + pos=0 + for obj in liste: + if sublist[pos] is None: + # nouvel objet : on cree un nouvel item + item = self.make_objecttreeitem(self.appli, obj.nom + " : ", obj) + sublist[pos]=item + pos=pos+1 + + self.sublist=sublist + return self.sublist + + def get_l_noms_etapes(self): + """ Retourne la liste des noms des étapes de self.object""" + return self.object.get_l_noms_etapes() + + def get_liste_cmd(self): + listeCmd = self.object.niveau.definition.get_liste_cmd() + return listeCmd + +import Accas +treeitem =JDCTreeItem +objet = Accas.JDC diff --git a/InterfaceQT/compomacro.py b/InterfaceQT/compomacro.py new file mode 100644 index 00000000..e59138f1 --- /dev/null +++ b/InterfaceQT/compomacro.py @@ -0,0 +1,170 @@ +# -*- coding: utf-8 -*- + +# Modules Python +import os,sys,string +import types +import traceback +from qt import * + +# Modules Eficas +from Editeur import Objecttreeitem +from InterfaceQT import compooper +from InterfaceQT import browser +from InterfaceQT import typeNode + +import convert + +class MACRONode(browser.JDCNode,typeNode.PopUpMenuNode): + def getPanel(self): + from monMacroPanel import MonMacroPanel + return MonMacroPanel (self,parent=self.editor ) + + def createPopUpMenu(self): + typeNode.PopUpMenuNode.createPopUpMenu(self) + + +class MACROTreeItem(compooper.EtapeTreeItem): + """ Cette classe hérite d'une grande partie des comportements + de la classe compooper.EtapeTreeItem + """ + itemNode=MACRONode + +class INCLUDETreeItemBase(MACROTreeItem): + + def __init__(self,appli, labeltext, object, setfunction): + MACROTreeItem.__init__(self,appli, labeltext, object, setfunction) + + def iscopiable(self): + """ + Retourne 1 si l'objet est copiable, 0 sinon + """ + return 0 + + +class INCLUDENode(browser.JDCNode,typeNode.PopUpMenuNode): +## def getPanel(self): +## """ +## """ +## return INCLUDEPanel( self, self.editor ) + + def makeEdit(self): #,appli,node + if self.item.object.text_converted == 0: + # Le texte du fichier inclus n'a pas pu etre converti par le module convert + msg="Le fichier de commande n'a pas pu etre converti pour etre editable par Eficas\n\n" + msg=msg+self.item.object.text_error + return + + if not hasattr(self.item.object,"jdc_aux") or self.item.object.jdc_aux is None: + #L'include n'est pas initialise + self.item.object.build_include(None,"") + + # On cree un nouvel onglet dans le bureau +## appli.bureau.ShowJDC( self.item.object.jdc_aux, +## self.item.object.jdc_aux.nom, +## label_onglet=None, +## JDCDISPLAY=macrodisplay.MACRODISPLAY) + self.editor.vm.displayJDC( self.item.object.jdc_aux ) #, self.item.object.jdc_aux.nom ) + + def makeView(self):#,appli,node): + pass #CS_pbruno todo + + + +class INCLUDETreeItem(INCLUDETreeItemBase): +## panel=INCLUDEPanel + itemNode=INCLUDENode + + + +class POURSUITENode(browser.JDCNode, typeNode.PopUpMenuNode): +## def getPanel(self): +## """ +## """ +## return INCLUDEPanel( self, self.editor ) + + def makeEdit(self): #,appli,node + if self.item.object.text_converted == 0: + # Le texte du fichier inclus n'a pas pu etre converti par le module convert + msg="Le fichier de commande n'a pas pu etre converti pour etre editable par Eficas\n\n" + msg=msg+self.item.object.text_error +## Fenetre(self,titre="Poursuite non editable",texte=msg,wrap='none') #CS_pbruno todo + return + + if not hasattr(self.item.object,"jdc_aux") or self.item.object.jdc_aux is None: + #La poursuite n'est pas initialisee + text="""DEBUT() + FIN()""" + self.object.build_poursuite(None,text) + + # On cree un nouvel onglet dans le bureau +## appli.bureau.ShowJDC( self.item.object.jdc_aux, +## self.item.object.jdc_aux.nom, +## label_onglet=None, +## JDCDISPLAY=macrodisplay.MACRODISPLAY) + self.editor.vm.displayJDC( self.item.object.jdc_aux ) #, self.item.object.jdc_aux.nom ) + + def makeView(self):#,appli,node): + pass #CS_pbruno todo + + + +class POURSUITETreeItem(INCLUDETreeItemBase): + itemNode=POURSUITENode +## def makeEdit(self,appli,node): +## if self.object.text_converted == 0: +## # Le texte du fichier inclus n'a pas pu etre converti par le module convert +## msg="Le fichier de commande n'a pas pu etre converti pour etre editable par Eficas\n\n" +## msg=msg+self.object.text_error +## Fenetre(self,titre="Poursuite non editable",texte=msg,wrap='none') +## return +## +## if not hasattr(self.object,"jdc_aux") or self.object.jdc_aux is None: +## #La poursuite n'est pas initialisee +## text="""DEBUT() +##FIN()""" +## self.object.build_poursuite(None,text) +## +## # On cree un nouvel onglet dans le bureau +## appli.bureau.ShowJDC(self.object.jdc_aux,self.object.jdc_aux.nom, +## label_onglet=None, +## JDCDISPLAY=macrodisplay.MACRODISPLAY) +## +## def makeView(self,appli,node): +## if not hasattr(self.object,"jdc_aux") or self.object.jdc_aux is None: +## showerror("Poursuite vide","Une POURSUITE doit etre correctement initialisée pour etre visualisée") +## return +## nom=self.object.nom +## if hasattr(self.object,'fichier_ini'): +## if self.object.fichier_ini is None: +## nom=nom+' '+"Fichier non défini" +## else: +## nom=nom+' '+self.object.fichier_ini +## macdisp=macrodisplay.makeMacroDisplay(appli,self,nom) + +class INCLUDE_MATERIAUTreeItem(INCLUDETreeItemBase): + rmenu_specs=[("View","makeView"), + ] + def iscopiable(self): + """ + Retourne 1 si l'objet est copiable, 0 sinon + """ + return 1 + + +def treeitem(appli, labeltext, object, setfunction=None): + """ Factory qui retourne l'item adapté au type de macro : + INCLUDE, POURSUITE, MACRO + """ + if object.nom == "INCLUDE_MATERIAU": + return INCLUDE_MATERIAUTreeItem(appli, labeltext, object, setfunction) + elif object.nom == "INCLUDE": + return INCLUDETreeItem(appli, labeltext, object, setfunction) + elif object.nom == "POURSUITE": + return POURSUITETreeItem(appli, labeltext, object, setfunction) + else: + return MACROTreeItem(appli, labeltext, object, setfunction) + +import Accas +objet=Accas.MACRO_ETAPE + +#import macrodisplay diff --git a/InterfaceQT/compomclist.py b/InterfaceQT/compomclist.py new file mode 100644 index 00000000..256f0f68 --- /dev/null +++ b/InterfaceQT/compomclist.py @@ -0,0 +1,206 @@ +# -*- coding: utf-8 -*- + +import types +import traceback + +from qt import * + +from InterfaceQT import compofact +from InterfaceQT import browser +from Editeur import Objecttreeitem +from Noyau.N_OBJECT import ErrorObj +#import compoerror + + +class Node(browser.JDCNode): + def getPanel(self): + """ + """ + if self.item.isMCList() : + if self.item.ajout_possible(): + from monMCListAjoutPanel import MonMCListAjoutPanel + return MonMCListAjoutPanel(self,parent=self.editor) + else : + print "MCList" + elif self.item.isMCFact() : + from monMCFactPanel import MonMCFactPanel + return MonMCFactPanel(self,parent=self.editor) + else : + print "MCList" + print "kkkkkkkkkkkkkkkkkkkkk" + + def doPaste(self,node_selected): + objet_a_copier = self.item.get_copie_objet() + child=node_selected.doPaste_MCF(objet_a_copier) + #print "doPaste",child + return child + + def doPaste_MCF(self,objet_a_copier): + child=None + # le noeud courant est une MCList + if self.item.isMCList() : + child = self.append_child(objet_a_copier,pos='first',retour='oui') + + # le noeud courant est un MCFACT + elif self.item.isMCFact() : + # le noeud selectionne est un MCFACT dans une MCList + if self.parent.item.isMCList(): + child = self.parent.append_child(objet_a_copier, + pos=self.item, + retour='oui') + + # le noeud MCFACT selectionne n'est pas dans une MCList + else: + child = self.parent.append_child(objet_a_copier,retour='oui') + + else: + QMessageBox.information( self, "Copie impossible", + "Vous ne pouvez coller le mot-clé facteur copié à ce niveau de l'arborescence !") + self.editor.affiche_infos("Copie refusée") + + return child + +class MCListTreeItem(Objecttreeitem.SequenceTreeItem,compofact.FACTTreeItem): + """ La classe MCListTreeItem joue le role d'un adaptateur pour les objets + du noyau Accas instances de la classe MCLIST. + Elle adapte ces objets pour leur permettre d'etre intégrés en tant que + noeuds dans un arbre graphique (voir treewidget.py et ObjectTreeItem.py). + Cette classe délègue les appels de méthode et les accès + aux attributs à l'objet du noyau soit manuellement soit + automatiquement (voir classe Delegate et attribut object). + """ + itemNode=Node + + def init(self): + # Si l'objet Accas (MCList) a moins d'un mot cle facteur + # on utilise directement ce mot cle facteur comme delegue + self.updateDelegate() + + def updateDelegate(self): + if len(self._object) > 1: + self.setdelegate(self._object) + else: + self.setdelegate(self._object.data[0]) + + def panel(self,jdcdisplay,pane,node): + """ Retourne une instance de l'objet panneau associe a l'item (self) + Si la liste ne contient qu'un mot clé facteur, on utilise le panneau + FACTPanel. + Si la liste est plus longue on utilise le panneau MCLISTPanel. + """ + if len(self._object) > 1: + return MCLISTPanel(jdcdisplay,pane,node) + elif isinstance(self._object.data[0],ErrorObj): + return compoerror.ERRORPanel(jdcdisplay,pane,node) + else: + return compofact.FACTPanel(jdcdisplay,pane,node) + + def IsExpandable(self): + if len(self._object) > 1: + return Objecttreeitem.SequenceTreeItem.IsExpandable(self) + else: + return compofact.FACTTreeItem.IsExpandable(self) + + def GetSubList(self): + self.updateDelegate() + if len(self._object) <= 1: + self._object.data[0].alt_parent=self._object + return compofact.FACTTreeItem.GetSubList(self) + + liste=self._object.data + sublist=[None]*len(liste) + # suppression des items lies aux objets disparus + for item in self.sublist: + old_obj=item.getObject() + if old_obj in liste: + pos=liste.index(old_obj) + sublist[pos]=item + else: + pass # objets supprimes ignores + # ajout des items lies aux nouveaux objets + pos=0 + for obj in liste: + if sublist[pos] is None: + # nouvel objet : on cree un nouvel item + def setfunction(value, object=obj): + object=value + item = self.make_objecttreeitem(self.appli, obj.nom + " : ", obj, setfunction) + sublist[pos]=item + #Attention : on ajoute une information supplementaire pour l'actualisation de + # la validite. L'attribut parent d'un MCFACT pointe sur le parent de la MCLISTE + # et pas sur la MCLISTE elle meme ce qui rompt la chaine de remontee des + # informations de validite. alt_parent permet de remedier a ce defaut. + obj.alt_parent=self._object + pos=pos+1 + + self.sublist=sublist + return self.sublist + + def GetIconName(self): + if self._object.isvalid(): + return "ast-green-los" + elif self._object.isoblig(): + return "ast-red-los" + else: + return "ast-yel-los" + + def get_docu(self): + """ Retourne la clef de doc de l'objet pointé par self """ + return self.object.get_docu() + + def iscopiable(self): + if len(self._object) > 1: + return Objecttreeitem.SequenceTreeItem.iscopiable(self) + else: + return compofact.FACTTreeItem.iscopiable(self) + + def isMCFact(self): + """ + Retourne 1 si l'objet pointé par self est un MCFact, 0 sinon + """ + return len(self._object) <= 1 + + def isMCList(self): + """ + Retourne 1 si l'objet pointé par self est une MCList, 0 sinon + """ + return len(self._object) > 1 + + def get_copie_objet(self): + return self._object.data[0].copy() + + def additem(self,obj,pos): + #print "compomclist.additem",obj,pos + if len(self._object) <= 1: + return compofact.FACTTreeItem.additem(self,obj,pos) + + o= self.object.addentite(obj,pos) + return o + + def suppitem(self,item): + """ + Retire un objet MCFACT de la MCList (self.object) + """ + #print "compomclist.suppitem",item + obj=item.getObject() + if len(self._object) <= 1: + return compofact.FACTTreeItem.suppitem(self,item) + + if self.object.suppentite(obj): + if len(self._object) == 1: self.updateDelegate() + message = "Mot-clef " + obj.nom + " supprimé" + self.appli.affiche_infos(message) + return 1 + else: + self.appli.affiche_infos('Impossible de supprimer ce mot-clef') + return 0 + + +import Accas +objet = Accas.MCList + +def treeitem(appli,labeltext,object,setfunction): + """ Factory qui produit un objet treeitem adapte a un objet + Accas.MCList (attribut objet de ce module) + """ + return MCListTreeItem(appli,labeltext,object,setfunction) diff --git a/InterfaceQT/componiveau.py b/InterfaceQT/componiveau.py new file mode 100644 index 00000000..37b38b7f --- /dev/null +++ b/InterfaceQT/componiveau.py @@ -0,0 +1,98 @@ +# -*- coding: utf-8 -*- + +from qt import * +from Editeur import Objecttreeitem +from Extensions import commentaire +from InterfaceQT import browser + +class Node(browser.JDCNode): pass +## def getPanel(self): +## """ +## """ +## return NIVEAUPanel( self, self.editor ) + +class NIVEAUTreeItem(Objecttreeitem.ObjectTreeItem): +## panel = NIVEAUPanel + itemNode=Node + + def isactif(self): + return self.object.isactif() + + def IsExpandable(self): + return 1 + + 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 + """ + if self.isactif(): + fonte = Fonte_Niveau + else : + fonte = Fonte_Niveau_inactif + return self.labeltext,fonte,'#00008b' + + def GetIconName(self): + if self.isactif(): + if self.object.isvalid(): + return "ast-green-text" + else: + return "ast-red-text" + else: + return "ast-white-text" + + def keys(self): + if self.object.etapes_niveaux != []: + return range(len(self.object.etapes_niveaux)) + else: + return range(len(self.object.etapes)) + + def GetSubList(self): + sublist=[] + for key in self.keys(): + if self.object.etapes_niveaux != []: + liste = self.object.etapes_niveaux + else: + liste = self.object.etapes + try: + value = liste[key] + except KeyError: + continue + def setfunction(value, key=key, object=liste): + object[key] = value + item =self.make_objecttreeitem(self.appli,value.ident() + " : ", value, setfunction) + sublist.append(item) + return sublist + + def additem(self,name,pos): + if isinstance(name,Objecttreeitem.TreeItem) : + cmd=self.object.addentite(name.getObject(),pos) + else : + cmd = self.object.addentite(name,pos) + item = self.make_objecttreeitem(self.appli,cmd.nom + " : ", cmd) + return item + + def suppitem(self,item) : + # item = item de l'ETAPE à supprimer du JDC + # item.getObject() = ETAPE ou COMMENTAIRE + # self.object = JDC + itemobject=item.getObject() + if self.object.suppentite(itemobject): + if isinstance(item.object,commentaire.COMMENTAIRE): + message = "Commentaire supprimé" + else : + message = "Commande " + itemobject.nom + " supprimée" + self.appli.affiche_infos(message) + return 1 + else: + self.appli.affiche_infos("Pb interne : impossible de supprimer cet objet") + return 0 + + def GetText(self): + return '' + + +import Accas +treeitem = NIVEAUTreeItem +objet = Accas.ETAPE_NIVEAU diff --git a/InterfaceQT/componuplet.py b/InterfaceQT/componuplet.py new file mode 100644 index 00000000..649ce0e2 --- /dev/null +++ b/InterfaceQT/componuplet.py @@ -0,0 +1,85 @@ +# -*- 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 types +from repr import Repr +from copy import copy,deepcopy + +# Modules Eficas +from Editeur import Objecttreeitem + +myrepr = Repr() +myrepr.maxstring = 100 +myrepr.maxother = 100 + +# Si Expandable vaut 1 les éléments du nuplet apparaissent dans l'arbre +# Si Expandable vaut 0 les éléments n'apparaissent pas +Expandable=1 + + +import browser +from qt import * + +class Node(browser.JDCNode): pass +## def getPanel(self): +## """ +## """ +## return NUPLETPanel( self, self.editor ) + + +class NUPLETTreeItem(Objecttreeitem.ObjectTreeItem): +## panel=NUPLETPanel + itemNode=Node + + def IsExpandable(self): + return Expandable + + def GetText(self): + return '' + + def isvalid(self): + return self.object.isvalid() + + def GetIconName(self): + if self.object.isvalid(): + return "ast-green-los" + elif self.object.isoblig(): + return "ast-red-los" + else: + return "ast-yel-los" + + def GetSubList(self): + if not Expandable:return [] + sublist=[] + for obj in self.object.mc_liste: + item = self.make_objecttreeitem(self.appli, obj.nom + " : ", obj, None) + sublist.append(item) + return sublist + + def additem(self,name,pos): + raise "NUPLET" + + def suppitem(self,item) : + raise "NUPLET" + +import Accas +treeitem=NUPLETTreeItem +objet=Accas.MCNUPLET diff --git a/InterfaceQT/compooper.py b/InterfaceQT/compooper.py new file mode 100644 index 00000000..5e84c736 --- /dev/null +++ b/InterfaceQT/compooper.py @@ -0,0 +1,247 @@ +# -*- coding: utf-8 -*- + +import traceback +import string + +from qt import * + +from Editeur import Objecttreeitem +from InterfaceQT import browser +from InterfaceQT import typeNode + +class Node(browser.JDCNode, typeNode.PopUpMenuNode): + def getPanel( self ): + """ + """ + from monCommandePanel import MonCommandePanel + return MonCommandePanel(self,parent=self.editor) + + def createPopUpMenu(self): + typeNode.PopUpMenuNode.createPopUpMenu(self) + + def doPaste(self,node_selected): + """ + Déclenche la copie de l'objet item avec pour cible + l'objet passé en argument : node_selected + """ + objet_a_copier = self.item.get_copie_objet() + child=node_selected.doPaste_Commande(objet_a_copier) + return child + + def doPasteCommande(self,objet_a_copier): + """ + Réalise la copie de l'objet passé en argument qui est nécessairement + une commande + """ + parent=self.parent + #child = parent.item.append_child(objet_a_copier,self.item.getObject()) + child = self.append_brother(objet_a_copier,retour='oui') + #if child is None:return 0 + return child + + def doPaste_MCF(self,objet_a_copier): + """ + Réalise la copie de l'objet passé en argument (objet_a_copier) + Il s'agit forcément d'un mot clé facteur + """ + child = self.append_child(objet_a_copier,pos='first',retour='oui') + return child + + +class EtapeTreeItem(Objecttreeitem.ObjectTreeItem): + """ La classe EtapeTreeItem est un adaptateur des objets ETAPE du noyau + Accas. Elle leur permet d'etre affichés comme des noeuds + d'un arbre graphique. + Cette classe a entre autres deux attributs importants : + - _object qui est un pointeur vers l'objet du noyau + - object qui pointe vers l'objet auquel sont délégués les + appels de méthode et les accès aux attributs + Dans le cas d'une ETAPE, _object et object pointent vers le + meme objet. + """ +## panel = OPERPanel + itemNode=Node + + def IsExpandable(self): + return 1 + + def GetIconName(self): + """ + Retourne le nom de l'icône à afficher dans l'arbre + Ce nom dépend de la validité de l'objet + """ + if not self.object.isactif(): + return "ast-white-square" + elif self.object.isvalid(): + return "ast-green-square" + else: + return "ast-red-square" + + 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 + """ + if self.object.isactif(): + # None --> fonte et couleur par défaut + return self.labeltext,None,None + else: + return self.labeltext, None, None #CS_pbruno todo +## return self.labeltext,fontes.standard_italique,None + + def get_objet(self,name) : + for v in self.object.mc_liste: + if v.nom == name : return v + return None + + def get_type_sd_prod(self): + """ + Retourne le nom du type du concept résultat de l'étape + """ + sd_prod=self.object.get_type_produit() + if sd_prod: + return sd_prod.__name__ + else: + return "" + + def additem(self,name,pos): + print "CS_PBRUNO compooper.additem",name,pos + mcent = self._object.addentite(name,pos) + print "CS_PBRUNO mcent ",mcent + return mcent + + + def suppitem(self,item) : + # item : item du MOCLE de l'ETAPE à supprimer + # item.getObject() = MCSIMP, MCFACT, MCBLOC ou MCList + itemobject=item.getObject() + if itemobject.isoblig() : + self.appli.affiche_infos('Impossible de supprimer un mot-clé obligatoire ') + return 0 + if self.object.suppentite(itemobject): + message = "Mot-clé " + itemobject.nom + " supprimé" + self.appli.affiche_infos(message) + return 1 + else : + self.appli.affiche_infos('Pb interne : impossible de supprimer ce mot-clé') + return 0 + + def GetText(self): + try: + return self.object.get_sdname() + except: + return '' + + def keys(self): + keys=self.object.mc_dict.keys() + return keys + + def GetSubList(self): + """ + Reactualise la liste des items fils stockes dans self.sublist + """ + if self.isactif(): + liste=self.object.mc_liste + else: + liste=[] + + sublist=[None]*len(liste) + # suppression des items lies aux objets disparus + for item in self.sublist: + old_obj=item.getObject() + if old_obj in liste: + pos=liste.index(old_obj) + sublist[pos]=item + else: + pass # objets supprimes ignores + + # ajout des items lies aux nouveaux objets + pos=0 + for obj in liste: + if sublist[pos] is None: + # nouvel objet : on cree un nouvel item + def setfunction(value, object=obj): + object.setval(value) + item = self.make_objecttreeitem(self.appli, obj.nom + " : ", obj, setfunction) + sublist[pos]=item + pos=pos+1 + + self.sublist=sublist + return self.sublist + + def isvalid(self): + return self.object.isvalid() + + def iscopiable(self): + """ + Retourne 1 si l'objet est copiable, 0 sinon + """ + return 1 + + def update(self,item): + if item.sd and item.sd.nom: + self.nomme_sd(item.sd.nom) + + def nomme_sd(self,nom): + """ Lance la méthode de nommage de la SD """ + oldnom="" + if self.object.sd != None : + oldnom=self.object.sd.nom + test,mess= self.object.nomme_sd(nom) + if test:self.object.parent.reset_context() + if (test and self.appli.dict_reels.has_key(oldnom) ): + self.appli.dict_reels[nom]=self.appli.dict_reels[oldnom] + return test,mess + + def is_reentrant(self): + return self.object.is_reentrant() + + def get_noms_sd_oper_reentrant(self): + return self.object.get_noms_sd_oper_reentrant() + + def get_objet_commentarise(self): + """ + Cette méthode retourne un objet commentarisé + représentatif de self.object + """ + # Format de fichier utilisé + format=self.appli.format_fichier.get() + return self.object.get_objet_commentarise(format) + + def get_objet_commentarise_BAK(self): + """ + Cette méthode retourne un objet commentarisé + représentatif de self.object + """ + import generator,string,Accas + # Format de fichier utilisé + format=self.appli.format_fichier.get() + g=generator.plugins[format]() + texte_commande = g.gener(self.object,format='beautifie') + # Il faut enlever la première ligne vide de texte_commande que + # rajoute le generator + rebut,texte_commande = string.split(texte_commande,'\n',1) + # on construit l'objet COMMANDE_COMM repésentatif de self mais non + # enregistré dans le jdc + commande_comment = Accas.COMMANDE_COMM(texte=texte_commande,reg='non', + parent=self.object.parent) + commande_comment.niveau = self.object.niveau + commande_comment.jdc = commande_comment.parent = self.object.jdc + + pos=self.object.parent.etapes.index(self.object) + parent=self.object.parent + self.object.parent.suppentite(self.object) + parent.addentite(commande_comment,pos) + + return commande_comment + + def visu_3D(self,appli,node) : + import TroisDPal + troisD=TroisDPal.TroisDPilote(node.item,appli,node.parent) + troisD.envoievisu() + +import Accas +treeitem = EtapeTreeItem +objet = Accas.ETAPE + diff --git a/InterfaceQT/compoparam.py b/InterfaceQT/compoparam.py new file mode 100644 index 00000000..989c79c9 --- /dev/null +++ b/InterfaceQT/compoparam.py @@ -0,0 +1,118 @@ +# -*- coding: utf-8 -*- +""" + Ce module contient les classes permettant de définir les objets graphiques + représentant un objet de type PARAMETRE, cad le panneau et l'item de l'arbre + d'EFICAS +""" + +# import modules Python +import string +from qt import * + +# import modules EFICAS +from Editeur import Objecttreeitem +from InterfaceQT import browser + +class Node(browser.JDCNode): pass +## def getPanel(self): +## """ +## """ +## return PARAMPanel( self, self.editor ) + + +class PARAMTreeItem(Objecttreeitem.ObjectTreeItem): + """ + Classe servant à définir l'item porté par le noeud de l'arbre d'EFICAS + qui représente le PARAMETRE + """ + itemNode=Node +## panel = PARAMPanel + + def init(self): + self.setfunction = self.set_valeur + +# --------------------------------------------------------------------------- +# API du PARAMETRE pour l'arbre +# --------------------------------------------------------------------------- + + def GetIconName(self): + """ + Retourne le nom de l'icone associée au noeud qui porte self, + dépendant de la validité de l'objet + NB : un PARAMETRE est toujours valide ... + """ + if self.isactif(): + if self.isvalid(): + return "ast-green-square" + else: + return "ast-red-square" + else: + return "ast-white-square" + + 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 'Paramêtre',None,None #CS_pbruno todo +## return 'Paramêtre',Fonte_PARAMETRE,None + + def GetText(self): + """ + Retourne le texte à afficher aprês le nom de la commande (ici aprês 'paramêtre') + Ce texte est tronqué à 25 caractêres + """ + texte = repr(self.object) + texte = string.split(texte,'\n')[0] + if len(texte) < 25 : + return texte + else : + return texte[0:24]+'...' + + def GetSubList(self): + """ + Retourne la liste des fils de self + """ + return [] + +# --------------------------------------------------------------------------- +# Méthodes permettant la modification et la lecture des attributs +# du paramêtre = API graphique du PARAMETRE pour Panel et EFICAS +# --------------------------------------------------------------------------- + + def get_valeur(self): + """ + Retourne la valeur de l'objet PARAMETRE cad son texte + """ + if self.object.valeur is None: return '' + else: return self.object.valeur + + def get_nom(self): + """ + Retourne le nom du paramêtre + """ + return self.object.nom + + def set_valeur(self,new_valeur): + """ + Affecte valeur à l'objet PARAMETRE + """ + self.object.set_valeur(new_valeur) + + def set_nom(self,new_nom): + """ + Renomme le paramêtre + """ + self.object.set_nom(new_nom) + #self.object.set_attribut('nom',new_nom) + + def get_fr(self): + """ + Retourne le fr associé au paramêtre, cad la bulle d'aide pour EFICAS + """ + return "Définition d'un paramêtre" + +import Extensions.parametre +treeitem =PARAMTreeItem +objet = Extensions.parametre.PARAMETRE diff --git a/InterfaceQT/compoparameval.py b/InterfaceQT/compoparameval.py new file mode 100644 index 00000000..ff0d1b94 --- /dev/null +++ b/InterfaceQT/compoparameval.py @@ -0,0 +1,153 @@ +# -*- coding: utf-8 -*- + +""" +Ce module contient les classes permettant de définir les objets graphiques +représentant un objet de type PARAMETRE_EVAL, cad le panneau et l'item de l'arbre +d'EFICAS +""" + +# import modules Python +import string + +# import modules EFICAS + +import Objecttreeitem + + +import browser +from qt import * + +class Node(browser.JDCNode): pass +## def getPanel(self): +## """ +## """ +## return PARAM_EVALPanel( self, self.editor ) + + +class PARAM_EVALTreeItem(Objecttreeitem.ObjectTreeItem): + """ + Classe servant a définir l'item porté par le noeud de l'arbre d'EFICAS + qui représente le PARAMETRE + """ + itemNode=Node +## panel = PARAM_EVALPanel + + def init(self): + self.setfunction = self.set_valeur + +# --------------------------------------------------------------------------- +# API du PARAMETRE pour l'arbre +# --------------------------------------------------------------------------- + + def GetIconName(self): + """ + Retourne le nom de l'icone associée au noeud qui porte self, + dépendant de la validité de l'objet + NB : un PARAMETRE est toujours valide ... + """ + if self.isactif(): + if self.isvalid(): + return "ast-green-square" + else: + return "ast-red-square" + else: + return "ast-white-square" + + def GetLabelText(self): + """ Retourne 3 valeurs : + - le texte a afficher dans le noeud représentant l'item + - la fonte dans laquelle afficher ce texte + - la couleur du texte + """ + return 'EVAL',Fonte_PARAMETRE,None + + def GetText(self): + """ + Retourne le texte a afficher apres le nom de la commande (ici apres 'parametre') + Ce texte est tronqué a 25 caracteres + """ + texte = repr(self.object) + texte = string.split(texte,'\n')[0] + if len(texte) < 25 : + return texte + else : + return texte[0:24]+'...' + + def GetSubList(self): + """ + Retourne la liste des fils de self + """ + return [] + +# --------------------------------------------------------------------------- +# Méthodes permettant la modification et la lecture des attributs +# du parametre = API graphique du PARAMETRE pour Panel et EFICAS +# --------------------------------------------------------------------------- + + def isvalid(self): + """ + Indique si l'objet pointé par self est valide + """ + return self.object.isvalid() + + def get_valeur(self): + """ + Retourne une chaine représentant la valeur de l'objet PARAMETRE + cad de l'objet class_eval.EVAL + """ + return self.object.get_valeur() or '' + + def get_nom(self): + """ + Retourne le nom du parametre + """ + return self.object.get_nom() + + def set_valeur(self,new_valeur): + """ + Affecte new_valeur a l'objet PARAMETRE_EVAL + """ + # on construit le texte de la nouvelle valeur + new_valeur = 'EVAL("""'+new_valeur+'""")' + # on affecte la nouvelle valeur a self.object + self.object.set_valeur(new_valeur) + + def set_nom(self,new_nom): + """ + Renomme le parametre + """ + self.object.set_nom(new_nom) + + def get_fr(self): + """ + Retourne le fr associé au parametre, cad la bulle d'aide pour EFICAS + """ + return "Définition d'un parametre de type EVAL" + + def verif_nom(self,nom): + """ + Lance la vérification de validité du nom passé en argument + """ + return self.object.verif_nom(nom = nom) + + def verif_eval(self,valeur): + """ + Lance la vérification de validité de l'expression EVAL passée en argument + """ + return self.object.verif_eval(exp_eval = valeur) + + def save_parametre_eval(self,new_nom,new_val): + """ + Vérifie si (new_nom,new_val) définit bien un EVAL licite : + - si oui, stocke ces parametres comme nouveaux parametres de l'EVAL courant et retourne 1 + - si non, laisse les parametres anciens de EVAL inchangés et retourne 0 + """ + test,erreur = self.object.verif_parametre_eval(param=(new_nom,new_val)) + if test : + # la formule est bien correcte : on sauve les nouveaux parametres + self.object.update(param=(new_nom,new_val)) + return test,erreur + +import Extensions.parametre_eval +treeitem =PARAM_EVALTreeItem +objet = Extensions.parametre_eval.PARAMETRE_EVAL diff --git a/InterfaceQT/compoproc.py b/InterfaceQT/compoproc.py new file mode 100644 index 00000000..862795f4 --- /dev/null +++ b/InterfaceQT/compoproc.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +from Editeur import Objecttreeitem +from InterfaceQT import compooper +from InterfaceQT import browser + +from qt import * + +class Node(browser.JDCNode): pass +## def getPanel(self): +## """ +## """ +## return PROCPanel( self, self.editor ) + +class ProcEtapeTreeItem(compooper.EtapeTreeItem): + itemNode=Node +## panel = PROCPanel + pass + +import Accas +treeitem = ProcEtapeTreeItem +objet = Accas.PROC_ETAPE + diff --git a/InterfaceQT/composimp.py b/InterfaceQT/composimp.py new file mode 100644 index 00000000..8f99baef --- /dev/null +++ b/InterfaceQT/composimp.py @@ -0,0 +1,639 @@ +# -*- coding: utf-8 -*- +# Modules Python +import string,types,os + +from copy import copy,deepcopy +import traceback +from qt import * + +# Modules Eficas +from Editeur import Objecttreeitem +from Aster import prefs +from InterfaceQT import browser +from Noyau.N_CR import justify_text + + +class Node(browser.JDCNode): + def getPanel(self): + """ + """ + klass = None + + # Attention l ordre des if est important + if self.item.wait_shell(): + # l'objet attend un shell + # a priori jamais + print "Pb : Panneau Shell attendu" + print "Pb : Prevenir la maintenance" + klass = None #CS_pbruno todo + return None + + # l'objet prend sa (ses) valeur(s) dans un ensemble discret de valeurs + if self.item.has_into(): + if self.item.is_list() : + from monPlusieursIntoPanel import MonPlusieursIntoPanel + klass = MonPlusieursIntoPanel + else: + from monUniqueIntoPanel import MonUniqueIntoPanel + klass = MonUniqueIntoPanel + + # l'objet prend une ou des valeurs a priori quelconques + else: + # on attend une liste de valeurs + if self.item.is_list() : + # on attend une liste de SD + if self.item.wait_assd(): + from monPlusieursASSDPanel import MonPlusieursASSDPanel + klass = MonPlusieursASSDPanel + else: + # on attend une liste de valeurs de types debase (entiers, réels,...) + from monPlusieursBasePanel import MonPlusieursBasePanel + klass = MonPlusieursBasePanel + # on n'attend qu'une seule valeur + else: + # on attend une SD ou un objet de la classe CO (qui n'existe pas encore) + if self.item.wait_co(): + from monUniqueSDCOPanel import MonUniqueSDCOPanel + klass = MonUniqueSDCOPanel + + # on attend une SD + elif self.item.wait_assd(): + if 'R' in self.item.GetType(): + from monUniqueASSDPanel import MonUniqueASSDReelPanel + klass = MonUniqueASSDReelPanel + else : + from monUniqueASSDPanel import MonUniqueASSDPanel + klass = MonUniqueASSDPanel + + # on attend une valeur d'un type de base (entier,reel,...) + else: + # on attend un complexe + if self.item.wait_complex(): + from monUniqueCompPanel import MonUniqueCompPanel + klass = MonUniqueCompPanel + else: + # on attend un entier, un réel ou une string + from monUniqueBasePanel import MonUniqueBasePanel + klass = MonUniqueBasePanel + + # cas particulier des fonctions + genea = self.item.get_genealogie() + if "VALE" in genea or "VALE_C" in genea: + if "DEFI_FONCTION" in genea : + from monFonctionPanel import MonFonctionPanel + klass = MonFonctionPanel + + #--------------------------------------------------------- + # PN ajout pour lancement de Salome + #--------------------------------------------------------- + if hasattr( self.editor, 'salome' ): +## import panelsSalome +## +## self.item.select_noeud_maille=0 +## self.item.clef_fonction="SALOME" +## for i in range(0,len( genea )) : +## self.item.clef_fonction=self.item.clef_fonction+"_"+ genea[i] +## #if genea[i] == "GROUP_NO" or genea[i] == "GROUP_MA": +## if "GROUP_NO" in genea[len(genea)-1] or "GROUP_MA" in genea[len(genea)-1]: +## self.item.select_noeud_maille=1 +## +## recherche=panelsSalome.dict_classes_salome[klass] +## if hasattr(recherche,self.item.clef_fonction): +## klass=recherche +## if self.item.select_noeud_maille==1 : +## klass=recherche + klass = None #CS_pbruno todo + + if not klass: + return None + + return klass( self, self.editor ) + + + +class SIMPTreeItem(Objecttreeitem.AtomicObjectTreeItem): +## from newsimppanel import newSIMPPanel +## panel = newSIMPPanel + itemNode=Node + + def init(self) : + self.expandable = 0 + + + #----------------------------------------------- + # + # Methodes liees aux informations sur le Panel + # ou au mot-clef simple + # + #----------------------------------------------- + # is_list + # get_into a priori inutile --> commentee + # has_into + # wait_into a priori inutile --> commentee + # GetMinMax + # GetMultiplicite + # GetIntervalle + # GetListeValeurs + # get_liste_possible + + def is_list(self): + """ + Cette méthode indique si le mot cle simple attend une liste (valeur de retour 1) + ou s'il n'en attend pas (valeur de retour 0) + + Deux cas principaux peuvent se presenter : avec validateurs ou bien sans. + Dans le cas sans validateur, l'information est donnée par l'attribut max + de la definition du mot cle. + Dans le cas avec validateur, il faut combiner l'information précédente avec + celle issue de l'appel de la méthode is_list sur le validateur.On utilisera + l'operateur ET pour effectuer cette combinaison (AndVal). + """ + is_a_list=0 + min,max = self.GetMinMax() + assert (min <= max) + if max > 1 : + is_a_list=1 + # Dans le cas avec validateurs, pour que le mot cle soit considéré + # comme acceptant une liste, il faut que max soit supérieur a 1 + # ET que la méthode is_list du validateur retourne 1. Dans les autres cas + # on retournera 0 (n'attend pas de liste) + if self.definition.validators : + is_a_list= self.definition.validators.is_list() * is_a_list + return is_a_list + + #def get_into(self,liste_courante=None): + # """ + # Cette méthode retourne la liste de choix proposée par le mot cle. Si le mot cle ne propose + # pas de liste de choix, la méthode retourne None. + # L'argument d'entrée liste_courante, s'il est différent de None, donne la liste des choix déja + # effectués par l'utilisateur. Dans ce cas, la méthode get_into doit calculer la liste des choix + # en en tenant compte. + # Cette méthode part du principe que la relation entre into du mot clé et les validateurs est + # une relation de type ET (AndVal). + # """ + # if not self.object.definition.validators : + # return self.object.definition.into + # else: + # return self.object.definition.validators.get_into(liste_courante,self.definition.into) + + def has_into(self): + """ + Cette méthode indique si le mot cle simple propose un choix (valeur de retour 1) + ou s'il n'en propose pas (valeur de retour 0) + + Deux cas principaux peuvent se presenter : avec validateurs ou bien sans. + Dans le cas sans validateur, l'information est donnée par l'attribut into + de la definition du mot cle. + Dans le cas avec validateurs, pour que le mot cle soit considéré + comme proposant un choix, il faut que into soit présent OU + que la méthode has_into du validateur retourne 1. Dans les autres cas + on retournera 0 (ne propose pas de choix) + """ + has_an_into=0 + if self.definition.into: + has_an_into=1 + elif self.definition.validators : + has_an_into= self.definition.validators.has_into() + return has_an_into + +# def wait_into(self): +# """ Méthode booléenne qui retourne 1 si l'objet pointé par self +# prend ses valeurs dans un ensemble discret (into), 0 sinon """ +# if self.object.definition.into != None : +# return 1 +# else: +# return 0 + + def GetMinMax(self): + """ Retourne les valeurs min et max de la définition de object """ + return self.object.get_min_max() + + def GetMultiplicite(self): + """ A préciser. + Retourne la multiplicité des valeurs affectées a l'objet + représenté par l'item. Pour le moment retourne invariablement 1. + """ + return 1 + + def GetIntervalle(self): + """ + Retourne le domaine de valeur attendu par l'objet représenté + par l'item. + """ + return self.object.getintervalle() + + def GetListeValeurs(self) : + """ Retourne la liste des valeurs de object """ + valeurs=self.object.get_liste_valeurs() + try : + if "R" in self.object.definition.type: + clef=self.object.GetNomConcept() + if self.appli.dict_reels.has_key(clef): + if type(valeurs) == types.TupleType: + valeurs_reelles=[] + for val in valeurs : + if self.appli.dict_reels[clef].has_key(val) : + valeurs_reelles.append(self.appli.dict_reels[clef][val]) + else : + valeurs_reelles.append(val) + else : + if self.appli.dict_reels[clef].has_key(valeurs): + valeurs_reelles=self.appli.dict_reels[clef][valeurs] + valeurs=valeurs_reelles + except : + pass + return valeurs + + def get_liste_possible(self,listeActuelle=[]): + if hasattr(self.definition.validators,'into'): + valeurspossibles = self.definition.validators.into + else: + valeurspossibles = self.get_definition().into + + #On ne garde que les items valides + listevalideitem=[] + for item in valeurspossibles: + encorevalide=self.valide_item(item) + if encorevalide : + listevalideitem.append(item) + + #on ne garde que les choix possibles qui passent le test de valide_liste_partielle + listevalideliste=[] + for item in listevalideitem: + encorevalide=self.valide_liste_partielle(item,listeActuelle) + if encorevalide : + listevalideliste.append(item) + return listevalideliste + + def get_liste_param_possible(self): + liste_param=[] + for param in self.object.jdc.params: + encorevalide=self.valide_item(param.valeur) + if encorevalide: + type_param=param.valeur.__class__.__name__ + for typ in self.definition.type: + if typ=='R': + liste_param.append(param) + if typ=='I' and type_param=='int': + liste_param.append(param) + if typ=='TXM' and type_param=='str': + liste_param.append(repr(param)) + return liste_param + + #-------------------------------------------------- + # + # Methodes liees a la validite des valeurs saisies + # + #--------------------------------------------------- + # valide_item + # valide_liste_partielle + # valide_liste_complete + # info_erreur_item + # info_erreur_liste + # IsInIntervalle + # isvalid + + def valide_item(self,item): + """ + La validation est réalisée directement par l'objet + """ + return self.object.valide_item(item) + + def valide_liste_partielle(self,item,listecourante): + #On protege la liste en entree en la copiant + valeur=listecourante[:] + valeur.append(item) + return self.object.valid_valeur_partielle(valeur) + + def valide_liste_complete (self,valeur): + return self.object.valid_valeur(valeur) + + def valide_val (self,valeur): + return self.object.valid_val(valeur) + + def info_erreur_item(self) : + commentaire="" + if self.definition.validators : + commentaire=self.definition.validators.info_erreur_item() + return commentaire + + def aide(self) : + commentaire="" + if self.definition.validators : + commentaire=self.definition.validators.aide() + return commentaire + + def info_erreur_liste(self) : + commentaire="" + if self.definition.validators : + commentaire=self.definition.validators.info_erreur_liste() + return commentaire + + def IsInIntervalle(self,valeur): + """ + Retourne 1 si la valeur est dans l'intervalle permis par + l'objet représenté par l'item. + """ + return self.valide_item(valeur) + + def isvalid(self): + valide=self.object.isvalid() + return valide + + #-------------------------------------------------- + # + # Autres ... + # + #--------------------------------------------------- + # SetText a priori inutilisee --> commentee + # GetIconName + # GetText + # getval a priori inutilisee --> commentee + # set_valeur_co + # get_sd_avant_du_bon_type + # verif a priori inutilisee --> commentee + # delete_valeur_co + + #def SetText(self, text): + # try: + # value = eval(text) + # self.object.setval(value) + # except: + # pass + + def GetIconName(self): + if self.isvalid(): + return "ast-green-ball" + elif self.object.isoblig(): + return "ast-red-ball" + else: + return "ast-yel-ball" + + def GetText(self): + """ + Classe SIMPTreeItem + Retourne le texte a afficher dans l'arbre représentant la valeur de l'objet + pointé par self + """ + text= self.object.GetText() + if text == None : text="" + return text + + #def getval(self): + # return self.object.getval() + + def set_valeur_co(self,nom_co): + """ + Affecte au MCS pointé par self l'objet de type CO et de nom nom_co + """ + ret = self.object.set_valeur_co(nom_co) + #print "set_valeur_co",ret + return ret + + def get_sd_avant_du_bon_type(self): + """ + Retourne la liste des noms des SD présentes avant l'étape qui contient + le MCS pointé par self et du type requis par ce MCS + """ + a=self.object.etape.parent.get_sd_avant_du_bon_type(self.object.etape,self.object.definition.type) + return a + + def get_sd_avant_du_bon_type_pour_type_de_base(self): + a=self.object.jdc.get_sd_avant_du_bon_type_pour_type_de_base(self.object.etape,"LASSD") + return a + + + + #def verif(self): + # pass + + def delete_valeur_co(self,valeur=None): + """ + Supprime la valeur du mot cle (de type CO) + il faut propager la destruction aux autres etapes + """ + if not valeur : valeur=self.object.valeur + # XXX faut il vraiment appeler del_sdprod ??? + #self.object.etape.parent.del_sdprod(valeur) + self.object.etape.parent.delete_concept(valeur) + + #----------------------------------------------- + # + # Methodes liees au type de l objet attendu + # + #----------------------------------------------- + # wait_co + # wait_geom + # wait_complex + # wait_reel + # wait_shell + # wait_assd + # GetType + + def wait_co(self): + """ + Méthode booléenne qui retourne 1 si l'objet pointé par self + attend un objet de type ASSD qui n'existe pas encore (type CO()), + 0 sinon + """ + return self.object.wait_co() + + def wait_geom(self): + """ + Méthode booléenne qui retourne 1 si l'objet pointé par self + attend un objet GEOM, 0 sinon + """ + return self.object.wait_geom() + + def wait_complex(self): + """ Méthode booléenne qui retourne 1 si l'objet pointé par self + attend un complexe, 0 sinon """ + if 'C' in self.object.definition.type: + return 1 + else: + return 0 + + def wait_reel(self): + """ Méthode booléenne qui retourne 1 si l'objet pointé par self + attend un réel, 0 sinon """ + if 'R' in self.object.definition.type: + return 1 + else: + return 0 + + def wait_shell(self): + """ Méthode booléenne qui retourne 1 si l'objet pointé par self + attend un shell, 0 sinon """ + if 'shell' in self.object.definition.type: + return 1 + else: + return 0 + + def wait_assd(self): + """Méthode booléenne qui retourne 1 si l'objet pointé par self + attend un objet de type ASSD ou dérivé, 0 sinon """ + return self.object.wait_assd() + + def wait_assd_or_type_base(self) : + boo=0 + if len(self.object.definition.type) > 1 : + if self.wait_reel() : + boo = 1 + if 'I' in self.object.definition.type : + boo = 1 + return boo + + + def GetType(self): + """ + Retourne le type de valeur attendu par l'objet représenté par l'item. + """ + return self.object.get_type() + + #----------------------------------------------------- + # + # Methodes liees a l evaluation de la valeur saisie + # + #----------------------------------------------------- + # eval_valeur + # eval_valeur_item + # is_CO + # traite_reel + + def eval_valeur(self,valeur): + """ Lance l'interprétation de 'valeur' (chaine de caractéres) comme valeur de self : + - retourne l'objet associé si on a pu interpréter (entier, réel, ASSD,...) + - retourne 'valeur' (chaine de caractéres) sinon + """ + newvaleur=self.eval_val(valeur) + return newvaleur,1 + + def eval_valeur_BAK(self,valeur): + """ Lance l'interprétation de 'valeur' (chaine de caractéres) comme valeur + de l'objet pointé par self : + - retourne l'objet associé si on a pu interpréter (entier, réel, ASSD,...) + - retourne 'valeur' (chaine de caractéres) sinon + - retourne None en cas d invalidite + - retourne invalide si 1 des objets du tuple l est + """ + validite=1 + if type(valeur) in (types.ListType,types.TupleType) : + valeurretour=[] + for item in valeur : + newvaleur,validiteitem=self.eval_valeur_item(item) + valeurretour.append(newvaleur) + if validiteitem == 0: + validite=0 + else : + valeurretour,validite= self.eval_valeur_item(valeur) + if validite == 0 : + valeurretour = None + return valeurretour,validite + + def eval_valeur_item(self,valeur): + """ Lance l'interprétation de 'valeur' qui doit ne pas etre un tuple + - va retourner la valeur de retour et la validite + selon le type de l objet attendu + - traite les reels et les parametres + """ + #print "eval_valeur_item",valeur + if valeur==None or valeur == "" : + return None,0 + validite=1 + if self.wait_reel(): + valeurinter = self.traite_reel(valeur) + if valeurinter != None : + valeurretour,validite= self.object.eval_valeur(valeurinter) + else: + valeurretour,validite= self.object.eval_valeur(valeur) + elif self.wait_geom(): + valeurretour,validite = valeur,1 + else : + valeurretour,validite= self.object.eval_valeur(valeur) + #print "eval_valeur_item",valeurretour,validite + + if validite == 0: + if type(valeur) == types.StringType and self.object.wait_TXM(): + essai_valeur="'" + valeur + "'" + valeurretour,validite= self.object.eval_valeur(essai_valeur) + + if hasattr(valeurretour,'__class__'): + #if valeurretour.__class__.__name__ in ('PARAMETRE','PARAMETRE_EVAL'): + if valeurretour.__class__.__name__ in ('PARAMETRE',): + validite=1 + + #if self.wait_co(): + # CCAR : il ne faut pas essayer de creer un concept + # il faut simplement en chercher un existant ce qui a du etre fait par self.object.eval_valeur(valeur) + #try: + #valeurretour=Accas.CO(valeur) + #except: + #valeurretour=None + #validite=0 + # on est dans le cas ou on a évalué et ou on n'aurait pas du + if self.object.wait_TXM() : + if type(valeurretour) != types.StringType: + valeurretour=str(valeur) + validite=1 + return valeurretour,validite + + def is_CO(self,valeur=None): + """ + Indique si valeur est un concept produit de la macro + Cette méthode n'a de sens que pour un MCSIMP d'une MACRO + Si valeur vaut None on teste la valeur du mot cle + """ + # Pour savoir si un concept est un nouveau concept de macro + # on regarde s'il est présent dans l'attribut sdprods de l'étape + # ou si son nom de classe est CO. + # Il faut faire les 2 tests car une macro non valide peut etre + # dans un etat pas tres catholique avec des CO pas encore types + # et donc pas dans sdprods (resultat d'une exception dans type_sdprod) + if not valeur:valeur=self.object.valeur + if valeur in self.object.etape.sdprods:return 1 + if type(valeur) is not types.InstanceType:return 0 + if valeur.__class__.__name__ == 'CO':return 1 + return 0 + + def is_param(self,valeur) : + for param in self.jdc.params: + if (repr(param) == valeur): + return 1 + return 0 + + def traite_reel(self,valeur): + """ + Cette fonction a pour but de rajouter le '.' en fin de chaine pour un réel + ou de détecter si on fait référence a un concept produit par DEFI_VALEUR + ou un EVAL ... + """ + valeur = string.strip(valeur) + liste_reels = self.get_sd_avant_du_bon_type() + if valeur in liste_reels: + return valeur + if len(valeur) >= 3 : + if valeur[0:4] == 'EVAL' : + # on a trouvé un EVAL --> on retourne directement la valeur + return valeur + if string.find(valeur,'.') == -1 : + # aucun '.' n'a été trouvé dans valeur --> on en rajoute un a la fin + if (self.is_param(valeur)): + return valeur + else: + if string.find(valeur,'e') != -1: + # Notation scientifique ? + try : + r=eval(valeur) + return valeur + except : + return None + else : + return valeur+'.' + else: + return valeur + + +import Accas +treeitem = SIMPTreeItem +objet = Accas.MCSIMP + diff --git a/InterfaceQT/editor.py b/InterfaceQT/editor.py new file mode 100644 index 00000000..8a903ed9 --- /dev/null +++ b/InterfaceQT/editor.py @@ -0,0 +1,668 @@ +# -*- coding: utf-8 -*- + +# Modules Python +import types,sys,os +import traceback +from qt import * + +# Modules Eficas + +import convert,generator +from Editeur import session +from Editeur import comploader +from Editeur import Objecttreeitem +from Aster import prefs +from InterfaceQT import panelsQT +from InterfaceQT import browser +from InterfaceQT import readercata + +import qtCommun + +VERSION_EFICAS = "EFICAS v1.12" + + +class StringVar: # a cause de format_fichier (Tkinter.StringVar) appele ailleurs que ds l'Interface + def __init__(self): + self.val = "" + def set(self,str): + self.val = str + def get(self): + return self.val + +# -------------------------- # +# # +class JDCEditor(QSplitter): +# # +# -------------------------- # + """ + Editeur de jdc + """ + + def __init__(self,fn = None, jdc = None ,parent=None, editor = None): + #-------------------------------------------------------------------# + + QSplitter.__init__(self, parent,'') + + VERSION_CODE = session.d_env.cata + self.top = None + self.code = prefs.code + self.version_code = VERSION_CODE + self.titre=VERSION_EFICAS + ' pour '+ self.code + self.dict_reels={} + self.liste_simp_reel=[] + self.format_fichier = StringVar() + self.format_fichier.set('python') #CS_pbruno gestion python uniquement + self.ihm="QT" + + from Editeur import configuration + self.CONFIGURATION = configuration.make_config(self,prefs.REPINI) + self.CONFIGStyle = configuration.make_config_style(self,prefs.REPINI) + self.test=0 + self.sb = None + if hasattr(qApp.mainWidget(),"statusBar"): + self.sb = qApp.mainWidget().statusBar() + + self.parent = parent + self.vm = parent #viewManager + self.fileName = fn + self.fileInfo = None + self.lastModified = 0 + self.jdc = jdc + + self.fichier=None + self.panel_courant=None + self.node_selected = None + self.modified = False + self.isReadOnly = False + + if not hasattr( readercata, 'reader' ): + readercata.reader = readercata.READERCATA( self, self ) + self.readercata = readercata.reader + + + #------- construction du jdc -------------- + + jdc_item = None + + if self.fileName is not None: # fichier jdc fourni + self.fileInfo = QFileInfo(self.fileName) + self.fileInfo.setCaching(0) + if editor is None: + self.jdc = self.readFile(self.fileName) + else: + self.top = editor.top + self.code = editor.code + self.version_code = editor.version_code + self.titre = editor.titre + self.dict_reels = editor.dict_reels + self.liste_simp_reel= editor.liste_simp_reel + self.format_fichier = editor.format_fichier + self.CONFIGURATION = editor.CONFIGURATION + self.CONFIGStyle = editor.CONFIGStyle + self.jdc = editor.jdc + + self.lastModified = self.fileInfo.lastModified() + elif editor is not None: + self.jdc = editor.jdc + else: + if not self.jdc: # nouveau jdc + self.jdc = self._newJDC() + + if self.jdc: + self.jdc.appli = self + txt_exception = None + if not jdc: + self.jdc.analyse() + txt_exception = self.jdc.cr.get_mess_exception() + if txt_exception: + self.jdc = None + qApp.restoreOverrideCursor() + self.affiche_infos("Erreur fatale au chargement de %s" %fn) + QMessageBox.critical( self, "Erreur fatale au chargement d'un fichier", txt_exception) + else: + comploader.charger_composants("QT") + jdc_item=Objecttreeitem.make_objecttreeitem( self, "nom", self.jdc ) + + if not self.jdc.isvalid(): + self.viewJdcRapport() + + #------- config widget -------------- + + if jdc_item: + self.tree = browser.JDCTree( jdc_item, self ) + self.connect(self.tree,SIGNAL('selectionChanged(QListViewItem *)'),self.updatePanel) + + sh = self.sizeHint() + if sh.height() < 300: + sh.setHeight(300) + self.resize(sh) + + # Make sure tabbing through a QWorkspace works. + self.setFocusPolicy(QWidget.StrongFocus) + self._updateReadOnly(1) + + # Set the editors size if it is too big for the parent. + if parent is not None: + req = self.size() + bnd = req.boundedTo(parent.size()) + + if bnd.width() < req.width() or bnd.height() < req.height(): + self.resize(bnd) + + self.panel = QWidget(self) + self.connect(self, SIGNAL('modificationChanged(bool)'), self.handleModificationChanged) + + + #-------------------------------------------------------------------# + def _updateReadOnly(self, bForce=1): + #-------------------------------------------------------------------# + """ + Private method to update the readOnly information for this editor. + + If bForce is True, then updates everything regardless if + the attributes have actually changed, such as during + initialization time. A signal is emitted after the + caption change. + + @param bForce 1 to force change, 0 to only update and emit + signal if there was an attribute change. + """ + + if self.fileName is None: + return + readOnly = not QFileInfo(self.fileName).isWritable() and 1 or 0 + if not bForce and (readOnly == self.isReadOnly): + return + cap = self.fileName + if readOnly: + cap = "%s (ro)" % unicode(cap) + self.isReadOnly = readOnly + self.setCaption(cap) + self.emit(PYSIGNAL('captionChanged'), (cap, self)) + + #-------------------# + def _newJDC( self ): + #-------------------# + """ + Initialise un nouveau JDC vierge + """ + CONTEXT.unset_current_step() + jdc=self.readercata.cata[0].JdC( procedure="", + appli=self, + cata=self.readercata.cata, + cata_ord_dico=self.readercata.cata_ordonne_dico, + rep_mat=self.CONFIGURATION.rep_mat + ) + jdc.analyse() + return jdc + + + #-----------------------# + def get_source(self,file): + #-----------------------# + import convert + format=self.format_fichier.get() + + # Il faut convertir le contenu du fichier en fonction du format + if convert.plugins.has_key(format): + # Le convertisseur existe on l'utilise + p=convert.plugins[format]() + p.readfile(file) + text=p.convert('execnoparseur') + if not p.cr.estvide(): + self.affiche_infos("Erreur a la conversion") + return text + else: + # Il n'existe pas c'est une erreur + self.affiche_infos("Type de fichier non reconnu") + QMessageBox.critical( self, "Type de fichier non reconnu","EFICAS ne sait pas ouvrir ce type de fichier") + return None + + #---------------------------------------------# + def get_file(self,unite=None,fic_origine = ''): + #---------------------------------------------# + ulfile = None + jdcText = "" + + titre = "" + + if unite : + titre = "Choix unite %d " %unite + texte = "Le fichier %s contient une commande INCLUDE \n" % fic_origine + texte = texte+'Donnez le nom du fichier correspondant\n à  l unité logique %d' % unite + labeltexte = 'Fichier pour unite %d :' % unite + else: + titre = "Choix d'un fichier de poursuite" + texte = "Le fichier %s contient une commande %s\n" %(fic_origine,'POURSUITE') + texte = texte+'Donnez le nom du fichier dont vous \n voulez faire une poursuite' + labeltexte = 'Fichier à  poursuivre :' + + fn = QFileDialog.getOpenFileName( None, + "", + self, + None, + labeltexte ) + + print 'GETFILE', fn + + if fn.isNull(): + return + + ulfile = os.path.abspath(unicode(fn)) + # On utilise le convertisseur défini par format_fichier + print 'GETFILE', ulfile + source=self.get_source(ulfile) + if source: + # On a réussi à  convertir le fichier self.ulfile + jdcText = source + else: + # Une erreur a été rencontrée + jdcText = '' + + + return ulfile, jdcText + + + #-----------------------# + def readFile(self, fn): + #-----------------------# + """ + Public slot to read the text from a file. + + @param fn filename to read from (string or QString) + """ + fn = unicode(fn) + + qApp.setOverrideCursor(Qt.waitCursor) + + # ------------------------------------------------------------------------------------ + # charge le JDC + # ------------------------------------------------------------------------------------ + + jdcName=os.path.basename(fn) + # Il faut convertir le contenu du fichier en fonction du format + if convert.plugins.has_key( self.format_fichier.get() ): + # Le convertisseur existe on l'utilise + appli = self # CS_pbruno compatiblity parseur_python: self.appli.liste_simp_reel, self.appli.dict_reels + p=convert.plugins[self.format_fichier.get()]() + p.readfile(fn) + text=p.convert('exec',appli) + if not p.cr.estvide(): + self.affiche_infos("Erreur à la conversion") + + CONTEXT.unset_current_step() + ## os.chdir(self.initialdir) + jdc=self.readercata.cata[0].JdC(procedure=text, + appli=self, + cata=self.readercata.cata, + cata_ord_dico=self.readercata.cata_ordonne_dico, + nom=jdcName, + rep_mat=self.CONFIGURATION.rep_mat + ) + # ---------------------------------------------------- + # charge le JDC fin + # ---------------------------------------------------- + self.modified = False + + qApp.restoreOverrideCursor() + self.lastModified = self.fileInfo.lastModified() + return jdc + + #----------------------------------------------# + def _viewText(self, txt, caption = "FILE_VIEWER"): + #----------------------------------------------# + w = qtCommun.ViewText( self.parent ) + w.setCaption( caption ) + w.setText(txt) + w.show() + + #-----------------------# + def viewJdcSource(self): + #-----------------------# + format = self.format_fichier.get() + strSource = str( self.get_text_JDC(format) ) + self._viewText(strSource, "JDC_SOURCE") + + #-----------------------# + def viewJdcRapport(self): + #-----------------------# + strRapport = str( self.jdc.report() ) + self._viewText(strRapport, "JDC_RAPPORT") + + #-----------------------# + def handleRenamed(self, fn): + #-----------------------# + """ + Public slot to handle the editorRenamed signal. + + @param fn filename to be set for the editor (QString or string). + """ + self.fileName = unicode(fn) + self.setCaption(self.fileName) + + if self.fileInfo is None: + self.fileInfo = QFileInfo(self.fileName) + self.fileInfo.setCaching(0) + + self.lastModified = self.fileInfo.lastModified() + self.vm.setEditorName(self, self.fileName) + self._updateReadOnly(1) + + #-----------------------# + def handleNewView(self): + #-----------------------# + """ + Private slot to create a new view to an open document. + """ + self.vm.newEditorView(self.fileName, self)#, self.isPythonFile) + + #------------------------------------# + def handleModificationChanged(self, m): + #------------------------------------# + """ + Private slot to handle the modificationChanged signal. + + It emits the signal modificationStatusChanged with parameters + m and self. + + @param m modification status + """ + if not m and self.fileInfo is not None: + self.lastModified = self.fileInfo.lastModified() + self.emit(PYSIGNAL('modificationStatusChanged'), (m, self)) + + #------------------------# + def hasSyntaxErrors(self): + #------------------------# + return False #CS_pbruno todo + + #----------------# + def closeIt(self): + #----------------# + """ + Public method called by the viewmanager to finally get rid of us. + """ + + if self.jdc: + self.jdc.supprime() + self.close() + + + #------------------------------# + def affiche_infos(self,message): + #------------------------------# + if self.sb: + self.sb.message(message)#,2000) + + #------------------------------# + def updatePanel(self, jdcNode): + #------------------------------# + """ + Appele a chaque changement de noeud + """ + self.node_selected = jdcNode + if self.panel: + self.panel.close() + del self.panel + self.panel = None + + print jdcNode.__class__ + if jdcNode.item.isactif(): + self.panel = jdcNode.getPanel() + else: + self.panel = panelsQT.PanelInactif(self.node_selected,self) + + if not self.panel: + self.panel = panelsQT.NoPanel(self) + + self.panel.show() + + + + #-------------------# + def init_modif(self): + #-------------------# + """ + Met l'attribut modified a 'o' : utilise par Eficas pour savoir + si un JDC doit etre sauvegarde avant destruction ou non + """ + self.modified = True + self.emit(PYSIGNAL('modificationStatusChanged'), (True, self)) + + #-------------------# + def stop_modif(self): + #-------------------# + """ + Met l'attribut modified à 'n' : utilisé par Eficas pour savoir + si un JDC doit etre sauvegardé avant destruction ou non + """ + self.modified = False + self.emit(PYSIGNAL('modificationStatusChanged'), (False, self)) + + + #-------------------# + def cut(self): + #-------------------# + """ + Stocke dans Eficas.noeud_a_editer le noeud à  couper + """ + if not self.node_selected.item.iscopiable(): + QMessageBox.information( self, "Copie impossible", + "Cette version d'EFICAS ne permet que la copie d'objets de type 'Commande' ou mot-clé facteur") + return + self.parent.edit="couper" + self.parent.noeud_a_editer = self.node_selected + + #-------------------# + def copy(self): + #-------------------# + """ + Stocke dans Eficas.noeud_a_editer le noeud a copier + """ + if not self.node_selected.item.iscopiable(): + QMessageBox.information( self, "Copie impossible", + "La copie d'un tel objet n'est pas permise") + return + self.parent.edit="copier" + self.parent.noeud_a_editer = self.node_selected + + #-------------------# + def paste(self): + #-------------------# + """ + Lance la copie de l'objet place dans self.parent.noeud_a_editer + Ne permet que la copie d'objets de type Commande ou MCF + """ + try: + child=self.parent.noeud_a_editer.doPaste(self.node_selected) + except: + traceback.print_exc() + QMessageBox.information( self, "Copie impossible", + "L'action de coller apres un tel objet n'est pas permise") + return + + if child == 0: + if self.message != '': + QMessageBox.critical( self, "Copie refusee", self.message) + self.message = '' + self.affiche_infos("Copie refusée") + return + + # il faut declarer le JDCDisplay_courant modifie + self.init_modif() + # suppression eventuelle du noeud selectionne + # si possible on renomme l objet comme le noeud couper + + if self.parent.edit == "couper": + #nom = self.parent.noeud_a_editer.item.object.sd.nom + item=self.parent.noeud_a_editer.item + self.parent.noeud_a_editer.delete() + child.item.update(item) + #test,mess = child.item.nomme_sd(nom) + child.select() + + # on rend la copie a nouveau possible en liberant le flag edit + self.parent.edit="copier" + + #---------------------# + def getFileName(self): + #---------------------# + return self.fileName + + #---------------------# + def writeFile(self, fn): + #---------------------# + """ + Public slot to write the text to a file. + + @param fn filename to write to (string or QString) + @return flag indicating success + """ + fn = unicode(fn) + txt = self.get_text_JDC('python') + + eol = '\n' + if len(txt) >= len(eol): + if txt[-len(eol):] != eol: + txt += eol + else: + txt += eol + try: + f = open(fn, 'wb') + f.write(txt) + 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 0 + + #-----------------------------# + def get_text_JDC(self,format): + #-----------------------------# + if generator.plugins.has_key(format): + # Le generateur existe on l'utilise + g=generator.plugins[format]() + jdc_formate=g.gener(self.jdc,format='beautifie') + if not g.cr.estvide(): + self.affiche_infos("Erreur à la generation") + QMessageBox.critical( self, "Erreur a la generation","EFICAS ne sait pas convertir ce JDC") + return + else: + return jdc_formate + else: + # Il n'existe pas c'est une erreur + self.affiche_infos("Format %s non reconnu" % format) + QMessageBox.critical( self, "Format %s non reconnu" % format,"EFICAS ne sait pas convertir le JDC en format %s "% format) + return + + + #-------------------------------------------# + def saveFile(self, saveas = 0, path = None): + #-------------------------------------------# + """ + Public slot to save the text to a file. + + @param saveas flag indicating a 'save as' action + @param path directory to save the file in (string or QString) + @return tuple of two values (boolean, string) giving a success indicator and + the name of the saved file + """ + self.modified = True #CS_pbruno test + + if not saveas and not self.modified:#self.isModified(): + return (0, None) # do nothing if text wasn't changed + + newName = None + if saveas or self.fileName is None: + if path is None and self.fileName is not None: + path = os.path.dirname(unicode(self.fileName)) + selectedFilter = QString('') + fn = QFileDialog.getSaveFileName(path, + self.trUtf8("JDC (*.comm);;" + "All Files (*)"), self, None, + self.trUtf8("Save File"), selectedFilter, 0) + + if not fn.isNull(): + ext = QFileInfo(fn).extension() + if ext.isEmpty(): + ex = selectedFilter.section('(*',1,1).section(')',0,0) + if not ex.isEmpty(): + fn.append(ex) + 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: + return (0, None) + fn = unicode(QDir.convertSeparators(fn)) + newName = fn + else: + return (0, None) + else: + fn = self.fileName + + if self.writeFile(fn): + self.fileName = fn + self.modified = False + self.setCaption(self.fileName) + if self.fileInfo is None or saveas: + self.fileInfo = QFileInfo(self.fileName) + self.fileInfo.setCaching(0) + self.emit(PYSIGNAL('editorRenamed'), (self.fileName,)) + self.lastModified = self.fileInfo.lastModified() + if newName is not None: + self.vm.addToRecentList(newName) + self.emit(PYSIGNAL('editorSaved'), (self.fileName,)) + self.stop_modif() + return (1, self.fileName) + else: + return (0, None) + + #---------------------------------# + def saveFileAs(self, path = None): + #---------------------------------# + """ + Public slot to save a file with a new name. + + @param path directory to save the file in (string or QString) + @return tuple of two values (boolean, string) giving a success indicator and + the name of the saved file + """ + return self.saveFile(1, path) + + + + + +if __name__=='__main__': + if hasattr(prefs,'encoding'): + # Hack pour changer le codage par defaut des strings + import sys + reload(sys) + sys.setdefaultencoding(prefs.encoding) + del sys.setdefaultencoding + # Fin hack + + #CS_pbruno note: fait implicitement des trucs ces imports (grr) + import styles + import import_code + import session + + # Analyse des arguments de la ligne de commande + options=session.parse(sys.argv) + code=options.code + + app = QApplication(sys.argv) + mw = JDCEditor('azAster.comm') + app.setMainWidget(mw) + app.connect(app, SIGNAL("lastWindowClosed()"), app, SLOT("quit()")) + mw.show() + + res = app.exec_loop() + sys.exit(res) + diff --git a/InterfaceQT/eficas.py b/InterfaceQT/eficas.py new file mode 100644 index 00000000..0a9c2a99 --- /dev/null +++ b/InterfaceQT/eficas.py @@ -0,0 +1,66 @@ +class UserInterface(Eficas): + """ + Class implementing the main user interface. + + @signal appendStderr(string) emitted to write data to stderr logger + @signal appendStdout(string) emitted to write data to stdout logger + @signal preferencesChanged() emitted after the preferences were changed + """ + def __init__(self): + """ + Constructor + + @param loc locale to be used by the UI (string) + @param splash reference to the splashscreen (UI.SplashScreen.SplashScreen) + """ + Eficas.__init__(self) + + # Generate the debug server object + dbs = DebugServer() + + + # Create main layout type 4 (floating windows) + + # Create the view manager depending on the configuration setting + self.viewmanager = MyTabview(self, self, dbs) #MyTabview, MyWorkspace, Listspace + self.setCentralWidget(self.viewmanager) + + + self.connect(self,PYSIGNAL('preferencesChanged'), + self.viewmanager.handlePreferencesChanged) + + + self.connect(self.viewmanager,PYSIGNAL('lastEditorClosed'), + self.handleLastEditorClosed) + self.connect(self.viewmanager,PYSIGNAL('editorOpened'), + self.handleEditorOpened) + + + + # Initialise the instance variables. + self.currentProg = None + self.isProg = 0 + self.utEditorOpen = 0 + self.utProjectOpen = 0 + + self.inDragDrop = 0 + self.setAcceptDrops(1) + + + + def handleLastEditorClosed(self): + """ + Public slot to handle the lastEditorClosed signal. + """ + pass + + def handleEditorOpened(self, fn): + """ + Public slot to handle the editorOpened signal. + + @param fn filename of the opened editor (string) + """ + pass + + def fileOpen(self, prog=None): + self.viewmanager.handleOpen(prog) diff --git a/InterfaceQT/monChoixCata.py b/InterfaceQT/monChoixCata.py new file mode 100644 index 00000000..f21aaa14 --- /dev/null +++ b/InterfaceQT/monChoixCata.py @@ -0,0 +1,57 @@ +# -*- 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 desChoixCata import DChoixCata +from qt import * + + +# Import des panels + +class MonChoixCata(DChoixCata): + """ + 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,listeCata,readercata, parent = None,name = None,fl = 0): + DChoixCata.__init__(self,parent,name,fl) + self.listeCata=listeCata + self.readercata=readercata + for cata in self.listeCata : + self.CBChoixCata.insertItem(cata,0) + lab = QString(repr(len(listeCata))) + lab += QString(" versions du catalogue sont disponibles") + self.TLNb.setText(lab) + self.readercata.version_cata=self.CBChoixCata.currentText() + + def BSupPressed(self): + QTPanel.BSupPressed(self) + + def CataChoisi(self): + self.readercata.version_cata=self.CBChoixCata.currentText() + + def BOkPressed(self): + QDialog.accept(self) + + def BCancelPressed(self): + QDialog.reject(self) diff --git a/InterfaceQT/monCommandePanel.py b/InterfaceQT/monCommandePanel.py new file mode 100644 index 00000000..a15cc8a1 --- /dev/null +++ b/InterfaceQT/monCommandePanel.py @@ -0,0 +1,69 @@ +# -*- 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 desCommande import DComm +from qtCommun import QTPanel +from qtCommun import QTPanelTBW1 +from qtCommun import QTPanelTBW2 +from qtCommun import QTPanelTBW3 +from qt import * + + +# Import des panels + +class MonCommandePanel(DComm,QTPanelTBW1,QTPanelTBW2,QTPanelTBW3): + """ + 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): + DComm.__init__(self,parent,name,fl) + QTPanel.__init__(self,node,parent) + QTPanelTBW1.__init__(self,node,parent) + QTPanelTBW2.__init__(self,node,parent) + QTPanelTBW3.__init__(self,node,parent) + + def BSupPressed(self): + QTPanel.BSupPressed(self) + + def BOkPressed(self): + QTPanel.BOkPressed(self) + + def BNextPressed(self): + QTPanelTBW2.BNextPressed(self) + + def BuildTabCommand(self): + QTPanelTBW2.BuildLBNouvCommande(self) + + def LEFiltreTextChanged(self): + QTPanelTBW2.LEFiltreTextChanged(self) + + def LEfiltreReturnPressed(self): + QTPanelTBW2.LEfiltreReturnPressed(self) + + def LBNouvCommandeClicked(self): + QTPanelTBW2.LBNouvCommandeClicked(self) + + def LENomConceptReturnPressed(self): + QTPanelTBW3.LENomConceptReturnPressed(self) diff --git a/InterfaceQT/monCommentairePanel.py b/InterfaceQT/monCommentairePanel.py new file mode 100644 index 00000000..ae6ce6e3 --- /dev/null +++ b/InterfaceQT/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 + +from qt import * + +from desCommentaire import DComment +from qtCommun import QTPanel +from Aster import prefs + +# 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/InterfaceQT/monFonctionPanel.py b/InterfaceQT/monFonctionPanel.py new file mode 100644 index 00000000..272c89af --- /dev/null +++ b/InterfaceQT/monFonctionPanel.py @@ -0,0 +1,124 @@ +# -*- 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:] + 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 self.nbValeurs == 2 : + if (i != index*2 and i != index*2+1 ) : listeVal.append(valeur) + elif self.nbValeurs == 3 : + if (i != index*3 and i != index*3+1 and i != index*3 +2) : listeVal.append(valeur) + else : + print "aiiiiiiiiiiiiiiiiiieeee" + i = i+1 + print listeVal + self.listeValeursCourantes=listeVal + listeValeurs=self.listeValeursCourantes + self.LBValeurs.clear() + for valeur in self.DecoupeListeValeurs(listeValeurs): + self.LBValeurs.insertItem(str(valeur)) + diff --git a/InterfaceQT/monFormulePanel.py b/InterfaceQT/monFormulePanel.py new file mode 100644 index 00000000..6fa2e588 --- /dev/null +++ b/InterfaceQT/monFormulePanel.py @@ -0,0 +1,140 @@ +# -*- 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 desFormule import DFormule +from qtCommun import QTPanel +from qtCommun import QTPanelTBW2 +from qt import * + + +# Import des panels + +class MonFormulePanel(DFormule,QTPanelTBW2): + """ + 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): + DFormule.__init__(self,parent,name,fl) + QTPanel.__init__(self,node,parent) + QTPanelTBW2.__init__(self,node,parent) + self.LENomFormule.setText(node.item.get_nom()) + self.LECorpsFormule.setText(node.item.get_corps()) + texte_args="" + for i in node.item.get_args() : + if texte_args != "" : + texte_args = texte_args +"," + texte_args=texte_args + i + self.LENomsArgs.setText(texte_args) + + + self.parent=parent + + def BSupPressed(self): + QTPanel.BSupPressed(self) + + def BOkPressed(self): + QTPanel.BOkPressed(self) + + def BNextPressed(self): + QTPanelTBW2.BNextPressed(self) + + def BuildTabCommand(self): + QTPanelTBW2.BuildLBNouvCommande(self) + + def LEFiltreTextChanged(self): + QTPanelTBW2.LEFiltreTextChanged(self) + + def LEfiltreReturnPressed(self): + QTPanelTBW2.LEfiltreReturnPressed(self) + + def LBNouvCommandeClicked(self): + QTPanelTBW2.LBNouvCommandeClicked(self) + + def NomFormuleSaisi(self): + nomFormule = self.LENomFormule.text().latin1() + if nomFormule == '' : return + test,erreur = self.node.item.verif_nom(nomFormule) + if test : + commentaire=nomFormule+" est un nom valide pour une FORMULE" + else : + commentaire=nomFormule+" n'est pas un nom valide pour une FORMULE" + self.editor.affiche_infos(commentaire) + + def argsSaisis(self): + arguments = self.LENomsArgs.text().latin1() + if arguments == '' : return + + test,erreur = self.node.item.verif_arguments(arguments) + if test: + commentaire="Argument(s) valide(s) pour une FORMULE" + else: + commentaire="Argument(s) invalide(s) pour une FORMULE" + self.editor.affiche_infos(commentaire) + + def FormuleSaisie(self): + nomFormule = self.LENomFormule.text().latin1() + arguments = self.LENomsArgs.text().latin1() + expression = self.LECorpsFormule.text().latin1() + if expression == '' : return + test,erreur = self.node.item.verif_formule_python((nomFormule,"REEL",arguments,expression)) + + if test: + commentaire="Corps de FORMULE valide" + else: + commentaire="Corps de FORMULE invalide" + self.editor.affiche_infos(commentaire) + + + def BOkPressedFormule(self): + if self.parent.modified == 'n' : self.parent.init_modif() + + nomFormule = self.LENomFormule.text().latin1() + test,erreur = self.node.item.verif_nom(nomFormule) + if not test : + self.editor.affiche_infos(erreur) + return + + arguments = self.LENomsArgs.text().latin1() + test,erreur = self.node.item.verif_arguments(arguments) + if not test : + self.editor.affiche_infos(erreur) + return + + expression = self.LECorpsFormule.text().latin1() + test,erreur = self.node.item.verif_formule_python((nomFormule,"REEL",arguments,expression)) + if not test : + self.editor.affiche_infos(erreur) + return + + test=self.node.item.object.update_formule_python(formule=(nomFormule,"REEL",arguments,expression)) + test,erreur = self.node.item.save_formule(nomFormule,"REEL",arguments,expression) + if test : + self.node.update_valid() + self.node.update_node_texte() + commentaire = "Formule modifiée" + else: + commentaire ="Formule incorrecte : " + erreur + self.editor.init_modif() + self.editor.affiche_infos(commentaire) diff --git a/InterfaceQT/monMCFactPanel.py b/InterfaceQT/monMCFactPanel.py new file mode 100644 index 00000000..ccd3f6e3 --- /dev/null +++ b/InterfaceQT/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/InterfaceQT/monMCListAjoutPanel.py b/InterfaceQT/monMCListAjoutPanel.py new file mode 100644 index 00000000..622deab5 --- /dev/null +++ b/InterfaceQT/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/InterfaceQT/monMacroPanel.py b/InterfaceQT/monMacroPanel.py new file mode 100644 index 00000000..b7905c2c --- /dev/null +++ b/InterfaceQT/monMacroPanel.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 +# Modules Eficas + +from desMacro import DMacro +from qtCommun import QTPanel +from qtCommun import QTPanelTBW1 +from qtCommun import QTPanelTBW2 +from qt import * + + +# Import des panels + +class MonMacroPanel(DMacro,QTPanelTBW1,QTPanelTBW2): + """ + 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): + DMacro.__init__(self,parent,name,fl) + QTPanel.__init__(self,node,parent) + QTPanelTBW2.__init__(self,node,parent) + QTPanelTBW1.__init__(self,node,parent) + + def BSupPressed(self): + QTPanel.BSupPressed(self) + + def BOkPressed(self): + QTPanel.BOkPressed(self) + + def BNextPressed(self): + QTPanelTBW2.BNextPressed(self) + + def BuildTabCommand(self): + QTPanelTBW2.BuildLBNouvCommande(self) + + def LEFiltreTextChanged(self): + QTPanelTBW2.LEFiltreTextChanged(self) + + def LEfiltreReturnPressed(self): + QTPanelTBW2.LEfiltreReturnPressed(self) + + def LBNouvCommandeClicked(self): + QTPanelTBW2.LBNouvCommandeClicked(self) + diff --git a/InterfaceQT/monPlusieursASSDPanel.py b/InterfaceQT/monPlusieursASSDPanel.py new file mode 100644 index 00000000..0b7a6412 --- /dev/null +++ b/InterfaceQT/monPlusieursASSDPanel.py @@ -0,0 +1,112 @@ +# -*- 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 +from Aster import prefs + +from qt import * +from monPlusieursIntoPanel import MonPlusieursIntoPanel +from desPlusieursInto import DPlusInto +from qtCommun import QTPanel +from politiquesValidation import PolitiquePlusieurs +# Import des panels + +class MonPlusieursASSDPanel(MonPlusieursIntoPanel): + """ + 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.listeValeursCourantes=self.node.item.GetListeValeurs() + self.InitValeursCourantes() + self.DisplayListBoxCourantes() + self.DisplayListBoxPossibles() + + self.politique=PolitiquePlusieurs(node,parent) + #QObject.connect(self.listBoxVal, SIGNAL("doubleClicked(QListBoxItem*)" ), self.Ajout1Valeur ) + # QObject.connect(self.listBoxVal, SIGNAL("doubleClicked(QListBoxItem*)" ), self.ClicASSD ) + + def DisplayListBoxPossibles(self): + listeNomsSD = self.node.item.get_sd_avant_du_bon_type() + self.listBoxVal.clear() + for aSD in listeNomsSD: + if aSD not in self.listNomsValeurs : + self.listBoxVal.insertItem( aSD) + + def DisplayListBoxCourantes(self): + self.LBValeurs.clear() + for aSD in self.listNomsValeurs : + self.LBValeurs.insertItem( aSD) + + def InitValeursCourantes(self): + self.listNomsValeurs=[] + for i in self.listeValeursCourantes : + self.listNomsValeurs.append(i.get_name()) + + def BOkPourListePressed(self): + self.node.item.set_valeur(self.listeValeursCourantes) + self.editor.affiche_infos("Valeur Acceptée") + pass + + 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 + self.InitValeursCourantes() + self.DisplayListBoxCourantes() + self.DisplayListBoxPossibles() + + 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 + self.InitValeursCourantes() + self.DisplayListBoxCourantes() + self.DisplayListBoxPossibles() diff --git a/InterfaceQT/monPlusieursBasePanel.py b/InterfaceQT/monPlusieursBasePanel.py new file mode 100644 index 00000000..f53f67f6 --- /dev/null +++ b/InterfaceQT/monPlusieursBasePanel.py @@ -0,0 +1,96 @@ +# -*- 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 +from Aster 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 + 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/InterfaceQT/monPlusieursIntoPanel.py b/InterfaceQT/monPlusieursIntoPanel.py new file mode 100644 index 00000000..7aa23d7c --- /dev/null +++ b/InterfaceQT/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 +from Aster 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/InterfaceQT/monRacinePanel.py b/InterfaceQT/monRacinePanel.py new file mode 100644 index 00000000..c36411ac --- /dev/null +++ b/InterfaceQT/monRacinePanel.py @@ -0,0 +1,75 @@ +# -*- 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 desRacine import DRac +from qtCommun import QTPanel +from qtCommun import QTPanelTBW2 +from qtCommun import itemColore +from qt import * + + +# Import des panels + +class MonRacinePanel(DRac,QTPanelTBW2): + """ + 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): + DRac.__init__(self,parent,name,fl) + QTPanel.__init__(self,node,parent) + QTPanelTBW2.__init__(self,node,parent) + + def BSupPressed(self): + QTPanel.BSupPressed(self) + + def BOkPressed(self): + QTPanel.BOkPressed(self) + + def BNextPressed(self): + QTPanelTBW2.BNextPressed(self) + + def BuildTabCommand(self): + QTPanelTBW2.BuildLBNouvCommande(self) + + def LEFiltreTextChanged(self): + QTPanelTBW2.LEFiltreTextChanged(self) + + def LEfiltreReturnPressed(self): + QTPanelTBW2.LEfiltreReturnPressed(self) + + def LBNouvCommandeClicked(self): + QTPanelTBW2.LBNouvCommandeClicked(self) + + def AppelleBuildLBRegles(self): + listeRegles=self.node.item.get_regles() + listeNomsEtapes = self.node.item.get_l_noms_etapes() + self.BuildLBRegles(listeRegles,listeNomsEtapes) + + 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_child(name,'first') diff --git a/InterfaceQT/monUniqueASSDPanel.py b/InterfaceQT/monUniqueASSDPanel.py new file mode 100644 index 00000000..7bc1cdfb --- /dev/null +++ b/InterfaceQT/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 +from Aster 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/InterfaceQT/monUniqueBasePanel.py b/InterfaceQT/monUniqueBasePanel.py new file mode 100644 index 00000000..8e83ec86 --- /dev/null +++ b/InterfaceQT/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 +from Aster 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/InterfaceQT/monUniqueCompPanel.py b/InterfaceQT/monUniqueCompPanel.py new file mode 100644 index 00000000..e47f2940 --- /dev/null +++ b/InterfaceQT/monUniqueCompPanel.py @@ -0,0 +1,152 @@ +# -*- 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,re + +# Modules Eficas +from Aster import prefs + +from qt import * + +from desUniqueComp import DUnComp +from qtCommun import QTPanel +from politiquesValidation import PolitiqueUnique + +# Import des panels + +#class MonUniqueCompPanel(DUnComp,QTPanel,SaisieValeur): +class MonUniqueCompPanel(DUnComp,QTPanel,PolitiqueUnique): + """ + 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) + DUnComp.__init__(self,parent,name,fl) + self.politique=PolitiqueUnique(node,parent) + self.InitLinesVal() + + def InitLinesVal(self): + valeur=self.node.item.get_valeur() + if valeur == None or valeur == '' : return + if type(valeur) not in (types.ListType,types.TupleType) : + self.LEcomp.setText(str(valeur)) + else : + typ_cplx,x1,x2=valeur + self.LEReel.setText(str(x1)) + self.LEImag.setText(str(x2)) + if typ_cplx == "RI" : + self.buttonGroup1.setButton(1) + else : + self.buttonGroup1.setButton(0) + + + def LEcompRPressed(self) : + self.LEReel.clear() + self.LEImag.clear() + commentaire="expression valide" + valeur = str(self.LEcomp.text()) + d={} + try : + v=eval(valeur,d) + except : + commentaire="expression invalide" + self.editor.affiche_infos(commentaire) + return + try : + i=v.imag + except : + commentaire="expression n est pas de la forme a+bj" + self.editor.affiche_infos(commentaire) + + def LEReelRPressed(self): + self.LEcomp.clear() + commentaire="expression valide" + valeur = str(self.LEReel.text()) + try : + a=string.atof(valeur) + except : + commentaire="expression invalide" + self.editor.affiche_infos(commentaire) + + def LEImagRPressed(self): + self.LEcomp.clear() + commentaire="expression valide" + valeur = str(self.LEImag.text()) + try : + a=string.atof(valeur) + except : + commentaire="expression invalide" + self.editor.affiche_infos(commentaire) + + def BOkPressed(self): + if self.LEcomp.text()== "" : + valeur = self.getValeurAster() + else : + if self.LEReel.text() != "" or self.LEImag.text() != "" : + commentaire="entrer une seule valeur SVP" + self.editor.affiche_infos(commentaire) + return + valeur= self.getValeurComp() + self.politique.RecordValeur(valeur) + + def getValeurAster(self): + """ + Retourne le complexe saisi par l'utilisateur + """ + l=[] + if (self.buttonGroup1.selectedId() == 0 ) : + l.append("MP") + elif (self.buttonGroup1.selectedId() == 1) : + l.append("RI") + else : + commentaire="saisir le type de complexe" + self.editor.affiche_infos(commentaire) + return None + try : + l.append(string.atof(str(self.LEReel.text()))) + l.append(string.atof(str(self.LEImag.text()))) + except : + return None + return `tuple(l)` + + def getValeurComp(self): + commentaire="expression valide" + valeur = str(self.LEcomp.text()) + d={} + try : + v=eval(valeur,d) + except : + commentaire="expression invalide" + self.editor.affiche_infos(commentaire) + return None + try : + i=v.imag + except : + commentaire="expression n est pas de la forme a+bj" + self.editor.affiche_infos(commentaire) + return None + return v + + def BSupPressed(self): + QTPanel.BSupPressed(self) + diff --git a/InterfaceQT/monUniqueIntoPanel.py b/InterfaceQT/monUniqueIntoPanel.py new file mode 100644 index 00000000..144dc700 --- /dev/null +++ b/InterfaceQT/monUniqueIntoPanel.py @@ -0,0 +1,57 @@ +# -*- 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 +from Aster import prefs + +from qt import * + +from desUniqueIntoPanel import DUnIn +from qtCommun import QTPanel +from qtSaisie import SaisieValeur +from politiquesValidation import PolitiqueUnique + +# Import des panels + +class MonUniqueIntoPanel(DUnIn,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) + DUnIn.__init__(self,parent,name,fl) + SaisieValeur.RemplitPanel(self) + self.politique=PolitiqueUnique(node,parent) + QObject.connect(self.listBoxVal, SIGNAL("doubleClicked(QListBoxItem*)" ), self.ClicValeur ) + + def ClicValeur(self): + SaisieValeur.ClicValeur(self) + + def BOkPressed(self): + SaisieValeur.BOkPressed(self) + + def BSupPressed(self): + QTPanel.BSupPressed(self) + diff --git a/InterfaceQT/myMain_ui.py b/InterfaceQT/myMain_ui.py new file mode 100644 index 00000000..697e5b47 --- /dev/null +++ b/InterfaceQT/myMain_ui.py @@ -0,0 +1,516 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file 'myMain.ui' +# +# Created: lun mar 5 15:21:40 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\x16\x00\x00\x00\x16" \ + "\x08\x06\x00\x00\x00\xc4\xb4\x6c\x3b\x00\x00\x00" \ + "\x74\x49\x44\x41\x54\x38\x8d\xed\xd5\xc1\x09\xc0" \ + "\x20\x0c\x05\xd0\x6f\xe9\x36\x81\x2c\x10\xb2\xff" \ + "\xdd\x85\xd2\x53\x85\xb6\xa9\x91\x48\x0f\x05\x3f" \ + "\x08\x1a\xf0\x29\x12\x10\xf8\x28\xc5\xa9\xd9\xc4" \ + "\xde\x96\xcd\x2b\x9a\xd9\xeb\x00\x00\x66\x0e\x2f" \ + "\xe0\xc2\x51\x98\x39\xc4\xf7\x0c\x4c\x44\x6d\x5e" \ + "\x6b\x35\x38\xcf\x92\x82\x45\xe4\xb2\xf6\xf0\x14" \ + "\xac\xaa\x8f\xda\x1d\x4f\xc1\xa5\x74\x1b\x22\x07" \ + "\x9f\x9d\x11\x1d\x96\xea\x8a\x91\x2c\x78\xc1\x0b" \ + "\xee\x64\xe6\x07\x19\xf5\x7e\x92\x03\xad\x45\x2a" \ + "\x04\xcc\x4e\x50\x20\x00\x00\x00\x00\x49\x45\x4e" \ + "\x44\xae\x42\x60\x82" +image1_data = \ + "\x89\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d" \ + "\x49\x48\x44\x52\x00\x00\x00\x16\x00\x00\x00\x16" \ + "\x08\x06\x00\x00\x00\xc4\xb4\x6c\x3b\x00\x00\x00" \ + "\x99\x49\x44\x41\x54\x38\x8d\xed\x94\x41\x0e\x85" \ + "\x20\x0c\x44\x5f\x89\xc7\x36\x7f\x61\xbc\x77\x5d" \ + "\x28\x48\xa4\x28\x60\xff\xce\xd9\x54\x8b\xbe\x8e" \ + "\x13\x04\x3e\x1d\x92\x81\x77\xf4\x81\xa1\x23\xdc" \ + "\x2b\x34\xf6\xf4\x7a\x3d\xe2\xb8\x65\xa8\x84\x3f" \ + "\x40\x01\x98\x2a\x0b\x3d\x5f\x62\xc5\x83\x00\xaa" \ + "\x1a\xd7\x05\x50\x44\x9a\xb9\xd5\x07\xa7\x73\xa8" \ + "\xa4\xba\x4f\x92\xa2\xdf\x33\x3c\x64\xc6\x3b\xeb" \ + "\xbd\x82\xe5\xb8\xad\xde\xcb\xcc\x78\x20\xeb\x42" \ + "\x66\xc6\x39\x74\x5d\xfa\x80\xf3\x6f\xaf\x66\xc6" \ + "\x6f\xa1\x9c\x3f\x88\x2f\xb4\x70\xec\x05\xcd\xc0" \ + "\xbe\xd0\x78\x93\xf6\x8e\x17\x14\x92\x63\x5f\x68" \ + "\x6c\x3e\xef\xf6\xba\x3c\x8f\xdd\x36\x6d\xc4\xc0" \ + "\x45\x2c\x87\x81\xf8\x08\x00\x00\x00\x00\x49\x45" \ + "\x4e\x44\xae\x42\x60\x82" +image2_data = \ + "\x89\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d" \ + "\x49\x48\x44\x52\x00\x00\x00\x16\x00\x00\x00\x16" \ + "\x08\x06\x00\x00\x00\xc4\xb4\x6c\x3b\x00\x00\x00" \ + "\xa0\x49\x44\x41\x54\x38\x8d\xd5\x95\x4d\x0a\x80" \ + "\x20\x10\x85\x9f\xd1\x46\x68\xe1\x8d\xe6\x62\xd2" \ + "\x22\xbc\x98\x37\x6a\x21\xb4\xac\x45\x19\x92\xc6" \ + "\x64\x69\xe0\xb7\xf1\x87\xf1\xf1\x1c\x47\x05\x2a" \ + "\x21\x8e\x76\x2d\xad\xdb\xfb\x9e\x99\xf6\x56\x8f" \ + "\x80\xb5\x36\x4b\x85\x88\xce\x35\x44\x04\x00\xe8" \ + "\x0a\x39\x8c\xe8\xf9\x90\x34\xd2\x29\x2c\xc3\x7c" \ + "\x8e\xbd\x53\x0f\xeb\x58\x3a\x05\xe9\x54\x34\x1f" \ + "\x8a\x02\x7b\x2a\x7d\x3a\x1f\x09\xbf\x85\x4d\xc5" \ + "\xd5\xd9\x53\xaa\x39\x6e\x4f\x38\xca\xb1\x99\xe2" \ + "\xd2\xe1\x08\xab\xe1\x56\xf8\x2e\x30\x97\x7f\xcb" \ + "\x4d\x8f\xf9\x42\xd7\x5d\xbe\xbe\xd2\xe1\x43\x95" \ + "\x3a\x93\xf6\xca\xad\x3d\x61\x11\xf4\x4b\x7d\x4f" \ + "\x82\x0f\xf9\xc0\x06\x9b\xb5\x1e\xcd\xed\x31\x8c" \ + "\x5c\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60" \ + "\x82" +image3_data = \ + "\x89\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d" \ + "\x49\x48\x44\x52\x00\x00\x00\x16\x00\x00\x00\x16" \ + "\x08\x06\x00\x00\x00\xc4\xb4\x6c\x3b\x00\x00\x00" \ + "\x73\x49\x44\x41\x54\x38\x8d\xed\x92\xc1\x0e\x80" \ + "\x20\x08\x40\xb1\xef\x66\x1d\x1c\xff\x4d\x87\x6a" \ + "\xa8\x88\xa1\x76\x69\xf9\x36\x0f\x28\x3e\xd8\x00" \ + "\x60\xf1\x59\x42\x5f\x3a\x71\xf5\x36\x02\xe0\x8e" \ + "\x99\x2b\x09\x88\x01\xd0\x28\x54\x17\x6a\xe4\x7f" \ + "\x21\xce\x1f\xb5\xb0\x5d\x38\xed\xdc\x90\x60\xd0" \ + "\xf1\x13\x79\x63\x5b\x3b\xc9\x2b\xd5\x18\xe2\x39" \ + "\xa9\x43\xec\x1d\x5a\xb7\x78\x5c\xee\x10\x7b\xe4" \ + "\xb2\x15\xaf\x40\x91\xf8\x94\xde\x47\x18\x1e\xce" \ + "\xa5\x9e\xde\x9e\xc5\x9f\x38\x00\x62\xac\x28\xb1" \ + "\xe3\xd7\x01\xd9\x00\x00\x00\x00\x49\x45\x4e\x44" \ + "\xae\x42\x60\x82" +image4_data = \ + "\x89\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d" \ + "\x49\x48\x44\x52\x00\x00\x00\x16\x00\x00\x00\x16" \ + "\x08\x06\x00\x00\x00\xc4\xb4\x6c\x3b\x00\x00\x00" \ + "\x74\x49\x44\x41\x54\x38\x8d\xed\x92\xc1\x0a\xc0" \ + "\x20\x08\x40\x6d\xdf\x2d\x3b\x84\xff\xed\x0e\xa3" \ + "\x58\x6a\x26\xd1\x65\xe0\x83\x0e\xa5\x3e\x85\x04" \ + "\x48\x7e\x4b\x91\x0f\x54\x89\xf1\x9e\xa5\xa3\xca" \ + "\x0f\x8a\x89\x63\x65\xb3\x06\xc4\x2d\xd6\x13\xc6" \ + "\x49\xbd\xc2\x59\x83\x16\x13\x62\x19\xf0\xf9\x36" \ + "\xc0\xa2\xef\x00\xd7\x5a\x62\x61\x4d\x3a\xb2\x29" \ + "\x96\xf2\xa3\x62\xff\xa3\x37\xc5\xeb\xed\xe9\x62" \ + "\xaa\xd1\xa2\xe8\x4a\xaa\xa2\xf7\x50\xdd\x12\x74" \ + "\x8c\x0f\xd0\xab\x93\x24\x67\x78\x00\x59\x6e\x28" \ + "\xb1\x74\x3f\x46\x86\x00\x00\x00\x00\x49\x45\x4e" \ + "\x44\xae\x42\x60\x82" +image5_data = \ + "\x89\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d" \ + "\x49\x48\x44\x52\x00\x00\x00\x16\x00\x00\x00\x16" \ + "\x08\x06\x00\x00\x00\xc4\xb4\x6c\x3b\x00\x00\x00" \ + "\x82\x49\x44\x41\x54\x38\x8d\xcd\xd3\x41\x12\x80" \ + "\x20\x08\x05\x50\xe8\xe0\x2e\xbc\x38\xad\x32\x73" \ + "\x50\x3e\x48\x53\x7f\xe3\xe4\x8c\x4f\x24\x25\xfa" \ + "\x28\xe2\x9c\x6f\x39\x92\x0b\xf9\x27\x6c\xb6\x01" \ + "\x85\x35\x88\x77\x61\x13\x88\xc2\x57\x64\x18\xcd" \ + "\xa0\x15\xf5\x20\xb4\xe6\xb5\x5b\xe1\x09\xdc\x06" \ + "\x22\xb8\xe2\x2a\xcf\x31\x05\x6e\x18\xdf\xdf\xf8" \ + "\x06\x06\xaa\x55\x1c\xc6\x35\x64\xc4\xdc\xf8\x0c" \ + "\xd0\x20\x1d\x57\x7a\x5c\x85\xa8\x84\x5f\xdc\x02" \ + "\x5e\xa5\x30\x7a\xfc\xcd\x07\xe2\x3a\x1d\xf2\x83" \ + "\xec\x2b\x37\xd9\xad\x5f\xb4\xdf\xef\xd4\x9c\xfb" \ + "\xf7\x2f\xac\x98\xc8\xcc\x89\x00\x00\x00\x00\x49" \ + "\x45\x4e\x44\xae\x42\x60\x82" +image6_data = \ + "\x89\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d" \ + "\x49\x48\x44\x52\x00\x00\x00\x16\x00\x00\x00\x16" \ + "\x08\x06\x00\x00\x00\xc4\xb4\x6c\x3b\x00\x00\x00" \ + "\xbf\x49\x44\x41\x54\x38\x8d\xd5\x93\x41\x0a\x83" \ + "\x30\x10\x45\xdf\x48\x8e\xe5\x1d\xbc\x8c\x3b\xa9" \ + "\x8b\xf4\x6a\x9e\xab\xd3\x85\x35\x0d\x26\x63\x62" \ + "\x44\x4a\x3f\x0c\x42\x66\xfc\xf3\xf8\x24\xf0\x6f" \ + "\x12\x40\x2b\x66\xda\x8c\x55\xf3\xde\x22\x12\xcf" \ + "\x9d\x92\xcb\x98\xc0\xba\x2d\x7c\x45\x44\xcf\x9a" \ + "\x07\x63\x8b\xba\xd5\x3c\x44\x91\x23\x5e\xcf\x7c" \ + "\xc1\x62\x36\x97\xa9\x25\x40\xc1\x1f\xf4\xfd\xa7" \ + "\x52\x75\x01\x5d\x24\xa9\x38\x9e\x7d\x6f\x53\xdf" \ + "\x4f\xe4\xcc\xab\x32\x3e\xea\x0f\x03\xc0\xc4\xb2" \ + "\xa0\x71\x2c\xe6\xad\xd8\x9b\x59\xb7\x66\x1c\x3b" \ + "\xe0\x95\x98\x5f\x26\x16\x79\xee\x4e\xbc\xc2\x2c" \ + "\x97\x88\x55\x1f\xe6\xa2\xcb\xc4\x96\x9a\x89\x4b" \ + "\xcb\x6f\x23\xee\x36\x1a\xab\x62\xe2\x52\xc5\x72" \ + "\x94\xdf\xbf\xb6\x10\xbb\xf2\xc8\x97\xb8\xa4\x6c" \ + "\xc6\x67\x7e\xaa\x51\x95\x71\xfa\x08\x7e\xa8\x37" \ + "\x62\xda\x9a\xba\xcb\x20\x23\x5f\x00\x00\x00\x00" \ + "\x49\x45\x4e\x44\xae\x42\x60\x82" +image7_data = \ + "\x89\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d" \ + "\x49\x48\x44\x52\x00\x00\x00\x16\x00\x00\x00\x16" \ + "\x08\x06\x00\x00\x00\xc4\xb4\x6c\x3b\x00\x00\x00" \ + "\xd5\x49\x44\x41\x54\x38\x8d\xc5\x95\x5d\x0a\x84" \ + "\x30\x0c\x84\x27\xe2\xa9\x0a\x9e\x6c\x8b\x0f\x4b" \ + "\x3d\xd9\x82\xd7\xca\x3e\x58\xd7\xfe\x4c\xd0\xba" \ + "\x5d\x76\x40\x02\x4d\xf2\x65\xda\x0a\x05\x7e\x24" \ + "\x39\xc9\xeb\x8d\x9e\xaa\x88\x41\xa0\xc9\xaa\xd8" \ + "\xc8\x2a\xb3\x2f\x9c\x42\x5b\xe1\xe3\x0e\x0d\xcf" \ + "\x00\xc0\x03\x08\xf0\xb3\xa7\xa0\x74\x10\xa9\xd7" \ + "\x14\x2e\x00\xb4\x2c\x5a\x5f\xab\x69\x6b\x97\x9b" \ + "\x1c\x83\x7f\xc0\xc3\x16\xb6\xe4\x16\x5b\x64\xf7" \ + "\x8d\x71\x63\x59\x91\x9b\xdc\x45\x70\xde\x47\xc0" \ + "\x47\x32\xdd\x5e\x5b\xcc\x35\xf0\xc9\x77\x62\xae" \ + "\x78\x79\x36\xdc\xcf\x75\x13\x57\x7e\x79\xf4\x8c" \ + "\x4b\x27\xaa\x0f\x13\x27\xb2\x40\xf5\x11\x7f\xcb" \ + "\xe3\x48\xaa\x33\xb6\xe0\x22\x4b\x05\x4d\x07\x46" \ + "\xb8\x02\x5e\x2e\x3b\x3e\x73\xcd\xe0\xdd\x1c\x97" \ + "\xf0\x2e\x8e\xd9\xd0\xaf\x1d\xb3\x81\x22\x4b\xdf" \ + "\x33\xee\xe6\x98\xa9\x34\xa0\xf6\x17\xb4\x55\x40" \ + "\xd0\x0b\xcf\x4c\xa0\x8f\xc0\xdf\xf4\x06\xe3\x25" \ + "\xc1\x98\x1b\xc4\x18\x76\x00\x00\x00\x00\x49\x45" \ + "\x4e\x44\xae\x42\x60\x82" +image8_data = \ + "\x89\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d" \ + "\x49\x48\x44\x52\x00\x00\x00\x16\x00\x00\x00\x16" \ + "\x08\x06\x00\x00\x00\xc4\xb4\x6c\x3b\x00\x00\x02" \ + "\x5d\x49\x44\x41\x54\x38\x8d\xd5\x93\xa1\x72\xdb" \ + "\x40\x10\x86\x3f\x67\x0a\x56\xec\xc4\x22\x78\xd0" \ + "\x65\x36\x93\xa0\xc2\x1c\x68\xd6\xc2\xe6\x0d\xf2" \ + "\x1a\x81\x81\x11\x34\x94\x99\xc2\x54\xa8\x32\x9b" \ + "\x55\xf0\xe0\x89\xdd\xb1\x5b\xa6\x02\xb7\x9d\x66" \ + "\x92\xd6\x99\xb6\xd3\x99\xfe\xe8\x6e\x67\xe7\xdb" \ + "\x7f\x77\xef\xe0\x7f\xd3\xe2\xc7\x4b\xd7\x75\xb3" \ + "\x73\x0e\xef\x3d\x51\x15\x00\x23\x82\xb5\x16\x6b" \ + "\x2d\x57\x57\x57\x8b\x17\x29\xbf\x02\xb7\x6d\x3b" \ + "\x0f\x87\x03\xb9\x2d\x58\xae\xd7\x60\x04\x00\xef" \ + "\x1c\xe3\xc7\x03\x06\xa8\xaa\x8a\xeb\xeb\xeb\x57" \ + "\xc1\x17\xdf\xa0\x6d\xdb\x52\x5d\xd7\x54\xef\xb6" \ + "\x00\xa8\x2a\x49\x13\x8a\x12\x35\x32\xec\x3a\xc4" \ + "\x2b\x9b\xcd\xe6\x55\xce\x2f\xfa\xbe\x9f\x87\xc3" \ + "\x40\xfd\xe1\x3d\xcb\x4d\x8d\xaa\xa2\x4e\x48\xee" \ + "\x12\xc6\x82\x38\x08\xc1\x07\x96\x9b\x1a\x8a\x9c" \ + "\xe3\xf1\xf8\xaa\x51\x5c\x38\xe7\xc8\xad\xa5\xaa" \ + "\x6b\x00\xc4\x5f\x12\x9c\x67\xd2\x23\x93\x8c\x88" \ + "\xe6\xc8\x60\xd1\x18\xb1\xd5\x92\xd1\x39\xba\xae" \ + "\x9b\xcf\x83\xa7\x89\x65\xb5\x46\x51\x34\x80\x1b" \ + "\x1d\x2e\x1f\x49\x45\xc0\xe3\x50\x09\x64\x08\xea" \ + "\x15\x44\x90\xc2\xe0\xbd\x3f\xef\x58\x53\xc2\xe4" \ + "\x86\xa0\x01\x9f\x4d\x84\xf5\x84\x18\x41\x83\x62" \ + "\xb0\x40\x8e\x8b\x23\xc9\x24\x50\x10\x93\x31\x4d" \ + "\xd3\x59\xf0\x1b\x80\x98\x14\x11\x20\x25\x14\x40" \ + "\x15\xf1\x96\x4c\x0b\xbc\x1b\x48\x4b\x07\xe4\x68" \ + "\x88\x80\xc0\x29\xeb\xd7\x8e\x41\x41\xf5\xb4\x34" \ + "\xfd\x76\x86\x4c\x05\x3f\x1e\x08\x4b\x0f\x85\x80" \ + "\x26\x54\x40\x63\x40\x44\xce\x83\x8b\xbc\xc0\x39" \ + "\x87\xa6\x13\x50\xa3\xa2\x28\x5e\x1d\x5a\x44\x14" \ + "\xd0\x70\x8a\xa5\x98\x08\x21\x62\xad\x3d\x0f\xb6" \ + "\xd6\xe2\x87\xcf\xa4\x98\x50\x8d\x27\x40\x50\x44" \ + "\x73\x70\x42\x8c\x91\xaf\x8d\x10\xfd\x44\x81\x60" \ + "\x8c\x39\x0b\x5e\x00\xdc\xdd\xdd\xcd\x8e\x80\xa9" \ + "\xde\x42\x02\x48\xe8\x04\x84\x08\x56\xf0\x3e\x02" \ + "\x90\x7d\x72\x94\x65\xc9\xba\x5a\xe3\x46\x87\x31" \ + "\xe6\xa7\x9f\xe5\x02\x60\xb5\x5a\x61\x02\xc4\xee" \ + "\x40\xa6\x89\x4c\x33\xf2\xcb\x0c\xb1\x06\x51\x28" \ + "\x14\xf8\xf8\x99\xb2\x2c\xb9\xb9\xb9\x59\xb8\xd1" \ + "\xf1\xf8\xf8\x48\xd3\x34\xb4\x6d\xfb\xe2\x9b\xfe" \ + "\x5e\xad\xef\xfb\xf9\x78\x3c\x32\x3a\x87\x18\x81" \ + "\xec\xb4\x20\x0d\x11\x51\xa8\xeb\x9a\xed\x76\xbb" \ + "\x00\x18\x86\x61\xee\xba\x8e\xfd\x7e\x8f\x31\x86" \ + "\xed\x76\xcb\x6a\xb5\x7a\xe2\xfe\x59\x1b\x5d\xd7" \ + "\xcd\xde\x7b\x62\x8c\x88\x08\x79\x9e\x63\xad\xa5" \ + "\xaa\xaa\x67\xb9\xbb\xdd\x6e\x6e\x9a\x06\xef\x3d" \ + "\x75\x5d\x3f\x29\xfe\xc7\xea\xfb\x7e\xbe\xbd\xbd" \ + "\x9d\xad\xb5\x73\x59\x96\xf3\xfd\xfd\xfd\xfc\xa2" \ + "\xe3\xdf\xd5\xc3\xc3\xc3\xdc\x34\x0d\xd3\x34\xb1" \ + "\xd9\x6c\xfe\x1e\x18\x4e\x63\xdc\xef\xf7\xa4\x94" \ + "\xfe\x26\xf6\x1f\xe9\x0b\xbc\x4c\x5e\x59\xd6\x14" \ + "\xca\xf4\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42" \ + "\x60\x82" + +class Eficas(QMainWindow): + def __init__(self,parent = None,name = None,fl = 0): + QMainWindow.__init__(self,parent,name,fl) + self.statusBar() + + self.image0 = QPixmap() + self.image0.loadFromData(image0_data,"PNG") + self.image1 = QPixmap() + self.image1.loadFromData(image1_data,"PNG") + self.image2 = QPixmap() + self.image2.loadFromData(image2_data,"PNG") + self.image3 = QPixmap() + self.image3.loadFromData(image3_data,"PNG") + self.image4 = QPixmap() + self.image4.loadFromData(image4_data,"PNG") + self.image5 = QPixmap() + self.image5.loadFromData(image5_data,"PNG") + self.image6 = QPixmap() + self.image6.loadFromData(image6_data,"PNG") + self.image7 = QPixmap() + self.image7.loadFromData(image7_data,"PNG") + self.image8 = QPixmap() + self.image8.loadFromData(image8_data,"PNG") + if not name: + self.setName("Eficas") + + self.setEnabled(1) + self.setMinimumSize(QSize(902,575)) + self.setBackgroundOrigin(QMainWindow.WidgetOrigin) + f = QFont(self.font()) + self.setFont(f) + + self.setCentralWidget(QWidget(self,"qt_central_widget")) + + self.line1 = QFrame(self.centralWidget(),"line1") + self.line1.setGeometry(QRect(-30,-10,930,20)) + self.line1.setFrameShape(QFrame.HLine) + self.line1.setFrameShadow(QFrame.Sunken) + self.line1.setFrameShape(QFrame.HLine) + + self.fileNewAction = QAction(self,"fileNewAction") + self.fileNewAction.setIconSet(QIconSet(self.image0)) + self.fileOpenAction = QAction(self,"fileOpenAction") + self.fileOpenAction.setIconSet(QIconSet(self.image1)) + self.fileSaveAction = QAction(self,"fileSaveAction") + self.fileSaveAction.setIconSet(QIconSet(self.image2)) + self.fileSaveAsAction = QAction(self,"fileSaveAsAction") + self.fileExitAction = QAction(self,"fileExitAction") + self.editUndoAction = QAction(self,"editUndoAction") + self.editUndoAction.setIconSet(QIconSet(self.image3)) + self.editRedoAction = QAction(self,"editRedoAction") + self.editRedoAction.setIconSet(QIconSet(self.image4)) + self.editCutAction = QAction(self,"editCutAction") + self.editCutAction.setIconSet(QIconSet(self.image5)) + self.editCopyAction = QAction(self,"editCopyAction") + self.editCopyAction.setIconSet(QIconSet(self.image6)) + self.editPasteAction = QAction(self,"editPasteAction") + self.editPasteAction.setIconSet(QIconSet(self.image7)) + self.editFindAction = QAction(self,"editFindAction") + self.editFindAction.setIconSet(QIconSet(self.image8)) + self.helpContentsAction = QAction(self,"helpContentsAction") + self.helpIndexAction = QAction(self,"helpIndexAction") + self.helpAboutAction = QAction(self,"helpAboutAction") + self.traductionnew_itemAction = QAction(self,"traductionnew_itemAction") + self.fileSaveCloseAction = QAction(self,"fileSaveCloseAction") + self.fileCloseAction = QAction(self,"fileCloseAction") + self.fileNewViewAction = QAction(self,"fileNewViewAction") + self.fileCloseAllAction = QAction(self,"fileCloseAllAction") + self.jdcRapportDeValidationAction = QAction(self,"jdcRapportDeValidationAction") + self.jdcFichierSourceAction = QAction(self,"jdcFichierSourceAction") + + + self.toolBar = QToolBar(QString(""),self,Qt.DockTop) + + self.toolBar.setFrameShape(QToolBar.MenuBarPanel) + self.toolBar.setHorizontallyStretchable(0) + self.fileNewAction.addTo(self.toolBar) + self.fileSaveAction.addTo(self.toolBar) + self.fileOpenAction.addTo(self.toolBar) + self.fileSaveAsAction.addTo(self.toolBar) + self.editCutAction.addTo(self.toolBar) + self.editPasteAction.addTo(self.toolBar) + self.editFindAction.addTo(self.toolBar) + self.fileExitAction.addTo(self.toolBar) + + + self.MenuBar = QMenuBar(self,"MenuBar") + + self.MenuBar.setMargin(2) + + self.Fichier = QPopupMenu(self) + self.fileNewAction.addTo(self.Fichier) + self.fileNewViewAction.addTo(self.Fichier) + self.fileOpenAction.addTo(self.Fichier) + self.fileSaveAction.addTo(self.Fichier) + self.fileSaveAsAction.addTo(self.Fichier) + self.fileCloseAction.addTo(self.Fichier) + self.fileCloseAllAction.addTo(self.Fichier) + self.Fichier.insertSeparator() + self.Fichier.insertSeparator() + self.fileExitAction.addTo(self.Fichier) + self.MenuBar.insertItem(QString(""),self.Fichier,2) + + self.Edition = QPopupMenu(self) + self.Edition.insertSeparator() + self.editCutAction.addTo(self.Edition) + self.editCopyAction.addTo(self.Edition) + self.editPasteAction.addTo(self.Edition) + self.Edition.insertSeparator() + self.editFindAction.addTo(self.Edition) + self.MenuBar.insertItem(QString(""),self.Edition,3) + + self.JdC = QPopupMenu(self) + self.jdcRapportDeValidationAction.addTo(self.JdC) + self.jdcFichierSourceAction.addTo(self.JdC) + self.MenuBar.insertItem(QString(""),self.JdC,4) + + self.Options = QPopupMenu(self) + self.MenuBar.insertItem(QString(""),self.Options,5) + + self.Aide = QPopupMenu(self) + self.MenuBar.insertItem(QString(""),self.Aide,6) + + self.Traduction = QPopupMenu(self) + self.traductionnew_itemAction.addTo(self.Traduction) + self.MenuBar.insertItem(QString(""),self.Traduction,7) + + self.Patrons = QPopupMenu(self) + self.MenuBar.insertItem(QString(""),self.Patrons,8) + + + self.languageChange() + + self.resize(QSize(902,575).expandedTo(self.minimumSizeHint())) + self.clearWState(Qt.WState_Polished) + + self.connect(self.fileNewAction,SIGNAL("activated()"),self.fileNew) + self.connect(self.fileOpenAction,SIGNAL("activated()"),self.fileOpen) + self.connect(self.fileSaveAction,SIGNAL("activated()"),self.fileSave) + self.connect(self.fileSaveAsAction,SIGNAL("activated()"),self.fileSaveAs) + self.connect(self.fileExitAction,SIGNAL("activated()"),self.fileExit) + self.connect(self.editUndoAction,SIGNAL("activated()"),self.editUndo) + self.connect(self.editRedoAction,SIGNAL("activated()"),self.editRedo) + self.connect(self.editCutAction,SIGNAL("activated()"),self.editCut) + self.connect(self.editPasteAction,SIGNAL("activated()"),self.editPaste) + self.connect(self.editFindAction,SIGNAL("activated()"),self.editFind) + self.connect(self.helpIndexAction,SIGNAL("activated()"),self.helpIndex) + self.connect(self.helpContentsAction,SIGNAL("activated()"),self.helpContents) + self.connect(self.helpAboutAction,SIGNAL("activated()"),self.helpAbout) + self.connect(self.fileCloseAction,SIGNAL("activated()"),self.fileClose) + self.connect(self.fileNewViewAction,SIGNAL("activated()"),self.fileNewView) + self.connect(self.fileCloseAllAction,SIGNAL("activated()"),self.fileCloseAll) + self.connect(self.editCopyAction,SIGNAL("activated()"),self.editCopy) + self.connect(self.jdcRapportDeValidationAction,SIGNAL("activated()"),self.jdcRapport) + self.connect(self.jdcFichierSourceAction,SIGNAL("activated()"),self.jdcFichierSource) + + + def languageChange(self): + self.setCaption(self.__tr("Eficas ")) + self.fileNewAction.setText(self.__tr("New")) + self.fileNewAction.setMenuText(self.__tr("&New")) + self.fileNewAction.setAccel(self.__tr("Ctrl+N")) + self.fileOpenAction.setText(self.__tr("Open")) + self.fileOpenAction.setMenuText(self.__tr("&Open...")) + self.fileOpenAction.setAccel(self.__tr("Ctrl+O")) + self.fileSaveAction.setText(self.__tr("Save")) + self.fileSaveAction.setMenuText(self.__tr("&Save")) + self.fileSaveAction.setAccel(self.__tr("Ctrl+S")) + self.fileSaveAsAction.setText(self.__tr("Save As")) + self.fileSaveAsAction.setMenuText(self.__tr("Save &As...")) + self.fileSaveAsAction.setAccel(QString.null) + self.fileExitAction.setText(self.__tr("Exit")) + self.fileExitAction.setMenuText(self.__tr("E&xit")) + self.fileExitAction.setAccel(QString.null) + self.editUndoAction.setText(self.__tr("Undo")) + self.editUndoAction.setMenuText(self.__tr("&Undo")) + self.editUndoAction.setAccel(self.__tr("Ctrl+Z")) + self.editRedoAction.setText(self.__tr("Redo")) + self.editRedoAction.setMenuText(self.__tr("&Redo")) + self.editRedoAction.setAccel(self.__tr("Ctrl+Y")) + self.editCutAction.setText(self.__tr("Cut")) + self.editCutAction.setMenuText(self.__tr("Cu&t")) + self.editCutAction.setAccel(self.__tr("Ctrl+X")) + self.editCopyAction.setText(self.__tr("Copy")) + self.editCopyAction.setMenuText(self.__tr("&Copy")) + self.editCopyAction.setAccel(self.__tr("Ctrl+C")) + self.editPasteAction.setText(self.__tr("Paste")) + self.editPasteAction.setMenuText(self.__tr("&Paste")) + self.editPasteAction.setAccel(self.__tr("Ctrl+V")) + self.editFindAction.setText(self.__tr("Find")) + self.editFindAction.setMenuText(self.__tr("&Find...")) + self.editFindAction.setAccel(self.__tr("Ctrl+F")) + self.helpContentsAction.setText(self.__tr("Contents")) + self.helpContentsAction.setMenuText(self.__tr("&Contents...")) + self.helpContentsAction.setAccel(QString.null) + self.helpIndexAction.setText(self.__tr("Index")) + self.helpIndexAction.setMenuText(self.__tr("&Index...")) + self.helpIndexAction.setAccel(QString.null) + self.helpAboutAction.setText(self.__tr("About")) + self.helpAboutAction.setMenuText(self.__tr("&About")) + self.helpAboutAction.setAccel(QString.null) + self.traductionnew_itemAction.setText(self.__tr("new item")) + self.traductionnew_itemAction.setMenuText(self.__tr("new item")) + self.fileSaveCloseAction.setText(self.__tr("Close")) + self.fileSaveCloseAction.setMenuText(self.__tr("Close")) + self.fileCloseAction.setText(self.__tr("Close")) + self.fileCloseAction.setMenuText(self.__tr("Close")) + self.fileCloseAction.setAccel(self.__tr("Ctrl+W")) + self.fileNewViewAction.setText(self.__tr("New view")) + self.fileCloseAllAction.setText(self.__tr("Close All")) + self.fileCloseAllAction.setMenuText(self.__tr("Close All")) + self.jdcRapportDeValidationAction.setText(self.__tr("Rapport de validation")) + self.jdcRapportDeValidationAction.setMenuText(self.__tr("Rapport de validation")) + self.jdcRapportDeValidationAction.setAccel(self.__tr("Ctrl+R")) + self.jdcFichierSourceAction.setText(self.__tr("Fichier source")) + self.jdcFichierSourceAction.setMenuText(self.__tr("Fichier source")) + self.jdcFichierSourceAction.setAccel(self.__tr("Ctrl+B")) + self.toolBar.setLabel(self.__tr("Tools")) + if self.MenuBar.findItem(2): + self.MenuBar.findItem(2).setText(self.__tr("&Fichier")) + if self.MenuBar.findItem(3): + self.MenuBar.findItem(3).setText(self.__tr("&Edition")) + if self.MenuBar.findItem(4): + self.MenuBar.findItem(4).setText(self.__tr("JdC")) + if self.MenuBar.findItem(5): + self.MenuBar.findItem(5).setText(self.__tr("Options")) + if self.MenuBar.findItem(6): + self.MenuBar.findItem(6).setText(self.__tr("&Aide")) + if self.MenuBar.findItem(7): + self.MenuBar.findItem(7).setText(self.__tr("Traduction")) + if self.MenuBar.findItem(8): + self.MenuBar.findItem(8).setText(self.__tr("Patrons")) + + + def fileNew(self): + print "Eficas.fileNew(): Not implemented yet" + + def fileOpen(self): + print "Eficas.fileOpen(): Not implemented yet" + + def fileSave(self): + print "Eficas.fileSave(): Not implemented yet" + + def fileSaveAs(self): + print "Eficas.fileSaveAs(): Not implemented yet" + + def filePrint(self): + print "Eficas.filePrint(): Not implemented yet" + + def fileExit(self): + print "Eficas.fileExit(): Not implemented yet" + + def editUndo(self): + print "Eficas.editUndo(): Not implemented yet" + + def editRedo(self): + print "Eficas.editRedo(): Not implemented yet" + + def jdcFichierSource(self): + print "Eficas.jdcFichierSource(): Not implemented yet" + + def fileNewView(self): + print "Eficas.fileNewView(): Not implemented yet" + + def editPaste(self): + print "Eficas.editPaste(): Not implemented yet" + + def editFind(self): + print "Eficas.editFind(): Not implemented yet" + + def helpIndex(self): + print "Eficas.helpIndex(): Not implemented yet" + + def helpContents(self): + print "Eficas.helpContents(): Not implemented yet" + + def helpAbout(self): + print "Eficas.helpAbout(): Not implemented yet" + + def fileClose(self): + print "Eficas.fileClose(): Not implemented yet" + + def fileCloseAll(self): + print "Eficas.fileCloseAll(): Not implemented yet" + + def jdcRapport(self): + print "Eficas.jdcRapport(): Not implemented yet" + + def editCut(self): + print "Eficas.editCut(): Not implemented yet" + + def editCopy(self): + print "Eficas.editCopy(): Not implemented yet" + + def __tr(self,s,c = None): + return qApp.translate("Eficas",s,c) diff --git a/InterfaceQT/panelsQT.py b/InterfaceQT/panelsQT.py new file mode 100644 index 00000000..cc2125fe --- /dev/null +++ b/InterfaceQT/panelsQT.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +import string +import os + +import traceback + +from qt import * +from qtCommun import QTPanel +from desInactif import DInactif + + +SEPARATEUR = '-'*30 + + +class PanelInactif( QTPanel, DInactif ): + def __init__(self,node,parent=None ): + DInactif.__init__(self,parent) + QTPanel.__init__(self,node,parent) + + +class NoPanel( QWidget ): + def __init__(self,parent = None,name = None,fl = 0): + QWidget.__init__(self,parent,name,fl) + self.textLabel = QLabel(self) + self.textLabel.setText(QString("PANNEAU A IMPLEMENTER")) + self.textLabel.setGeometry(QRect(130,150,219,17)) + self.resize(QSize(600,480).expandedTo(self.minimumSizeHint())) + diff --git a/InterfaceQT/politiquesValidation.py b/InterfaceQT/politiquesValidation.py new file mode 100644 index 00000000..dd04a650 --- /dev/null +++ b/InterfaceQT/politiquesValidation.py @@ -0,0 +1,148 @@ +# -*- 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 types + + +#------------------ +class Validation : +#------------------ + def __init__(self,node,parent) : + self.node=node + self.parent=parent + + def TesteUneValeur(self,valeurentree): + valeur,validite=self.node.item.eval_valeur(valeurentree) + if not validite : + commentaire = "impossible d'évaluer : %s " %`valeurentree` + return valeur,validite,commentaire + + testtype,commentaire = self.node.item.object.verif_type(valeur) + if not testtype : + return valeur,0,commentaire + + valide=self.node.item.valide_item(valeur) + if type(valide) == types.TupleType: + validite,commentaire=valide + else : + validite=valide + commentaire=" " + + if not validite : + commentaire = "impossible d'évaluer : %s " %`valeurentree` + return valeur, validite, commentaire + +# ---------------------------------------------------------------------------------------- +# Méthodes utilisées pour la manipulation des items en notation scientifique +# a mettre au point +# ---------------------------------------------------------------------------------------- + def SetValeurTexte(self,texteValeur) : + try : + if "R" in self.node.item.object.definition.type: + if texteValeur[0] != "'": + clef=eval(texteValeur) + if str(clef) != str(texteValeur) : + self.node.item.object.init_modif() + clefobj=self.node.item.object.GetNomConcept() + if not self.parent.dict_reels.has_key(clefobj): + self.parent.dict_reels[clefobj] = {} + self.parent.dict_reels[clefobj][clef]=texteValeur + self.parent.dict_reels[clefobj] + self.node.item.object.fin_modif() + except: + pass + + def GetValeurTexte(self,valeur) : + valeurTexte=valeur + if "R" in self.node.item.object.definition.type: + clefobj=self.node.item.object.GetNomConcept() + if self.parent.dict_reels.has_key(clefobj): + if self.parent.dict_reels[clefobj].has_key(valeur): + valeurTexte=self.parent.dict_reels[clefobj][valeur] + return valeurTexte + +#------------------------------------ +class PolitiqueUnique(Validation) : +#------------------------------------ + """ + classe servant pour les entrees ne demandant qu un mot clef + """ + def __init__(self,node,parent): + Validation.__init__(self,node,parent) + + 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) + if validite : + validite=self.node.item.set_valeur(valeur) + if self.node.item.isvalid(): + commentaire = "Valeur du mot-clé enregistrée" + self.SetValeurTexte(str(valeurentree)) + else: + 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) + return validite, commentaire + + +#------------------------ +class PolitiquePlusieurs: +#------------------------ + """ + classe servant pour les entrees ne demandant qu un mot clef + """ + def __init__(self,node,parent) : + self.node=node + self.parent=parent + + + 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,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(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) + + return valide,commentaire,commentaire2,listeRetour diff --git a/InterfaceQT/prefsQT.py b/InterfaceQT/prefsQT.py new file mode 100644 index 00000000..ef1aa899 --- /dev/null +++ b/InterfaceQT/prefsQT.py @@ -0,0 +1,25 @@ +# -*- 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. +# +# +# ====================================================================== + +lang='fr' + diff --git a/InterfaceQT/qtCommun.py b/InterfaceQT/qtCommun.py new file mode 100644 index 00000000..d0502605 --- /dev/null +++ b/InterfaceQT/qtCommun.py @@ -0,0 +1,296 @@ +# -*- 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 InterfaceQT import prefsQT + +# 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) + - la mutualisation de l affichage des regles + """ + def __init__(self,node, parent = None): + self.editor = parent + self.node = node + + def BSupPressed(self): + self.editor.init_modif() + self.node.delete() + + 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.LENomConceptReturnPressed() + if label==QString("Ajouter Mot-Clef"): + self.DefMC() + if label==QString("Définition Formule"): + self.BOkPressedFormule() + + def AppelleBuildLBRegles(self): + listeRegles = self.node.item.get_regles() + listeNomsEtapes = self.node.item.get_mc_presents() + self.BuildLBRegles(listeRegles,listeNomsEtapes) + + + def BuildLBRegles(self,listeRegles,listeNomsEtapes): + if len(listeRegles) > 0: + for regle in listeRegles : + texteRegle=regle.gettext() + texteMauvais,test = regle.verif(listeNomsEtapes) + for ligne in texteRegle.split("\n") : + if ligne == "" : + self.LBRegles.insertItem(ligne) + continue + if ligne[0]=="\t" : + ligne=" "+ligne[1:] + if test : + self.LBRegles.insertItem(ligne) + else : + self.LBRegles.insertItem(itemColore(ligne)) + + +# ----------------------- # +class QTPanelTBW1(QTPanel): +# ----------------------- # + """ + Classe contenant les méthodes nécessaires a l onglet "Ajouter Mot-Clef" + hérite de QTPanel # Attention n appelle pas le __init__ + Gére plus précisement : + """ + def __init__(self,node, parent = None): + self.editor = parent + self.node = node + self.BuildLBMCPermis() + self.AppelleBuildLBRegles() + + 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) + +# ---------------------------- # +class QTPanelTBW2(QTPanel): +# ---------------------------- # + """ + Classe contenant les méthodes nécessaires a l onglet "Nouvelle Commande" + hérite de QTPanel # Attention n appelle pas le __init__ + Gére plus précisement : + """ + + def __init__(self,node, parent = None): + self.editor = parent + self.node = node + self.BuildLBNouvCommande() + self.AppelleBuildLBRegles() + + + 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 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()) + + +# ---------------------------- # +class QTPanelTBW3(QTPanel): +# ---------------------------- # + + """ + Classe contenant les méthodes nécessaires a l onglet "Nommer Concept" + si non réentrant + hérite de QTPanel # Attention n appelle pas le __init__ + Gére plus précisement : + """ + + def __init__(self,node, parent = None): + self.editor = parent + self.node = node + type_sd = self.node.item.get_type_sd_prod() + nomConcept = self.node.item.GetText() + self.typeConcept.setText(type_sd) + self.LENomConcept.setText("") + self.LENomConcept.setText(nomConcept) + + + + def LENomConceptReturnPressed(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: + return + fn = unicode(QDir.convertSeparators(fn)) + else: + return + + #ecriture du fichier + try: + 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 + + +#------------------------------- +class itemColore(QListBoxText): +#------------------------------- + def paint(self,p): + p.setPen(Qt.red) + QListBoxText.paint(self,p); diff --git a/InterfaceQT/qtEficas.py b/InterfaceQT/qtEficas.py new file mode 100644 index 00000000..a94621b3 --- /dev/null +++ b/InterfaceQT/qtEficas.py @@ -0,0 +1,206 @@ +""" + +""" +import os, sys +REPINI=os.path.dirname(os.path.abspath(__file__)) +INSTALLDIR=os.path.join(REPINI,'..') +sys.path.append(INSTALLDIR) +sys.path.append(INSTALLDIR+"/Ui") + +from qt import * +from myMain_ui import Eficas +from viewManager import MyTabview + +from Editeur import configuration +from Aster import prefs +from InterfaceQT import utilIcons +utilIcons.initializeMimeSourceFactory() + +class Appli(Eficas): + """ + Class implementing the main user interface. + """ + def __init__(self): + """ + Constructor + + @param loc locale to be used by the UI (string) + @param splash reference to the splashscreen (UI.SplashScreen.SplashScreen) + """ + Eficas.__init__(self) + + self.top=self + self.CONFIGURATION = configuration.make_config(self,prefs.REPINI) + self.CONFIGStyle = configuration.make_config_style(self,prefs.REPINI) + + self.viewmanager = MyTabview(self, self) #MyTabview, MyWorkspace, Listspace + self.setCentralWidget(self.viewmanager) + + self.recentMenu = QPopupMenu(self.Fichier) + self.Fichier.insertItem(self.trUtf8('Open &Recent Files'), self.recentMenu) + self.connect(self.recentMenu,SIGNAL('aboutToShow()'),self.handleShowRecentMenu) + + + self.connect(self,PYSIGNAL('preferencesChanged'), + self.viewmanager.handlePreferencesChanged) + + self.connect(self.viewmanager,PYSIGNAL('lastEditorClosed'), + self.handleLastEditorClosed) + + self.connect(self.viewmanager,PYSIGNAL('editorOpened'), + self.handleEditorOpened) + + # Initialise the instance variables. + self.currentProg = None + self.isProg = 0 + self.utEditorOpen = 0 + self.utProjectOpen = 0 + + self.inDragDrop = 0 + self.setAcceptDrops(1) + self.ficPatrons={} + self.initPatrons() + self.ihm="QT" + + + def initPatrons(self) : + from Editeur import listePatrons + self.listePatrons = listePatrons.listePatrons() + idx = 0 + for nomSsMenu in self.listePatrons.liste.keys(): + ssmenu = QPopupMenu(self.Patrons) + self.Patrons.insertItem(nomSsMenu, ssmenu) + for fichier in self.listePatrons.liste[nomSsMenu]: + id = ssmenu.insertItem(fichier, self.handleOpenPatrons) + self.ficPatrons[idx]=fichier + self.Patrons.setItemParameter(id,idx) + idx=idx+1 + + def handleShowRecentMenu(self): + """ + Private method to set up recent files menu. + """ + idx = 0 + self.recentMenu.clear() + + for rp in self.viewmanager.recent: + id = self.recentMenu.insertItem('&%d. %s' % (idx+1, unicode(rp)), + self.handleOpenRecent) + self.recentMenu.setItemParameter(id,idx) + + idx = idx + 1 + + self.recentMenu.insertSeparator() + self.recentMenu.insertItem(self.trUtf8('&Clear'), self.handleClearRecent) + + def handleOpenPatrons(self, idx): + fichier=REPINI+"/../Editeur/Patrons/"+self.ficPatrons[idx] + self.viewmanager.handleOpen(fn=fichier, patron = 1) + + + def handleOpenRecent(self, idx): + """ + Private method to open a file from the list of rencently opened files. + + @param idx index of the selected entry (int) + """ + self.viewmanager.handleOpen(unicode(self.viewmanager.recent[idx])) + + def handleClearRecent(self): + """ + Private method to clear the recent files menu. + """ +## self.recent = QStringList() + self.viewmanager.recent = QStringList() + + + def handleLastEditorClosed(self): + """ + Public slot to handle the lastEditorClosed signal. + """ + print 10*"handleLastEditorClosed: CS_pbruno todo griser les parties k'il faut " + pass # CS_pbruno todo griser les parties k'il faut + + def handleEditorOpened(self, fn): + """ + Public slot to handle the editorOpened signal. + + @param fn filename of the opened editor (string) + """ + print 10*"handleEditorOpened: CS_pbruno todo griser les parties k'il faut " + pass # CS_pbruno todo degriser les parties k'il faut + + + def fileNew(self): + self.viewmanager.newEditor() + + def fileOpen(self, prog=None): + self.viewmanager.handleOpen(prog) + + def fileNewView(self): + self.viewmanager.handleNewView() + + def fileSave(self): + self.viewmanager.saveCurrentEditor() + + def fileSaveAs(self): + self.viewmanager.saveAsCurrentEditor() + + def fileClose(self): + self.viewmanager.handleClose() + + def fileCloseAll(self): + self.viewmanager.handleCloseAll() + + def fileExit(self): + self.viewmanager.handleCloseAll() + qApp.closeAllWindows() + + def editCopy(self): + self.viewmanager.handleEditCopy() + + def editCut(self): + self.viewmanager.handleEditCut() + + def editPaste(self): + self.viewmanager.handleEditPaste() + + def jdcFichierSource(self): + self.viewmanager.handleViewJdcFichierSource() + + def jdcRapport(self): + self.viewmanager.handleViewJdcRapport() + + + + + +if __name__=='__main__': + + # Modules Eficas + from Aster import prefs + if hasattr(prefs,'encoding'): + # Hack pour changer le codage par defaut des strings + import sys + reload(sys) + sys.setdefaultencoding(prefs.encoding) + del sys.setdefaultencoding + # Fin hack + + #CS_pbruno note: fait implicitement des trucs ces imports (grr) + #import styles + from Editeur import import_code + from Editeur import session + + # Analyse des arguments de la ligne de commande + options=session.parse(sys.argv) + code=options.code + + app = QApplication(sys.argv) + mw = Appli() + app.setMainWidget(mw) + app.connect(app, SIGNAL("lastWindowClosed()"), app, SLOT("quit()")) + mw.show() + + res = app.exec_loop() + sys.exit(res) diff --git a/InterfaceQT/qtSaisie.py b/InterfaceQT/qtSaisie.py new file mode 100644 index 00000000..3ec98d3d --- /dev/null +++ b/InterfaceQT/qtSaisie.py @@ -0,0 +1,144 @@ +# -*- 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)) + if listeValeurs != None and listeValeurs != [] : + self.LBValeurs.setCurrentItem(len(listeValeurs) - 1) + + + 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,valeurTraitee=None) : + # lit la chaine entree dans le line edit + # et la tranforme en chaine de valeurs + # a traiter. renvoie eventuellement des complexes + listeValeurs=[] + if valeurTraitee == None : + valeurBrute=str(self.LEValeur.text()) + else : + valeurBrute=valeurTraitee + print type(valeurBrute) + 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/InterfaceQT/readercata.py b/InterfaceQT/readercata.py new file mode 100644 index 00000000..2fbe686b --- /dev/null +++ b/InterfaceQT/readercata.py @@ -0,0 +1,405 @@ +# -*- 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. +# +# +# ====================================================================== +""" + Ce module sert a lire un catalogue et a construire + un objet CataItem pour Eficas. + Il s'appuie sur la classe READERCATA +""" +# Modules Python +import time +import os,sys,py_compile +import traceback +import cPickle +import re + +# Modules Eficas +from Aster import prefs +from Noyau.N_CR import CR +from utils import init_rep_cata_dev + +from Editeur import analyse_catalogue +from Editeur import autre_analyse_cata +from Editeur import uiinfo +from monChoixCata import MonChoixCata + +from qt import * + +class READERCATA: + + #menu_defs=[ + # ('Catalogue',[ + # ("Rapport de validation catalogue",'visuCRCATA'), + # ] + # ) + # ] + # + #button_defs=[] + + def __init__(self,appli,parent): + self.appli=appli + self.parent=parent + self.code=self.appli.code + self.appli.format_fichier.set('python') + self.version_code=self.appli.version_code + self.version_cata=None + self.fic_cata=None + self.OpenCata() + self.cataitem=None + + def OpenCata(self): + """ + Ouvre le catalogue standard du code courant, cad le catalogue présent + dans le répertoire Cata + """ + message1 = "Compilation des fichiers Eficas \n\n Veuillez patienter ..." + self.configure_barre(4) + + liste_cata_possibles=[] + for catalogue in self.appli.CONFIGURATION.catalogues: + if catalogue[0] == self.code : + liste_cata_possibles.append(catalogue) + + if len(liste_cata_possibles)==0: + QMessageBox.critical( self.parent, "Import du catalogue","Pas de catalogue defini pour le code %s" % self.code) + self.appli.quit() + sys.exit(1) + + if self.version_code is not None: + # La version a ete fixee + for cata in liste_cata_possibles: + if self.version_code == cata[1]: + self.fic_cata = cata[2] + self.appli.format_fichier.set(cata[3]) + elif len(liste_cata_possibles)==1: + self.fic_cata = liste_cata_possibles[0][2] + self.code = self.appli.CONFIGURATION.catalogues[0][0] + self.version_code = liste_cata_possibles[0][1] + self.appli.format_fichier.set(liste_cata_possibles[0][3]) + lab=QString("Eficas V1.12 pour ASTER avec le catalogue ") + lab+=self.version_code + qApp.mainWidget().setCaption(lab) + else: + # plusieurs catalogues sont disponibles : il faut demander a l'utilisateur + # lequel il veut utiliser ... + self.ask_choix_catalogue() + + if self.fic_cata == None : + print "Pas de catalogue pour code %s, version %s" %(self.code,self.version_code) + sys.exit(0) + + # Determinination du repertoire materiau + v_codeSansPoint=self.version_code + v_codeSansPoint=re.sub("\.","",v_codeSansPoint) + chaine="rep_mat_"+v_codeSansPoint + if hasattr(self.appli.CONFIGURATION,chaine): + a=getattr(self.appli.CONFIGURATION,chaine) + else : + try : + a=self.appli.CONFIGURATION.dRepMat[self.version_code] + except : + print "Probleme avec le repertoire materiau" + a='.' + self.appli.CONFIGURATION.rep_mat=a + + + # détermination de fic_cata_c et fic_cata_p + self.fic_cata_c = self.fic_cata + 'c' + self.fic_cata_p = os.path.splitext(self.fic_cata)[0]+'_pickled.py' + + # import du catalogue + self.cata = self.import_cata(self.fic_cata) + self.update_barre() + if not self.cata : + QMessageBox.critical( self.parent, "Import du catalogue","Impossible d'importer le catalogue %s" %self.fic_cata) + self.appli.quit() + sys.exit(1) + # + # analyse du catalogue (ordre des mots-clés) + # + # Retrouve_Ordre_Cata_Standard fait une analyse textuelle du catalogue + # remplacé par Retrouve_Ordre_Cata_Standard_autre qui utilise une numerotation + # des mots clés a la création + self.Retrouve_Ordre_Cata_Standard_autre() + self.update_barre() + + # + # analyse des données liées a  l'IHM : UIinfo + # + uiinfo.traite_UIinfo(self.cata) + self.update_barre() + + # + # traitement des clefs documentaires + # + self.traite_clefs_documentaires() + + # chargement et analyse des catalogues développeur (le cas échéant) + # + if self.appli.CONFIGURATION.isdeveloppeur == 'OUI' : + init_rep_cata_dev(self.fic_cata,self.appli.CONFIGURATION.path_cata_dev) + fic_cata_dev = os.path.join(self.appli.CONFIGURATION.path_cata_dev,'cata_developpeur.py') + if os.path.isfile(fic_cata_dev): + # il y a bien un catalogue développeur : il faut récupérer le module_object associé ... + test = self.compile_cata(fic_cata_dev,fic_cata_dev+'c') + if not test : + showinfo("Compilation catalogue développeur", + "Erreur dans la compilation du catalogue développeur") + self.cata = (self.cata,) + else: + self.cata_dev =self.import_cata(fic_cata_dev) + #self.Retrouve_Ordre_Cata_Developpeur() + self.Retrouve_Ordre_Cata_Developpeur_autre() + self.cata = (self.cata,self.cata_dev) + else: + self.cata = (self.cata,) + else: + self.cata = (self.cata,) + titreSuite=" avec le catalogue " + os.path.basename(self.fic_cata) + titre=self.appli.titre+titreSuite + if self.appli.top: + self.appli.top.title(titre) + self.appli.titre=titre + + def import_cata(self,cata): + """ + Réalise l'import du catalogue dont le chemin d'acca¨s est donné par cata + """ + nom_cata = os.path.splitext(os.path.basename(cata))[0] + rep_cata = os.path.dirname(cata) + sys.path[:0] = [rep_cata] + try : + o=__import__(nom_cata) + return o + except Exception,e: + traceback.print_exc() + return 0 + + def Retrouve_Ordre_Cata_Standard_autre(self): + """ + Construit une structure de données dans le catalogue qui permet + a  EFICAS de retrouver l'ordre des mots-clés dans le texte du catalogue. + Pour chaque entité du catlogue on crée une liste de nom ordre_mc qui + contient le nom des mots clés dans le bon ordre + """ + self.cata_ordonne_dico,self.appli.liste_simp_reel=autre_analyse_cata.analyse_catalogue(self.cata) + + def Retrouve_Ordre_Cata_Standard(self): + """ + Retrouve l'ordre des mots-clés dans le catalogue, cad : + - si ce dernier a été modifié, relance l'analyse du catalogue pour déterminer + l'ordre des mots-clés dans le catalogue + - s'il n'a pas été modifié, relie le fichier pickle + """ + time1 = os.path.getmtime(self.fic_cata) + try : + time2 = os.path.getmtime(self.fic_cata_p) + except: + time2 = 0 + if time2 > time1 : + # l'objet catalogue n'a pas été modifié depuis le dernier "pickle" + self.Get_Ordre_Cata() + else : + # le catalogue a été modifié depuis le dernier "pickle" : + # il faut retrouver l'ordre du catalogue et refaire pickle + self.Get_Ordre_Cata(mode='cata') + self.appli.affiche_infos("Catalogue standard chargé") + + def Retrouve_Ordre_Cata_Developpeur(self): + """ + Retrouve l'ordre des mots-clés dans le catalogue, cad : + - si ce dernier a été modifié, relance l'analyse du catalogue pour déterminer + l'ordre des mots-clés dans le catalogue + - s'il n'a pas été modifié, relie le fichier pickle + """ + if self.code != 'ASTER' : return + fic_cata = os.path.join(self.appli.CONFIGURATION.path_cata_dev,'cata_developpeur.py') + message="Chargement catalogue développeur présent dans :\n %s..." % self.appli.CONFIGURATION.path_cata_dev + cata_dev_ordonne = analyse_cata.analyse_catalogue(self,self.fic_cata) + self.cata_dev_ordonne_cr = cata_dev_ordonne.cr + cata_dev_ordonne_dico = cata_dev_ordonne.entites + self.cata_ordonne_dico.update(cata_dev_ordonne_dico) + self.appli.affiche_infos(" catalogue(s) développeur(s) chargé(s)" ) + + def Retrouve_Ordre_Cata_Developpeur_autre(self): + """ + Retrouve l'ordre des mots-clés dans le catalogue, cad : + - si ce dernier a été modifié, relance l'analyse du catalogue pour déterminer + l'ordre des mots-clés dans le catalogue + - s'il n'a pas été modifié, relie le fichier pickle + """ + if self.code != 'ASTER' : return + message="Chargement catalogue développeur présent dans :\n %s..." % self.appli.CONFIGURATION.path_cata_dev + cata_dev_ordonne_dico,self.appli.liste_simp_reel=autre_analyse_cata.analyse_catalogue(self.cata) + self.cata_ordonne_dico.update(cata_dev_ordonne_dico) + self.appli.affiche_infos(" catalogue(s) développeur(s) chargé(s)" ) + + def Get_Ordre_Cata(self,mode='pickle'): + """ + Retrouve l'ordre du catalogue : + - mode='pickle ': tente de relire le fichier pickle et sinon lance l'analyse du catalogue + - mode='cata' : force l'analyse du catalogue directement sans relire le pickle + """ + if mode == 'pickle' : + try: + f = open(self.fic_cata_p) + u = cPickle.Unpickler(f) + self.cata_ordonne_dico = u.load() + f.close() + except : + # on peut ne pas arriver a  relire le fichier pickle s'il a été altéré + # ou (le plus probable) s'il a été créé sous un autre OS + self.Get_Ordre_Cata(mode='cata') + elif mode == 'cata': + cata_ordonne = analyse_catalogue.analyse_catalogue(self,self.fic_cata) + self.cata_ordonne_cr = cata_ordonne.cr + self.cata_ordonne_dico = cata_ordonne.entites + f = open(self.fic_cata_p,'w+') + p = cPickle.Pickler(f) + p.dump(self.cata_ordonne_dico) + f.close() + else : + raise Exception("Appel a  un mode inconnu de Get_Ordre_Cata : %s" % mode) + return + + def ask_choix_catalogue(self): + """ + Ouvre une fenetre de sélection du catalogue dans le cas oa¹ plusieurs + ont été définis dans Accas/editeur.ini + """ + # construction du dictionnaire et de la liste des catalogues + self.dico_catalogues = {} + defaut = None + for catalogue in self.appli.CONFIGURATION.catalogues: + if catalogue[0] == self.code : + self.dico_catalogues[catalogue[1]] = catalogue + if len(catalogue) == 5 : + if catalogue[4]=='defaut' : defaut = catalogue[1] + liste_choix = self.dico_catalogues.keys() + liste_choix.sort() + + lab=QString("Eficas V1.12 pour ASTER avec le catalogue ") + + # teste si plusieurs catalogues ou non + if len(liste_choix) == 0: + QMessageBox.critical( self.parent, "", "Aucun catalogue déclaré pour %s" %self.code) + self.appli.quit() + sys.exit(1) + #elif len(liste_choix) == 1: + # self.fic_cata = self.dico_catalogues[liste_choix[0]][2] + # self.version_code = liste_choix[0] + lab=QString("Eficas V1.12 pour ASTER avec le catalogue ") + # lab+=self.version_code + # qApp.mainWidget().setCaption(lab) + # return + + # création d'une boite de dialogue modale + widgetChoix=MonChoixCata(liste_choix,self, self.parent, "", True ) + ret=widgetChoix.exec_loop() + + if ret == QDialog.Accepted: + self.version_cata=str(self.version_cata) + self.fic_cata = self.dico_catalogues[self.version_cata][2] + self.version_code = self.version_cata + self.appli.format_fichier.set( self.dico_catalogues[self.version_cata][3] ) + lab+=self.version_cata + qApp.mainWidget().setCaption(lab) + + + + + def compile_cata(self,cata,catac): + """ + Teste si le catalogue a bien besoin d'etre recompilé et si oui, le compile et + affiche un message dans le splash . Retourne 1 si la compilation s'est bien déroulée, + 0 sinon. + """ + time1 = os.path.getmtime(cata) + try: + time2 = os.path.getmtime(catac) + except: + time2 = 0 + if time1 > time2: + try: + # le catalogue doit etre recompilé avant d'etre importé + if self.appli.test == 0 : + splash._splash.configure(text="Compilation du catalogue\nCela peut prendre plusieurs secondes ...") + py_compile.compile(cata) + except: + return 0 + return 1 + + +#-------------------------------------------------------------------------------- +# Méthodes concernant la barre de progression lors de l'analyse du catalogue +#-------------------------------------------------------------------------------- + + def configure_barre(self,nbcommandes): + """ Configure la barre de progression en lui passant comme parama¨tre le + nombre de commandes du catalogue qui lui sert a  déterminer la longueur de son incrément """ + try: + if self.appli.test == 0 : + splash._splash.configure(barre='oui',ratio = nbcommandes) + except: + pass + + def update_barre(self): + """ Update la position de la barre de progression : la fait progresser de son incrément """ + try: + if self.appli.test == 0 : + splash._splash.update_barre() + except: + pass + + def visuCRCATA(self): + """ + Méthode permettant l'affichage du rapport de validation + """ + cr = CR( debut = "Début rapport de validation du catalogue", + fin = "Fin rapport de validation du catalogue") + titre="rapport de validation du catalogue" + if hasattr(self,'cata_ordonne_cr') : + cr.add(self.cata_ordonne_cr) + if hasattr(self,'cata_dev_ordonne_cr') : + cr.add(self.cata_dev_ordonne_cr) + for cata in self.cata: + if hasattr(cata,'JdC'): + cr.add(cata.JdC.report()) + texte_cr = str(cr) + self.visu_texte_cr = Fenetre(self.appli,titre=titre,texte=texte_cr) + + + def traite_clefs_documentaires(self): + try: + self.fic_cata_clef=os.path.splitext(self.fic_cata_c)[0]+'_clefs_docu' + f=open(self.fic_cata_clef) + except: + #print "Pas de fichier associé contenant des clefs documentaires" + return + + dict_clef_docu={} + for l in f.readlines(): + clef=l.split(':')[0] + docu=l.split(':')[1] + docu=docu[0:-1] + dict_clef_docu[clef]=docu + for oper in self.cata.JdC.commandes: + if dict_clef_docu.has_key(oper.nom): + oper.docu=dict_clef_docu[oper.nom] diff --git a/InterfaceQT/typeNode.py b/InterfaceQT/typeNode.py new file mode 100644 index 00000000..9f111468 --- /dev/null +++ b/InterfaceQT/typeNode.py @@ -0,0 +1,54 @@ +# -*- coding: utf-8 -*- +from qt import * + +#---------------------------# +class PopUpMenuNodePartiel : +#---------------------------# + def createPopUpMenu(self): + #menu + self.menu = QPopupMenu(self.tree) + + #ss-menu Comment: + self.commentMenu = QPopupMenu( self.menu ) + self.menu.insertItem( qApp.translate('Browser','Comment'), self.commentMenu ) + self.commentMenu.insertItem( 'after', self.addCommentAfter ) + self.commentMenu.insertItem( 'before', self.addCommentBefore ) + + #ss-menu Parameters: + self.parametersMenu = QPopupMenu( self.menu ) + self.parametersMenu.insertItem( 'after', self.addParametersAfter ) + self.parametersMenu.insertItem( 'before', self.addParametersBefore ) + + #items du menu + self.menu.insertItem( qApp.translate('Browser','Delete'), self.delete ) + self.menu.insertItem( qApp.translate('Browser','Parameters'), self.parametersMenu ) + + + def addCommentAfter(self): + """ + """ + self.addComment() + + def addCommentBefore(self): + """ + """ + self.addComment(False) + + def addParametersAfter(self): + """ + """ + self.addParameters() + + def addParametersBefore(self): + """ + """ + self.addParameters(False) + + +#-----------------------------------------# +class PopUpMenuNode(PopUpMenuNodePartiel) : +#-----------------------------------------# + def createPopUpMenu(self): + PopUpMenuNodePartiel.createPopUpMenu(self) + + self.commentMenu.insertItem( 'it', self.commentIt ) diff --git a/InterfaceQT/utilIcons.py b/InterfaceQT/utilIcons.py new file mode 100644 index 00000000..d52fbc50 --- /dev/null +++ b/InterfaceQT/utilIcons.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- + +from qt import QPixmap +import os + +class PixmapCache: + """ + Class implementing a pixmap cache for icons. + """ + def __init__(self): + """ + Constructor + """ + self.pixmapCache = {} + + def getPixmap(self, key): + """ + Public method to retrieve a pixmap. + + @param key name of the wanted pixmap (string) + @return the requested pixmap (QPixmap) + """ + try: + return self.pixmapCache[key] + except KeyError: + self.pixmapCache[key] = QPixmap.fromMimeSource(key) + return self.pixmapCache[key] + +pixCache = PixmapCache() + +def getPixmap(key, cache = pixCache): + """ + Module function to retrieve a pixmap. + + @param key name of the wanted pixmap (string) + @return the requested pixmap (QPixmap) + """ + return cache.getPixmap(key) + + + +from qt import QMimeSourceFactory + +def initializeMimeSourceFactory(): + """ + Function to initialize the default mime source factory. + + """ + defaultFactory = QMimeSourceFactory.defaultFactory() + repini=os.path.dirname(os.path.abspath(__file__)) + defaultFactory.addFilePath(repini+"/../Editeur/icons") #CS_pbruno todo (config) + diff --git a/InterfaceQT/viewManager.py b/InterfaceQT/viewManager.py new file mode 100644 index 00000000..c06e9c2b --- /dev/null +++ b/InterfaceQT/viewManager.py @@ -0,0 +1,2543 @@ +# -*- 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 os +from InterfaceQT import utilIcons +from qt import * + + +##fonctions utilitaires +def normabspath(path): + """ + Function returning a normalized, absolute path. + + @param path file path (string) + @return absolute, normalized path (string) + """ + return os.path.abspath(path) + + +def samepath(f1, f2): + """ + Function to compare two paths. + + @param f1 first path for the compare (string) + @param f2 second path for the compare (string) + @return flag indicating whether the two paths represent the + same path on disk. + """ + if f1 is None or f2 is None: + return 0 + + if normcasepath(f1) == normcasepath(f2): + return 1 + + return 0 + +def normcasepath(path): + """ + Function returning a path, that is normalized with respect to its case and references. + + @param path file path (string) + @return case normalized path (string) + """ + return os.path.normcase(os.path.normpath(path)) + + + + +class ViewManager: + """ + Base class inherited by all specific viewmanager classes. + + It defines the interface to be implemented by specific + viewmanager classes and all common methods. + + @signal lastEditorClosed emitted after the last editor window was closed + @signal editorOpened(string) emitted after an editor window was opened + @signal editorSaved(string) emitted after an editor window was saved + @signal checkActions(editor) emitted when some actions should be checked + for their status + @signal cursorChanged(editor) emitted after the cursor position of the active + window has changed + @signal breakpointToggled(editor) emitted when a breakpoint is toggled. + @signal bookmarkToggled(editor) emitted when a bookmark is toggled. + """ + def __init__(self, ui ): + """ + Constructor + + @param ui reference to the main user interface + @param dbs reference to the debug server object + """ + # initialize the instance variables + self.ui = ui + self.editors = [] + self.currentEditor = None + self.untitledCount = 0 + self.srHistory = {"search" : QStringList(), "replace" : QStringList()} + self.editorsCheckFocusIn = 1 + self.recent = QStringList() + + + # initialize the central store for api information (used by + # autocompletion and calltips) + self.apis = {} + self.initFileFilters() + + + def initFileFilters(self): + """ + Private method to initialize the lists of supported filename filters. + """ + self.fileFiltersString = self.trUtf8(\ + 'Python Files (*.py);;' + 'Aster Files (*.com*);;' + 'Pyrex Files (*.pyx);;' + 'Quixote Template Files (*.ptl);;' + 'IDL Files (*.idl);;' + 'C Files (*.h *.c);;' + 'C++ Files (*.h *.hpp *.hh *.cxx *.cpp *.cc);;' + 'C# Files (*.cs);;' + 'HTML Files (*.html *.htm *.asp *.shtml *.css);;' + 'PHP Files (*.php *.php3 *.php4 *.php5 *.phtml);;' + 'XML Files (*.xml *.xsl *.xslt *.dtd);;' + 'Java Files (*.java);;' + 'JavaScript Files (*.js);;' + 'SQL Files (*.sql);;' + 'Docbook Files (*.docbook);;' + 'Perl Files (*.pl *.pm *.ph);;' + 'Shell Files (*.sh);;' + 'Aster Files (*.com*);;' + 'All Files (*)') + + fileFilters = QStringList.split(';;', self.fileFiltersString) + + self.ext2Filter = {} + for fileFilter in fileFilters: + extensions = QStringList.split('*', fileFilter) + for extension in extensions[1:]: + extension = unicode(extension).strip().replace(')', '') + if extension: + self.ext2Filter[extension] = unicode(fileFilter) + + + + ##################################################################### + ## methods above need to be implemented by a subclass + ##################################################################### + + def canSplit(self): + """ + public method to signal if splitting of the view is available. + + @return flag indicating splitting of the view is available. + """ + return 0 + + def addSplit(self): + """ + Public method used to split the current view. + """ + pass + + def removeSplit(self): + """ + Public method used to remove the current split view. + + @return Flag indicating successful deletion + """ + return 0 + + def setSplitOrientation(self, orientation): + """ + Public method used to set the orientation of the split view. + + @param orientation orientation of the split + (QSplitter.Horizontal or QSplitter.Vertical) + """ + pass + + def eventFilter(self, object, event): + """ + Private method called to filter an event. + + @param object object, that generated the event (QObject) + @param event the event, that was generated by object (QEvent) + @return flag indicating if event was filtered out + """ + return 0 + + def focusInEvent(self, event): + """ + Public method called when the viewmanager receives focus. + + @param event the event object (QFocusEvent) + """ + self.editorActGrp.setEnabled(1) + + def focusOutEvent(self, event): + """ + Public method called when the viewmanager loses focus. + + @param event the event object (QFocusEvent) + """ + self.editorActGrp.setEnabled(0) + + + def initEditMenu(self): + """ + Public method to create the Edit menu + + @return the generated menu + """ + menu = QPopupMenu(self.ui) + menu.insertTearOffHandle() + self.undoAct.addTo(menu) + self.redoAct.addTo(menu) + self.revertAct.addTo(menu) + menu.insertSeparator() + self.cutAct.addTo(menu) + self.copyAct.addTo(menu) + self.pasteAct.addTo(menu) + self.deleteAct.addTo(menu) + menu.insertSeparator() + self.indentAct.addTo(menu) + self.unindentAct.addTo(menu) + menu.insertSeparator() + self.commentAct.addTo(menu) + self.uncommentAct.addTo(menu) + self.streamCommentAct.addTo(menu) + self.boxCommentAct.addTo(menu) + menu.insertSeparator() + self.autoCompleteAct.addTo(menu) + self.autoCompleteFromDocAct.addTo(menu) + self.autoCompleteFromAPIsAct.addTo(menu) + menu.insertSeparator() + self.searchAct.addTo(menu) + self.searchAgainAct.addTo(menu) + self.replaceAct.addTo(menu) + menu.insertSeparator() + self.searchFilesAct.addTo(menu) + menu.insertSeparator() + self.gotoAct.addTo(menu) + self.gotoBraceAct.addTo(menu) + menu.insertSeparator() + self.selectBraceAct.addTo(menu) + self.selectAllAct.addTo(menu) + self.deselectAllAct.addTo(menu) + menu.insertSeparator() + self.shortenEmptyAct.addTo(menu) + self.convertEOLAct.addTo(menu) + + return menu + + def initEditToolbar(self): + """ + Public method to create the Edit toolbar + + @return the generated toolbar + """ + tb = QToolBar(self.ui) + self.undoAct.addTo(tb) + self.redoAct.addTo(tb) + tb.addSeparator() + self.cutAct.addTo(tb) + self.copyAct.addTo(tb) + self.pasteAct.addTo(tb) + self.deleteAct.addTo(tb) + tb.addSeparator() + self.indentAct.addTo(tb) + self.unindentAct.addTo(tb) + tb.addSeparator() + self.commentAct.addTo(tb) + self.uncommentAct.addTo(tb) + + return tb + + ################################################################## + ## Initialize the search related actions, search menu and toolbar + ################################################################## + + def initSearchActions(self): + """ + Private method defining the user interface actions for the search commands. + """ + self.searchActGrp = QActionGroup(self) + + self.searchAct = QAction(self.trUtf8('Search'), + QIconSet(utilIcons.getPixmap("find.png")), + self.trUtf8('&Search...'), + QKeySequence(self.trUtf8("CTRL+F","Search|Search")), + self.searchActGrp) + self.searchAct.setStatusTip(self.trUtf8('Search for a text')) + self.searchAct.setWhatsThis(self.trUtf8( + """Search""" + """

Search for some text in the current editor. A""" + """ dialog is shown to enter the searchtext and options""" + """ for the search.

""" + )) + self.connect(self.searchAct,SIGNAL('activated()'),self.handleSearch) + self.searchActions.append(self.searchAct) + + self.searchAgainAct = QAction(self.trUtf8('Search again'), + QIconSet(utilIcons.getPixmap("findNext.png")), + self.trUtf8('Search &again'), + Qt.Key_F3,self.searchActGrp) + self.searchAgainAct.setStatusTip(self.trUtf8('Search again for text')) + self.searchAgainAct.setWhatsThis(self.trUtf8( + """Search again""" + """

Search again for some text in the current editor.""" + """ The previously entered searchtext and options are reused.

""" + )) + self.connect(self.searchAgainAct,SIGNAL('activated()'),self.searchDlg.handleFindNext) + self.searchActions.append(self.searchAgainAct) + + self.replaceAct = QAction(self.trUtf8('Replace'), + self.trUtf8('&Replace...'), + QKeySequence(self.trUtf8("CTRL+R","Search|Replace")), + self.searchActGrp) + self.replaceAct.setStatusTip(self.trUtf8('Replace some text')) + self.replaceAct.setWhatsThis(self.trUtf8( + """Replace""" + """

Search for some text in the current editor and replace it. A""" + """ dialog is shown to enter the searchtext, the replacement text""" + """ and options for the search and replace.

""" + )) + self.connect(self.replaceAct,SIGNAL('activated()'),self.handleReplace) + self.searchActions.append(self.replaceAct) + + self.gotoAct = QAction(self.trUtf8('Goto Line'), + QIconSet(utilIcons.getPixmap("goto.png")), + self.trUtf8('&Goto Line...'), + QKeySequence(self.trUtf8("CTRL+G","Search|Goto Line")), + self.searchActGrp) + self.gotoAct.setStatusTip(self.trUtf8('Goto Line')) + self.gotoAct.setWhatsThis(self.trUtf8( + """Goto Line""" + """

Go to a specific line of text in the current editor.""" + """ A dialog is shown to enter the linenumber.

""" + )) + self.connect(self.gotoAct,SIGNAL('activated()'),self.handleGoto) + self.searchActions.append(self.gotoAct) + + self.gotoBraceAct = QAction(self.trUtf8('Goto Brace'), + QIconSet(utilIcons.getPixmap("gotoBrace.png")), + self.trUtf8('Goto &Brace'), + QKeySequence(self.trUtf8("CTRL+L","Search|Goto Brace")), + self.searchActGrp) + self.gotoBraceAct.setStatusTip(self.trUtf8('Goto Brace')) + self.gotoBraceAct.setWhatsThis(self.trUtf8( + """Goto Brace""" + """

Go to the matching brace in the current editor.

""" + )) + self.connect(self.gotoBraceAct,SIGNAL('activated()'),self.handleGotoBrace) + self.searchActions.append(self.gotoBraceAct) + + self.searchActGrp.setEnabled(0) + + self.searchFilesAct = QAction(self.trUtf8('Search in Files'), + QIconSet(utilIcons.getPixmap("projectFind.png")), + self.trUtf8('Search in &Files...'), + QKeySequence(self.trUtf8("SHIFT+CTRL+F","Search|Search Files")), + self) + self.searchFilesAct.setStatusTip(self.trUtf8('Search for a text in files')) + self.searchFilesAct.setWhatsThis(self.trUtf8( + """Search in Files""" + """

Search for some text in the files of a directory tree""" + """ or the project. A dialog is shown to enter the searchtext""" + """ and options for the search and to display the result.

""" + )) + self.connect(self.searchFilesAct,SIGNAL('activated()'),self.handleSearchFiles) + self.searchActions.append(self.searchFilesAct) + + + ################################################################## + ## Initialize the view related actions, view menu and toolbar + ################################################################## + + def initViewActions(self): + """ + Protected method defining the user interface actions for the view commands. + """ + self.viewActGrp = QActionGroup(self) + self.viewFoldActGrp = QActionGroup(self) + + self.zoomInAct = QAction(self.trUtf8('Zoom in'), + QIconSet(utilIcons.getPixmap("zoomIn.png")), + self.trUtf8('Zoom &in'), + Qt.CTRL+Qt.Key_Plus, self.viewActGrp) + self.zoomInAct.setStatusTip(self.trUtf8('Zoom in on the text')) + self.zoomInAct.setWhatsThis(self.trUtf8( + """Zoom in""" + """

Zoom in on the text. This makes the text bigger.

""" + )) + self.connect(self.zoomInAct,SIGNAL('activated()'),self.handleZoomIn) + self.viewActions.append(self.zoomInAct) + + self.zoomOutAct = QAction(self.trUtf8('Zoom out'), + QIconSet(utilIcons.getPixmap("zoomOut.png")), + self.trUtf8('Zoom &out'), + Qt.CTRL+Qt.Key_Minus, self.viewActGrp) + self.zoomOutAct.setStatusTip(self.trUtf8('Zoom out on the text')) + self.zoomOutAct.setWhatsThis(self.trUtf8( + """Zoom out""" + """

Zoom out on the text. This makes the text smaller.

""" + )) + self.connect(self.zoomOutAct,SIGNAL('activated()'),self.handleZoomOut) + self.viewActions.append(self.zoomOutAct) + + self.zoomToAct = QAction(self.trUtf8('Zoom'), + QIconSet(utilIcons.getPixmap("zoomTo.png")), + self.trUtf8('&Zoom'), + 0, self.viewActGrp) + self.zoomToAct.setStatusTip(self.trUtf8('Zoom the text')) + self.zoomToAct.setWhatsThis(self.trUtf8( + """Zoom""" + """

Zoom the text. This opens a dialog where the""" + """ desired size can be entered.

""" + )) + self.connect(self.zoomToAct,SIGNAL('activated()'),self.handleZoom) + self.viewActions.append(self.zoomToAct) + + self.toggleAllAct = QAction(self.trUtf8('Toggle all folds'), + self.trUtf8('Toggle &all folds'), + 0, self.viewFoldActGrp) + self.toggleAllAct.setStatusTip(self.trUtf8('Toggle all folds')) + self.toggleAllAct.setWhatsThis(self.trUtf8( + """Toggle all folds""" + """

Toggle all folds of the current editor.

""" + )) + self.connect(self.toggleAllAct,SIGNAL('activated()'),self.handleToggleAll) + self.viewActions.append(self.toggleAllAct) + + self.toggleCurrentAct = QAction(self.trUtf8('Toggle current fold'), + self.trUtf8('Toggle ¤t fold'), + 0, self.viewFoldActGrp) + self.toggleCurrentAct.setStatusTip(self.trUtf8('Toggle current fold')) + self.toggleCurrentAct.setWhatsThis(self.trUtf8( + """Toggle current fold""" + """

Toggle the folds of the current line of the current editor.

""" + )) + self.connect(self.toggleCurrentAct,SIGNAL('activated()'),self.handleToggleCurrent) + self.viewActions.append(self.toggleCurrentAct) + + self.unhighlightAct = QAction(self.trUtf8('Remove all highlights'), + QIconSet(utilIcons.getPixmap("unhighlight.png")), + self.trUtf8('Remove all highlights'), + 0, self) + self.unhighlightAct.setStatusTip(self.trUtf8('Remove all highlights')) + self.unhighlightAct.setWhatsThis(self.trUtf8( + """Remove all highlights""" + """

Remove the highlights of all editors.

""" + )) + self.connect(self.unhighlightAct,SIGNAL('activated()'),self.unhighlight) + self.viewActions.append(self.unhighlightAct) + + self.splitViewAct = QAction(self.trUtf8('Split view'), + QIconSet(utilIcons.getPixmap("splitVertical.png")), + self.trUtf8('&Split view'), + 0, self) + self.splitViewAct.setStatusTip(self.trUtf8('Add a split to the view')) + self.splitViewAct.setWhatsThis(self.trUtf8( + """Split view""" + """

Add a split to the view.

""" + )) + self.connect(self.splitViewAct,SIGNAL('activated()'),self.handleSplitView) + self.viewActions.append(self.splitViewAct) + + self.splitOrientationAct = QAction(self.trUtf8('Arrange horizontally'), + self.trUtf8('Arrange &horizontally'), + 0, self, None, 1) + self.splitOrientationAct.setStatusTip(self.trUtf8('Arrange the splitted views horizontally')) + self.splitOrientationAct.setWhatsThis(self.trUtf8( + """Arrange horizontally""" + """

Arrange the splitted views horizontally.

""" + )) + self.splitOrientationAct.setOn(0) + self.connect(self.splitOrientationAct,SIGNAL('activated()'),self.handleSplitOrientation) + self.viewActions.append(self.splitOrientationAct) + + self.splitRemoveAct = QAction(self.trUtf8('Remove split'), + QIconSet(utilIcons.getPixmap("remsplitVertical.png")), + self.trUtf8('&Remove split'), + 0, self) + self.splitRemoveAct.setStatusTip(self.trUtf8('Remove the current split')) + self.splitRemoveAct.setWhatsThis(self.trUtf8( + """Remove split""" + """

Remove the current split.

""" + )) + self.connect(self.splitRemoveAct,SIGNAL('activated()'),self.removeSplit) + self.viewActions.append(self.splitRemoveAct) + + self.viewActGrp.setEnabled(0) + self.viewFoldActGrp.setEnabled(0) + self.unhighlightAct.setEnabled(0) + self.splitViewAct.setEnabled(0) + self.splitOrientationAct.setEnabled(0) + self.splitRemoveAct.setEnabled(0) + + def initViewMenu(self): + """ + Public method to create the View menu + + @return the generated menu + """ + menu = QPopupMenu(self.ui) + menu.insertTearOffHandle() + self.viewActGrp.addTo(menu) + menu.insertSeparator() + self.viewFoldActGrp.addTo(menu) + menu.insertSeparator() + self.unhighlightAct.addTo(menu) + if self.canSplit(): + menu.insertSeparator() + self.splitViewAct.addTo(menu) + self.splitOrientationAct.addTo(menu) + self.splitRemoveAct.addTo(menu) + return menu + + def initViewToolbar(self): + """ + Public method to create the View toolbar + + @return the generated toolbar + """ + tb = QToolBar(self.ui) + self.viewActGrp.addTo(tb) + tb.addSeparator() + self.unhighlightAct.addTo(tb) + if self.canSplit(): + tb.addSeparator() + self.splitViewAct.addTo(tb) + self.splitRemoveAct.addTo(tb) + + return tb + + ################################################################## + ## Initialize the macro related actions and macro menu + ################################################################## + + def initMacroActions(self): + """ + Private method defining the user interface actions for the macro commands. + """ + self.macroActGrp = QActionGroup(self) + + self.macroStartRecAct = QAction(self.trUtf8('Start Macro Recording'), + self.trUtf8('S&tart Macro Recording'), + 0, self.macroActGrp) + self.macroStartRecAct.setStatusTip(self.trUtf8('Start Macro Recording')) + self.macroStartRecAct.setWhatsThis(self.trUtf8( + """Start Macro Recording""" + """

Start recording editor commands into a new macro.

""" + )) + self.connect(self.macroStartRecAct,SIGNAL('activated()'),self.handleMacroStartRecording) + self.macroActions.append(self.macroStartRecAct) + + self.macroStopRecAct = QAction(self.trUtf8('Stop Macro Recording'), + self.trUtf8('Sto&p Macro Recording'), + 0, self.macroActGrp) + self.macroStopRecAct.setStatusTip(self.trUtf8('Stop Macro Recording')) + self.macroStopRecAct.setWhatsThis(self.trUtf8( + """Stop Macro Recording""" + """

Stop recording editor commands into a new macro.

""" + )) + self.connect(self.macroStopRecAct,SIGNAL('activated()'),self.handleMacroStopRecording) + self.macroActions.append(self.macroStopRecAct) + + self.macroRunAct = QAction(self.trUtf8('Run Macro'), + self.trUtf8('&Run Macro'), + 0, self.macroActGrp) + self.macroRunAct.setStatusTip(self.trUtf8('Run Macro')) + self.macroRunAct.setWhatsThis(self.trUtf8( + """Run Macro""" + """

Run a previously recorded editor macro.

""" + )) + self.connect(self.macroRunAct,SIGNAL('activated()'),self.handleMacroRun) + self.macroActions.append(self.macroRunAct) + + self.macroDeleteAct = QAction(self.trUtf8('Delete Macro'), + self.trUtf8('&Delete Macro'), + 0, self.macroActGrp) + self.macroDeleteAct.setStatusTip(self.trUtf8('Delete Macro')) + self.macroDeleteAct.setWhatsThis(self.trUtf8( + """Delete Macro""" + """

Delete a previously recorded editor macro.

""" + )) + self.connect(self.macroDeleteAct,SIGNAL('activated()'),self.handleMacroDelete) + self.macroActions.append(self.macroDeleteAct) + + self.macroLoadAct = QAction(self.trUtf8('Load Macro'), + self.trUtf8('&Load Macro'), + 0, self.macroActGrp) + self.macroLoadAct.setStatusTip(self.trUtf8('Load Macro')) + self.macroLoadAct.setWhatsThis(self.trUtf8( + """Load Macro""" + """

Load an editor macro from a file.

""" + )) + self.connect(self.macroLoadAct,SIGNAL('activated()'),self.handleMacroLoad) + self.macroActions.append(self.macroLoadAct) + + self.macroSaveAct = QAction(self.trUtf8('Save Macro'), + self.trUtf8('&Save Macro'), + 0, self.macroActGrp) + self.macroSaveAct.setStatusTip(self.trUtf8('Save Macro')) + self.macroSaveAct.setWhatsThis(self.trUtf8( + """Save Macro""" + """

Save a previously recorded editor macro to a file.

""" + )) + self.connect(self.macroSaveAct,SIGNAL('activated()'),self.handleMacroSave) + self.macroActions.append(self.macroSaveAct) + + self.macroActGrp.setEnabled(0) + + def initMacroMenu(self): + """ + Public method to create the Macro menu + + @return the generated menu + """ + menu = QPopupMenu(self.ui) + menu.insertTearOffHandle() + self.macroActGrp.addTo(menu) + return menu + + + def checkDirty(self, editor): + """ + Private method to check dirty status and open a message window. + + @param editor editor window to check + @return flag indicating successful reset of the dirty flag (boolean) + """ + if editor.modified: + print 'CHECKDIRTY AAAAAA' + fn = editor.getFileName() + if fn is None: + fn = self.trUtf8('Noname') + res = QMessageBox.warning(self.parent(), + self.trUtf8("File Modified"), + self.trUtf8("The file %1 has unsaved changes.") + .arg(fn), + self.trUtf8("&Save"), self.trUtf8("&Discard changes"), + self.trUtf8("&Abort"), 0, 2) + if res == 0: + (ok, newName) = editor.saveFile() + if ok: + self.setEditorName(editor, newName) + return ok + elif res == 2: + return 0 + print 'CHECKDIRTY BBBBBB' + return 1 + + def checkAllDirty(self): + """ + Public method to check the dirty status of all editors. + + @return flag indicating successful reset of all dirty flags (boolean) + """ + for editor in self.editors: + if not self.checkDirty(editor): + return 0 + + return 1 + + def closeEditor(self, editor): + """ + Private method to close an editor window. + + @param editor editor window to be closed + @return flag indicating success (boolean) + """ + print 'CLOSEEDITOR' + # save file if necessary + if not self.checkDirty(editor): + return 0 + + # remove the window + self.removeView(editor) + self.editors.remove(editor) + if not len(self.editors): + self.handleLastEditorClosed() + self.emit(PYSIGNAL('lastEditorClosed'), ()) #CS_pbruno connecter signal avec l'appli + return 1 + + def handleClose(self): + """ + Public method to close the current window. + + @return flag indicating success (boolean) + """ + aw = self.activeWindow() + if aw is None: + return 0 + + res = self.closeEditor(aw) + if res and aw == self.currentEditor: + self.currentEditor = None + + return res + + def handleNewView(self): + """ + Public method to close the current window. + + @return flag indicating success (boolean) + """ + aw = self.activeWindow() + if aw is None: + return 0 + + aw.handleNewView() + + + def handleCloseAll(self): + """ + Private method to close all editor windows via file menu. + """ + savedEditors = self.editors[:] + for editor in savedEditors: + self.closeEditor(editor) + + def handleCloseWindow(self, fn): + """ + Public method to close an arbitrary source editor. + + @param fn filename of editor to be closed + @return flag indicating success (boolean) + """ + for editor in self.editors: + if samepath(fn, editor.getFileName()): + break + else: + return 1 + + res = self.closeEditor(editor) + if res and editor == self.currentEditor: + self.currentEditor = None + + return res + + def handleExit(self): + """ + Public method to handle the debugged program terminating. + """ + if self.currentEditor is not None: + self.currentEditor.highlight() + self.currentEditor = None + + self.setSbFile() + + def handlePythonFile(self,pyfn,lineno=None): + """ + Public method to handle the user selecting a file for display. + + @param pyfn name of file to be opened + @param lineno line number to place the cursor at + """ + try: + self.displayPythonFile(pyfn,lineno) + except IOError: + pass + + + def displayJDC(self,jdc): + """ + Public slot to display a file in an editor. + + @param fn name of file to be opened + @param lineno line number to place the cursor at + """ + newWin, editor = self.getEditor(None, jdc) + + if newWin: + self.handleModificationStatusChanged(editor.modified, editor) + self.checkActions(editor) + + # insert filename into list of recently opened files + self.addToRecentList(editor.getFileName()) + + + + def newEditorView(self, fn, caller): + """ + Public method to create a new editor displaying the given document. + + @param fn filename of this view + @param caller reference to the editor calling this method + """ + from editor import JDCEditor + print 50*'=' + print 'newEditorView fn->',fn + print 'newEditorView caller.jdc->',caller.jdc + print 50*'+' + editor = JDCEditor(fn, None, self, editor=caller) + self.editors.append(editor) + self.connect(editor, PYSIGNAL('modificationStatusChanged'), + self.handleModificationStatusChanged) + self.connect(editor, PYSIGNAL('cursorChanged'), self.handleCursorChanged) + self.connect(editor, PYSIGNAL('editorSaved'), self.handleEditorSaved) + self.connect(editor, PYSIGNAL('breakpointToggled'), self.handleBreakpointToggled) + self.connect(editor, PYSIGNAL('bookmarkToggled'), self.handleBookmarkToggled) + self.connect(editor, PYSIGNAL('syntaxerrorToggled'), self.handleSyntaxErrorToggled) + self.connect(editor, PYSIGNAL('autoCompletionAPIsAvailable'), + self.handleEditoracAPIsAvailable) + self.handleEditorOpened() + self.emit(PYSIGNAL('editorOpened'), (fn,)) + + self.connect(caller, PYSIGNAL('editorRenamed'), editor.handleRenamed) + self.connect(editor, PYSIGNAL('editorRenamed'), caller.handleRenamed) + + self.addView(editor, fn) + self.handleModificationStatusChanged(editor.modified, editor) + self.checkActions(editor) + + def addToRecentList(self, fn): + """ + Public slot to add a filename to the list of recently opened files. + + @param fn name of the file to be added + """ + self.recent.remove(fn) + self.recent.prepend(fn) + if len(self.recent) > 9: + self.recent = self.recent[:9] + + def toggleWindow(self,w): + """ + Private method to toggle a workspace window. + + @param w editor window to be toggled + """ + if w.isHidden(): + w.show() + else: + w.hide() + + def setFileLine(self,fn,line,error=0,syntaxError=0): + """ + Public method to update the user interface when the current program or line changes. + + @param fn filename of editor to update (string) + @param line line number to highlight (int) + @param error flag indicating an error highlight (boolean) + @param syntaxError flag indicating a syntax error + """ + self.setSbFile(fn,line) + + try: + newWin, self.currentEditor = self.getEditor(fn) + except IOError: + return + + # Change the highlighted line. + self.currentEditor.highlight(line,error,syntaxError) + + self.currentEditor.highlightVisible() + self.checkActions(self.currentEditor, 0) + + def setSbFile(self,fn=None,line=None,pos=None): + """ + Private method to set the file info in the status bar. + + @param fn filename to display (string) + @param line line number to display (int) + @param pos character position to display (int) + """ + if fn is None: + fn = '' + writ = ' ' + else: + if QFileInfo(fn).isWritable(): + writ = ' rw' + else: + writ = ' ro' + + self.sbWritable.setText(writ) + self.sbFile.setText(self.trUtf8('File: %1').arg(fn,-50)) + + if line is None: + line = '' + + self.sbLine.setText(self.trUtf8('Line: %1').arg(line,5)) + + if pos is None: + pos = '' + + self.sbPos.setText(self.trUtf8('Pos: %1').arg(pos, 5)) + + def unhighlight(self, current=0): + """ + Public method to switch off all highlights. + + @param current flag indicating only the current editor should be unhighlighted + (boolean) + """ + if current: + if self.currentEditor is not None: + self.currentEditor.highlight() + else: + for editor in self.editors: + editor.highlight() + + def getOpenFilenames(self): + """ + Public method returning a list of the filenames of all editors. + + @return list of all opened filenames (list of strings) + """ + filenames = [] + for editor in self.editors: + fn = editor.getFileName() + if fn is not None: + filenames.append(fn) + + return filenames + + def getEditor(self, fn, jdc = None): + """ + Private method to return the editor displaying the given file. + + If there is no editor with the given file, a new editor window is + created. + + @param fn filename to look for + @param isPythonFile flag indicating that this is a Python file + even if it doesn't have the .py extension (boolean) + @return tuple of two values giving a flag indicating a new window creation and + a reference to the editor displaying this file + """ + newWin = 0 + for editor in self.editors: + if samepath(fn, editor.getFileName()): + break + else: + from editor import JDCEditor + editor = JDCEditor(fn, jdc, self) + + print 'GETEDITOR editor.jdc->', editor.jdc + if editor.jdc: # le fichier est bien un jdc + self.editors.append(editor) + self.connect(editor, PYSIGNAL('modificationStatusChanged'), + self.handleModificationStatusChanged) + self.connect(editor, PYSIGNAL('cursorChanged'), self.handleCursorChanged) + self.connect(editor, PYSIGNAL('editorSaved'), self.handleEditorSaved) + self.connect(editor, PYSIGNAL('breakpointToggled'), self.handleBreakpointToggled) + self.connect(editor, PYSIGNAL('bookmarkToggled'), self.handleBookmarkToggled) + self.connect(editor, PYSIGNAL('syntaxerrorToggled'), self.handleSyntaxErrorToggled) + self.connect(editor, PYSIGNAL('autoCompletionAPIsAvailable'), + self.handleEditoracAPIsAvailable) + self.handleEditorOpened() + self.emit(PYSIGNAL('editorOpened'), (fn,)) + newWin = 1 + else: + editor.closeIt() + + if newWin: + print 'GETEDITOR addView' + self.addView(editor, fn) + elif editor.jdc: + print 'GETEDITOR showView' + self.showView(editor, fn) + + return (newWin, editor) + + + def getOpenEditor(self, fn): + """ + Public method to return the editor displaying the given file. + + @param fn filename to look for + @return a reference to the editor displaying this file or None, if + no editor was found + """ + for editor in self.editors: + if samepath(fn, editor.getFileName()): + return editor + + return None + + def getActiveName(self): + """ + Public method to retrieve the filename of the active window. + + @return filename of active window (string) + """ + aw = self.activeWindow() + if aw: + return aw.getFileName() + else: + return None + + def saveEditor(self, fn): + """ + Public method to save a named editor file. + + @param fn filename of editor to be saved (string) + @return flag indicating success (boolean) + """ + for editor in self.editors: + if samepath(fn, editor.getFileName()): + break + else: + return 1 + + if not editor.modified: + return 1 + else: + ok, dummy = editor.saveFile() + return ok + + def saveCurrentEditor(self): + """ + Public slot to save the contents of the current editor. + """ + aw = self.activeWindow() + if aw: + ok, newName = aw.saveFile() + if ok: + self.setEditorName(aw, newName) + else: + return + + def saveAsCurrentEditor(self): + """ + Public slot to save the contents of the current editor to a new file. + """ + aw = self.activeWindow() + if aw: + ok, newName = aw.saveFileAs() + if ok: + self.setEditorName(aw, newName) + else: + return + + def saveAllEditors(self): + """ + Public slot to save the contents of all editors. + """ + for editor in self.editors: + ok, newName = editor.saveFile() + if ok: + self.setEditorName(editor, newName) + + # restart autosave timer + if self.autosaveInterval > 0: + self.autosaveTimer.start(self.autosaveInterval * 60000, 1) + + def saveCurrentEditorToProject(self): + """ + Public slot to save the contents of the current editor to the current project. + """ + pro = self.ui.getProject() + path = pro.ppath + aw = self.activeWindow() + if aw: + ok, newName = aw.saveFileAs(path) + if ok: + self.setEditorName(aw, newName) + pro.appendFile(newName) + else: + return + + def newEditor(self): + """ + Public slot to generate a new empty editor. + """ + from editor import JDCEditor + editor = JDCEditor(None,None,self) + + self.editors.append(editor) + self.connect(editor, PYSIGNAL('modificationStatusChanged'), + self.handleModificationStatusChanged) + self.connect(editor, PYSIGNAL('cursorChanged'), self.handleCursorChanged) + self.connect(editor, PYSIGNAL('editorSaved'), self.handleEditorSaved) + self.connect(editor, PYSIGNAL('breakpointToggled'), self.handleBreakpointToggled) + self.connect(editor, PYSIGNAL('bookmarkToggled'), self.handleBookmarkToggled) + self.connect(editor, PYSIGNAL('syntaxerrorToggled'), self.handleSyntaxErrorToggled) + self.connect(editor, PYSIGNAL('autoCompletionAPIsAvailable'), + self.handleEditoracAPIsAvailable) + self.addView(editor, None) + self.handleEditorOpened() + self.checkActions(editor) + self.emit(PYSIGNAL('editorOpened'), (None,)) + + def printCurrentEditor(self): + """ + Public slot to print the contents of the current editor. + """ + aw = self.activeWindow() + if aw: + aw.printFile() + else: + return + + def printCurrentEditorSel(self): + """ + Public slot to print the selection of the current editor. + """ + aw = self.activeWindow() + if aw: + aw.printSelection() + else: + return + +## def handleShowRecentMenu(self): +## """ +## Private method to set up recent files menu. +## """ +## idx = 0 +## self.recentMenu.clear() +## +## for rp in self.recent: +## id = self.recentMenu.insertItem('&%d. %s' % (idx+1, unicode(rp)), +## self.handleOpenRecent) +## self.recentMenu.setItemParameter(id,idx) +## +## idx = idx + 1 +## +## self.recentMenu.insertSeparator() +## self.recentMenu.insertItem(self.trUtf8('&Clear'), self.handleClearRecent) +## +## def handleOpenRecent(self, idx): +## """ +## Private method to open a file from the list of rencently opened files. +## +## @param idx index of the selected entry (int) +## """ +## self.handlePythonFile(unicode(self.recent[idx])) +## +## def handleClearRecent(self): +## """ +## Private method to clear the recent files menu. +## """ +## self.recent = QStringList() + + + def handleViewJdcFichierSource(self): + self.activeWindow().viewJdcSource() + + def handleViewJdcRapport(self): + self.activeWindow().viewJdcRapport() + + def handleNewProject(self): + """ + Public slot to handle the NewProject signal. + """ + self.saveToProjectAct.setEnabled(1) + + def handleProjectOpened(self): + """ + Public slot to handle the projectOpened signal. + """ + self.saveToProjectAct.setEnabled(1) + + def handleProjectClosed(self): + """ + Public slot to handle the projectClosed signal. + """ + self.saveToProjectAct.setEnabled(0) + + def handleProjectFileRenamed(self, oldfn, newfn): + """ + Public slot to handle the projectFileRenamed signal. + + @param oldfn old filename of the file (string) + @param newfn new filename of the file (string) + """ + editor = self.getOpenEditor(oldfn) + if editor: + editor.fileRenamed(newfn) + + def enableEditorsCheckFocusIn(self, enabled): + """ + Public method to set a flag enabling the editors to perform focus in checks. + + @param enabled flag indicating focus in checks should be performed (boolean) + """ + self.editorsCheckFocusIn = enabled + + def editorsCheckFocusInEnabled(self): + """ + Public method returning the flag indicating editors should perform focus in checks. + + @return flag indicating focus in checks should be performed (boolean) + """ + return self.editorsCheckFocusIn + + def handleFindFileName(self): + """ + Private method to handle the search for file action. + """ + self.ui.findFileNameDialog.show() + self.ui.findFileNameDialog.raiseW() + self.ui.findFileNameDialog.setActiveWindow() + + ################################################################## + ## Below are the action methods for the edit menu + ################################################################## + + def handleEditUndo(self): + """ + Private method to handle the undo action. + """ + self.activeWindow().undo() + + def handleEditRedo(self): + """ + Private method to handle the redo action. + """ + self.activeWindow().redo() + + def handleEditRevert(self): + """ + Private method to handle the revert action. + """ + self.activeWindow().revertToUnmodified() + + def handleEditCut(self): + """ + Private method to handle the cut action. + """ + self.activeWindow().cut() + + def handleEditCopy(self): + """ + Private method to handle the copy action. + """ + self.activeWindow().copy() + + def handleEditPaste(self): + """ + Private method to handle the paste action. + """ + self.activeWindow().paste() + + def handleEditDelete(self): + """ + Private method to handle the delete action. + """ + self.activeWindow().clear() + + def handleEditIndent(self): + """ + Private method to handle the indent action. + """ + self.activeWindow().indentLineOrSelection() + + def handleEditUnindent(self): + """ + Private method to handle the unindent action. + """ + self.activeWindow().unindentLineOrSelection() + + def handleEditComment(self): + """ + Private method to handle the comment action. + """ + self.activeWindow().commentLineOrSelection() + + def handleEditUncomment(self): + """ + Private method to handle the uncomment action. + """ + self.activeWindow().uncommentLineOrSelection() + + def handleEditStreamComment(self): + """ + Private method to handle the stream comment action. + """ + self.activeWindow().streamCommentLineOrSelection() + + def handleEditBoxComment(self): + """ + Private method to handle the box comment action. + """ + self.activeWindow().boxCommentLineOrSelection() + + def handleEditSelectBrace(self): + """ + Private method to handle the select to brace action. + """ + self.activeWindow().selectToMatchingBrace() + + def handleEditSelectAll(self): + """ + Private method to handle the select all action. + """ + self.activeWindow().selectAll(1) + + def handleEditDeselectAll(self): + """ + Private method to handle the select all action. + """ + self.activeWindow().selectAll(0) + + def handleConvertEOL(self): + """ + Private method to handle the convert line end characters action. + """ + aw = self.activeWindow() + aw.convertEols(aw.eolMode()) + + def handleShortenEmptyLines(self): + """ + Private method to handle the shorten empty lines action. + """ + self.activeWindow().handleShortenEmptyLines() + + def handleEditAutoComplete(self): + """ + Private method to handle the autocomplete action. + """ + aw = self.activeWindow() + aw.autoComplete() + + def handleEditAutoCompleteFromDoc(self): + """ + Private method to handle the autocomplete from document action. + """ + aw = self.activeWindow() + aw.autoCompleteFromDocument() + + def handleEditAutoCompleteFromAPIs(self): + """ + Private method to handle the autocomplete from APIs action. + """ + aw = self.activeWindow() + aw.autoCompleteFromAPIs() + + def handleEditoracAPIsAvailable(self, available): + """ + Private method to handle the availability of API autocompletion signal. + """ + self.autoCompleteFromAPIsAct.setEnabled(available) + + ################################################################## + ## Below are the action and utility methods for the search menu + ################################################################## + + def getWord(self, text, index): + """ + Private method to get the word at a position. + + @param text text to look at (string or QString) + @param index position to look at (int) + @return the word at that position + """ + re = QRegExp('[^\w_]') + start = text.findRev(re, index) + 1 + end = text.find(re, index) + if end > start: + word = text.mid(start, end-start) + else: + word = QString('') + return word + + def textForFind(self): + """ + Private method to determine the selection or the current word for the next find operation. + + @return selection or current word (QString) + """ + aw = self.activeWindow() + if aw is None: + return '' + + if aw.hasSelectedText(): + text = aw.selectedText() + if text.contains('\r') or text.contains('\n'): + # the selection contains at least a newline, it is + # unlikely to be the expression to search for + return '' + + return text + + # no selected text, determine the word at the current position + line, index = aw.getCursorPosition() + return self.getWord(aw.text(line), index) + + def getSRHistory(self, key): + """ + Private method to get the search or replace history list. + + @param key list to return (must be 'search' or 'replace') + @return the requested history list (QStringList) + """ + return self.srHistory[key] + + def handleSearch(self): + """ + Private method to handle the search action. + """ + self.searchDlg.showFind(self.textForFind()) + + def handleReplace(self): + """ + Private method to handle the replace action. + """ + self.replaceDlg.showReplace(self.textForFind()) + + def handleGoto(self): + """ + Private method to handle the goto action. + """ + aw = self.activeWindow() + dlg = GotoDialog(self.ui, None, 1) + dlg.selectAll() + if dlg.exec_loop() == QDialog.Accepted: + aw.gotoLine(min(dlg.getLinenumber(), aw.lines())) + + def handleGotoBrace(self): + """ + Private method to handle the goto brace action. + """ + self.activeWindow().moveToMatchingBrace() + + def handleSearchFiles(self): + """ + Private method to handle the search in files action. + """ + self.ui.findFilesDialog.show(self.textForFind()) + self.ui.findFilesDialog.raiseW() + self.ui.findFilesDialog.setActiveWindow() + + ################################################################## + ## Below are the action methods for the view menu + ################################################################## + + def handleZoomIn(self): + """ + Private method to handle the zoom in action. + """ + self.activeWindow().zoomIn() + + def handleZoomOut(self): + """ + Private method to handle the zoom out action. + """ + self.activeWindow().zoomOut() + + def handleZoom(self): + """ + Private method to handle the zoom action. + """ + aw = self.activeWindow() + dlg = ZoomDialog(aw.getZoom(), self.ui, None, 1) + if dlg.exec_loop() == QDialog.Accepted: + aw.zoomTo(dlg.getZoomSize()) + + def handleToggleAll(self): + """ + Private method to handle the toggle all folds action. + """ + self.activeWindow().foldAll() + + def handleToggleCurrent(self): + """ + Private method to handle the toggle current fold action. + """ + aw = self.activeWindow() + line, index = aw.getCursorPosition() + aw.foldLine(line) + + def handleSplitView(self): + """ + Private method to handle the split view action. + """ + self.addSplit() + + def handleSplitOrientation(self): + """ + Private method to handle the split orientation action. + """ + if self.splitOrientationAct.isOn(): + self.setSplitOrientation(QSplitter.Horizontal) + self.splitViewAct.setIconSet(\ + QIconSet(utilIcons.getPixmap("splitHorizontal.png"))) + self.splitRemoveAct.setIconSet(\ + QIconSet(utilIcons.getPixmap("remsplitHorizontal.png"))) + else: + self.setSplitOrientation(QSplitter.Vertical) + self.splitViewAct.setIconSet(\ + QIconSet(utilIcons.getPixmap("splitVertical.png"))) + self.splitRemoveAct.setIconSet(\ + QIconSet(utilIcons.getPixmap("remsplitVertical.png"))) + + ################################################################## + ## Below are the action methods for the macro menu + ################################################################## + + def handleMacroStartRecording(self): + """ + Private method to handle the start macro recording action. + """ + self.activeWindow().handleStartMacroRecording() + + def handleMacroStopRecording(self): + """ + Private method to handle the stop macro recording action. + """ + self.activeWindow().handleStopMacroRecording() + + def handleMacroRun(self): + """ + Private method to handle the run macro action. + """ + self.activeWindow().handleRunMacro() + + def handleMacroDelete(self): + """ + Private method to handle the delete macro action. + """ + self.activeWindow().handleDeleteMacro() + + def handleMacroLoad(self): + """ + Private method to handle the load macro action. + """ + self.activeWindow().handleLoadMacro() + + def handleMacroSave(self): + """ + Private method to handle the save macro action. + """ + self.activeWindow().handleSaveMacro() + + ################################################################## + ## Below are the action methods for the bookmarks menu + ################################################################## + + def handleToggleBookmark(self): + """ + Private method to handle the toggle bookmark action. + """ + self.activeWindow().handleToggleBookmark() + + def handleNextBookmark(self): + """ + Private method to handle the next bookmark action. + """ + self.activeWindow().handleNextBookmark() + + def handlePreviousBookmark(self): + """ + Private method to handle the previous bookmark action. + """ + self.activeWindow().handlePreviousBookmark() + + def handleClearAllBookmarks(self): + """ + Private method to handle the clear all bookmarks action. + """ + for editor in self.editors: + editor.handleClearBookmarks() + + self.bookmarkNextAct.setEnabled(0) + self.bookmarkPreviousAct.setEnabled(0) + self.bookmarkClearAct.setEnabled(0) + + def handleShowBookmarksMenu(self): + """ + Private method to handle the show bookmarks menu signal. + """ + self.bookmarks = {} + self.bookmarksMenu.clear() + + filenames = self.getOpenFilenames() + filenames.sort() + for filename in filenames: + editor = self.getOpenEditor(filename) + for bookmark in editor.getBookmarks(): + if len(filename) > 50: + dots = "..." + else: + dots = "" + id = self.bookmarksMenu.insertItem(\ + "%s%s : %d" % (dots, filename[-50:], bookmark)) + self.bookmarks[id] = (filename, bookmark) + + def handleBookmarkSelected(self, id): + """ + Private method to handle the bookmark selected signal. + + @param id index of the selected menu entry + This acts as an index into the list of bookmarks + that was created, when the bookmarks menu was built. + """ + self.displayPythonFile(self.bookmarks[id][0], self.bookmarks[id][1]) + + def handleBookmarkToggled(self, editor): + """ + Private slot to handle the bookmarkToggled signal. + + It checks some bookmark actions and reemits the signal. + + @param editor editor that sent the signal + """ + if editor.hasBookmarks(): + self.bookmarkNextAct.setEnabled(1) + self.bookmarkPreviousAct.setEnabled(1) + self.bookmarkClearAct.setEnabled(1) + else: + self.bookmarkNextAct.setEnabled(0) + self.bookmarkPreviousAct.setEnabled(0) + self.bookmarkClearAct.setEnabled(0) + self.emit(PYSIGNAL('bookmarkToggled'), (editor,)) + + def handleGotoSyntaxError(self): + """ + Private method to handle the goto syntax error action. + """ + self.activeWindow().handleGotoSyntaxError() + + def handleClearAllSyntaxErrors(self): + """ + Private method to handle the clear all syntax errors action. + """ + for editor in self.editors: + editor.handleClearSyntaxError() + + def handleSyntaxErrorToggled(self, editor): + """ + Private slot to handle the syntaxerrorToggled signal. + + It checks some syntax error actions and reemits the signal. + + @param editor editor that sent the signal + """ + if editor.hasSyntaxErrors(): + self.syntaxErrorGotoAct.setEnabled(1) + self.syntaxErrorClearAct.setEnabled(1) + else: + self.syntaxErrorGotoAct.setEnabled(0) + self.syntaxErrorClearAct.setEnabled(0) + self.emit(PYSIGNAL('syntaxerrorToggled'), (editor,)) + + ################################################################## + ## Below are general utility methods + ################################################################## + + def handleResetUI(self): + """ + Public slot to handle the resetUI signal. + """ + editor = self.activeWindow() + if editor is None: + self.setSbFile() + else: + line, pos = editor.getCursorPosition() + self.setSbFile(editor.getFileName(), line+1, pos) + + def closeViewManager(self): + """ + Public method to shutdown the viewmanager. + + If it cannot close all editor windows, it aborts the shutdown process. + + @return flag indicating success (boolean) + """ + self.handleCloseAll() + if len(self.editors): + return 0 + else: + return 1 + + def handleLastEditorClosed(self): + """ + Private slot to handle the lastEditorClosed signal. + """ + self.SauveRecents() + + + def handleEditorOpened(self): + """ + Private slot to handle the editorOpened signal. + """ + self.closeActGrp.setEnabled(1) + self.saveActGrp.setEnabled(1) + self.printAct.setEnabled(1) + self.printSelAct.setEnabled(1) + self.editActGrp.setEnabled(1) + self.searchActGrp.setEnabled(1) + self.viewActGrp.setEnabled(1) + self.viewFoldActGrp.setEnabled(1) + self.unhighlightAct.setEnabled(1) + self.splitViewAct.setEnabled(1) + self.splitOrientationAct.setEnabled(1) + self.macroActGrp.setEnabled(1) + self.bookmarkActGrp.setEnabled(1) + + # activate the autosave timer + if not self.autosaveTimer.isActive() and \ + self.autosaveInterval > 0: + self.autosaveTimer.start(self.autosaveInterval * 60000, 1) + + + def checkActions(self, editor, setSb=1): + """ + Private slot to check some actions for their enable/disable status and set the statusbar info. + + @param editor editor window + @param setSb flag indicating an update of the status bar is wanted (boolean) + """ + if editor is not None: + self.saveAct.setEnabled(editor.modified) + self.revertAct.setEnabled(editor.modified) + + lex = editor.getLexer() + if lex is not None: + self.commentAct.setEnabled(lex.canBlockComment()) + self.uncommentAct.setEnabled(lex.canBlockComment()) + self.streamCommentAct.setEnabled(lex.canStreamComment()) + self.boxCommentAct.setEnabled(lex.canBoxComment()) + else: + self.commentAct.setEnabled(0) + self.uncommentAct.setEnabled(0) + self.streamCommentAct.setEnabled(0) + self.boxCommentAct.setEnabled(0) + + if editor.hasBookmarks(): + self.bookmarkNextAct.setEnabled(1) + self.bookmarkPreviousAct.setEnabled(1) + self.bookmarkClearAct.setEnabled(1) + else: + self.bookmarkNextAct.setEnabled(0) + self.bookmarkPreviousAct.setEnabled(0) + self.bookmarkClearAct.setEnabled(0) + + if editor.hasSyntaxErrors(): + self.syntaxErrorGotoAct.setEnabled(1) + self.syntaxErrorClearAct.setEnabled(1) + else: + self.syntaxErrorGotoAct.setEnabled(0) + self.syntaxErrorClearAct.setEnabled(0) + + if editor.canAutoCompleteFromAPIs(): + self.autoCompleteFromAPIsAct.setEnabled(1) + else: + self.autoCompleteFromAPIsAct.setEnabled(0) + + if setSb: + line, pos = editor.getCursorPosition() + self.setSbFile(editor.getFileName(), line+1, pos) + + self.emit(PYSIGNAL('checkActions'), (editor,)) + + def handlePreferencesChanged(self): + """ + Public slot to handle the preferencesChanged signal. + + This method performs the following actions +
    +
  • reread the colours for the syntax highlighting
  • +
  • reloads the already created API objetcs
  • +
  • starts or stops the autosave timer
  • +
  • Note: changes in viewmanager type are activated + on an application restart.
  • +
+ """ + # reload api information + for language, api in self.apis.items(): + if api is not None: + apifiles = Preferences.getEditorAPI(language) + if len(apifiles): + api.clear() + for apifile in apifiles: + api.load(apifile) + else: + self.apis[language] = None + + # reload editor settings + for editor in self.editors: + editor.readSettings() + + # reload the autosave timer setting + self.autosaveInterval = Preferences.getEditor("AutosaveInterval") + if len(self.editors): + if self.autosaveTimer.isActive() and \ + self.autosaveInterval == 0: + self.autosaveTimer.stop() + elif not self.autosaveTimer.isActive() and \ + self.autosaveInterval > 0: + self.autosaveTimer.start(self.autosaveInterval * 60000, 1) + + def handleEditorSaved(self, fn): + """ + Public slot to handle the editorSaved signal. + + It simply reemits the signal. + + @param fn filename of the saved editor + """ + self.emit(PYSIGNAL('editorSaved'), (fn,)) + + def handleCursorChanged(self, fn, line, pos): + """ + Private slot to handle the cursorChanged signal. + + It emits the signal cursorChanged with parameter editor. + + @param fn filename (string) + @param line line number of the cursor (int) + @param pos position in line of the cursor (int) + """ + self.setSbFile(fn, line, pos) + self.emit(PYSIGNAL('cursorChanged'), (self.getOpenEditor(fn),)) + + def handleBreakpointToggled(self, editor): + """ + Private slot to handle the breakpointToggled signal. + + It simply reemits the signal. + + @param editor editor that sent the signal + """ + self.emit(PYSIGNAL('breakpointToggled'), (editor,)) + + + def getProject(self): + """ + Public method to get a reference to the Project object. + + @return Reference to the Project object (Project.Project) + """ + return self.ui.getProject() + + def getActions(self, type): + """ + Public method to get a list of all actions. + + @param type string denoting the action set to get. + It must be one of "edit", "file", "search", + "view" or "window" + @return list of all actions (list of QAction) + """ + try: + exec 'actionList = self.%sActions[:]' % type + except: + actionList = [] + + return actionList + + def editorCommand(self, cmd): + """ + Private method to send an editor command to the active window. + + @param cmd the scintilla command to be sent + """ + aw = self.activeWindow() + if aw: + aw.SendScintilla(cmd) + + ################################################################## + ## Below are protected utility methods + ################################################################## + + def _getOpenStartDir(self): + """ + Protected method to return the starting directory for a file open dialog. + + The appropriate starting directory is calculated + using the following search order, until a match is found:
+ 1: Directory of currently active editor
+ 2: Directory of currently active Project
+ 3: CWD + + @return String name of directory to start or None + """ + # if we have an active source, return its path + if self.activeWindow() is not None and \ + self.activeWindow().getFileName(): + return os.path.dirname(self.activeWindow().getFileName()) + + # ok, try if there is an active project and return its path + elif self.getProject().isOpen(): + return self.getProject().ppath + + else: + # None will cause open dialog to start with cwd + return None + + + def _getOpenFileFilter(self): + """ + Protected method to return the active filename filter for a file open dialog. + + The appropriate filename filter is determined by file extension of + the currently active editor. + + @return name of the filename filter (QString) or None + """ + if self.activeWindow() is not None and \ + self.activeWindow().getFileName(): + ext = os.path.splitext(self.activeWindow().getFileName())[1] + try: + return QString(self.ext2Filter[ext]) + except KeyError: + return None + + else: + return None + + + + +""" +Module implementing a tabbed viewmanager class. +""" + + + +class TabWidget(QTabWidget): + """ + Class implementing a custimized TabWidget. + """ + def __init__(self, parent): + """ + Constructor + + @param parent parent widget (QWidget) + """ + QTabWidget.__init__(self, parent) + + self.editors = [] + self.curIndex = 0 + + self.connect(self, SIGNAL("currentChanged(QWidget *)"), self.handleCurrentChanged) + + def handleCurrentChanged(self): + """ + Private slot called by the currentChanged signal. + """ + self.curIndex = self.currentPageIndex() + + def addTab(self, editor, title): + """ + Overwritten method to add a new tab. + + @param editor the editor object to be added (QScintilla.Editor.Editor) + @param title title for the new tab (string, QString or QTab) + """ + QTabWidget.addTab(self, editor, title) + + if not editor in self.editors: + self.editors.append(editor) + self.connect(editor, PYSIGNAL('captionChanged'), + self.handleCaptionChange) + + def showPage(self, editor): + """ + Overridden method to show a tab. + + @param editor the editor object to be shown (QScintilla.Editor.Editor) + """ + QTabWidget.showPage(self, editor) + self.curIndex = self.indexOf(editor) + + def nextTab(self): + """ + Public slot used to show the next tab. + """ + if self.count(): + self.curIndex += 1 + if self.curIndex == self.count(): + self.curIndex = 0 + + QTabWidget.showPage(self, self.page(self.curIndex)) + + def prevTab(self): + """ + Public slot used to show the previous tab. + """ + if self.count(): + self.curIndex -= 1 + if self.curIndex == -1: + self.curIndex = self.count() - 1 + + QTabWidget.showPage(self, self.page(self.curIndex)) + + def handleCaptionChange(self, cap, editor): + """ + Private method to handle Caption change signals from the editor. + + Updates the listview text to reflect the new caption information. + + @param cap Caption for the editor + @param editor Editor to update the caption for + """ + fn = editor.getFileName() + if fn: + txt = os.path.basename(fn) + if editor.isReadOnly(): + txt = '%s (ro)' % txt + self.changeTab(editor, txt) + + def removePage(self, object): + """ + Overwritten method to remove a page. + + @param object object to be removed (QObject) + """ + QTabWidget.removePage(self, object) + + self.disconnect( object, PYSIGNAL('captionChanged'), + self.handleCaptionChange ) + self.editors.remove(object) + + def hasEditor(self, editor): + """ + Public method to check for an editor. + + @param editor editor object to check for + @return flag indicating, whether the editor to be checked belongs + to the list of editors managed by this tab widget. + """ + return editor in self.editors + + def hasEditors(self): + """ + Public method to test, if any editor is managed. + + @return flag indicating editors are managed + """ + return len(self.editors) and 1 or 0 + +class Tabview(QSplitter, ViewManager): + """ + Class implementing a tabbed viewmanager class embedded in a splitter. + + @signal lastEditorClosed emitted after the last editor window was closed + @signal editorOpened emitted after an editor window was opened + @signal editorSaved emitted after an editor window was saved + """ + def __init__(self,parent, ui): + """ + Constructor + + @param parent parent widget (QWidget) + @param ui reference to the main user interface + @param dbs reference to the debug server object + """ + self.tabWidgets = [] + + QSplitter.__init__(self,parent) + ViewManager.__init__(self, ui) + tw = TabWidget(self) + self.tabWidgets.append(tw) + self.currentTabWidget = tw + self.connect(tw, SIGNAL('currentChanged(QWidget*)'), + self.handleCurrentChanged) + tw.installEventFilter(self) + tw.tabBar().installEventFilter(self) + self.setOrientation(QSplitter.Vertical) + + def initViewActions(self): + """ + Protected method defining the user interface actions for the view commands. + """ + ViewManager.initViewActions(self) + + self.nextTabAct = QAction(self.trUtf8('Show next tab'), + self.trUtf8('Show next tab'), + QKeySequence(self.trUtf8('Ctrl+Alt+Tab')), self) + self.connect(self.nextTabAct, SIGNAL('activated()'), self.nextTab) + self.viewActions.append(self.nextTabAct) + + self.prevTabAct = QAction(self.trUtf8('Show previous tab'), + self.trUtf8('Show previous tab'), + QKeySequence(self.trUtf8('Shift+Ctrl+Alt+Tab')), self) + self.connect(self.prevTabAct, SIGNAL('activated()'), self.prevTab) + self.viewActions.append(self.prevTabAct) + + def nextTab(self): + """ + Private slot used to show the next tab of the current tabwidget. + """ + self.currentTabWidget.nextTab() + + def prevTab(self): + """ + Private slot used to show the previous tab of the current tabwidget. + """ + self.currentTabWidget.prevTab() + + def canCascade(self): + """ + Public method to signal if cascading of managed windows is available. + + @return flag indicating cascading of windows is available + """ + return 0 + + def canTile(self): + """ + Public method to signal if tiling of managed windows is available. + + @return flag indicating tiling of windows is available + """ + return 0 + + def canSplit(self): + """ + public method to signal if splitting of the view is available. + + @return flag indicating splitting of the view is available. + """ + return 1 + + def tile(self): + """ + Public method to tile the managed windows. + """ + pass + + def cascade(self): + """ + Public method to cascade the managed windows. + """ + pass + + def removeAllViews(self): + """ + Private method to remove all views (i.e. windows) + """ + for win in self.editors: + self.removeView(win) + + def removeView(self, win): + """ + Private method to remove a view (i.e. window) + + @param win editor window to be removed + """ + print 'removeView win', win + for tw in self.tabWidgets: + if tw.hasEditor(win): + tw.removePage(win) + break + win.closeIt() + + print 'removeView A' + # if this was the last editor in this view, switch to the next, that + # still has open editors + print 'removeView B' + for i in range(self.tabWidgets.index(tw), -1, -1) + \ + range(self.tabWidgets.index(tw) + 1, len(self.tabWidgets)): + print 'removeView C' + if self.tabWidgets[i].hasEditors(): + self.currentTabWidget = self.tabWidgets[i] + self.activeWindow().setFocus() + print 'removeView D',self.activeWindow() + break + + def addView(self, win, fn=None): + """ + Private method to add a view (i.e. window) + + @param win editor window to be added + @param fn filename of this editor + """ + win.show() + if fn is None: + self.untitledCount += 1 + self.currentTabWidget.addTab(win, self.trUtf8("Untitled %1").arg(self.untitledCount)) + else: + txt = os.path.basename(fn) + if not QFileInfo(fn).isWritable(): + txt = '%s (ro)' % txt + self.currentTabWidget.addTab(win, txt) + self.currentTabWidget.setTabToolTip(win, os.path.dirname(fn)) + self.currentTabWidget.showPage(win) + win.setFocus() + + def showView(self, win, fn=None): + """ + Private method to show a view (i.e. window) + + @param win editor window to be shown + @param fn filename of this editor + """ + win.show() + for tw in self.tabWidgets: + if tw.hasEditor(win): + tw.showPage(win) + self.currentTabWidget = tw + break + win.setFocus() + + def activeWindow(self): + """ + Private method to return the active (i.e. current) window. + + @return reference to the active editor + """ + return self.currentTabWidget.currentPage() + + def handleShowWindowMenu(self, windowMenu): + """ + Private method to set up the viewmanager part of the Window menu. + + @param windowMenu reference to the window menu + """ + pass + + def initWindowActions(self): + """ + Define the user interface actions for window handling. + """ + pass + + def setEditorName(self, editor, newName): + """ + Change the displayed name of the editor. + + @param editor editor window to be changed + @param newName new name to be shown (string or QString) + """ + self.currentTabWidget.changeTab(editor, + os.path.basename(unicode(newName))) + self.currentTabWidget.setTabToolTip(editor, + os.path.dirname(unicode(newName))) + + def handleModificationStatusChanged(self, m, editor): + """ + Private slot to handle the modificationStatusChanged signal. + + @param m flag indicating the modification status (boolean) + @param editor editor window changed + """ + print 50*'handleModificationStatusChanged' + for tw in self.tabWidgets: + if tw.hasEditor(editor): + break + if m: + tw.setTabIconSet(editor, + QIconSet(utilIcons.getPixmap("fileModified.png"))) + elif editor.hasSyntaxErrors(): + tw.setTabIconSet(editor, + QIconSet(utilIcons.getPixmap("syntaxError.png"))) + else: + tw.setTabIconSet(editor, + QIconSet(utilIcons.getPixmap("empty.png"))) + self.checkActions(editor) + + def handleSyntaxErrorToggled(self, editor): + """ + Private slot to handle the syntaxerrorToggled signal. + + @param editor editor that sent the signal + """ + for tw in self.tabWidgets: + if tw.hasEditor(editor): + break + if editor.hasSyntaxErrors(): + tw.setTabIconSet(editor, + QIconSet(utilIcons.getPixmap("syntaxError.png"))) + else: + tw.setTabIconSet(editor, + QIconSet(utilIcons.getPixmap("empty.png"))) + + ViewManager.handleSyntaxErrorToggled(self, editor) + + def addSplit(self): + """ + Public method used to split the current view. + """ + tw = TabWidget(self) + tw.show() + self.tabWidgets.append(tw) + self.currentTabWidget = self.tabWidgets[-1] + self.connect(tw, SIGNAL('currentChanged(QWidget*)'), + self.handleCurrentChanged) + tw.installEventFilter(self) + tw.tabBar().installEventFilter(self) + self.setSizes([int(100/len(self.tabWidgets))] * len(self.tabWidgets)) + self.splitRemoveAct.setEnabled(1) + + def removeSplit(self): + """ + Public method used to remove the current split view. + + @return flag indicating successfull removal + """ + if len(self.tabWidgets) > 1: + tw = self.currentTabWidget + res = 1 + savedEditors = tw.editors[:] + for editor in savedEditors: + res &= self.closeEditor(editor) + if res: + i = self.tabWidgets.index(tw) + if i == len(self.tabWidgets)-1: + i -= 1 + self.tabWidgets.remove(tw) + tw.close(1) + self.currentTabWidget = self.tabWidgets[i] + if len(self.tabWidgets) == 1: + self.splitRemoveAct.setEnabled(0) + return 1 + + return 0 + + def setSplitOrientation(self, orientation): + """ + Public method used to set the orientation of the split view. + + @param orientation orientation of the split + (QSplitter.Horizontal or QSplitter.Vertical) + """ + self.setOrientation(orientation) + + def handleCurrentChanged(self, editor): + """ + Private slot to handle the currentChanged signal. + + @param editor selected editor window + """ + self.checkActions(editor) + editor.setFocus() + + def eventFilter(self, watched, event): + """ + Method called to filter the event queue. + + @param watched the QObject being watched + @param event the event that occurred + @return always 0 + """ + if event.type() == QEvent.MouseButtonPress and \ + not event.button() == Qt.RightButton: + if isinstance(watched, QTabWidget): + self.currentTabWidget = watched + elif isinstance(watched, QTabBar): + self.currentTabWidget = watched.parent() + elif isinstance(watched, QScintilla.Editor.Editor): + for tw in self.tabWidgets: + if tw.hasEditor(watched): + self.currentTabWidget = tw + break + + aw = self.activeWindow() + if aw is not None: + self.checkActions(aw) + aw.setFocus() + + return 0 + + +class MyTabview(Tabview): + """ + Base class inherited by all specific viewmanager classes. + + It defines the interface to be implemented by specific + viewmanager classes and all common methods. + + @signal lastEditorClosed emitted after the last editor window was closed + @signal editorOpened(string) emitted after an editor window was opened + @signal editorSaved(string) emitted after an editor window was saved + @signal checkActions(editor) emitted when some actions should be checked + for their status + @signal cursorChanged(editor) emitted after the cursor position of the active + window has changed + @signal breakpointToggled(editor) emitted when a breakpoint is toggled. + @signal bookmarkToggled(editor) emitted when a bookmark is toggled. + """ + def __init__(self, parent, ui): + Tabview.__init__(self, parent, ui) + self.appli=parent + self.initRecent() + + def initRecent(self) : + rep=self.appli.CONFIGURATION.rep_user + monFichier=rep+"/listefichiers" + index=0 + try : + f=open(monFichier) + while ( index < 9) : + ligne=f.readline() + if ligne != "" : + l=(ligne.split("\n"))[0] + self.recent.append(l) + index=index+1 + except : pass + + try : f.close() + except : pass + + def SauveRecents(self) : + rep=self.appli.CONFIGURATION.rep_user + monFichier=rep+"/listefichiers" + try : + f=open(monFichier,'w') + if len(self.recent) == 0 : return + index=0 + while ( index < len(self.recent)): + ligne=str(self.recent[index])+"\n" + f.write(ligne) + index=index+1 + except : + pass + try : + f.close() + except : + pass + + + def checkActions(self, editor, setSb=1): + """ + Private slot to check some actions for their enable/disable status and set the statusbar info. + + @param editor editor window + @param setSb flag indicating an update of the status bar is wanted (boolean) + """ + self.emit(PYSIGNAL('checkActions'), (editor,)) + + + def addToRecentList(self, fn): + """ + Public slot to add a filename to the list of recently opened files. + + @param fn name of the file to be added + """ + self.recent.remove(fn) + self.recent.prepend(fn) + if len(self.recent) > 9: + self.recent = self.recent[:9] + + def handleOpen(self,fn=None,patron=0): + """ + Public slot to open a Python JDC file. + + @param prog name of file to be opened (string or QString) + patron booleen pour indiquer si le fichier doit etre + ajoute a la liste des fichiers ouverts recemment + """ + # Get the file name if one wasn't specified. + if fn is None: + + fn = QFileDialog.getOpenFileName(self._getOpenStartDir(), + self.trUtf8('JDC Files (*.comm);;''All Files (*)'), self.ui, None, None, None) + + if fn.isNull(): + return + + fn = normabspath(unicode(fn)) + + newWin, editor = self.getEditor(fn) + + if newWin: + self.handleModificationStatusChanged(editor.modified, editor) + self.checkActions(editor) + + # insert filename into list of recently opened files + if patron == 0 : self.addToRecentList(fn) + + + ################################################################## + ## Below are protected utility methods + ################################################################# + + def _getOpenStartDir(self): + """ + Protected method to return the starting directory for a file open dialog. + + The appropriate starting directory is calculated + using the following search order, until a match is found:
+ 1: Directory of currently active editor
+ 2: Directory of currently active Project
+ 3: CWD + + @return String name of directory to start or None + """ + # if we have an active source, return its path + if self.activeWindow() is not None and \ + self.activeWindow().getFileName(): + return os.path.dirname(self.activeWindow().getFileName()) + + + else: + # None will cause open dialog to start with cwd + return None + + + def handleEditorOpened(self): + """ + Private slot to handle the editorOpened signal. + """ + pass + + def handleModificationStatusChanged(self, m, editor): + """ + Private slot to handle the modificationStatusChanged signal. + + @param m flag indicating the modification status (boolean) + @param editor editor window changed + """ + for tw in self.tabWidgets: + if tw.hasEditor(editor): + break + if m: + #tw.setTabIconSet(editor, + # QIconSet(utilIcons.getPixmap("fileModified.png"))) + pass + elif editor.hasSyntaxErrors(): + tw.setTabIconSet(editor, + QIconSet(utilIcons.getPixmap("syntaxError.png"))) + else: + tw.setTabIconSet(editor, + QIconSet(utilIcons.getPixmap("empty.png"))) + self.checkActions(editor) + + + + +if __name__=='__main__': + import sys + from Aster import prefs + if hasattr(prefs,'encoding'): + # Hack pour changer le codage par defaut des strings + import sys + reload(sys) + sys.setdefaultencoding(prefs.encoding) + del sys.setdefaultencoding + # Fin hack + + #CS_pbruno note: fait implicitement des trucs ces imports (grr) + #import styles + from Editeur import import_code + from Editeur import session + + # Analyse des arguments de la ligne de commande + options=session.parse(sys.argv) + code=options.code + app = QApplication(sys.argv) + + mw = MyTabview(None,None) + app.setMainWidget(mw) + app.connect(app, SIGNAL("lastWindowClosed()"), app, SLOT("quit()")) + mw.show() + mw.getEditor('azAster.comm') + mw.getEditor('azAster2.comm') + res = app.exec_loop() + sys.exit(res) diff --git a/InterfaceQT/visualisation.py b/InterfaceQT/visualisation.py new file mode 100644 index 00000000..675bc29b --- /dev/null +++ b/InterfaceQT/visualisation.py @@ -0,0 +1,59 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file 'visualisation.ui' +# +# Created: mer fév 21 10:55:14 2007 +# by: The PyQt User Interface Compiler (pyuic) 3.13 +# +# WARNING! All changes made in this file will be lost! + + +from qt import * + + +class visual(QWidget): + def __init__(self,parent = None,name = None,fl = 0): + QWidget.__init__(self,parent,name,fl) + + if not name: + self.setName("visual") + + f = QFont(self.font()) + f.setPointSize(14) + self.setFont(f) + + + self.frame5 = QFrame(self,"frame5") + self.frame5.setGeometry(QRect(10,520,801,41)) + self.frame5.setFrameShape(QFrame.StyledPanel) + self.frame5.setFrameShadow(QFrame.Raised) + + self.pushBOK = QPushButton(self.frame5,"pushBOK") + self.pushBOK.setGeometry(QRect(120,8,121,25)) + + self.pushBSave = QPushButton(self.frame5,"pushBSave") + self.pushBSave.setGeometry(QRect(470,8,120,25)) + + self.textBrowser1 = QTextBrowser(self,"textBrowser1") + self.textBrowser1.setGeometry(QRect(10,10,810,500)) + + self.languageChange() + + self.resize(QSize(830,582).expandedTo(self.minimumSizeHint())) + self.clearWState(Qt.WState_Polished) + + self.connect(self.pushBOK,SIGNAL("clicked()"),self.close) + self.connect(self.pushBSave,SIGNAL("clicked()"),self.Save) + + + def languageChange(self): + self.setCaption(self.__tr("Visualisation du rapport de validation du jeu de commandes courant")) + self.pushBOK.setText(self.__tr("Fermer")) + self.pushBSave.setText(self.__tr("Sauver")) + + + def Save(self): + print "visual.Save(): Not implemented yet" + + def __tr(self,s,c = None): + return qApp.translate("visual",s,c) diff --git a/Editeur/Interp.py b/InterfaceTK/Interp.py similarity index 100% rename from Editeur/Interp.py rename to InterfaceTK/Interp.py diff --git a/InterfaceTK/Objecttreeitem.py b/InterfaceTK/Objecttreeitem.py new file mode 100644 index 00000000..21998b57 --- /dev/null +++ b/InterfaceTK/Objecttreeitem.py @@ -0,0 +1,505 @@ +# -*- 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 généraux +import types,string,os,glob,imp,sys +from repr import Repr +from copy import copy,deepcopy + +# import du chargeur de composants +from comploader import make_objecttreeitem +import treewidget +from Ihm import CONNECTOR + +myrepr = Repr() +myrepr.maxstring = 100 +myrepr.maxother = 100 + +class TreeItem: + + """Abstract class representing tree items. + + Methods should typically be overridden, otherwise a default action + is used. + + """ + # itemNode est une factory qui doit retourner un objet de la classe Node + # ou dérivé de cette classe. + # Le widget arbre utilisera cet objet comme noeud associé au tree item. + # Par defaut, utilise la classe Node de base + # La signature de la factory est la suivante : + # itemNode(treeOrNode,item,command,rmenu) + # ou treeOrNode est le noeud parent, item est l'item associé + # command est une fonction python appelée sur sélection graphique + # du noeud et rmenu est une fonction python appelée sur click droit sur le noeud + itemNode=treewidget.Node + + def __init__(self): + """Constructor. Do whatever you need to do.""" + + def GetText(self): + """Return text string to display.""" + + def GetLabelText(self): + """Return label text string to display in front of text (if any).""" + + expandable = None + + def _IsExpandable(self): + """Do not override! Called by TreeNode.""" + if self.expandable is None: + self.expandable = self.IsExpandable() + return self.expandable + + def IsExpandable(self): + """Return whether there are subitems.""" + return 1 + + def _GetSubList(self): + """Do not override! Called by TreeNode.""" + if not self.IsExpandable(): + return [] + sublist = self.GetSubList() + if not sublist: + self.expandable = 0 + return sublist + + def IsEditable(self): + """Return whether the item's text may be edited.""" + + def SetText(self, text): + """Change the item's text (if it is editable).""" + + def GetIconName(self): + """Return name of icon to be displayed normally.""" + + def GetSelectedIconName(self): + """Return name of icon to be displayed when selected.""" + + def GetSubList(self): + """Return list of items forming sublist.""" + + def OnDoubleClick(self): + """Called on a double-click on the item.""" + +class Delegate: + def __init__(self, delegate=None): + self.object = delegate + self.__cache = {} + + def setdelegate(self, delegate): + self.resetcache() + self.object = delegate + + def getdelegate(self): + return self.object + + def __getattr__(self, name): + attr = getattr(self.object, name) # May raise AttributeError + setattr(self, name, attr) + self.__cache[name] = attr + return attr + + def resetcache(self): + for key in self.__cache.keys(): + try: + delattr(self, key) + except AttributeError: + pass + self.__cache.clear() + + def cachereport(self): + keys = self.__cache.keys() + keys.sort() + print keys + + +class ObjectTreeItem(TreeItem,Delegate): + def __init__(self, appli, labeltext, object, setfunction=None): + self.labeltext = labeltext + self.appli = appli + # L'objet délegué est stocké dans l'attribut object + # L'objet associé à l'item est stocké dans l'attribut _object + # Il peut etre obtenu par appel à la méthode getObject + # Attention : le délégué peut etre différent de l'objet associé (MCLIST) + # Dans le cas d'une MCListe de longueur 1, l'objet associé est la MCListe + # et l'objet délégué est le MCFACT (object = _object.data[0]) + Delegate.__init__(self,object) + # On cache l'objet initial (pour destruction eventuelle + # ultérieure) + self._object = object + self.setfunction = setfunction + self.expandable = 1 + self.sublist=[] + self.init() + + def init(self): + return + + def getObject(self): + return self._object + + def connect(self,channel,callable,args): + """ Connecte la fonction callable (avec arguments args) à l'item self sur le + canal channel + """ + CONNECTOR.Connect(self._object,channel,callable,args) + CONNECTOR.Connect(self.object, channel,callable,args) + + def copy(self): + """ + Crée un item copie de self + """ + object = self._object.copy() + appli = copy(self.appli) + labeltext = copy(self.labeltext) + fonction = deepcopy(self.setfunction) + item = make_objecttreeitem(appli,labeltext,object,fonction) + return item + + def isactif(self): + if hasattr(self.object,'actif'): + return self.object.actif + else: + return 1 + + def update(self,item): + """ + Met a jour l'item courant a partir d'un autre item passe en argument + Ne fait rien par defaut + """ + pass + + 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 + """ + # None --> fonte et couleur par défaut + return self.labeltext,None,None + + def get_nature(self) : + """ + Retourne la nature de l'item et de l'objet + """ + return self.object.nature + + def get_regles(self): + """ retourne les règles de l'objet pointé par self """ + return self.object.get_regles() + + def get_liste_mc_presents(self): + """ Retourne la liste des mots-clés fils de l'objet pointé par self """ + return self.object.liste_mc_presents() + + def get_val(self): + """ Retourne le nom de la valeur de l'objet pointé par self dans le cas + où celle-ci est un objet (ASSD) """ + return self.object.getval() + + def get_definition(self): + """ + Retourne l'objet definition de l'objet pointé par self + """ + return self.object.definition + + def get_liste_mc_ordonnee(self,liste,dico): + """ retourne la liste ordonnée (suivant le catalogue) brute des mots-clés + d'une entité composée dont le chemin complet est donné sous forme + d'une liste du type :ETAPE + MCFACT ou MCBLOC + ... + il faut encore réarranger cette liste (certains mots-clés déjà + présents ne doivent plus être proposés, règles ...)""" + return self.object.get_liste_mc_ordonnee(liste,dico) + + def get_liste_mc_ordonnee_brute(self,liste,dico): + """ + retourne la liste ordonnée (suivant le catalogue) BRUTE des mots-clés + d'une entité composée dont le chemin complet est donné sous forme + d'une liste du type :ETAPE + MCFACT ou MCBLOC + ... + """ + return self.object.get_liste_mc_ordonnee_brute(liste,dico) + + def get_genealogie(self): + """ + Retourne la liste des noms des ascendants (noms de MCSIMP,MCFACT,MCBLOC ou ETAPE) + de l'objet pointé par self + """ + return self.object.get_genealogie() + + def get_index_child(self,nom_fils): + """ + Retourne l'index dans la liste des fils de self du nouveau fils de nom nom_fils + Nécessaire pour savoir à quelle position dans la liste des fils il faut ajouter + le nouveau mot-clé + """ + return self.object.get_index_child(nom_fils) + + def get_index_child_old(self,nom_fils): + """ + Retourne l'index dans la liste des fils de self du nouveau fils de nom nom_fils + Nécessaire pour savoir à quelle position dans la liste des fils il faut ajouter + le nouveau mot-clé + """ + liste_noms_mc_ordonnee = self.get_liste_mc_ordonnee_brute(self.get_genealogie(),self.get_jdc().cata_ordonne_dico) + liste_noms_mc_presents = self.object.liste_mc_presents() + l=[] + for nom in liste_noms_mc_ordonnee: + if nom in liste_noms_mc_presents or nom == nom_fils: + l.append(nom) + # l contient les anciens mots-clés + le nouveau dans l'ordre + return l.index(nom_fils) + + def append_child(self,name,pos=None): + """ + Permet d'ajouter un item fils à self + """ + if pos == 'first': + index = 0 + elif pos == 'last': + index = len(self.liste_mc_presents()) + elif type(pos) == types.IntType : + # la position est fixée + index = pos + elif type(pos) == types.InstanceType: + # pos est un item. Il faut inserer name apres pos + index = self.get_index(pos) +1 + elif type(name) == types.InstanceType: + index = self.get_index_child(name.nom) + else: + index = self.get_index_child(name) + return self.addobject(name,index) + + def append_brother(self,name,pos='after'): + """ + Permet d'ajouter un frère à self + par défaut on l'ajoute après self + """ + index = self._object.parent.get_index(self.getObject()) + if pos == 'before': + index = index + elif pos == 'after': + index = index +1 + else: + print str(pos)," n'est pas un index valide pour append_brother" + return + return self.parent.addobject(name,index) + + def get_nom_etape(self): + """Retourne le nom de self """ + return self.object.get_nom_etape() + + def get_copie_objet(self): + """ Retourne une copie de l'objet pointé par self """ + return self.object.copy() + + def get_position(self): + """ Retourne la valeur de l'attribut position de l'objet pointé par self """ + definition = self.get_definition() + try: + return getattr(definition,'position') + except AttributeError: + return 'local' + + def get_nom(self): + """ Retourne le nom de l'objet pointé par self """ + return self.object.nom + + def get_jdc(self): + """ Retourne le jdc auquel appartient l'objet pointé par self """ + return self.object.jdc + + def get_valeur(self): + """ Retourne la valeur de l'objet pointé par self """ + return self.object.valeur + + def get_cr(self): + """ Retourne le compte-rendu CR de self """ + return self.object.report() + + def get_objet_commentarise(self): + """ + Cette méthode retourne un objet commentarisé + représentatif de self.object + --> à surcharger par les différents items + """ + raise Exception("MESSAGE AU DEVELOPPEUR : il faut surcharger la methode get_objet_commentarise() pour la classe "+self.__class__.__name__) + pass + + def isvalid(self): + """ Retourne 1 si l'objet pointé par self est valide, 0 sinon""" + return self.object.isvalid() + + def iscopiable(self): + """ + Retourne 1 si l'objet est copiable, 0 sinon + Par défaut retourne 0 + """ + return 0 + + def get_mc_presents(self): + """ Retourne le dictionnaire des mots-clés présents de l'objet pointé par self """ + return self.object.dict_mc_presents() + + def verif_condition_regles(self,l_mc_presents): + return self.object.verif_condition_regles(l_mc_presents) + + def get_fr(self): + """ Retourne le fr de l'objet pointé par self """ + try: + return self.object.get_fr() + except: + return "" + + def get_docu(self): + """ Retourne la clé de doc de l'objet pointé par self """ + return self.object.get_docu() + + def set_valeur(self,new_valeur): + """ Remplace la valeur de l'objet pointé par self par new_valeur """ + return self.object.set_valeur(new_valeur) + + def GetText(self): + return myrepr.repr(self.object) + + def GetIconName(self): + if not self.IsExpandable(): + return "python" + + def IsEditable(self): + return self.setfunction is not None + + def SetText(self, text): + try: + value = eval(text) + self.setfunction(value) + except: + pass +# Modif de ma part CCar : je ne comprend pas a quoi ca sert +# ca parait meme incorrect + # else: + # self.object = value + + def IsExpandable(self): + return 1 + + def GetSubList(self): + keys = dir(self.object) + sublist = [] + for key in keys: + try: + value = getattr(self.object, key) + except AttributeError: + continue + item = make_objecttreeitem( + self.appli, + str(key) + " =", + value, + lambda value, key=key, object=self.object: + setattr(object, key, value)) + sublist.append(item) + return sublist + + def wait_fichier_init(self): + """ Retourne 1 si l'object pointé par self attend un fichier d'initialisation + (ex: macros POURSUITE et INCLUDE de Code_Aster), 0 SINON """ + return self.object.definition.fichier_ini + + def make_objecttreeitem(self,appli,labeltext, object, setfunction=None): + """ + Cette methode, globale pour les objets de type item, permet de construire et de retourner un objet + de type item associé à l'object passé en argument. + """ + return make_objecttreeitem(appli,labeltext,object,setfunction) + + #def __del__(self): + # print "__del__",self + +class AtomicObjectTreeItem(ObjectTreeItem): + def IsExpandable(self): + return 0 + +class SequenceTreeItem(ObjectTreeItem): + def IsExpandable(self): + return len(self._object) > 0 + + def __len__(self) : + return len(self._object) + + def keys(self): + return range(len(self._object)) + + def GetIconName(self): + if self._object.isvalid(): + return "ast-green-los" + elif self._object.isoblig(): + return "ast-red-los" + else: + return "ast-yel-los" + + def ajout_possible(self): + return self._object.ajout_possible() + + def get_index(self,child): + """ Retourne le numéro de child dans la liste des enfants de self """ + return self._object.get_index(child.getObject()) + + def GetText(self): + return " " + + def additem(self,obj,pos): + self._object.insert(pos,obj) + item = self.make_objecttreeitem(self.appli, obj.nom + ":", obj) + return item + + def suppitem(self,item): + try : + self._object.remove(item.getObject()) + # la liste peut être retournée vide ! + message = "Mot-clé " + item.getObject().nom + " supprimé" + self.appli.affiche_infos(message) + return 1 + except: + return 0 + + def GetSubList(self): + isublist=iter(self.sublist) + liste=self._object.data + iliste=iter(liste) + self.sublist=[] + + while(1): + old_obj=obj=None + for item in isublist: + old_obj=item.getObject() + if old_obj in liste:break + + for obj in iliste: + if obj is old_obj:break + # nouvel objet : on cree un nouvel item + def setfunction(value, object=obj): + object=value + it = self.make_objecttreeitem(self.appli, obj.nom + " : ", obj, setfunction) + self.sublist.append(it) + if old_obj is None and obj is None:break + if old_obj is obj: self.sublist.append(item) + return self.sublist diff --git a/Editeur/TroisDPal.py b/InterfaceTK/TroisDPal.py similarity index 100% rename from Editeur/TroisDPal.py rename to InterfaceTK/TroisDPal.py diff --git a/InterfaceTK/__init__.py b/InterfaceTK/__init__.py new file mode 100644 index 00000000..28da2d3d --- /dev/null +++ b/InterfaceTK/__init__.py @@ -0,0 +1,20 @@ +# -*- 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. +# +# +# ====================================================================== diff --git a/Editeur/appli.py b/InterfaceTK/appli.py similarity index 91% rename from Editeur/appli.py rename to InterfaceTK/appli.py index 140d4493..17e9b81f 100644 --- a/Editeur/appli.py +++ b/InterfaceTK/appli.py @@ -35,29 +35,33 @@ from widgets import showerror # Modules Eficas import splash -import prefs +from Aster import prefs import styles from styles import style -import fontes +from InterfaceTK import fontes import tooltip import properties import convert,generator -import comploader -from utils import extension_fichier,stripPath +from Editeur import comploader +from Editeur.utils import extension_fichier,stripPath from widgets import Fenetre from Misc import MakeNomComplet -import session +from Editeur import session + import listeFichiers -import listePatrons + +REPTK=os.path.dirname(os.path.abspath(__file__)) +sys.path[:0]=[REPTK] VERSION="EFICAS v1.12" class APPLI: - def __init__ (self,master,code=prefs.code,fichier=None,test=0) : + def __init__ (self,master,code=prefs.code,fichier=None,test=0,ihm="TK") : self.code=code self.top=master self.top.protocol("WM_DELETE_WINDOW",self.exitEFICAS) + self.ihm=ihm #dimensionnement de la fenetre principale #aspect ratio de l'ecran @@ -98,7 +102,8 @@ class APPLI: # Creation des autres composants graphiques dont le bureau (parametrable par prefs.py) self.load_appli_composants() self.listeFichiers=listeFichiers.listeFichiers(self) - self.listePatrons=listePatrons.listePatrons(self) + from InterfaceTK import listePatronsTK + self.listePatrons=listePatronsTK.listePatronsTK(self) self.dir=None # Fermer le splash et deiconifier la fenetre principale si on n'est pas en test @@ -130,7 +135,7 @@ class APPLI: """ if (self.test == 0): splash._splash.configure(text = "Chargement des paramètres utilisateur") - import configuration + from Editeur import configuration self.CONFIGURATION = configuration.make_config(self,prefs.REPINI) self.CONFIGStyle = configuration.make_config_style(self,prefs.REPINI) @@ -169,7 +174,26 @@ class APPLI: self.load_appli_composant(mname) def load_appli_composant(self,mname): - module=__import__(mname,globals(),locals()) + if mname=="bureau" : + mnameTK="InterfaceTK."+mname + moduleTK=__import__(mnameTK,globals(),locals()) + module=getattr(moduleTK,mname) + factory=getattr(module,mname.upper()) + appli_composant=factory(self,self.top) + setattr(self,mname,appli_composant) + self.fill_menus(appli_composant,appli_composant.menu_defs) + self.toolbar.creer_boutons_appli_composant(appli_composant.button_defs,appli_composant) + return + + + try : + mnameTK="InterfaceTK."+mname + moduleTK=__import__(mnameTK,globals(),locals()) + module=getattr(moduleTK,mname) + except : + mnameEditeur="Editeur."+mname + moduleEditeur=__import__(mnameEditeur,globals(),locals()) + module=getattr(moduleEditeur,mname) factory=getattr(module,mname.upper()) appli_composant=factory(self,self.top) setattr(self,mname,appli_composant) @@ -340,7 +364,7 @@ class STANDALONE(APPLI): self.message='' # Avant la creation du bureau qui lit le catalogue self.version_code=version - import readercata + from InterfaceTK import readercata self.readercata=readercata.READERCATA(self,None) self.dir=None diff --git a/Editeur/basestyle.py b/InterfaceTK/basestyle.py similarity index 100% rename from Editeur/basestyle.py rename to InterfaceTK/basestyle.py diff --git a/Editeur/browser.py b/InterfaceTK/browser.py similarity index 100% rename from Editeur/browser.py rename to InterfaceTK/browser.py diff --git a/Editeur/bureau.py b/InterfaceTK/bureau.py similarity index 99% rename from Editeur/bureau.py rename to InterfaceTK/bureau.py index b1a408d5..f9263e06 100644 --- a/Editeur/bureau.py +++ b/InterfaceTK/bureau.py @@ -30,7 +30,7 @@ from widgets import showinfo,askyesno,showerror # Modules Eficas import splash -import prefs +import Aster.prefs import convert import generator import AIDE @@ -42,7 +42,7 @@ from fenetre_mc_inconnus import fenetre_mc_inconnus from Ihm import CONNECTOR from Traducteur import traduitV7V8 -import comploader +from Editeur import comploader class BUREAU: menu_defs=[ diff --git a/Editeur/catabrowser.py b/InterfaceTK/catabrowser.py similarity index 98% rename from Editeur/catabrowser.py rename to InterfaceTK/catabrowser.py index e1ed7fcc..c3a38080 100644 --- a/Editeur/catabrowser.py +++ b/InterfaceTK/catabrowser.py @@ -27,17 +27,17 @@ import Pmw from Tkinter import * # Modules Eficas -import fontes +from InterfaceTK import fontes from treewidget import Tree -from Objecttreeitem import TreeItem +from Editeur.Objecttreeitem import TreeItem from Accas import AsException from Noyau.N_CR import justify_text from Accas import OPER,PROC,MACRO,FORM from Accas import FACT,BLOC,SIMP # -__version__="$Name: $" -__Id__="$Id: catabrowser.py,v 1.3 2002/09/10 15:59:37 eficas Exp $" +__version__="$Name: BR_V1_12qt $" +__Id__="$Id: catabrowser.py,v 1.4 2004-09-10 15:51:48 eficas Exp $" # class Tableau: incr = 10 diff --git a/Editeur/cataediteur.py b/InterfaceTK/cataediteur.py similarity index 99% rename from Editeur/cataediteur.py rename to InterfaceTK/cataediteur.py index cac0254d..6b51fe07 100644 --- a/Editeur/cataediteur.py +++ b/InterfaceTK/cataediteur.py @@ -28,10 +28,10 @@ from widgets import showinfo from Tkinter import * # Modules Eficas -import fontes +from InterfaceTK import fontes from widgets import * from treewidget import Tree -from Objecttreeitem import TreeItem +from Editeur.Objecttreeitem import TreeItem from Accas import AsException from Noyau.N_CR import justify_text @@ -39,8 +39,8 @@ from Accas import ASSD,GEOM import definition_cata # -__version__="$Name: $" -__Id__="$Id: cataediteur.py,v 1.8 2005/11/29 11:14:14 eficas Exp $" +__version__="$Name: BR_V1_12qt $" +__Id__="$Id: cataediteur.py,v 1.9 2005-12-07 10:17:21 eficas Exp $" # Fonte_Niveau = fontes.canvas_gras_italique diff --git a/Editeur/centerwindow.py b/InterfaceTK/centerwindow.py similarity index 100% rename from Editeur/centerwindow.py rename to InterfaceTK/centerwindow.py diff --git a/Editeur/change_comm.py b/InterfaceTK/change_comm.py similarity index 96% rename from Editeur/change_comm.py rename to InterfaceTK/change_comm.py index 8b0a4bca..a664e27c 100755 --- a/Editeur/change_comm.py +++ b/InterfaceTK/change_comm.py @@ -27,13 +27,13 @@ import sys import os # Modules Eficas -import import_code -import session -import prefs +from Editeur import import_code +from Editeur import session +from Aster import prefs import convert import generator import string -from utils import extension_fichier,stripPath, save_in_file +from Editeur.utils import extension_fichier,stripPath, save_in_file class DUP : @@ -46,7 +46,7 @@ class DUP : self.top=None self.test=2 - import configuration + from Editeur import configuration self.CONFIGURATION=configuration.make_config(self,prefs.REPINI) self.load_readercata() diff --git a/Editeur/compobase.py b/InterfaceTK/compobase.py similarity index 60% rename from Editeur/compobase.py rename to InterfaceTK/compobase.py index df539df0..a287b7d2 100644 --- a/Editeur/compobase.py +++ b/InterfaceTK/compobase.py @@ -1,3 +1,3 @@ -import Objecttreeitem +from Editeur import Objecttreeitem treeitem = Objecttreeitem.ObjectTreeItem objet = None diff --git a/Editeur/compobloc.py b/InterfaceTK/compobloc.py similarity index 97% rename from Editeur/compobloc.py rename to InterfaceTK/compobloc.py index d2f2f3ac..e92d5199 100644 --- a/Editeur/compobloc.py +++ b/InterfaceTK/compobloc.py @@ -21,7 +21,7 @@ from Tkinter import * import Pmw -import Objecttreeitem +from Editeur import Objecttreeitem import compofact diff --git a/Editeur/compocomm.py b/InterfaceTK/compocomm.py similarity index 98% rename from Editeur/compocomm.py rename to InterfaceTK/compocomm.py index f0fdca5c..2d96384a 100644 --- a/Editeur/compocomm.py +++ b/InterfaceTK/compocomm.py @@ -22,9 +22,9 @@ from Tkinter import * import Pmw import string -import Objecttreeitem +from Editeur import Objecttreeitem import panels -import fontes +from InterfaceTK import fontes Fonte_Commentaire = fontes.standard_italique diff --git a/Editeur/compocommandecomm.py b/InterfaceTK/compocommandecomm.py similarity index 98% rename from Editeur/compocommandecomm.py rename to InterfaceTK/compocommandecomm.py index bbc3a47a..e51705c2 100644 --- a/Editeur/compocommandecomm.py +++ b/InterfaceTK/compocommandecomm.py @@ -24,9 +24,9 @@ import Pmw import string from widgets import showerror -import Objecttreeitem +from Editeur import Objecttreeitem import panels -import fontes +from InterfaceTK import fontes Fonte_Commentaire = fontes.standard_italique diff --git a/Editeur/compoerror.py b/InterfaceTK/compoerror.py similarity index 97% rename from Editeur/compoerror.py rename to InterfaceTK/compoerror.py index 814782c8..74e0c46c 100644 --- a/Editeur/compoerror.py +++ b/InterfaceTK/compoerror.py @@ -23,7 +23,7 @@ from Tkinter import Label,Button #Modules Eficas from Noyau.N_OBJECT import ErrorObj -import Objecttreeitem +from Editeur import Objecttreeitem import panels class ERRORPanel(panels.Panel_Inactif): diff --git a/Editeur/compofact.py b/InterfaceTK/compofact.py similarity index 99% rename from Editeur/compofact.py rename to InterfaceTK/compofact.py index 51b36738..0d984381 100644 --- a/Editeur/compofact.py +++ b/InterfaceTK/compofact.py @@ -19,7 +19,7 @@ # # ====================================================================== import Pmw -import Objecttreeitem +from Editeur import Objecttreeitem import panels class FACTPanel(panels.OngletPanel) : diff --git a/Editeur/compoformule.py b/InterfaceTK/compoformule.py similarity index 99% rename from Editeur/compoformule.py rename to InterfaceTK/compoformule.py index d134713b..a9a5a5fd 100644 --- a/Editeur/compoformule.py +++ b/InterfaceTK/compoformule.py @@ -32,7 +32,7 @@ import string # import modules EFICAS import widgets import panels -import fontes +from InterfaceTK import fontes import compooper Fonte_TITRE = fontes.standard_gras_souligne diff --git a/Editeur/compojdc.py b/InterfaceTK/compojdc.py similarity index 99% rename from Editeur/compojdc.py rename to InterfaceTK/compojdc.py index 8572c13f..fb9b7d76 100644 --- a/Editeur/compojdc.py +++ b/InterfaceTK/compojdc.py @@ -19,7 +19,7 @@ # # ====================================================================== import Pmw -import Objecttreeitem +from Editeur import Objecttreeitem import panels from widgets import ListeChoix diff --git a/Editeur/compomacro.py b/InterfaceTK/compomacro.py similarity index 98% rename from Editeur/compomacro.py rename to InterfaceTK/compomacro.py index ba423070..54a19c9a 100644 --- a/Editeur/compomacro.py +++ b/InterfaceTK/compomacro.py @@ -26,9 +26,9 @@ import Pmw import traceback # Modules Eficas -import Objecttreeitem +from Editeur import Objecttreeitem import panels -import fontes +from InterfaceTK import fontes import compooper import convert from widgets import askopenfilename @@ -36,8 +36,8 @@ from widgets import Fenetre,FenetreYesNo from widgets import showinfo,showerror # -__version__="$Name: $" -__Id__="$Id: compomacro.py,v 1.25.10.1 2006/11/15 17:59:30 cchris Exp $" +__version__="$Name: BR_V1_12qt $" +__Id__="$Id: compomacro.py,v 1.26 2006-12-15 16:00:21 cchris Exp $" # class MACROPanel(panels.OngletPanel): diff --git a/Editeur/compomclist.py b/InterfaceTK/compomclist.py similarity index 99% rename from Editeur/compomclist.py rename to InterfaceTK/compomclist.py index ae92e03a..ba3704ca 100644 --- a/Editeur/compomclist.py +++ b/InterfaceTK/compomclist.py @@ -23,7 +23,7 @@ from Tkinter import * import Pmw from Noyau.N_OBJECT import ErrorObj -import Objecttreeitem +from Editeur import Objecttreeitem import panels import traceback diff --git a/Editeur/componiveau.py b/InterfaceTK/componiveau.py similarity index 98% rename from Editeur/componiveau.py rename to InterfaceTK/componiveau.py index 0a74d55c..e96fea45 100644 --- a/Editeur/componiveau.py +++ b/InterfaceTK/componiveau.py @@ -22,9 +22,9 @@ from Tkinter import * import Pmw -import Objecttreeitem +from Editeur import Objecttreeitem import panels -import fontes +from InterfaceTK import fontes from Extensions import commentaire Fonte_Niveau = fontes.canvas_gras_italique diff --git a/Editeur/componuplet.py b/InterfaceTK/componuplet.py similarity index 97% rename from Editeur/componuplet.py rename to InterfaceTK/componuplet.py index 5098b97c..c14573d3 100644 --- a/Editeur/componuplet.py +++ b/InterfaceTK/componuplet.py @@ -26,12 +26,12 @@ from repr import Repr from copy import copy,deepcopy # Modules Eficas -import Objecttreeitem +from Editeur import Objecttreeitem import panels # -__version__="$Name: $" -__Id__="$Id: componuplet.py,v 1.8 2005/11/03 09:03:48 eficas Exp $" +__version__="$Name: BR_V1_12qt $" +__Id__="$Id: componuplet.py,v 1.9 2005-12-07 10:20:34 eficas Exp $" # myrepr = Repr() diff --git a/Editeur/compooper.py b/InterfaceTK/compooper.py similarity index 99% rename from Editeur/compooper.py rename to InterfaceTK/compooper.py index 2fcbfff9..f153122d 100644 --- a/Editeur/compooper.py +++ b/InterfaceTK/compooper.py @@ -21,9 +21,9 @@ from Tkinter import * import Pmw import traceback -import Objecttreeitem +from Editeur import Objecttreeitem import panels -import fontes +from InterfaceTK import fontes class OPERPanel(panels.OngletPanel): diff --git a/Editeur/compoparam.py b/InterfaceTK/compoparam.py similarity index 99% rename from Editeur/compoparam.py rename to InterfaceTK/compoparam.py index 98f7a7c1..f842f44c 100644 --- a/Editeur/compoparam.py +++ b/InterfaceTK/compoparam.py @@ -30,9 +30,9 @@ import Pmw import string # import modules EFICAS -import Objecttreeitem +from Editeur import Objecttreeitem import panels -import fontes +from InterfaceTK import fontes Fonte_PARAMETRE = fontes.standard_italique diff --git a/Editeur/compoparameval.py b/InterfaceTK/compoparameval.py similarity index 99% rename from Editeur/compoparameval.py rename to InterfaceTK/compoparameval.py index 41c6e291..23deafa3 100644 --- a/Editeur/compoparameval.py +++ b/InterfaceTK/compoparameval.py @@ -31,9 +31,9 @@ import string # import modules EFICAS import widgets -import Objecttreeitem +from Editeur import Objecttreeitem import panels -import fontes +from InterfaceTK import fontes Fonte_PARAMETRE = fontes.standard_italique diff --git a/Editeur/compoproc.py b/InterfaceTK/compoproc.py similarity index 96% rename from Editeur/compoproc.py rename to InterfaceTK/compoproc.py index cb24795a..63fb490d 100644 --- a/Editeur/compoproc.py +++ b/InterfaceTK/compoproc.py @@ -21,9 +21,9 @@ from Tkinter import * import Pmw -import Objecttreeitem +from Editeur import Objecttreeitem import panels -import fontes +from InterfaceTK import fontes import compooper class PROCPanel(panels.OngletPanel): diff --git a/Editeur/composimp.py b/InterfaceTK/composimp.py similarity index 99% rename from Editeur/composimp.py rename to InterfaceTK/composimp.py index 7be5ba46..6f9d7b98 100644 --- a/Editeur/composimp.py +++ b/InterfaceTK/composimp.py @@ -26,15 +26,15 @@ from copy import copy,deepcopy import traceback # Modules Eficas -import Objecttreeitem -import prefs +from Editeur import Objecttreeitem +from Aster import prefs import panels import images from widgets import ListeChoix from widgets import FenetreDeSelection from Noyau.N_CR import justify_text -from utils import substract_list +from Editeur.utils import substract_list class SIMPTreeItem(Objecttreeitem.AtomicObjectTreeItem): diff --git a/Editeur/definition_cata.py b/InterfaceTK/definition_cata.py similarity index 100% rename from Editeur/definition_cata.py rename to InterfaceTK/definition_cata.py diff --git a/Editeur/eficas.py b/InterfaceTK/eficas.py similarity index 100% rename from Editeur/eficas.py rename to InterfaceTK/eficas.py diff --git a/Editeur/eficas_go.py b/InterfaceTK/eficas_go.py similarity index 92% rename from Editeur/eficas_go.py rename to InterfaceTK/eficas_go.py index 84e8e7a2..81e929f4 100644 --- a/Editeur/eficas_go.py +++ b/InterfaceTK/eficas_go.py @@ -27,7 +27,7 @@ import sys import Tkinter # Modules Eficas -import prefs +from Aster import prefs if hasattr(prefs,'encoding'): # Hack pour changer le codage par defaut des strings import sys @@ -37,9 +37,9 @@ if hasattr(prefs,'encoding'): # Fin hack import styles -import import_code -import splash -import session +from Editeur import import_code +from InterfaceTK import splash +from Editeur import session def lance_eficas(code=None,fichier=None): """ @@ -53,7 +53,7 @@ def lance_eficas(code=None,fichier=None): splash.init_splash(root,code=code,titre="Lancement d'EFICAS pour %s" %code) splash._splash.configure(text="Chargement d'EFICAS en cours.\n Veuillez patienter ...") import eficas - eficas.EFICAS(root,code=code) + eficas.EFICAS(root,code=code,ihm="TK") root.mainloop() diff --git a/Editeur/eficas_test.py b/InterfaceTK/eficas_test.py similarity index 97% rename from Editeur/eficas_test.py rename to InterfaceTK/eficas_test.py index 6ff3db51..2a5230cf 100644 --- a/Editeur/eficas_test.py +++ b/InterfaceTK/eficas_test.py @@ -27,8 +27,8 @@ import sys import Tkinter # Modules Eficas -import import_code -import session +from Editeur import import_code +from Editeur import session def lance_eficas(code,fichier=None): """ @@ -54,10 +54,9 @@ def duplique_fichier(code,fichier=None,root=None): import eficas import convert import generator - import utils + import Editeur.utils import string - from Editeur import session if fichier != None : options=session.parse(sys.argv+[fichier]) else : diff --git a/Editeur/faq.py b/InterfaceTK/faq.py similarity index 97% rename from Editeur/faq.py rename to InterfaceTK/faq.py index 30764b53..afa09fed 100644 --- a/Editeur/faq.py +++ b/InterfaceTK/faq.py @@ -28,8 +28,8 @@ import Pmw from Tkinter import END # Modules Eficas -import prefs -import fontes +from Aster import prefs +from InterfaceTK import fontes class FAQ: def __init__(self,parent): diff --git a/Editeur/faqs.txt b/InterfaceTK/faqs.txt similarity index 100% rename from Editeur/faqs.txt rename to InterfaceTK/faqs.txt diff --git a/Editeur/fenetre_mc_inconnus.py b/InterfaceTK/fenetre_mc_inconnus.py similarity index 100% rename from Editeur/fenetre_mc_inconnus.py rename to InterfaceTK/fenetre_mc_inconnus.py diff --git a/Editeur/fonctionpanel.py b/InterfaceTK/fonctionpanel.py similarity index 99% rename from Editeur/fonctionpanel.py rename to InterfaceTK/fonctionpanel.py index a5661581..7b1646fc 100644 --- a/Editeur/fonctionpanel.py +++ b/InterfaceTK/fonctionpanel.py @@ -26,8 +26,8 @@ from copy import copy,deepcopy import traceback # Modules Eficas -import Objecttreeitem -import prefs +from Editeur import Objecttreeitem +from Aster import prefs import panels import images from widgets import ListeChoix @@ -36,7 +36,7 @@ from widgets import askopenfilename from widgets import showinfo from Noyau.N_CR import justify_text -from utils import substract_list +from Editeur.utils import substract_list from plusieursbasepanel import PLUSIEURS_BASE_Panel diff --git a/Editeur/fontes.py b/InterfaceTK/fontes.py similarity index 100% rename from Editeur/fontes.py rename to InterfaceTK/fontes.py diff --git a/Editeur/images.py b/InterfaceTK/images.py similarity index 97% rename from Editeur/images.py rename to InterfaceTK/images.py index 9cdfa19a..08401ffd 100644 --- a/Editeur/images.py +++ b/InterfaceTK/images.py @@ -41,11 +41,12 @@ if __name__ == '__main__': sys.exit() try: - import prefs + from Aster import prefs ICONDIR=prefs.ICONDIR except: # Par defaut on utilise le repertoire local icons - ICONDIR=os.path.join(os.path.abspath(os.path.dirname(__file__)),'icons') + ICONDIR=os.path.join(os.path.abspath(os.path.dirname(__file__)),'/Editeur/icons') + dico_images={} diff --git a/Editeur/jdcdisplay.py b/InterfaceTK/jdcdisplay.py similarity index 100% rename from Editeur/jdcdisplay.py rename to InterfaceTK/jdcdisplay.py diff --git a/Editeur/listeFichiers.py b/InterfaceTK/listeFichiers.py similarity index 100% rename from Editeur/listeFichiers.py rename to InterfaceTK/listeFichiers.py diff --git a/InterfaceTK/listePatronsTK.py b/InterfaceTK/listePatronsTK.py new file mode 100644 index 00000000..350749b1 --- /dev/null +++ b/InterfaceTK/listePatronsTK.py @@ -0,0 +1,27 @@ +import os +import re +import Tkinter + + +from Editeur import listePatrons + +class listePatronsTK(listePatrons.listePatrons) : + + def __init__(self,appli): + self.appli=appli + listePatrons.listePatrons.__init__(self) + self.ajout_menu() + + def ajout_menu(self): + menuFichier=self.appli.menubar.menubar + menu_cascade=Tkinter.Menu(menuFichier,tearoff=0) + menuFichier.add_cascade(label="Patrons",menu=menu_cascade) + for ss_menu in self.liste.keys(): + ssmenu=Tkinter.Menu(menu_cascade,tearoff=0) + menu_cascade.add_cascade(label=ss_menu,menu=ssmenu) + for fichier in self.liste[ss_menu]: + ssmenu.add_command(label=fichier,command= lambda self=self, l=fichier:self.ouvre(l)); + + def ouvre(self,label): + fichier=self.rep_patrons+"/"+label + self.appli.bureau.openJDC(file=fichier,enregistre="non") diff --git a/Editeur/macrodisplay.py b/InterfaceTK/macrodisplay.py similarity index 99% rename from Editeur/macrodisplay.py rename to InterfaceTK/macrodisplay.py index 464d59a8..a0e7e8de 100644 --- a/Editeur/macrodisplay.py +++ b/InterfaceTK/macrodisplay.py @@ -29,7 +29,7 @@ import Tkinter,Pmw # Modules EFICAS import images import tooltip -import Objecttreeitem +from Editeur import Objecttreeitem import compojdc import treewidget from widgets import Fenetre diff --git a/Editeur/menubar.py b/InterfaceTK/menubar.py similarity index 100% rename from Editeur/menubar.py rename to InterfaceTK/menubar.py diff --git a/Editeur/newsimppanel.py b/InterfaceTK/newsimppanel.py similarity index 98% rename from Editeur/newsimppanel.py rename to InterfaceTK/newsimppanel.py index ea414a03..0a04ce0f 100644 --- a/Editeur/newsimppanel.py +++ b/InterfaceTK/newsimppanel.py @@ -26,8 +26,8 @@ from copy import copy,deepcopy import traceback # Modules Eficas -import Objecttreeitem -import prefs +from Editeur import Objecttreeitem +from Aster import prefs import panels import images import composimp @@ -35,7 +35,7 @@ from widgets import ListeChoix from widgets import FenetreDeSelection from Noyau.N_CR import justify_text -from utils import substract_list +from Editeur.utils import substract_list class newSIMPPanel(panels.OngletPanel): diff --git a/Editeur/options.py b/InterfaceTK/options.py similarity index 100% rename from Editeur/options.py rename to InterfaceTK/options.py diff --git a/Editeur/panels.py b/InterfaceTK/panels.py similarity index 99% rename from Editeur/panels.py rename to InterfaceTK/panels.py index 636473a1..15ab8ca9 100644 --- a/Editeur/panels.py +++ b/InterfaceTK/panels.py @@ -28,7 +28,7 @@ import traceback import widgets from widgets import ListeChoix from widgets import ListeChoixParGroupes -import prefs +from Aster import prefs import options SEPARATEUR = '-'*30 diff --git a/Editeur/panelsSalome.py b/InterfaceTK/panelsSalome.py similarity index 100% rename from Editeur/panelsSalome.py rename to InterfaceTK/panelsSalome.py diff --git a/Editeur/patches.py b/InterfaceTK/patches.py similarity index 100% rename from Editeur/patches.py rename to InterfaceTK/patches.py diff --git a/Editeur/plusieursassdpanel.py b/InterfaceTK/plusieursassdpanel.py similarity index 98% rename from Editeur/plusieursassdpanel.py rename to InterfaceTK/plusieursassdpanel.py index 88eea05d..3d77f39f 100644 --- a/Editeur/plusieursassdpanel.py +++ b/InterfaceTK/plusieursassdpanel.py @@ -26,15 +26,15 @@ from copy import copy,deepcopy import traceback # Modules Eficas -import Objecttreeitem -import prefs +from Editeur import Objecttreeitem +from Aster import prefs import panels import images from widgets import ListeChoix from widgets import FenetreDeSelection from Noyau.N_CR import justify_text -from utils import substract_list +from Editeur.utils import substract_list # Import des panels from plusieurspanel import PLUSIEURS_Panel diff --git a/Editeur/plusieursbasepanel.py b/InterfaceTK/plusieursbasepanel.py similarity index 99% rename from Editeur/plusieursbasepanel.py rename to InterfaceTK/plusieursbasepanel.py index 38831dc1..550b98eb 100644 --- a/Editeur/plusieursbasepanel.py +++ b/InterfaceTK/plusieursbasepanel.py @@ -26,8 +26,8 @@ from copy import copy,deepcopy import traceback # Modules Eficas -import Objecttreeitem -import prefs +from Editeur import Objecttreeitem +from Aster import prefs import panels import images from widgets import showinfo @@ -40,11 +40,11 @@ from Noyau.N_CR import justify_text from Ihm.I_LASSD import LASSD from Extensions.parametre import PARAMETRE -from utils import substract_list +from Editeur.utils import substract_list from plusieurspanel import PLUSIEURS_Panel from uniqueassdpanel import UNIQUE_ASSD_Panel -import fontes +from InterfaceTK import fontes import math class PLUSIEURS_BASE_Panel(PLUSIEURS_Panel): diff --git a/Editeur/plusieursintopanel.py b/InterfaceTK/plusieursintopanel.py similarity index 98% rename from Editeur/plusieursintopanel.py rename to InterfaceTK/plusieursintopanel.py index 1854e865..3484a83a 100644 --- a/Editeur/plusieursintopanel.py +++ b/InterfaceTK/plusieursintopanel.py @@ -26,15 +26,15 @@ from copy import copy,deepcopy import traceback # Modules Eficas -import Objecttreeitem -import prefs +from Editeur import Objecttreeitem +from Aster import prefs import panels import images from widgets import ListeChoix from widgets import FenetreDeSelection from Noyau.N_CR import justify_text -from utils import substract_list +from Editeur.utils import substract_list # Import des panels from plusieurspanel import PLUSIEURS_Panel diff --git a/Editeur/plusieurspanel.py b/InterfaceTK/plusieurspanel.py similarity index 98% rename from Editeur/plusieurspanel.py rename to InterfaceTK/plusieurspanel.py index ba641445..b79906f6 100644 --- a/Editeur/plusieurspanel.py +++ b/InterfaceTK/plusieurspanel.py @@ -26,15 +26,15 @@ from copy import copy,deepcopy import traceback # Modules Eficas -import Objecttreeitem -import prefs +from Editeur import Objecttreeitem +from Aster import prefs import panels import images from widgets import ListeChoix from widgets import FenetreDeSelection from Noyau.N_CR import justify_text -from utils import substract_list +from Editeur.utils import substract_list # Import des panels from newsimppanel import newSIMPPanel diff --git a/InterfaceTK/prefsTK.py b/InterfaceTK/prefsTK.py new file mode 100644 index 00000000..6590c55f --- /dev/null +++ b/InterfaceTK/prefsTK.py @@ -0,0 +1,66 @@ +# -*- 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. +# +# +# ====================================================================== + + +labels= ('Fichier','Edition','Jeu de commandes', + 'Options', + 'Aide', + 'Traduction', + ) + +appli_composants=['readercata','bureau', + 'options', + ] + +menu_defs={ 'bureau': [ + ('Fichier',[ + ('Nouveau','newJDC','','Ctrl+N'), + ('Nouvel INCLUDE','newJDC_include'), + ('Ouvrir','openJDC','','Ctrl+O'), + ('Enregistrer','saveJDC','','Ctrl+S'), + ('Enregistrer sous','saveasJDC','','Ctrl+E'), + None, + ('Fermer','closeJDC','','Ctrl+W'), + ('Quitter','exitEFICAS','','Ctrl+Q'), + ] + ), + ('Edition',[ + ('Copier','copy','','Ctrl+C'), + ('Couper','cut','','Ctrl+X'), + ('Coller','paste','','Ctrl+V'), + ] + ), + ('Jeu de commandes',[ + ('Rapport de validation','visuCRJDC','','Ctrl+R'), + ('Fichier source','visu_txt_brut_JDC','','Ctrl+B'), + #('Paramètres Eficas','affichage_fichier_ini'), + ] + ), + ('Traduction',[ + ('Traduction v7 en v8','TraduitFichier','','Ctrl+T'), + ] + ), + ('Aide',[ + ('Aide EFICAS','aideEFICAS','','Ctrl+A'), + ] + ), + ] + } diff --git a/Editeur/readercata.py b/InterfaceTK/readercata.py similarity index 93% rename from Editeur/readercata.py rename to InterfaceTK/readercata.py index 1555f388..07c5ebf5 100644 --- a/Editeur/readercata.py +++ b/InterfaceTK/readercata.py @@ -29,21 +29,19 @@ import os,sys,py_compile import traceback import cPickle import Pmw +import re # Modules Eficas -import prefs -import splash -import fontes -import analyse_catalogue +from Editeur import analyse_catalogue +from Editeur import autre_analyse_cata +from Editeur import uiinfo from Noyau.N_CR import CR -from widgets import showinfo,showerror -from widgets import Fenetre +from InterfaceTK.widgets import showinfo,showerror +from InterfaceTK.widgets import Fenetre +from InterfaceTK import fontes + from utils import init_rep_cata_dev -#import catabrowser -import autre_analyse_cata -import uiinfo -import re class READERCATA: @@ -63,6 +61,7 @@ class READERCATA: self.appli.format_fichier.set('python') self.version_code=self.appli.version_code self.fic_cata=None + self.version_cata=None self.OpenCata() self.cataitem=None @@ -71,8 +70,10 @@ class READERCATA: Ouvre le catalogue standard du code courant, cad le catalogue présent dans le répertoire Cata """ + if self.appli.ihm == "TK" : + from InterfaceTK import splash message1 = "Compilation des fichiers Eficas \n\n Veuillez patienter ..." - if self.appli.test == 0 : + if self.appli.test == 0 and self.appli.ihm=="TK" : splash._splash.configure(text = message1) self.configure_barre(4) @@ -124,21 +125,12 @@ class READERCATA: self.fic_cata_c = self.fic_cata + 'c' self.fic_cata_p = os.path.splitext(self.fic_cata)[0]+'_pickled.py' - #if self.appli.test == 0 : - # splash._splash.configure(text = "Debut compil cata: %d s" % time.clock()) - # compilation éventuelle du catalogue - #test = self.compile_cata(self.fic_cata,self.fic_cata_c) - #self.update_barre() - #if self.appli.test == 0 : - # splash._splash.configure(text = "Fin compil cata: %d s" % time.clock()) - #if not test : showerror("Compilation catalogue","Impossible de compiler le catalogue %s" %self.fic_cata) - # import du catalogue - if self.appli.test == 0 : + if self.appli.test == 0 and self.appli.ihm=="TK" : splash._splash.configure(text = "Debut import_cata: %d s" % time.clock()) self.cata = self.import_cata(self.fic_cata) self.update_barre() - if self.appli.test == 0 : + if self.appli.test == 0 and self.appli.ihm=="TK" : splash._splash.configure(text = "Fin import_cata: %d s" % time.clock()) if not self.cata : showerror("Import du catalogue","Impossible d'importer le catalogue %s" %self.fic_cata) @@ -147,7 +139,7 @@ class READERCATA: # # analyse du catalogue (ordre des mots-clés) # - if self.appli.test == 0 : + if self.appli.test == 0 and self.appli.ihm=="TK" : splash._splash.configure(text = "Debut Retrouve_Ordre: %d s" % time.clock()) # Retrouve_Ordre_Cata_Standard fait une analyse textuelle du catalogue # remplacé par Retrouve_Ordre_Cata_Standard_autre qui utilise une numerotation @@ -155,7 +147,7 @@ class READERCATA: #self.Retrouve_Ordre_Cata_Standard() self.Retrouve_Ordre_Cata_Standard_autre() self.update_barre() - if self.appli.test == 0 : + if self.appli.test == 0 and self.appli.ihm=="TK" : splash._splash.configure(text = "Fin Retrouve_Ordre: %d s" % time.clock()) # # analyse des données liées à l'IHM : UIinfo @@ -200,7 +192,8 @@ class READERCATA: """ Réalise l'import du catalogue dont le chemin d'accès est donné par cata """ - if self.appli.test == 0 : + if self.appli.test == 0 and self.appli.ihm=="TK" : + from InterfaceTK import splash splash._splash.configure(text = "Chargement du catalogue") nom_cata = os.path.splitext(os.path.basename(cata))[0] rep_cata = os.path.dirname(cata) @@ -252,7 +245,7 @@ class READERCATA: if self.code != 'ASTER' : return fic_cata = os.path.join(self.appli.CONFIGURATION.path_cata_dev,'cata_developpeur.py') message="Chargement catalogue développeur présent dans :\n %s..." % self.appli.CONFIGURATION.path_cata_dev - if self.appli.test == 0 : + if self.appli.test == 0 and self.appli.ihm=="TK" : splash._splash.configure(text = message,barre='oui') cata_dev_ordonne = analyse_cata.analyse_catalogue(self,self.fic_cata) self.cata_dev_ordonne_cr = cata_dev_ordonne.cr @@ -269,7 +262,7 @@ class READERCATA: """ if self.code != 'ASTER' : return message="Chargement catalogue développeur présent dans :\n %s..." % self.appli.CONFIGURATION.path_cata_dev - if self.appli.test == 0 : + if self.appli.test == 0 and self.appli.ihm=="TK": splash._splash.configure(text = message,barre='oui') cata_dev_ordonne_dico,self.appli.liste_simp_reel=autre_analyse_cata.analyse_catalogue(self.cata) self.cata_ordonne_dico.update(cata_dev_ordonne_dico) @@ -285,7 +278,7 @@ class READERCATA: try: f = open(self.fic_cata_p) u = cPickle.Unpickler(f) - if self.appli.test == 0 : + if self.appli.test == 0 and self.appli.ihm=="TK" : splash._splash.configure(text = "Analyse du catalogue") self.cata_ordonne_dico = u.load() f.close() @@ -294,7 +287,7 @@ class READERCATA: # ou (le plus probable) s'il a été créé sous un autre OS self.Get_Ordre_Cata(mode='cata') elif mode == 'cata': - if self.appli.test == 0 : + if self.appli.test == 0 and self.appli.ihm=="TK" : splash._splash.configure(text = "Analyse du catalogue",barre='oui') cata_ordonne = analyse_catalogue.analyse_catalogue(self,self.fic_cata) self.cata_ordonne_cr = cata_ordonne.cr @@ -333,6 +326,7 @@ class READERCATA: self.version_code = liste_choix[0] return # création d'une boîte de dialogue modale + from InterfaceTK import splash self.fenetre_choix_cata = Pmw.Dialog(splash._splash, #avec self.parent, ne marche pas sous Windows buttons=('OK','ANNULER'), defaultbutton = 'OK', @@ -345,7 +339,7 @@ class READERCATA: buttontype='radiobutton', labelpos = 'w', label_text = label, - label_font = fontes.standard, + label_font = fontes.standard, orient='vertical') for choix in liste_choix : self.radiobutton.add(choix) @@ -384,7 +378,7 @@ class READERCATA: if time1 > time2: try: # le catalogue doit être recompilé avant d'être importé - if self.appli.test == 0 : + if self.appli.test == 0 and self.appli.ihm=="TK" : splash._splash.configure(text="Compilation du catalogue\nCela peut prendre plusieurs secondes ...") py_compile.compile(cata) except: @@ -400,7 +394,7 @@ class READERCATA: """ Configure la barre de progression en lui passant comme paramètre le nombre de commandes du catalogue qui lui sert à déterminer la longueur de son incrément """ try: - if self.appli.test == 0 : + if self.appli.test == 0 and self.appli.ihm=="TK" : splash._splash.configure(barre='oui',ratio = nbcommandes) except: pass @@ -408,7 +402,7 @@ class READERCATA: def update_barre(self): """ Update la position de la barre de progression : la fait progresser de son incrément """ try: - if self.appli.test == 0 : + if self.appli.test == 0 and self.appli.ihm=="TK" : splash._splash.update_barre() except: pass diff --git a/Editeur/shellpanel.py b/InterfaceTK/shellpanel.py similarity index 97% rename from Editeur/shellpanel.py rename to InterfaceTK/shellpanel.py index 0f929484..b7682198 100644 --- a/Editeur/shellpanel.py +++ b/InterfaceTK/shellpanel.py @@ -26,7 +26,7 @@ from copy import copy,deepcopy import traceback # Modules Eficas -import Objecttreeitem +from Editeur import Objecttreeitem #import prefs #import panels #import images @@ -34,7 +34,7 @@ import Objecttreeitem #from widgets import FenetreDeSelection from Noyau.N_CR import justify_text -from utils import substract_list +from Editeur.utils import substract_list from newsimppanel import newSIMPPanel diff --git a/Editeur/splash.py b/InterfaceTK/splash.py similarity index 99% rename from Editeur/splash.py rename to InterfaceTK/splash.py index 2918ddfe..f1deca69 100644 --- a/Editeur/splash.py +++ b/InterfaceTK/splash.py @@ -26,7 +26,7 @@ from Tkinter import * from centerwindow import centerwindow from Tools.foztools.foztools import Slider -import fontes +from InterfaceTK import fontes import images _splash=None diff --git a/Editeur/statusbar.py b/InterfaceTK/statusbar.py similarity index 100% rename from Editeur/statusbar.py rename to InterfaceTK/statusbar.py diff --git a/Editeur/styles.py b/InterfaceTK/styles.py similarity index 88% rename from Editeur/styles.py rename to InterfaceTK/styles.py index dd90ee60..ead56a55 100644 --- a/Editeur/styles.py +++ b/InterfaceTK/styles.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- import os -import prefs +from Aster import prefs import basestyle from basestyle import STYLE,style @@ -12,8 +12,10 @@ userstylefile=os.path.expanduser("~/Eficas_install/style.py") if os.path.isfile(userstylefile): execfile(userstylefile) -import fontes +from InterfaceTK import fontes for attr in dir(style): if attr[0]=='_':continue if not hasattr(fontes,attr):continue setattr(fontes,attr,getattr(style,attr)) + + diff --git a/Editeur/toolbar.py b/InterfaceTK/toolbar.py similarity index 100% rename from Editeur/toolbar.py rename to InterfaceTK/toolbar.py diff --git a/Editeur/tooltip.py b/InterfaceTK/tooltip.py similarity index 100% rename from Editeur/tooltip.py rename to InterfaceTK/tooltip.py diff --git a/Editeur/treeitemincanvas.py b/InterfaceTK/treeitemincanvas.py similarity index 98% rename from Editeur/treeitemincanvas.py rename to InterfaceTK/treeitemincanvas.py index f007f450..05239c94 100644 --- a/Editeur/treeitemincanvas.py +++ b/InterfaceTK/treeitemincanvas.py @@ -24,7 +24,7 @@ import Tkinter,Pmw # Modules Eficas -import Objecttreeitem +from Editeur import Objecttreeitem import treewidget class TREEITEMINCANVAS: diff --git a/Editeur/treewidget.py b/InterfaceTK/treewidget.py similarity index 99% rename from Editeur/treewidget.py rename to InterfaceTK/treewidget.py index a0c3be10..2cdae73f 100644 --- a/Editeur/treewidget.py +++ b/InterfaceTK/treewidget.py @@ -22,13 +22,13 @@ import os,sys,string,re,types,traceback from Tkinter import * -import fontes +from InterfaceTK import fontes import images from Ihm import CONNECTOR # -__version__="$Name: $" -__Id__="$Id: treewidget.py,v 1.31.12.1 2007-04-26 07:56:07 cchris Exp $" +__version__="$Name: BR_V1_12qt $" +__Id__="$Id: treewidget.py,v 1.32 2007-06-15 15:52:04 cchris Exp $" # Fonte_Standard = fontes.standard diff --git a/Editeur/uniqueassdpanel.py b/InterfaceTK/uniqueassdpanel.py similarity index 98% rename from Editeur/uniqueassdpanel.py rename to InterfaceTK/uniqueassdpanel.py index bc777b76..ad9ed244 100644 --- a/Editeur/uniqueassdpanel.py +++ b/InterfaceTK/uniqueassdpanel.py @@ -25,15 +25,15 @@ from copy import copy,deepcopy import traceback # Modules Eficas -import Objecttreeitem -import prefs +from Editeur import Objecttreeitem +from Aster import prefs import panels import images from widgets import ListeChoix from widgets import FenetreDeSelection from Noyau.N_CR import justify_text -from utils import substract_list +from Editeur.utils import substract_list # Import des panels from uniquepanel import UNIQUE_Panel diff --git a/Editeur/uniquebasepanel.py b/InterfaceTK/uniquebasepanel.py similarity index 98% rename from Editeur/uniquebasepanel.py rename to InterfaceTK/uniquebasepanel.py index 5517defa..707fc285 100644 --- a/Editeur/uniquebasepanel.py +++ b/InterfaceTK/uniquebasepanel.py @@ -27,15 +27,15 @@ from copy import copy,deepcopy import traceback # Modules Eficas -import Objecttreeitem -import prefs +from Editeur import Objecttreeitem +from Aster import prefs import panels import images from widgets import FenetreDeParametre from widgets import showerror from Noyau.N_CR import justify_text -from utils import substract_list +from Editeur.utils import substract_list # Import des panels from uniquepanel import UNIQUE_Panel diff --git a/Editeur/uniquecomppanel.py b/InterfaceTK/uniquecomppanel.py similarity index 98% rename from Editeur/uniquecomppanel.py rename to InterfaceTK/uniquecomppanel.py index 3aa09074..b7fdf618 100644 --- a/Editeur/uniquecomppanel.py +++ b/InterfaceTK/uniquecomppanel.py @@ -26,15 +26,15 @@ from copy import copy,deepcopy import traceback # Modules Eficas -import Objecttreeitem -import prefs +from Editeur import Objecttreeitem +from Aster import prefs import panels import images from widgets import ListeChoix from widgets import FenetreDeSelection from Noyau.N_CR import justify_text -from utils import substract_list +from Editeur.utils import substract_list # Import des panels from uniquepanel import UNIQUE_Panel diff --git a/Editeur/uniqueintopanel.py b/InterfaceTK/uniqueintopanel.py similarity index 97% rename from Editeur/uniqueintopanel.py rename to InterfaceTK/uniqueintopanel.py index 6532e3fa..5c6552b5 100644 --- a/Editeur/uniqueintopanel.py +++ b/InterfaceTK/uniqueintopanel.py @@ -26,15 +26,15 @@ from copy import copy,deepcopy import traceback # Modules Eficas -import Objecttreeitem -import prefs +from Editeur import Objecttreeitem +from Aster import prefs import panels import images from widgets import ListeChoix from widgets import FenetreDeSelection from Noyau.N_CR import justify_text -from utils import substract_list +from Editeur.utils import substract_list # Import des panels from uniquepanel import UNIQUE_Panel diff --git a/Editeur/uniquepanel.py b/InterfaceTK/uniquepanel.py similarity index 96% rename from Editeur/uniquepanel.py rename to InterfaceTK/uniquepanel.py index a622b8a6..4e3a6037 100644 --- a/Editeur/uniquepanel.py +++ b/InterfaceTK/uniquepanel.py @@ -26,15 +26,15 @@ from copy import copy,deepcopy import traceback # Modules Eficas -import Objecttreeitem -import prefs +from Editeur import Objecttreeitem +from Aster import prefs import panels import images from widgets import ListeChoix from widgets import FenetreDeSelection from Noyau.N_CR import justify_text -from utils import substract_list +from Editeur.utils import substract_list # Import des panels from newsimppanel import newSIMPPanel diff --git a/Editeur/uniquesdcopanel.py b/InterfaceTK/uniquesdcopanel.py similarity index 99% rename from Editeur/uniquesdcopanel.py rename to InterfaceTK/uniquesdcopanel.py index 6c3f1fc4..9722862c 100644 --- a/Editeur/uniquesdcopanel.py +++ b/InterfaceTK/uniquesdcopanel.py @@ -26,15 +26,15 @@ from copy import copy,deepcopy import traceback # Modules Eficas -import Objecttreeitem -import prefs +from Editeur import Objecttreeitem +from Aster import prefs import panels import images from widgets import ListeChoix from widgets import FenetreDeSelection from Noyau.N_CR import justify_text -from utils import substract_list +from Editeur.utils import substract_list # Import des panels from uniqueassdpanel import UNIQUE_ASSD_Panel diff --git a/Editeur/widgets.py b/InterfaceTK/widgets.py similarity index 99% rename from Editeur/widgets.py rename to InterfaceTK/widgets.py index 83c51ffc..d43053ba 100644 --- a/Editeur/widgets.py +++ b/InterfaceTK/widgets.py @@ -32,9 +32,9 @@ import traceback from tkFileDialog import * from tkMessageBox import showinfo,askyesno,showerror,askretrycancel -import fontes -import prefs -from utils import save_in_file +from InterfaceTK import fontes +from Aster import prefs +from Editeur.utils import save_in_file from centerwindow import centerwindow from Noyau.N_utils import repr_float diff --git a/Ui/desChoixCata.py b/Ui/desChoixCata.py new file mode 100644 index 00000000..8446d25c --- /dev/null +++ b/Ui/desChoixCata.py @@ -0,0 +1,79 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file 'desChoixCata.ui' +# +# Created: mer mai 23 10:40:48 2007 +# by: The PyQt User Interface Compiler (pyuic) 3.13 +# +# WARNING! All changes made in this file will be lost! + + +from qt import * + + +class DChoixCata(QDialog): + def __init__(self,parent = None,name = None,modal = 0,fl = 0): + QDialog.__init__(self,parent,name,modal,fl) + + if not name: + self.setName("DChoixCata") + + self.setSizeGripEnabled(1) + + + self.frame3 = QFrame(self,"frame3") + self.frame3.setGeometry(QRect(0,120,540,50)) + self.frame3.setFrameShape(QFrame.StyledPanel) + self.frame3.setFrameShadow(QFrame.Raised) + + self.buttonCancel = QPushButton(self.frame3,"buttonCancel") + self.buttonCancel.setGeometry(QRect(370,10,90,30)) + self.buttonCancel.setAutoDefault(1) + + self.buttonOk = QPushButton(self.frame3,"buttonOk") + self.buttonOk.setGeometry(QRect(80,10,90,30)) + self.buttonOk.setAutoDefault(1) + self.buttonOk.setDefault(1) + + self.textLabel1_2 = QLabel(self,"textLabel1_2") + self.textLabel1_2.setGeometry(QRect(40,50,340,20)) + + self.CBChoixCata = QComboBox(0,self,"CBChoixCata") + self.CBChoixCata.setEnabled(1) + self.CBChoixCata.setGeometry(QRect(400,41,101,30)) + + self.TLNb = QLabel(self,"TLNb") + self.TLNb.setGeometry(QRect(110,30,210,20)) + self.TLNb.setMinimumSize(QSize(30,0)) + + self.languageChange() + + self.resize(QSize(547,172).expandedTo(self.minimumSizeHint())) + self.clearWState(Qt.WState_Polished) + + self.connect(self.buttonOk,SIGNAL("clicked()"),self.BOkPressed) + self.connect(self.buttonCancel,SIGNAL("clicked()"),self.BCancelPressed) + self.connect(self.CBChoixCata,SIGNAL("textChanged(const QString&)"),self.CataChoisi) + + + def languageChange(self): + self.setCaption(self.__tr("Choix d'une version du code Aster")) + self.buttonCancel.setText(self.__tr("&Cancel")) + self.buttonCancel.setAccel(QString.null) + self.buttonOk.setText(self.__tr("&OK")) + self.buttonOk.setAccel(QString.null) + self.textLabel1_2.setText(self.__tr("Veuillez choisir celle avec laquelle vous souhaitez travailler")) + self.TLNb.setText(self.__tr("2")) + + + def CataChoisi(self): + print "DChoixCata.CataChoisi(): Not implemented yet" + + def BOkPressed(self): + print "DChoixCata.BOkPressed(): Not implemented yet" + + def BCancelPressed(self): + print "DChoixCata.BCancelPressed(): Not implemented yet" + + def __tr(self,s,c = None): + return qApp.translate("DChoixCata",s,c) diff --git a/Ui/desChoixCata.ui b/Ui/desChoixCata.ui new file mode 100644 index 00000000..66297798 --- /dev/null +++ b/Ui/desChoixCata.ui @@ -0,0 +1,168 @@ + +DChoixCata + + + DChoixCata + + + + 0 + 0 + 547 + 172 + + + + Choix d'une version du code Aster + + + true + + + + frame3 + + + + 0 + 120 + 540 + 50 + + + + StyledPanel + + + Raised + + + + buttonCancel + + + + 370 + 10 + 90 + 30 + + + + &Cancel + + + + + + true + + + + + buttonOk + + + + 80 + 10 + 90 + 30 + + + + &OK + + + + + + true + + + true + + + + + + textLabel1_2 + + + + 40 + 50 + 340 + 20 + + + + <font size="+1">Veuillez choisir celle avec laquelle vous souhaitez travailler</font> + + + + + CBChoixCata + + + true + + + + 400 + 41 + 101 + 30 + + + + + + TLNb + + + + 110 + 30 + 210 + 20 + + + + + 30 + 0 + + + + 2 + + + + + + buttonOk + clicked() + DChoixCata + BOkPressed() + + + buttonCancel + clicked() + DChoixCata + BCancelPressed() + + + CBChoixCata + textChanged(const QString&) + DChoixCata + CataChoisi() + + + + CataChoisi() + BOkPressed() + BCancelPressed() + + + diff --git a/Ui/desCommande.py b/Ui/desCommande.py new file mode 100644 index 00000000..9ae67ecb --- /dev/null +++ b/Ui/desCommande.py @@ -0,0 +1,220 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file 'desCommande.ui' +# +# Created: jeu avr 26 14:25:01 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.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,140,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.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\xa8\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/Ui/desCommande.ui b/Ui/desCommande.ui new file mode 100644 index 00000000..e8d3037b --- /dev/null +++ b/Ui/desCommande.ui @@ -0,0 +1,551 @@ + +DComm + + + DComm + + + + 0 + 0 + 505 + 483 + + + + + 505 + 0 + + + + DComm + + + + Commentaire + + + + 10 + 410 + 490 + 20 + + + + NoFrame + + + Plain + + + + + + + + bSup + + + + 320 + 440 + 142 + 30 + + + + &Supprimer + + + Alt+S + + + true + + + suppression du mot clef + + + + + bOk + + + + 170 + 440 + 142 + 30 + + + + &Valider + + + Shift+A, Alt+A, Alt+A, Alt+A + + + true + + + true + + + validation de la saisie + + + + + bHelp + + + + 10 + 440 + 142 + 30 + + + + &Documentation + + + Alt+D + + + true + + + affichage documentation aster + + + + + TWChoix + + + + 0 + 0 + 500 + 400 + + + + + MotClef + + + Ajouter Mot-Clef + + + + LBMCPermis + + + + 10 + 40 + 220 + 290 + + + + + 0 + 0 + + + + + + LBRegles + + + + 260 + 40 + 230 + 290 + + + + + + textLabel1 + + + + 50 + 10 + 140 + 20 + + + + + 0 + 0 + + + + <h3><p align="center"><u><b>Mots Clefs Permis</b></u></p></h3> + + + + + textLabel1_2 + + + + 360 + 0 + 50 + 37 + + + + <h3><p align="center"><u><b>Règles</b></u></p></h3> + + + + + + Concept + + + Nommer Concept + + + + groupBox1 + + + + 0 + 10 + 520 + 380 + + + + Concept + + + + textLabel1_3 + + + + 80 + 50 + 82 + 31 + + + + <u>Nom du concept :</u> + + + + + textLabel1_3_2 + + + + 80 + 170 + 82 + 31 + + + + <u>Type du concept :</u> + + + + + textLabel3 + + + + 80 + 200 + 230 + 31 + + + + L'opérateur courant retourne un concept de type : + + + + + LENomConcept + + + + 80 + 110 + 310 + 30 + + + + + + typeConcept + + + + 320 + 200 + 100 + 31 + + + + TypeDuConcept + + + + + + + Commande + + + Nouvelle Commande + + + + textLabel6 + + + + 10 + 60 + 60 + 30 + + + + Filtre + + + + + textLabel4 + + + + 90 + 340 + 300 + 30 + + + + La commande choisie sera ajoutée APRES la commande courante + + + + + LBNouvCommande + + + + 50 + 100 + 410 + 240 + + + + + + buttonGroup1 + + + + 298 + 17 + 151 + 70 + + + + Affichage + + + + RBGroupe + + + + 20 + 40 + 101 + 20 + + + + par groupe + + + + + RBalpha + + + + 20 + 20 + 101 + 20 + + + + alphabétique + + + true + + + + + + LEFiltre + + + + 50 + 60 + 160 + 30 + + + + + + BNext + + + + 220 + 60 + 30 + 31 + + + + + + + image0 + + + affiche la prochaine occurence + + + + + textLabel1_4 + + + + 50 + 20 + 171 + 21 + + + + <b><u>Commandes :</u></b> + + + + + + + + 89504e470d0a1a0a0000000d49484452000000210000000e0806000000a11e758c000000cf49444154388dd594db0ec3200c43edfdf8d897bb0f345b480845d51eb64888f412e76001c00f046fd6e99bba77200480924a1032c92efbd8c7d5cabcc025400099e957849568fe7f06c0ded1deb32b4a1ec4ea824b9e74097165bd01f85527f78a7201e0a3129f345a017c543bafdc983d0f7109d15a331b471f47072c17494a82338f6178203a8817e67306b1f08b07ba03e602c9b831077e37e0209e67e3386710977b17de80c185ad38695a51d522c82ce77912e2fed8be83762092f52b1820dd11bb10e565b53a5a3bbaff130713d66fa6981857060000000049454e44ae426082 + + + + + LBNouvCommande + clicked(QListBoxItem*) + DComm + LBNouvCommandeClicked() + + + LEFiltre + textChanged(const QString&) + DComm + LEFiltreTextChanged() + + + LEFiltre + returnPressed() + DComm + LEfiltreReturnPressed() + + + bSup + pressed() + DComm + BSupPressed() + + + bOk + clicked() + DComm + BOkPressed() + + + LENomConcept + returnPressed() + DComm + LENomConceptReturnPressed() + + + RBGroupe + clicked() + DComm + BuildTabCommand() + + + RBalpha + clicked() + DComm + BuildTabCommand() + + + bHelp + clicked() + DComm + BHelpPressed() + + + BNext + pressed() + DComm + BNextPressed() + + + + LBNouvCommandeClicked() + LEFiltreTextChanged() + LEfiltreReturnPressed() + BSupPressed() + LENomConceptReturnPressed() + BOkPressed() + BuildTabCommand() + BHelpPressed() + BNextPressed() + + + diff --git a/Ui/desCommentaire.py b/Ui/desCommentaire.py new file mode 100644 index 00000000..2f4ef35a --- /dev/null +++ b/Ui/desCommentaire.py @@ -0,0 +1,70 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file 'desCommentaire.ui' +# +# Created: lun mar 19 11:05:34 2007 +# by: The PyQt User Interface Compiler (pyuic) 3.13 +# +# WARNING! All changes made in this file will be lost! + + +from qt import * + + +class DComment(QWidget): + def __init__(self,parent = None,name = None,fl = 0): + QWidget.__init__(self,parent,name,fl) + + if not name: + self.setName("DComment") + + self.setMinimumSize(QSize(350,0)) + + + self.bSup = QPushButton(self,"bSup") + self.bSup.setGeometry(QRect(310,420,142,30)) + self.bSup.setAutoDefault(1) + + self.bHelp = QPushButton(self,"bHelp") + self.bHelp.setGeometry(QRect(10,420,142,30)) + self.bHelp.setAutoDefault(1) + + self.textLabel1 = QLabel(self,"textLabel1") + self.textLabel1.setGeometry(QRect(160,10,120,21)) + + self.textCommentaire = QTextEdit(self,"textCommentaire") + self.textCommentaire.setGeometry(QRect(10,40,451,360)) + + self.bOk = QPushButton(self,"bOk") + self.bOk.setGeometry(QRect(160,420,142,30)) + self.bOk.setAutoDefault(1) + self.bOk.setDefault(1) + + self.languageChange() + + self.resize(QSize(475,480).expandedTo(self.minimumSizeHint())) + self.clearWState(Qt.WState_Polished) + + self.connect(self.textCommentaire,SIGNAL("returnPressed()"),self.TexteCommentaireEntre) + self.connect(self.bOk,SIGNAL("clicked()"),self.TexteCommentaireEntre) + + + def languageChange(self): + self.setCaption(self.__tr("Form1")) + self.bSup.setText(self.__tr("&Supprimer")) + self.bSup.setAccel(self.__tr("Alt+S")) + QToolTip.add(self.bSup,self.__tr("suppression du mot clef")) + 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("

Texte du Commentaire

")) + 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")) + + + def TexteCommentaireEntre(self): + print "DComment.TexteCommentaireEntre(): Not implemented yet" + + def __tr(self,s,c = None): + return qApp.translate("DComment",s,c) diff --git a/Ui/desCommentaire.ui b/Ui/desCommentaire.ui new file mode 100644 index 00000000..e161ac53 --- /dev/null +++ b/Ui/desCommentaire.ui @@ -0,0 +1,150 @@ + +DComment + + + DComment + + + + 0 + 0 + 475 + 480 + + + + + 350 + 0 + + + + Form1 + + + + bSup + + + + 310 + 420 + 142 + 30 + + + + &Supprimer + + + Alt+S + + + true + + + suppression du mot clef + + + + + bHelp + + + + 10 + 420 + 142 + 30 + + + + &Documentation + + + Alt+D + + + true + + + affichage documentation aster + + + + + textLabel1 + + + + 160 + 10 + 120 + 21 + + + + <p align="center"><b>Texte du Commentaire</b></p> + + + + + textCommentaire + + + + 10 + 40 + 451 + 360 + + + + + + bOk + + + + 160 + 420 + 142 + 30 + + + + &Valider + + + Shift+A, Alt+A, Alt+A, Alt+A + + + true + + + true + + + validation de la saisie + + + + + + textCommentaire + returnPressed() + DComment + TexteCommentaireEntre() + + + bOk + clicked() + DComment + TexteCommentaireEntre() + + + + TexteCommentaireEntre() + + + diff --git a/Ui/desFormule.py b/Ui/desFormule.py new file mode 100644 index 00000000..5c5aa32e --- /dev/null +++ b/Ui/desFormule.py @@ -0,0 +1,226 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file 'desFormule.ui' +# +# Created: mar aoû 7 16:45:45 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 DFormule(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("DFormule") + + self.setMinimumSize(QSize(505,0)) + + + self.bSup = QPushButton(self,"bSup") + self.bSup.setGeometry(QRect(320,440,142,30)) + self.bSup.setAutoDefault(1) + + self.bHelp = QPushButton(self,"bHelp") + self.bHelp.setGeometry(QRect(10,440,142,30)) + self.bHelp.setAutoDefault(1) + + self.Commentaire = QLabel(self,"Commentaire") + self.Commentaire.setGeometry(QRect(-8,404,490,20)) + + self.bOk = QPushButton(self,"bOk") + self.bOk.setGeometry(QRect(170,440,142,30)) + self.bOk.setAutoDefault(1) + self.bOk.setDefault(1) + + self.TWChoix = QTabWidget(self,"TWChoix") + self.TWChoix.setGeometry(QRect(0,0,500,400)) + + self.Formule = QWidget(self.TWChoix,"Formule") + + self.textLabel1_2 = QLabel(self.Formule,"textLabel1_2") + self.textLabel1_2.setGeometry(QRect(290,10,80,20)) + + self.textLabel1 = QLabel(self.Formule,"textLabel1") + self.textLabel1.setGeometry(QRect(30,10,160,30)) + self.textLabel1.setMinimumSize(QSize(0,0)) + + self.textLabel2 = QLabel(self.Formule,"textLabel2") + self.textLabel2.setGeometry(QRect(220,40,220,20)) + + self.textLabel1_5 = QLabel(self.Formule,"textLabel1_5") + self.textLabel1_5.setGeometry(QRect(30,180,420,20)) + self.textLabel1_5.setMinimumSize(QSize(0,0)) + + self.textLabel1_3_2 = QLabel(self.Formule,"textLabel1_3_2") + self.textLabel1_3_2.setGeometry(QRect(28,306,401,31)) + + self.textLabel1_6 = QLabel(self.Formule,"textLabel1_6") + self.textLabel1_6.setGeometry(QRect(210,60,20,50)) + + self.textLabel2_2 = QLabel(self.Formule,"textLabel2_2") + self.textLabel2_2.setGeometry(QRect(210,130,49,20)) + + self.textLabel1_6_2 = QLabel(self.Formule,"textLabel1_6_2") + self.textLabel1_6_2.setGeometry(QRect(450,60,20,50)) + + self.LENomFormule = QLineEdit(self.Formule,"LENomFormule") + self.LENomFormule.setGeometry(QRect(30,70,171,31)) + + self.LENomsArgs = QLineEdit(self.Formule,"LENomsArgs") + self.LENomsArgs.setGeometry(QRect(220,70,230,31)) + + self.textLabel1_3 = QLabel(self.Formule,"textLabel1_3") + self.textLabel1_3.setGeometry(QRect(90,260,300,20)) + + self.LECorpsFormule = QLineEdit(self.Formule,"LECorpsFormule") + self.LECorpsFormule.setGeometry(QRect(20,220,440,31)) + self.TWChoix.insertTab(self.Formule,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(529,484).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) + self.connect(self.LENomFormule,SIGNAL("returnPressed()"),self.NomFormuleSaisi) + self.connect(self.LENomsArgs,SIGNAL("returnPressed()"),self.argsSaisis) + self.connect(self.LECorpsFormule,SIGNAL("returnPressed()"),self.FormuleSaisie) + + + def languageChange(self): + self.setCaption(self.__tr("DMacro")) + self.bSup.setText(self.__tr("&Supprimer")) + self.bSup.setAccel(self.__tr("Alt+S")) + QToolTip.add(self.bSup,self.__tr("suppression du mot clef")) + self.bHelp.setText(self.__tr("&Documentation")) + self.bHelp.setAccel(self.__tr("Alt+D")) + QToolTip.add(self.bHelp,self.__tr("affichage documentation aster")) + self.Commentaire.setText(QString.null) + 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.textLabel1_2.setText(self.__tr("

Arguments

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

Nom de la formule

")) + self.textLabel2.setText(self.__trUtf8("\x76\x61\x72\x69\x61\x62\x6c\x65\x73\x20\x73\xc3\xa9\x70\x61\x72\xc3\xa9\x65\x73\x20\x70\x61\x72\x20\x64\x65\x73\x20\x22\x2c\x22\x20\x70\x61\x72\x20\x65\x78\x2e\x20\x3a\x20\x78\x2c\x79\x2c\x7a")) + self.textLabel1_5.setText(self.__tr("

Corps de la formule

")) + self.textLabel1_3_2.setText(self.__trUtf8("\x43\x65\x20\x6e\x27\x65\x73\x74\x20\x71\x75\x27\x61\x70\x72\xc3\xa8\x73\x20\x61\x76\x6f\x69\x72\x20\x61\x70\x70\x75\x79\xc3\xa9\x20\x73\x75\x72\x20\x6c\x65\x20\x62\x6f\x75\x74\x6f\x6e\x20\x56\x61\x6c\x69\x64\x65\x72\x20\x71\x75\x65\x20\x6c\x65\x73\x20\x6e\x6f\x75\x76\x65\x6c\x6c\x65\x73\x0a\x76\x61\x65\x6c\x75\x72\x73\x20\x73\x65\x72\x6f\x6e\x74\x20\x65\x66\x66\x65\x63\x74\x69\x76\x65\x6d\x65\x6e\x74\x20\x70\x72\x69\x73\x65\x73\x20\x65\x6e\x20\x63\x6f\x6d\x70\x74\x65")) + self.textLabel1_6.setText(self.__tr("

(

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

)

")) + self.textLabel1_3.setText(self.__trUtf8("\x52\x65\x74\x6f\x75\x72\x2d\x43\x68\x61\x72\x69\x6f\x74\x20\x70\x65\x72\x6d\x65\x74\x20\x64\x65\x20\x76\xc3\xa9\x72\x69\x66\x69\x65\x72\x20\x71\x75\x65\x20\x6c\x27\x65\x78\x70\x72\x65\x73\x73\x69\x6f\x6e\x20\x65\x73\x74\x20\x76\x61\x6c\x69\x64\x65\x2e")) + self.TWChoix.changeTab(self.Formule,self.__trUtf8("\x44\xc3\xa9\x66\x69\x6e\x69\x74\x69\x6f\x6e\x20\x46\x6f\x72\x6d\x75\x6c\x65")) + 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 "DFormule.LBNouvCommandeClicked(): Not implemented yet" + + def LEFiltreTextChanged(self): + print "DFormule.LEFiltreTextChanged(): Not implemented yet" + + def LEfiltreReturnPressed(self): + print "DFormule.LEfiltreReturnPressed(): Not implemented yet" + + def BSupPressed(self): + print "DFormule.BSupPressed(): Not implemented yet" + + def BOkPressed(self): + print "DFormule.BOkPressed(): Not implemented yet" + + def BuildTabCommand(self): + print "DFormule.BuildTabCommand(): Not implemented yet" + + def BNextPressed(self): + print "DFormule.BNextPressed(): Not implemented yet" + + def NomFormuleSaisi(self): + print "DFormule.NomFormuleSaisi(): Not implemented yet" + + def argsSaisis(self): + print "DFormule.argsSaisis(): Not implemented yet" + + def FormuleSaisie(self): + print "DFormule.FormuleSaisie(): Not implemented yet" + + def __tr(self,s,c = None): + return qApp.translate("DFormule",s,c) + + def __trUtf8(self,s,c = None): + return qApp.translate("DFormule",s,c,QApplication.UnicodeUTF8) diff --git a/Ui/desFormule.ui b/Ui/desFormule.ui new file mode 100644 index 00000000..5afefa16 --- /dev/null +++ b/Ui/desFormule.ui @@ -0,0 +1,577 @@ + +DFormule + + + DFormule + + + + 0 + 0 + 529 + 484 + + + + + 505 + 0 + + + + DMacro + + + + bSup + + + + 320 + 440 + 142 + 30 + + + + &Supprimer + + + Alt+S + + + true + + + suppression du mot clef + + + + + bHelp + + + + 10 + 440 + 142 + 30 + + + + &Documentation + + + Alt+D + + + true + + + affichage documentation aster + + + + + Commentaire + + + + -8 + 404 + 490 + 20 + + + + + + + + + bOk + + + + 170 + 440 + 142 + 30 + + + + &Valider + + + Shift+A, Alt+A, Alt+A, Alt+A + + + true + + + true + + + validation de la saisie + + + + + TWChoix + + + + 0 + 0 + 500 + 400 + + + + + Formule + + + Définition Formule + + + + textLabel1_2 + + + + 290 + 10 + 80 + 20 + + + + <h3><p align="center"><u><b>Arguments</b></u></p></h3> + + + + + textLabel1 + + + + 30 + 10 + 160 + 30 + + + + + 0 + 0 + + + + <h3><p align="center"><u><b>Nom de la formule</b></u></p></h3> + + + + + textLabel2 + + + + 220 + 40 + 220 + 20 + + + + variables séparées par des "," par ex. : x,y,z + + + + + textLabel1_5 + + + + 30 + 180 + 420 + 20 + + + + + 0 + 0 + + + + <h3><p align="center"><u><b>Corps de la formule</b></u></p></h3> + + + + + textLabel1_3_2 + + + + 28 + 306 + 401 + 31 + + + + Ce n'est qu'après avoir appuyé sur le bouton Valider que les nouvelles +vaelurs seront effectivement prises en compte + + + + + textLabel1_6 + + + + 210 + 60 + 20 + 50 + + + + <h1><b>(</b></h1> + + + + + textLabel2_2 + + + + 210 + 130 + 49 + 20 + + + + <font size="+4" face="Helvetica"><b>=</b></font> + + + + + textLabel1_6_2 + + + + 450 + 60 + 20 + 50 + + + + <h1><b>)</b></h1> + + + + + LENomFormule + + + + 30 + 70 + 171 + 31 + + + + + + LENomsArgs + + + + 220 + 70 + 230 + 31 + + + + + + textLabel1_3 + + + + 90 + 260 + 300 + 20 + + + + Retour-Chariot permet de vérifier que l'expression est valide. + + + + + LECorpsFormule + + + + 20 + 220 + 440 + 31 + + + + + + + Commande + + + Nouvelle Commande + + + + textLabel6 + + + + 10 + 60 + 60 + 30 + + + + Filtre + + + + + textLabel4 + + + + 90 + 340 + 300 + 30 + + + + La commande choisie sera ajoutée APRES la commande courante + + + + + LBNouvCommande + + + + 50 + 100 + 410 + 240 + + + + + + buttonGroup1 + + + + 300 + 20 + 151 + 70 + + + + Affichage + + + + RBGroupe + + + + 20 + 40 + 101 + 20 + + + + par groupe + + + + + RBalpha + + + + 20 + 20 + 101 + 20 + + + + alphabétique + + + true + + + + + + LEFiltre + + + + 50 + 60 + 160 + 30 + + + + + + textLabel1_4 + + + + 50 + 20 + 171 + 21 + + + + <b><u>Commandes :</u></b> + + + + + BNext + + + + 220 + 60 + 30 + 31 + + + + + + + image0 + + + affiche la prochaine occurence + + + + + + + + 89504e470d0a1a0a0000000d49484452000000210000000e0806000000a11e758c000000cf49444154388dd594db0ec3200c43edfdf8d897bb0f345b480845d51eb64888f412e76001c00f046fd6e99bba77200480924a1032c92efbd8c7d5cabcc025400099e957849568fe7f06c0ded1deb32b4a1ec4ea824b9e74097165bd01f85527f78a7201e0a3129f345a017c543bafdc983d0f7109d15a331b471f47072c17494a82338f6178203a8817e67306b1f08b07ba03e602c9b831077e37e0209e67e3386710977b17de80c185ad38695a51d522c82ce77912e2fed8be83762092f52b1820dd11bb10e565b53a5a3bbaff130713d66fa6981857060000000049454e44ae426082 + + + + + LBNouvCommande + clicked(QListBoxItem*) + DFormule + LBNouvCommandeClicked() + + + LEFiltre + textChanged(const QString&) + DFormule + LEFiltreTextChanged() + + + LEFiltre + returnPressed() + DFormule + LEfiltreReturnPressed() + + + bSup + pressed() + DFormule + BSupPressed() + + + bOk + clicked() + DFormule + BOkPressed() + + + RBalpha + clicked() + DFormule + BuildTabCommand() + + + RBGroupe + clicked() + DFormule + BuildTabCommand() + + + BNext + clicked() + DFormule + BNextPressed() + + + LENomFormule + returnPressed() + DFormule + NomFormuleSaisi() + + + LENomsArgs + returnPressed() + DFormule + argsSaisis() + + + LECorpsFormule + returnPressed() + DFormule + FormuleSaisie() + + + + LBNouvCommandeClicked() + LEFiltreTextChanged() + LEfiltreReturnPressed() + BSupPressed() + BOkPressed() + BuildTabCommand() + BNextPressed() + NomFormuleSaisi() + argsSaisis() + FormuleSaisie() + + + diff --git a/Ui/desInactif.py b/Ui/desInactif.py new file mode 100644 index 00000000..72b72ff5 --- /dev/null +++ b/Ui/desInactif.py @@ -0,0 +1,76 @@ +# -*- 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/Ui/desInactif.ui b/Ui/desInactif.ui new file mode 100644 index 00000000..c5a6b800 --- /dev/null +++ b/Ui/desInactif.ui @@ -0,0 +1,134 @@ + +DInactif + + + DInactif + + + + 0 + 0 + 482 + 480 + + + + + 350 + 0 + + + + + + + + textLabel1_4 + + + + 30 + 240 + 420 + 20 + + + + <font size="+2"><p align="center"> + DEBUT / POURSUITE et FIN +</p></font> + + + + + textLabel1 + + + + 30 + 220 + 420 + 20 + + + + <font size="+2"><p align="center"> +Seules les commandes placées entre : +</p></font> + + + + + textLabel1_4_2 + + + + 30 + 260 + 420 + 20 + + + + <font size="+2"><p align="center"> +sont actives +</p></font> + + + + + bSup + + + + 170 + 430 + 142 + 30 + + + + &Supprimer + + + Alt+S + + + true + + + suppression du mot clef + + + + + textLabel1_3 + + + + 20 + 130 + 420 + 20 + + + + <font size="+2"><p align="center">Le noeud sélectionné ne correspond pas à un objet actif.</p></font> + + + + + + bSup + clicked() + DInactif + BSupPressed() + + + + BSupPressed() + ViewDoc() + BOkPressed() + + + diff --git a/Ui/desMCFact.py b/Ui/desMCFact.py new file mode 100644 index 00000000..cc10c426 --- /dev/null +++ b/Ui/desMCFact.py @@ -0,0 +1,111 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file 'desMCFact.ui' +# +# Created: mer mar 21 12:08:55 2007 +# by: The PyQt User Interface Compiler (pyuic) 3.13 +# +# WARNING! All changes made in this file will be lost! + + +from qt import * + + +class DMCFact(QWidget): + def __init__(self,parent = None,name = None,fl = 0): + QWidget.__init__(self,parent,name,fl) + + if not name: + self.setName("DMCFact") + + 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.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.LBMCPermis = QListBox(self.MotClef,"LBMCPermis") + self.LBMCPermis.setGeometry(QRect(10,40,220,290)) + self.LBMCPermis.setMinimumSize(QSize(0,0)) + self.TWChoix.insertTab(self.MotClef,QString("")) + + self.languageChange() + + self.resize(QSize(521,499).expandedTo(self.minimumSizeHint())) + self.clearWState(Qt.WState_Polished) + + self.connect(self.bSup,SIGNAL("pressed()"),self.BSupPressed) + self.connect(self.bOk,SIGNAL("clicked()"),self.BOkPressed) + + + 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")) + + + def LBNouvCommandeClicked(self): + print "DMCFact.LBNouvCommandeClicked(): Not implemented yet" + + def LEFiltreTextChanged(self): + print "DMCFact.LEFiltreTextChanged(): Not implemented yet" + + def LEfiltreReturnPressed(self): + print "DMCFact.LEfiltreReturnPressed(): Not implemented yet" + + def BSupPressed(self): + print "DMCFact.BSupPressed(): Not implemented yet" + + def BOkPressed(self): + print "DMCFact.BOkPressed(): Not implemented yet" + + def buildTabCommand(self): + print "DMCFact.buildTabCommand(): Not implemented yet" + + def BNextPressed(self): + print "DMCFact.BNextPressed(): Not implemented yet" + + def __tr(self,s,c = None): + return qApp.translate("DMCFact",s,c) + + def __trUtf8(self,s,c = None): + return qApp.translate("DMCFact",s,c,QApplication.UnicodeUTF8) diff --git a/Ui/desMCFact.ui b/Ui/desMCFact.ui new file mode 100644 index 00000000..6e7714a6 --- /dev/null +++ b/Ui/desMCFact.ui @@ -0,0 +1,234 @@ + +DMCFact + + + DMCFact + + + + 0 + 0 + 521 + 499 + + + + + 505 + 0 + + + + DMacro + + + + Commentaire + + + + 10 + 410 + 490 + 20 + + + + + + + + + bSup + + + + 320 + 440 + 142 + 30 + + + + &Supprimer + + + Alt+S + + + true + + + suppression du mot clef + + + + + bOk + + + + 170 + 440 + 142 + 30 + + + + &Valider + + + Shift+A, Alt+A, Alt+A, Alt+A + + + true + + + true + + + validation de la saisie + + + + + bHelp + + + + 10 + 440 + 142 + 30 + + + + &Documentation + + + Alt+D + + + true + + + affichage documentation aster + + + + + TWChoix + + + + 0 + 0 + 500 + 400 + + + + + MotClef + + + Ajouter Mot-Clef + + + + textLabel1_2 + + + + 360 + 0 + 50 + 37 + + + + <h3><p align="center"><u><b>Régles</b></u></p></h3> + + + + + LBRegles + + + + 260 + 40 + 230 + 290 + + + + + + LBMCPermis + + + + 10 + 40 + 220 + 290 + + + + + 0 + 0 + + + + + + textLabel1 + + + + 50 + 10 + 140 + 20 + + + + + 0 + 0 + + + + <h3><p align="center"><u><b>Mots Clefs Permis</b></u></p></h3> + + + + + + + + bSup + pressed() + DMCFact + BSupPressed() + + + bOk + clicked() + DMCFact + BOkPressed() + + + + LBNouvCommandeClicked() + LEFiltreTextChanged() + LEfiltreReturnPressed() + BSupPressed() + BOkPressed() + buildTabCommand() + BNextPressed() + + + diff --git a/Ui/desMCListAjout.py b/Ui/desMCListAjout.py new file mode 100644 index 00000000..61594a59 --- /dev/null +++ b/Ui/desMCListAjout.py @@ -0,0 +1,91 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file 'desMCListAjout.ui' +# +# Created: ven mar 23 12:13:13 2007 +# by: The PyQt User Interface Compiler (pyuic) 3.13 +# +# WARNING! All changes made in this file will be lost! + + +from qt import * + + +class DMCListAjout(QWidget): + def __init__(self,parent = None,name = None,fl = 0): + QWidget.__init__(self,parent,name,fl) + + if not name: + self.setName("DMCListAjout") + + self.setMinimumSize(QSize(350,0)) + + + self.bSup = QPushButton(self,"bSup") + self.bSup.setGeometry(QRect(310,420,142,30)) + self.bSup.setAutoDefault(1) + + self.bOk = QPushButton(self,"bOk") + self.bOk.setGeometry(QRect(160,420,142,30)) + self.bOk.setAutoDefault(1) + self.bOk.setDefault(1) + + self.bHelp = QPushButton(self,"bHelp") + self.bHelp.setGeometry(QRect(10,420,142,30)) + self.bHelp.setAutoDefault(1) + + self.bAjout = QPushButton(self,"bAjout") + self.bAjout.setGeometry(QRect(160,260,142,30)) + self.bAjout.setAutoDefault(1) + self.bAjout.setDefault(1) + + self.textLabel1_2_2 = QLabel(self,"textLabel1_2_2") + self.textLabel1_2_2.setGeometry(QRect(180,170,89,33)) + + self.textLabel1 = QLabel(self,"textLabel1") + self.textLabel1.setGeometry(QRect(160,50,140,36)) + + self.textLabel1_2 = QLabel(self,"textLabel1_2") + self.textLabel1_2.setGeometry(QRect(170,80,120,20)) + + self.MCFacteur = QLabel(self,"MCFacteur") + self.MCFacteur.setGeometry(QRect(200,120,50,20)) + + self.languageChange() + + self.resize(QSize(459,480).expandedTo(self.minimumSizeHint())) + self.clearWState(Qt.WState_Polished) + + self.connect(self.bOk,SIGNAL("clicked()"),self.BAjoutClicked) + self.connect(self.bAjout,SIGNAL("clicked()"),self.BAjoutClicked) + self.connect(self.bSup,SIGNAL("clicked()"),self.BSupPressed) + + + def languageChange(self): + self.setCaption(self.__tr("Form1")) + 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.bAjout.setText(self.__tr("&Ajouter")) + self.bAjout.setAccel(self.__tr("Alt+A")) + QToolTip.add(self.bAjout,self.__tr("validation de la saisie")) + self.textLabel1_2_2.setText(self.__tr("

cliquez ci-dessous

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

Pour ajouter une autre occurrence

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

du mot clef-facteur

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

AFFE

")) + + + def BAjoutClicked(self): + print "DMCListAjout.BAjoutClicked(): Not implemented yet" + + def BSupPressed(self): + print "DMCListAjout.BSupPressed(): Not implemented yet" + + def __tr(self,s,c = None): + return qApp.translate("DMCListAjout",s,c) diff --git a/Ui/desMCListAjout.ui b/Ui/desMCListAjout.ui new file mode 100644 index 00000000..935c7bd7 --- /dev/null +++ b/Ui/desMCListAjout.ui @@ -0,0 +1,220 @@ + +DMCListAjout + + + DMCListAjout + + + + 0 + 0 + 459 + 480 + + + + + 350 + 0 + + + + Form1 + + + + bSup + + + + 310 + 420 + 142 + 30 + + + + &Supprimer + + + Alt+S + + + true + + + suppression du mot clef + + + + + bOk + + + + 160 + 420 + 142 + 30 + + + + &Valider + + + Shift+A, Alt+A, Alt+A, Alt+A + + + true + + + true + + + validation de la saisie + + + + + bHelp + + + + 10 + 420 + 142 + 30 + + + + &Documentation + + + Alt+D + + + true + + + affichage documentation aster + + + + + bAjout + + + + 160 + 260 + 142 + 30 + + + + &Ajouter + + + Alt+A + + + true + + + true + + + validation de la saisie + + + + + textLabel1_2_2 + + + + 180 + 170 + 89 + 33 + + + + <p align="center"><font size="+1">cliquez ci-dessous</font> </p> + + + + + textLabel1 + + + + 160 + 50 + 140 + 36 + + + + <p align="center"><font size="+1">Pour ajouter une autre occurrence</font></p> + + + + + textLabel1_2 + + + + 170 + 80 + 120 + 20 + + + + <p align="center"><font size="+1">du mot clef-facteur</font> </p> + + + + + MCFacteur + + + + 200 + 120 + 50 + 20 + + + + <p align="center">AFFE</p> + + + + + + bOk + clicked() + DMCListAjout + BAjoutClicked() + + + bAjout + clicked() + DMCListAjout + BAjoutClicked() + + + bSup + clicked() + DMCListAjout + BSupPressed() + + + + BAjoutClicked() + BSupPressed() + + + diff --git a/Ui/desMacro.py b/Ui/desMacro.py new file mode 100644 index 00000000..2ec81cd5 --- /dev/null +++ b/Ui/desMacro.py @@ -0,0 +1,183 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file 'desMacro.ui' +# +# Created: jeu avr 26 14:25:17 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/Ui/desMacro.ui b/Ui/desMacro.ui new file mode 100644 index 00000000..a54b2a63 --- /dev/null +++ b/Ui/desMacro.ui @@ -0,0 +1,430 @@ + +DMacro + + + DMacro + + + + 0 + 0 + 521 + 499 + + + + + 505 + 0 + + + + DMacro + + + + Commentaire + + + + 10 + 410 + 490 + 20 + + + + + + + + + bSup + + + + 320 + 440 + 142 + 30 + + + + &Supprimer + + + Alt+S + + + true + + + suppression du mot clef + + + + + bOk + + + + 170 + 440 + 142 + 30 + + + + &Valider + + + Shift+A, Alt+A, Alt+A, Alt+A + + + true + + + true + + + validation de la saisie + + + + + bHelp + + + + 10 + 440 + 142 + 30 + + + + &Documentation + + + Alt+D + + + true + + + affichage documentation aster + + + + + TWChoix + + + + 0 + 0 + 500 + 400 + + + + + MotClef + + + Ajouter Mot-Clef + + + + textLabel1_2 + + + + 360 + 0 + 50 + 37 + + + + <h3><p align="center"><u><b>Régles</b></u></p></h3> + + + + + LBMCPermis + + + + 10 + 40 + 220 + 290 + + + + + 0 + 0 + + + + + + LBRegles + + + + 260 + 40 + 230 + 290 + + + + + + textLabel1 + + + + 50 + 10 + 120 + 20 + + + + + 0 + 0 + + + + <h3><p align="center"><u><b>Mots Clefs Permis</b></u></p></h3> + + + + + + Commande + + + Nouvelle Commande + + + + textLabel6 + + + + 10 + 60 + 60 + 30 + + + + Filtre + + + + + textLabel4 + + + + 90 + 340 + 300 + 30 + + + + La commande choisie sera ajoutée APRES la commande courante + + + + + LBNouvCommande + + + + 50 + 100 + 410 + 240 + + + + + + buttonGroup1 + + + + 300 + 20 + 151 + 70 + + + + Affichage + + + + RBGroupe + + + + 20 + 40 + 101 + 20 + + + + par groupe + + + + + RBalpha + + + + 20 + 20 + 101 + 20 + + + + alphabétique + + + true + + + + + + LEFiltre + + + + 50 + 60 + 160 + 30 + + + + + + textLabel1_4 + + + + 50 + 20 + 171 + 21 + + + + <b><u>Commandes :</u></b> + + + + + BNext + + + + 220 + 60 + 30 + 31 + + + + + + + image0 + + + affiche la prochaine occurence + + + + + + + + 89504e470d0a1a0a0000000d49484452000000210000000e0806000000a11e758c000000cf49444154388dd594db0ec3200c43edfdf8d897bb0f345b480845d51eb64888f412e76001c00f046fd6e99bba77200480924a1032c92efbd8c7d5cabcc025400099e957849568fe7f06c0ded1deb32b4a1ec4ea824b9e74097165bd01f85527f78a7201e0a3129f345a017c543bafdc983d0f7109d15a331b471f47072c17494a82338f6178203a8817e67306b1f08b07ba03e602c9b831077e37e0209e67e3386710977b17de80c185ad38695a51d522c82ce77912e2fed8be83762092f52b1820dd11bb10e565b53a5a3bbaff130713d66fa6981857060000000049454e44ae426082 + + + + + LBNouvCommande + clicked(QListBoxItem*) + DMacro + LBNouvCommandeClicked() + + + LEFiltre + textChanged(const QString&) + DMacro + LEFiltreTextChanged() + + + LEFiltre + returnPressed() + DMacro + LEfiltreReturnPressed() + + + bSup + pressed() + DMacro + BSupPressed() + + + bOk + clicked() + DMacro + BOkPressed() + + + RBalpha + clicked() + DMacro + BuildTabCommand() + + + RBGroupe + clicked() + DMacro + BuildTabCommand() + + + BNext + clicked() + DMacro + BNextPressed() + + + + LBNouvCommandeClicked() + LEFiltreTextChanged() + LEfiltreReturnPressed() + BSupPressed() + BOkPressed() + BuildTabCommand() + BNextPressed() + + + diff --git a/Ui/desPlusieursBase.py b/Ui/desPlusieursBase.py new file mode 100644 index 00000000..b24626fc --- /dev/null +++ b/Ui/desPlusieursBase.py @@ -0,0 +1,194 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file 'desPlusieursBase.ui' +# +# Created: lun avr 23 09:30:04 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" \ + "\xc7\x49\x44\x41\x54\x38\x8d\xcd\x94\x59\x0e\xc3" \ + "\x20\x0c\x44\x71\xd5\x7b\xc7\x3d\xf9\xf4\x07\xd3" \ + "\x31\xb1\x59\xa2\x28\xaa\x25\x44\x48\xbc\x3c\xc6" \ + "\x81\x52\xfe\xc0\xe4\x42\x0c\xee\xce\xb9\x12\xe0" \ + "\x8a\x02\x39\x83\x88\x48\xf5\xdf\x02\xc9\x9c\x11" \ + "\xf8\x60\x04\x30\x01\x19\x05\x4a\xe8\x68\xc5\x6a" \ + "\xc2\x06\xc0\x6b\x4b\x10\x91\x11\xc8\x02\x87\x4f" \ + "\x3a\x52\xa5\x87\x75\x71\x23\x89\x7e\x40\x39\xc4" \ + "\x6b\x50\xd8\x86\x5b\x07\xf5\x40\x0a\x45\x00\x53" \ + "\x33\x08\x93\xcf\x86\x74\xa3\x00\x28\xd4\x92\xde" \ + "\xef\x04\x62\x6b\x55\x9d\xfe\x48\xac\x84\x2b\x1a" \ + "\x6d\xaa\xe6\x85\x01\x55\x03\x3b\x99\xc5\x00\x9f" \ + "\x70\xce\xda\x11\x1a\xab\x41\x3b\x6f\x6a\x70\xd1" \ + "\x18\xe0\x08\xe6\xfd\x8b\xc5\x1d\x5d\x00\xa0\xf6" \ + "\x14\x55\x6d\x1f\xf9\xb9\xbe\x49\x52\xaa\xbc\x37" \ + "\x21\xf8\xf8\xb6\xf6\x24\xc5\x57\xef\x89\x47\xaf" \ + "\xed\xf4\x8c\x5e\x60\xb8\xdf\xbe\xb8\x1d\x6d\xab" \ + "\x9a\xff\x99\x27\x00\x00\x00\x00\x49\x45\x4e\x44" \ + "\xae\x42\x60\x82" +image1_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 DPlusBase(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") + self.image1 = QPixmap() + self.image1.loadFromData(image1_data,"PNG") + if not name: + self.setName("DPlusBase") + + 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.bHelp = QPushButton(self.Widget8,"bHelp") + self.bHelp.setGeometry(QRect(0,370,142,30)) + self.bHelp.setAutoDefault(1) + + 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.bParam = QPushButton(self.Widget8,"bParam") + self.bParam.setGeometry(QRect(290,240,142,30)) + self.bParam.setAutoDefault(1) + + self.bImport = QPushButton(self.Widget8,"bImport") + self.bImport.setGeometry(QRect(290,280,142,30)) + self.bImport.setAutoDefault(1) + + self.Commentaire = QLabel(self.Widget8,"Commentaire") + self.Commentaire.setGeometry(QRect(38,337,381,20)) + + self.textLabel1 = QLabel(self.Widget8,"textLabel1") + self.textLabel1.setGeometry(QRect(40,20,120,21)) + + self.textLabel1_2 = QLabel(self.Widget8,"textLabel1_2") + self.textLabel1_2.setGeometry(QRect(330,80,45,21)) + + self.BAjout1Val = QToolButton(self.Widget8,"BAjout1Val") + self.BAjout1Val.setGeometry(QRect(230,120,40,31)) + self.BAjout1Val.setIconSet(QIconSet(self.image0)) + + self.BSup1Val = QToolButton(self.Widget8,"BSup1Val") + self.BSup1Val.setGeometry(QRect(230,80,40,31)) + self.BSup1Val.setIconSet(QIconSet(self.image1)) + + self.LBValeurs = QListBox(self.Widget8,"LBValeurs") + self.LBValeurs.setGeometry(QRect(20,50,180,280)) + + self.LEValeur = QLineEdit(self.Widget8,"LEValeur") + self.LEValeur.setGeometry(QRect(280,110,150,30)) + 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.BOkPourListePressed) + self.connect(self.bSup,SIGNAL("clicked()"),self.BSupPressed) + self.connect(self.bParam,SIGNAL("clicked()"),self.BParametresPressed) + self.connect(self.bImport,SIGNAL("clicked()"),self.BImportPressed) + self.connect(self.BAjout1Val,SIGNAL("clicked()"),self.Ajout1Valeur) + self.connect(self.BSup1Val,SIGNAL("clicked()"),self.Sup1Valeur) + self.connect(self.LEValeur,SIGNAL("returnPressed()"),self.LEValeurPressed) + + + def languageChange(self): + self.setCaption(self.__tr("DUnIn")) + 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.bParam.setText(self.__tr("&Parametres")) + self.bParam.setAccel(self.__tr("Alt+P")) + QToolTip.add(self.bParam,self.__tr("suppression du mot clef")) + self.bImport.setText(self.__tr("&Importer")) + self.bImport.setAccel(self.__tr("Alt+I")) + QToolTip.add(self.bImport,self.__tr("suppression du mot clef")) + self.Commentaire.setText(QString.null) + self.textLabel1.setText(self.__tr("Valeur(s) actuelle(s)")) + self.textLabel1_2.setText(self.__tr("Valeur")) + self.BAjout1Val.setText(QString.null) + QToolTip.add(self.BAjout1Val,self.__trUtf8("\x61\x6a\x6f\x75\x74\x65\x20\x6c\x61\x20\x76\x61\x6c\x65\x75\x72\x20\x73\x61\x69\x73\x69\x65\x20\x73\x6f\x75\x73\x20\x6c\x20\x6f\x63\x63\x75\x72\x65\x6e\x63\x65\x20\x73\x65\x6c\x65\x63\x74\x69\x6f\x6e\x6e\xc3\xa9\x65\x20\x28\x65\x6e\x20\x66\x69\x6e\x20\x64\x65\x20\x6c\x69\x73\x74\x65\x20\x73\x69\x20\x69\x6c\x20\x6e\x20\x79\x20\x61\x20\x70\x61\x73\x20\x64\x65\x20\x73\x65\x6c\x65\x63\x74\x69\x6f\x6e\x29")) + self.BSup1Val.setText(QString.null) + QToolTip.add(self.BSup1Val,self.__tr("enleve l occurence selectionnee")) + self.tabuniqueinto.changeTab(self.Widget8,self.__tr("Saisir Valeur")) + + + def BSupPressed(self): + print "DPlusBase.BSupPressed(): Not implemented yet" + + def ViewDoc(self): + print "DPlusBase.ViewDoc(): Not implemented yet" + + def BOkPourListePressed(self): + print "DPlusBase.BOkPourListePressed(): Not implemented yet" + + def BParametresPressed(self): + print "DPlusBase.BParametresPressed(): Not implemented yet" + + def LEValeurPressed(self): + print "DPlusBase.LEValeurPressed(): Not implemented yet" + + def Ajout1Valeur(self): + print "DPlusBase.Ajout1Valeur(): Not implemented yet" + + def Sup1Valeur(self): + print "DPlusBase.Sup1Valeur(): Not implemented yet" + + def BImportPressed(self): + print "DPlusBase.BImportPressed(): Not implemented yet" + + def __tr(self,s,c = None): + return qApp.translate("DPlusBase",s,c) + + def __trUtf8(self,s,c = None): + return qApp.translate("DPlusBase",s,c,QApplication.UnicodeUTF8) diff --git a/Ui/desPlusieursBase.ui b/Ui/desPlusieursBase.ui new file mode 100644 index 00000000..a54a7d8d --- /dev/null +++ b/Ui/desPlusieursBase.ui @@ -0,0 +1,361 @@ + +DPlusBase + + + DPlusBase + + + + 0 + 0 + 482 + 480 + + + + + 350 + 0 + + + + DUnIn + + + + tabuniqueinto + + + + 20 + 20 + 450 + 440 + + + + + Widget8 + + + Saisir Valeur + + + + bHelp + + + + 0 + 370 + 142 + 30 + + + + &Documentation + + + Alt+D + + + true + + + affichage documentation aster + + + + + bOk + + + + 150 + 370 + 142 + 30 + + + + &Valider + + + Shift+A, Alt+A, Alt+A, Alt+A + + + true + + + true + + + validation de la saisie + + + + + bSup + + + + 300 + 370 + 142 + 30 + + + + &Supprimer + + + Alt+S + + + true + + + suppression du mot clef + + + + + bParam + + + + 290 + 240 + 142 + 30 + + + + &Parametres + + + Alt+P + + + true + + + suppression du mot clef + + + + + bImport + + + + 290 + 280 + 142 + 30 + + + + &Importer + + + Alt+I + + + true + + + suppression du mot clef + + + + + Commentaire + + + + 38 + 337 + 381 + 20 + + + + + + + + + textLabel1 + + + + 40 + 20 + 120 + 21 + + + + <u><font size="+1">Valeur(s) actuelle(s)</font></u> + + + + + textLabel1_2 + + + + 330 + 80 + 45 + 21 + + + + <font size="+1">Valeur</font> + + + + + BAjout1Val + + + + 230 + 120 + 40 + 31 + + + + + + + image0 + + + ajoute la valeur saisie sous l occurence selectionnée (en fin de liste si il n y a pas de selection) + + + + + BSup1Val + + + + 230 + 80 + 40 + 31 + + + + + + + image1 + + + enleve l occurence selectionnee + + + + + LBValeurs + + + + 20 + 50 + 180 + 280 + + + + + + LEValeur + + + + 280 + 110 + 150 + 30 + + + + + + + + + 89504e470d0a1a0a0000000d49484452000000210000000e0806000000a11e758c000000c749444154388dcd94590ec3200c4471d57bc73df9f407d331b159a228aa254448bc3cc68152fec0e4420ceeceb912e08a0239838848f5df02c99c11f86004300119054ae868c56ac206c06b4b109111c802874f3a52a587757123897e4039c46b50d8865b07f5400a450053330893cf8674a30028d492deef04626b559dfe48ac842b1a6daae6850155033b99c5009f70ceda111aab413b6f6a70d118e008e6fd8bc51d5d00a0f614556d1ff9b9be4952aabc3721f8f8b6f624c557ef8947afedf48c5e60b8dfbeb81d6dab9aff99270000000049454e44ae426082 + + + 89504e470d0a1a0a0000000d49484452000000210000000e0806000000a11e758c000000cf49444154388dd594db0ec3200c43edfdf8d897bb0f345b480845d51eb64888f412e76001c00f046fd6e99bba77200480924a1032c92efbd8c7d5cabcc025400099e957849568fe7f06c0ded1deb32b4a1ec4ea824b9e74097165bd01f85527f78a7201e0a3129f345a017c543bafdc983d0f7109d15a331b471f47072c17494a82338f6178203a8817e67306b1f08b07ba03e602c9b831077e37e0209e67e3386710977b17de80c185ad38695a51d522c82ce77912e2fed8be83762092f52b1820dd11bb10e565b53a5a3bbaff130713d66fa6981857060000000049454e44ae426082 + + + + + bHelp + clicked() + DPlusBase + ViewDoc() + + + bOk + clicked() + DPlusBase + BOkPourListePressed() + + + bSup + clicked() + DPlusBase + BSupPressed() + + + bParam + clicked() + DPlusBase + BParametresPressed() + + + bImport + clicked() + DPlusBase + BImportPressed() + + + BAjout1Val + clicked() + DPlusBase + Ajout1Valeur() + + + BSup1Val + clicked() + DPlusBase + Sup1Valeur() + + + LEValeur + returnPressed() + DPlusBase + LEValeurPressed() + + + + BSupPressed() + ViewDoc() + BOkPourListePressed() + BParametresPressed() + LEValeurPressed() + Ajout1Valeur() + Sup1Valeur() + BImportPressed() + + + diff --git a/Ui/desPlusieursInto.py b/Ui/desPlusieursInto.py new file mode 100644 index 00000000..c5c177bb --- /dev/null +++ b/Ui/desPlusieursInto.py @@ -0,0 +1,169 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file 'desPlusieursInto.ui' +# +# Created: mer avr 25 09:04:00 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" +image1_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" \ + "\xc7\x49\x44\x41\x54\x38\x8d\xcd\x94\x59\x0e\xc3" \ + "\x20\x0c\x44\x71\xd5\x7b\xc7\x3d\xf9\xf4\x07\xd3" \ + "\x31\xb1\x59\xa2\x28\xaa\x25\x44\x48\xbc\x3c\xc6" \ + "\x81\x52\xfe\xc0\xe4\x42\x0c\xee\xce\xb9\x12\xe0" \ + "\x8a\x02\x39\x83\x88\x48\xf5\xdf\x02\xc9\x9c\x11" \ + "\xf8\x60\x04\x30\x01\x19\x05\x4a\xe8\x68\xc5\x6a" \ + "\xc2\x06\xc0\x6b\x4b\x10\x91\x11\xc8\x02\x87\x4f" \ + "\x3a\x52\xa5\x87\x75\x71\x23\x89\x7e\x40\x39\xc4" \ + "\x6b\x50\xd8\x86\x5b\x07\xf5\x40\x0a\x45\x00\x53" \ + "\x33\x08\x93\xcf\x86\x74\xa3\x00\x28\xd4\x92\xde" \ + "\xef\x04\x62\x6b\x55\x9d\xfe\x48\xac\x84\x2b\x1a" \ + "\x6d\xaa\xe6\x85\x01\x55\x03\x3b\x99\xc5\x00\x9f" \ + "\x70\xce\xda\x11\x1a\xab\x41\x3b\x6f\x6a\x70\xd1" \ + "\x18\xe0\x08\xe6\xfd\x8b\xc5\x1d\x5d\x00\xa0\xf6" \ + "\x14\x55\x6d\x1f\xf9\xb9\xbe\x49\x52\xaa\xbc\x37" \ + "\x21\xf8\xf8\xb6\xf6\x24\xc5\x57\xef\x89\x47\xaf" \ + "\xed\xf4\x8c\x5e\x60\xb8\xdf\xbe\xb8\x1d\x6d\xab" \ + "\x9a\xff\x99\x27\x00\x00\x00\x00\x49\x45\x4e\x44" \ + "\xae\x42\x60\x82" + +class DPlusInto(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") + self.image1 = QPixmap() + self.image1.loadFromData(image1_data,"PNG") + if not name: + self.setName("DPlusInto") + + 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.bHelp = QPushButton(self.Widget8,"bHelp") + self.bHelp.setGeometry(QRect(0,370,142,30)) + self.bHelp.setAutoDefault(1) + + 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.LBValeurs = QListBox(self.Widget8,"LBValeurs") + self.LBValeurs.setGeometry(QRect(10,50,180,280)) + + self.BSup1Val = QToolButton(self.Widget8,"BSup1Val") + self.BSup1Val.setGeometry(QRect(200,70,40,31)) + self.BSup1Val.setIconSet(QIconSet(self.image0)) + + self.BAjout1Val = QToolButton(self.Widget8,"BAjout1Val") + self.BAjout1Val.setGeometry(QRect(200,110,40,31)) + self.BAjout1Val.setIconSet(QIconSet(self.image1)) + + self.textLabel1 = QLabel(self.Widget8,"textLabel1") + self.textLabel1.setGeometry(QRect(40,20,120,21)) + + self.textLabel1_2 = QLabel(self.Widget8,"textLabel1_2") + self.textLabel1_2.setGeometry(QRect(278,16,130,21)) + + self.Commentaire = QLabel(self.Widget8,"Commentaire") + self.Commentaire.setGeometry(QRect(30,340,381,20)) + + self.listBoxVal = QListBox(self.Widget8,"listBoxVal") + self.listBoxVal.setGeometry(QRect(250,50,180,280)) + 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.BOkPourListePressed) + self.connect(self.bSup,SIGNAL("clicked()"),self.BSupPressed) + self.connect(self.LBValeurs,SIGNAL("doubleClicked(QListBoxItem*)"),self.Sup1Valeur) + self.connect(self.BAjout1Val,SIGNAL("clicked()"),self.Ajout1Valeur) + self.connect(self.BSup1Val,SIGNAL("clicked()"),self.Sup1Valeur) + + + def languageChange(self): + self.setCaption(self.__tr("DUnIn")) + 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.BSup1Val.setText(QString.null) + QToolTip.add(self.BSup1Val,self.__tr("enleve l occurence selectionnee")) + self.BAjout1Val.setText(QString.null) + QToolTip.add(self.BAjout1Val,self.__trUtf8("\x61\x6a\x6f\x75\x74\x65\x20\x6c\x61\x20\x76\x61\x6c\x65\x75\x72\x20\x73\x61\x69\x73\x69\x65\x20\x73\x6f\x75\x73\x20\x6c\x20\x6f\x63\x63\x75\x72\x65\x6e\x63\x65\x20\x73\x65\x6c\x65\x63\x74\x69\x6f\x6e\x6e\xc3\xa9\x65\x20\x28\x65\x6e\x20\x66\x69\x6e\x20\x64\x65\x20\x6c\x69\x73\x74\x65\x20\x73\x69\x20\x69\x6c\x20\x6e\x20\x79\x20\x61\x20\x70\x61\x73\x20\x64\x65\x20\x73\x65\x6c\x65\x63\x74\x69\x6f\x6e\x29")) + self.textLabel1.setText(self.__tr("Valeur(s) actuelle(s)")) + self.textLabel1_2.setText(self.__tr("Valeur(s) possibles(s)")) + self.Commentaire.setText(QString.null) + self.tabuniqueinto.changeTab(self.Widget8,self.__tr("Saisir Valeur")) + + + def BSupPressed(self): + print "DPlusInto.BSupPressed(): Not implemented yet" + + def ViewDoc(self): + print "DPlusInto.ViewDoc(): Not implemented yet" + + def BOkPourListePressed(self): + print "DPlusInto.BOkPourListePressed(): Not implemented yet" + + def Ajout1Valeur(self): + print "DPlusInto.Ajout1Valeur(): Not implemented yet" + + def Sup1Valeur(self): + print "DPlusInto.Sup1Valeur(): Not implemented yet" + + def __tr(self,s,c = None): + return qApp.translate("DPlusInto",s,c) + + def __trUtf8(self,s,c = None): + return qApp.translate("DPlusInto",s,c,QApplication.UnicodeUTF8) diff --git a/Ui/desPlusieursInto.ui b/Ui/desPlusieursInto.ui new file mode 100644 index 00000000..8ea0dcb9 --- /dev/null +++ b/Ui/desPlusieursInto.ui @@ -0,0 +1,296 @@ + +DPlusInto + + + DPlusInto + + + + 0 + 0 + 482 + 480 + + + + + 350 + 0 + + + + DUnIn + + + + tabuniqueinto + + + + 20 + 20 + 450 + 440 + + + + + Widget8 + + + Saisir Valeur + + + + bHelp + + + + 0 + 370 + 142 + 30 + + + + &Documentation + + + Alt+D + + + true + + + affichage documentation aster + + + + + bOk + + + + 150 + 370 + 142 + 30 + + + + &Valider + + + Shift+A, Alt+A, Alt+A, Alt+A + + + true + + + true + + + validation de la saisie + + + + + bSup + + + + 300 + 370 + 142 + 30 + + + + &Supprimer + + + Alt+S + + + true + + + suppression du mot clef + + + + + LBValeurs + + + + 10 + 50 + 180 + 280 + + + + + + BSup1Val + + + + 200 + 70 + 40 + 31 + + + + + + + image0 + + + enleve l occurence selectionnee + + + + + BAjout1Val + + + + 200 + 110 + 40 + 31 + + + + + + + image1 + + + ajoute la valeur saisie sous l occurence selectionnée (en fin de liste si il n y a pas de selection) + + + + + textLabel1 + + + + 40 + 20 + 120 + 21 + + + + <u><font size="+1">Valeur(s) actuelle(s)</font></u> + + + + + textLabel1_2 + + + + 278 + 16 + 130 + 21 + + + + <u><font size="+1">Valeur(s) possibles(s)</font></u> + + + + + Commentaire + + + + 30 + 340 + 381 + 20 + + + + + + + + + listBoxVal + + + + 250 + 50 + 180 + 280 + + + + + + + + + 89504e470d0a1a0a0000000d49484452000000210000000e0806000000a11e758c000000cf49444154388dd594db0ec3200c43edfdf8d897bb0f345b480845d51eb64888f412e76001c00f046fd6e99bba77200480924a1032c92efbd8c7d5cabcc025400099e957849568fe7f06c0ded1deb32b4a1ec4ea824b9e74097165bd01f85527f78a7201e0a3129f345a017c543bafdc983d0f7109d15a331b471f47072c17494a82338f6178203a8817e67306b1f08b07ba03e602c9b831077e37e0209e67e3386710977b17de80c185ad38695a51d522c82ce77912e2fed8be83762092f52b1820dd11bb10e565b53a5a3bbaff130713d66fa6981857060000000049454e44ae426082 + + + 89504e470d0a1a0a0000000d49484452000000210000000e0806000000a11e758c000000c749444154388dcd94590ec3200c4471d57bc73df9f407d331b159a228aa254448bc3cc68152fec0e4420ceeceb912e08a0239838848f5df02c99c11f86004300119054ae868c56ac206c06b4b109111c802874f3a52a587757123897e4039c46b50d8865b07f5400a450053330893cf8674a30028d492deef04626b559dfe48ac842b1a6daae6850155033b99c5009f70ceda111aab413b6f6a70d118e008e6fd8bc51d5d00a0f614556d1ff9b9be4952aabc3721f8f8b6f624c557ef8947afedf48c5e60b8dfbeb81d6dab9aff99270000000049454e44ae426082 + + + + + bHelp + clicked() + DPlusInto + ViewDoc() + + + bOk + clicked() + DPlusInto + BOkPourListePressed() + + + bSup + clicked() + DPlusInto + BSupPressed() + + + LBValeurs + doubleClicked(QListBoxItem*) + DPlusInto + Sup1Valeur() + + + BAjout1Val + clicked() + DPlusInto + Ajout1Valeur() + + + BSup1Val + clicked() + DPlusInto + Sup1Valeur() + + + + BSupPressed() + ViewDoc() + BOkPourListePressed() + Ajout1Valeur() + Sup1Valeur() + + + diff --git a/Ui/desRacine.py b/Ui/desRacine.py new file mode 100644 index 00000000..f82675bb --- /dev/null +++ b/Ui/desRacine.py @@ -0,0 +1,155 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file 'desRacine.ui' +# +# Created: jeu avr 26 14:24:43 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/Ui/desRacine.ui b/Ui/desRacine.ui new file mode 100644 index 00000000..e3c46363 --- /dev/null +++ b/Ui/desRacine.ui @@ -0,0 +1,328 @@ + +DRac + + + DRac + + + + 0 + 0 + 505 + 499 + + + + + 505 + 0 + + + + DMacro + + + + bHelp + + + + 10 + 440 + 142 + 30 + + + + &Documentation + + + Alt+D + + + true + + + affichage documentation aster + + + + + textLabel6 + + + + 10 + 70 + 30 + 30 + + + + Filtre + + + + + textLabel1_4_2 + + + + 350 + 0 + 50 + 21 + + + + <b><u>Régles :</u></b> + + + + + LEFiltre + + + + 50 + 70 + 140 + 30 + + + + + + BNext + + + + 200 + 70 + 30 + 31 + + + + + + + image0 + + + affiche la prochaine occurence + + + + + textLabel1_4 + + + + 90 + 0 + 75 + 21 + + + + <b><u>Commandes :</u></b> + + + + + buttonGroup1 + + + + 10 + 20 + 230 + 40 + + + + Affichage + + + + RBGroupe + + + + 20 + 10 + 101 + 20 + + + + par groupe + + + + + RBalpha + + + + 140 + 10 + 80 + 20 + + + + alphabétique + + + true + + + + + + bOk + + + + 180 + 440 + 142 + 30 + + + + &Valider + + + Shift+A, Alt+A, Alt+A, Alt+A + + + true + + + true + + + validation de la saisie + + + + + bSup + + + + 350 + 440 + 142 + 30 + + + + &Supprimer + + + Alt+S + + + true + + + suppression du mot clef + + + + + LBNouvCommande + + + + 10 + 110 + 230 + 320 + + + + + + LBRegles + + + + 260 + 30 + 230 + 400 + + + + + + + 89504e470d0a1a0a0000000d49484452000000210000000e0806000000a11e758c000000cf49444154388dd594db0ec3200c43edfdf8d897bb0f345b480845d51eb64888f412e76001c00f046fd6e99bba77200480924a1032c92efbd8c7d5cabcc025400099e957849568fe7f06c0ded1deb32b4a1ec4ea824b9e74097165bd01f85527f78a7201e0a3129f345a017c543bafdc983d0f7109d15a331b471f47072c17494a82338f6178203a8817e67306b1f08b07ba03e602c9b831077e37e0209e67e3386710977b17de80c185ad38695a51d522c82ce77912e2fed8be83762092f52b1820dd11bb10e565b53a5a3bbaff130713d66fa6981857060000000049454e44ae426082 + + + + + LBNouvCommande + clicked(QListBoxItem*) + DRac + LBNouvCommandeClicked() + + + LEFiltre + textChanged(const QString&) + DRac + LEFiltreTextChanged() + + + LEFiltre + returnPressed() + DRac + LEfiltreReturnPressed() + + + bSup + pressed() + DRac + BSupPressed() + + + bOk + clicked() + DRac + BOkPressed() + + + RBalpha + clicked() + DRac + BuildTabCommand() + + + RBGroupe + clicked() + DRac + BuildTabCommand() + + + BNext + clicked() + DRac + BNextPressed() + + + + LBNouvCommandeClicked() + LEFiltreTextChanged() + LEfiltreReturnPressed() + BSupPressed() + BOkPressed() + BuildTabCommand() + BNextPressed() + + + diff --git a/Ui/desUniqueASSD.py b/Ui/desUniqueASSD.py new file mode 100644 index 00000000..24b38d77 --- /dev/null +++ b/Ui/desUniqueASSD.py @@ -0,0 +1,91 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file 'desUniqueASSD.ui' +# +# Created: mer mar 21 10:41:08 2007 +# by: The PyQt User Interface Compiler (pyuic) 3.13 +# +# WARNING! All changes made in this file will be lost! + + +from qt import * + + +class DUnASSD(QWidget): + def __init__(self,parent = None,name = None,fl = 0): + QWidget.__init__(self,parent,name,fl) + + if not name: + self.setName("DUnASSD") + + 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(140,20,160,60)) + + self.Commentaire = QLabel(self.Widget8,"Commentaire") + self.Commentaire.setGeometry(QRect(40,311,381,30)) + + self.listBoxASSD = QListBox(self.Widget8,"listBoxASSD") + self.listBoxASSD.setGeometry(QRect(40,100,380,180)) + 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.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.__trUtf8("\x3c\x66\x6f\x6e\x74\x20\x73\x69\x7a\x65\x3d\x22\x2b\x31\x22\x3e\x3c\x70\x20\x61\x6c\x69\x67\x6e\x3d\x22\x63\x65\x6e\x74\x65\x72\x22\x3e\x53\x74\x72\x75\x63\x74\x75\x72\x65\x73\x20\x64\x65\x20\x64\x6f\x6e\x6e\xc3\xa9\x65\x73\x20\x64\x75\x20\x74\x79\x70\x65\x0a\x72\x65\x71\x75\x69\x73\x20\x70\x61\x72\x20\x6c\x27\x6f\x62\x6a\x65\x74\x20\x63\x6f\x75\x72\x61\x6e\x74\x20\x3a\x3c\x2f\x70\x3e\x3c\x2f\x66\x6f\x6e\x74\x3e")) + self.Commentaire.setText(QString.null) + self.tabuniqueinto.changeTab(self.Widget8,self.__tr("Saisir Valeur")) + + + def BSupPressed(self): + print "DUnASSD.BSupPressed(): Not implemented yet" + + def ViewDoc(self): + print "DUnASSD.ViewDoc(): Not implemented yet" + + def BOkPressed(self): + print "DUnASSD.BOkPressed(): Not implemented yet" + + def __tr(self,s,c = None): + return qApp.translate("DUnASSD",s,c) + + def __trUtf8(self,s,c = None): + return qApp.translate("DUnASSD",s,c,QApplication.UnicodeUTF8) diff --git a/Ui/desUniqueASSD.ui b/Ui/desUniqueASSD.ui new file mode 100644 index 00000000..a22cbb9e --- /dev/null +++ b/Ui/desUniqueASSD.ui @@ -0,0 +1,196 @@ + +DUnASSD + + + DUnASSD + + + + 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 + + + + + textLabel2 + + + + 140 + 20 + 160 + 60 + + + + <font size="+1"><p align="center">Structures de données du type +requis par l'objet courant :</p></font> + + + + + Commentaire + + + + 40 + 311 + 381 + 30 + + + + + + + + + listBoxASSD + + + + 40 + 100 + 380 + 180 + + + + + + + + + bHelp + clicked() + DUnASSD + ViewDoc() + + + bOk + clicked() + DUnASSD + BOkPressed() + + + bSup + clicked() + DUnASSD + BSupPressed() + + + + BSupPressed() + ViewDoc() + BOkPressed() + + + diff --git a/Ui/desUniqueBase.py b/Ui/desUniqueBase.py new file mode 100644 index 00000000..7f69b8ea --- /dev/null +++ b/Ui/desUniqueBase.py @@ -0,0 +1,99 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file 'desUniqueBasePanel.ui' +# +# Created: mar mar 20 14:05: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 DUnBase(QWidget): + def __init__(self,parent = None,name = None,fl = 0): + QWidget.__init__(self,parent,name,fl) + + if not name: + self.setName("DUnBase") + + 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.Commentaire = QLabel(self.Widget8,"Commentaire") + self.Commentaire.setGeometry(QRect(38,316,381,41)) + + 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.bParametres = QPushButton(self.Widget8,"bParametres") + self.bParametres.setGeometry(QRect(300,10,140,30)) + 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.Commentaire.setText(QString.null) + self.textLabel2.setText(self.__tr("

Valeur:

")) + self.bParametres.setText(self.__tr("Parametres")) + self.tabuniqueinto.changeTab(self.Widget8,self.__tr("Saisir Valeur")) + + + def BSupPressed(self): + print "DUnBase.BSupPressed(): Not implemented yet" + + def ViewDoc(self): + print "DUnBase.ViewDoc(): Not implemented yet" + + def BOk2Pressed(self): + print "DUnBase.BOk2Pressed(): Not implemented yet" + + def BParametresPressed(self): + print "DUnBase.BParametresPressed(): Not implemented yet" + + def LEValeurPressed(self): + print "DUnBase.LEValeurPressed(): Not implemented yet" + + def __tr(self,s,c = None): + return qApp.translate("DUnBase",s,c) diff --git a/Ui/desUniqueBase.ui b/Ui/desUniqueBase.ui new file mode 100644 index 00000000..0c47dc40 --- /dev/null +++ b/Ui/desUniqueBase.ui @@ -0,0 +1,219 @@ + +DUnBase + + + DUnBase + + + + 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 + + + + 38 + 316 + 381 + 41 + + + + + + + + + textLabel2 + + + + 40 + 160 + 50 + 21 + + + + <b><u><p align="center">Valeur: </p></u></b> + + + + + lineEditVal + + + + 120 + 150 + 231 + 31 + + + + + + bParametres + + + + 300 + 10 + 140 + 30 + + + + Parametres + + + + + + + + bHelp + clicked() + DUnBase + ViewDoc() + + + bOk + clicked() + DUnBase + BOk2Pressed() + + + bSup + clicked() + DUnBase + BSupPressed() + + + lineEditVal + returnPressed() + DUnBase + LEValeurPressed() + + + + BSupPressed() + ViewDoc() + BOk2Pressed() + BParametresPressed() + LEValeurPressed() + + + diff --git a/Ui/desUniqueComp.py b/Ui/desUniqueComp.py new file mode 100644 index 00000000..e0a470df --- /dev/null +++ b/Ui/desUniqueComp.py @@ -0,0 +1,121 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file 'desUniqueComp.ui' +# +# Created: mar aoû 7 16:45:58 2007 +# by: The PyQt User Interface Compiler (pyuic) 3.13 +# +# WARNING! All changes made in this file will be lost! + + +from qt import * + + +class DUnComp(QWidget): + def __init__(self,parent = None,name = None,fl = 0): + QWidget.__init__(self,parent,name,fl) + + if not name: + self.setName("DUnComp") + + 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.textLabel1 = QLabel(self.Widget8,"textLabel1") + self.textLabel1.setGeometry(QRect(60,30,190,20)) + + self.Commentaire = QLabel(self.Widget8,"Commentaire") + self.Commentaire.setGeometry(QRect(140,320,170,30)) + + self.LEImag = QLineEdit(self.Widget8,"LEImag") + self.LEImag.setGeometry(QRect(240,250,170,31)) + + self.LEReel = QLineEdit(self.Widget8,"LEReel") + self.LEReel.setGeometry(QRect(50,250,170,31)) + + self.LEcomp = QLineEdit(self.Widget8,"LEcomp") + self.LEcomp.setGeometry(QRect(50,60,360,40)) + + self.buttonGroup1 = QButtonGroup(self.Widget8,"buttonGroup1") + self.buttonGroup1.setGeometry(QRect(50,160,360,70)) + + self.RBMP = QRadioButton(self.buttonGroup1,"RBMP") + self.RBMP.setGeometry(QRect(10,40,330,21)) + + self.RBRI = QRadioButton(self.buttonGroup1,"RBRI") + self.RBRI.setGeometry(QRect(10,20,330,21)) + self.tabuniqueinto.insertTab(self.Widget8,QString("")) + + self.languageChange() + + self.resize(QSize(484,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) + self.connect(self.LEImag,SIGNAL("returnPressed()"),self.LEImagRPressed) + self.connect(self.LEReel,SIGNAL("returnPressed()"),self.LEReelRPressed) + self.connect(self.LEcomp,SIGNAL("returnPressed()"),self.LEcompRPressed) + + + def languageChange(self): + self.setCaption(self.__tr("DUnComp")) + 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("Complexe de la forme : a+bj")) + self.Commentaire.setText(self.__tr("Un complexe est attendu")) + self.buttonGroup1.setTitle(self.__tr("OU")) + self.RBMP.setText(self.__tr("MP : Module Phase")) + self.RBRI.setText(self.__trUtf8("\x52\x49\x20\x20\x20\x3a\x20\x52\xc3\xa9\x65\x6c\x09\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x49\x6d\x61\x67\x69\x6e\x61\x69\x72\x65")) + self.tabuniqueinto.changeTab(self.Widget8,self.__tr("Saisir Valeur")) + + + def BSupPressed(self): + print "DUnComp.BSupPressed(): Not implemented yet" + + def ViewDoc(self): + print "DUnComp.ViewDoc(): Not implemented yet" + + def BOkPressed(self): + print "DUnComp.BOkPressed(): Not implemented yet" + + def LEImagRPressed(self): + print "DUnComp.LEImagRPressed(): Not implemented yet" + + def LEReelRPressed(self): + print "DUnComp.LEReelRPressed(): Not implemented yet" + + def LEcompRPressed(self): + print "DUnComp.LEcompRPressed(): Not implemented yet" + + def __tr(self,s,c = None): + return qApp.translate("DUnComp",s,c) + + def __trUtf8(self,s,c = None): + return qApp.translate("DUnComp",s,c,QApplication.UnicodeUTF8) diff --git a/Ui/desUniqueComp.ui b/Ui/desUniqueComp.ui new file mode 100644 index 00000000..54af7913 --- /dev/null +++ b/Ui/desUniqueComp.ui @@ -0,0 +1,290 @@ + +DUnComp + + + DUnComp + + + + 0 + 0 + 484 + 480 + + + + + 350 + 0 + + + + DUnComp + + + + 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 + + + + + textLabel1 + + + + 60 + 30 + 190 + 20 + + + + <font size="+2">Complexe de la forme : a+bj</font> + + + + + Commentaire + + + + 140 + 320 + 170 + 30 + + + + <font size="+2">Un complexe est attendu</font> + + + + + LEImag + + + + 240 + 250 + 170 + 31 + + + + + + LEReel + + + + 50 + 250 + 170 + 31 + + + + + + LEcomp + + + + 50 + 60 + 360 + 40 + + + + + + buttonGroup1 + + + + 50 + 160 + 360 + 70 + + + + OU + + + + RBMP + + + + 10 + 40 + 330 + 21 + + + + MP : Module Phase + + + + + RBRI + + + + 10 + 20 + 330 + 21 + + + + RI : Réel Imaginaire + + + + + + + + + bHelp + clicked() + DUnComp + ViewDoc() + + + bOk + clicked() + DUnComp + BOkPressed() + + + bSup + clicked() + DUnComp + BSupPressed() + + + LEImag + returnPressed() + DUnComp + LEImagRPressed() + + + LEReel + returnPressed() + DUnComp + LEReelRPressed() + + + LEcomp + returnPressed() + DUnComp + LEcompRPressed() + + + + BSupPressed() + ViewDoc() + BOkPressed() + LEImagRPressed() + LEReelRPressed() + LEcompRPressed() + + + diff --git a/Ui/desUniqueInto.ui b/Ui/desUniqueInto.ui new file mode 100644 index 00000000..6fa50f00 --- /dev/null +++ b/Ui/desUniqueInto.ui @@ -0,0 +1,211 @@ + +DUnIn + + + DUnIn + + + + 0 + 0 + 482 + 480 + + + + + 350 + 0 + + + + DUnIn + + + + tabuniqueinto + + + + 20 + 20 + 450 + 440 + + + + + Widget8 + + + Saisir Valeur + + + + textLabel2 + + + + 170 + 30 + 100 + 21 + + + + <b><u><p align="center">Valeurs possibles</p></u></b> + + + + + textLabel1 + + + + 170 + -10 + 90 + 31 + + + + <p align="center">Choisir une valeur</p> + + + + + Commentaire + + + + 38 + 316 + 381 + 41 + + + + + + + + + bHelp + + + + 0 + 370 + 142 + 30 + + + + &Documentation + + + Alt+D + + + true + + + affichage documentation aster + + + + + listBoxVal + + + + 80 + 60 + 290 + 240 + + + + + + bOk + + + + 150 + 370 + 142 + 30 + + + + &Valider + + + Shift+A, Alt+A, Alt+A, Alt+A + + + true + + + true + + + validation de la saisie + + + + + bSup + + + + 300 + 370 + 142 + 30 + + + + &Supprimer + + + Alt+S + + + true + + + suppression du mot clef + + + + + + + + bHelp + clicked() + DUnIn + ViewDoc() + + + bOk + clicked() + DUnIn + BOkPressed() + + + bSup + clicked() + DUnIn + BSupPressed() + + + + BSupPressed() + ViewDoc() + BOkPressed() + + + diff --git a/Ui/desUniqueIntoPanel.py b/Ui/desUniqueIntoPanel.py new file mode 100644 index 00000000..b48c58b9 --- /dev/null +++ b/Ui/desUniqueIntoPanel.py @@ -0,0 +1,90 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file 'desUniqueInto.ui' +# +# Created: mar mar 20 12:00:55 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/Ui/myMain.ui b/Ui/myMain.ui new file mode 100644 index 00000000..863e7fc3 --- /dev/null +++ b/Ui/myMain.ui @@ -0,0 +1,607 @@ + +Eficas + + + Eficas + + + true + + + + 0 + 0 + 902 + 575 + + + + + 1 + 1 + 0 + 0 + + + + + 21 + 323 + + + + WidgetOrigin + + + + + + + Eficas + + + + line1 + + + + -30 + -10 + 930 + 20 + + + + HLine + + + Sunken + + + Horizontal + + + + + + MenuBar + + + 2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + toolBar + + + MenuBarPanel + + + false + + + Tools + + + + + + + + + + + + + + + + fileNewAction + + + image0 + + + New + + + &New + + + Ctrl+N + + + + + fileOpenAction + + + image1 + + + Open + + + &Open... + + + Ctrl+O + + + + + fileSaveAction + + + image2 + + + Save + + + &Save + + + Ctrl+S + + + + + fileSaveAsAction + + + Save As + + + Save &As... + + + + + + + + fileExitAction + + + Exit + + + E&xit + + + + + + + + editUndoAction + + + image3 + + + Undo + + + &Undo + + + Ctrl+Z + + + + + editRedoAction + + + image4 + + + Redo + + + &Redo + + + Ctrl+Y + + + + + editCutAction + + + image5 + + + Cut + + + Cu&t + + + Ctrl+X + + + + + editCopyAction + + + image6 + + + Copy + + + &Copy + + + Ctrl+C + + + + + editPasteAction + + + image7 + + + Paste + + + &Paste + + + Ctrl+V + + + + + editFindAction + + + image8 + + + Find + + + &Find... + + + Ctrl+F + + + + + helpContentsAction + + + Contents + + + &Contents... + + + + + + + + helpIndexAction + + + Index + + + &Index... + + + + + + + + helpAboutAction + + + About + + + &About + + + + + + + + traductionnew_itemAction + + + new item + + + new item + + + + + fileSaveCloseAction + + + Close + + + Close + + + + + fileCloseAction + + + Close + + + Close + + + Ctrl+W + + + + + fileNewViewAction + + + New view + + + + + fileCloseAllAction + + + Close All + + + Close All + + + + + jdcRapportDeValidationAction + + + Rapport de validation + + + Rapport de validation + + + Ctrl+R + + + + + jdcFichierSourceAction + + + Fichier source + + + Fichier source + + + Ctrl+B + + + + + + 89504e470d0a1a0a0000000d4948445200000016000000160806000000c4b46c3b0000007449444154388dedd5c109c0200c05d06fe936812c10b2ffdd85d25385b6a991480f053f081af0291210f828c5a9d9c4de96cd2b9ad9eb0000660e2fe0c2519839c4f70c4c446d5e6b3538cf928245e4b2f6f014acaa8fda1d4fc1a5741b22079f9d111d96ea8a912c78c10bee64e60719f57e9203ad452a04cc4e50200000000049454e44ae426082 + + + 89504e470d0a1a0a0000000d4948445200000016000000160806000000c4b46c3b0000009949444154388ded94410e85200c445f89c7367f61bc775d2848a42860ffced9548bbe8e13043e1d928177f481a123dc2b34f6f47a3de2b865a8843f4001982a0b3d5f62c58300aa1ad70550449ab9d507a773a8a4ba4f92a2df333c64c63bebbd82e5b8addecbcc7820eb4266c639745dfa80f36faf66c66fa19c3f882fb470ec05cdc0bed07893f68e171492635f686c3eeff6ba3c8fdd366dc4c0452c8781f8080000000049454e44ae426082 + + + 89504e470d0a1a0a0000000d4948445200000016000000160806000000c4b46c3b000000a049444154388dd5954d0a802010859fd14668e18de662d222bc98376a21b4ac451992c66469e0b7f187f1f11c47052a218e762daddbfb9e99f6568f80b5364b8588ce35440400e80a398ce8f99034d2292cc37c8ebd530feb583a05e954341f8a027b2a7d3a1f09bf854dc5d5d953aa396e4f38cab199e2d2e108abe156f82e30977fcb4d8ff942d75dbebed2e143953a93f6caad3d6111f44b7d4f820ff9c0069bb51ecded318c5c0000000049454e44ae426082 + + + 89504e470d0a1a0a0000000d4948445200000016000000160806000000c4b46c3b0000007349444154388ded92c10e80200840b1ef661d1cff4d876aa888a17669f9360f283ed80060f159425f3a71f53602e08e992b098801d02854176ae47f21ce1fb5b05d38eddc9060d0f11379635b3bc92bd518e239a943ec1d5ab7785cee107be4b215af4091f894de47181ecea59ede9ec59f380062ac28b1e3d701d90000000049454e44ae426082 + + + 89504e470d0a1a0a0000000d4948445200000016000000160806000000c4b46c3b0000007449444154388ded92c10ac02008406ddf2d3b84ffed0ea3586a26d165e0830ea53e8504487e4b910f5489f19ea5a3ca0f8a896365b306c42dd613c649bdc2598316136219f0f936c0a2ef00d75a62614d3ab22996f2a362ffa337c5ebede962aad1a2e84aaaa2f750dd12748c0fd0ab9324677800596e28b1743f46860000000049454e44ae426082 + + + 89504e470d0a1a0a0000000d4948445200000016000000160806000000c4b46c3b0000008249444154388dcdd341128020080550e8e02ebc38ad3273503e48537fe3e48c4f2425fa28e29c6f39920bf9276cb60185358877611388c2576418cda015f520b4e6b55be109dc0622b8e22acf31056e18dfdff80606aa551cc63564c4dcf80cd0201d577a5c85a8845fdc025ea5307afccd07e23a1df283ec2b37d9ad5fb4dfefd49cfbf72fac98c8cc890000000049454e44ae426082 + + + 89504e470d0a1a0a0000000d4948445200000016000000160806000000c4b46c3b000000bf49444154388dd593410a83301045df488ee51dbc8c3ba98bf46a9eabd385350d266362444a3f0c4266fcf3f824f06f12402b66da8c55f3de2212cf9d92cb98c0ba2d7c4544cf9a07638bbad53c4491235ecf7cc1623697a92540c11ff4fda75275015d24a9389e7d6f53df4fe4ccab323eea0f03c0c4b2a0712ce6add89b59b7661c3be095985f261679ee4ebcc22c9788551fe6a2cbc4969a894bcb6f23ee361aab62e252c57294dfbfb610bbf2c897b8a46cc6677eaa519571fa087ea83762da9abacb20235f0000000049454e44ae426082 + + + 89504e470d0a1a0a0000000d4948445200000016000000160806000000c4b46c3b000000d549444154388dc5955d0a84300c8427e2a90a9e6c8b0f4b3dd982d7ca3e58d7fe4cd0ba5d7640024df265da0a057e2439c9eb8d9eaa8841a0c9aad8c82ab32f9c425be1e30e0dcf00c00308f0b3a7a07410a9d7142e00b42c5a5fab696b979b1c837fc0c316b6e4165b64f78d716359919bdc4570de47c04732dd5e5bcc35f0c97762ae787936dccf7513577e79f48c4b27aa0f1327b240f5117fcbe348aa33b6e0224b054d0746b8025e2e3b3e73cde0dd1c97f02e8ed9d0af1db381224bdf33eee698a934a0f617b45540d00bcf4ca08fc0dff406e325c1981bc418760000000049454e44ae426082 + + + 89504e470d0a1a0a0000000d4948445200000016000000160806000000c4b46c3b0000025d49444154388dd593a172db4010863f670a56ecc42278d0653693a0c21c68d6c2e60df21a818111349499c254a8329b55f0e089ddb15ba602b79d6692d699b6d399fee86e67e7db7f77efe07fd3e2c74bd775b3730eef3d5115002382b5166b2d5757578b1729bf02b76d3b0f8703b92d58aed7600400ef1ce3c70306a8aa8aebebeb57c117dfa06ddb525dd754efb600a82a49138a123532ec3ac42b9bcde655ce2ffabe9f87c340fde13dcb4d8daaa24e48ee12c6823808c107969b1a8a9ce3f1f8aa515c38e7c8ada5aa6b00c45f129c67d223938c88e6c860d118b1d592d139baae9bcf83a78965b5465134801b1d2e1f4945c0e350096408ea154490c2e0bd3fef5853c2e486a0019f4d84f58418418362b0408e8b23c924501093314dd359f01b809814112025144015f1964c0bbc1b484b07e4688880c029ebd78e4141f5b434fd76864c053f1e084b0f8580265440634044ce838bbcc03987a61350a3a2285e1d5a4414d0708aa598082162ad3d0fb6d6e287cfa498508d274050447370428c91af8d10fd4481608c390b5e00dcddddcd8e80a9de420248e804840856f03e02907d729465c9ba5ae3468731e6a79fe50260b55a6102c4ee40a6894c33f2cb0cb106512814f8f899b22cb9b9b959b8d1f1f8f848d334b46dfbe29bfe5eadeffbf9783c323a871881ecb4200d1151a8eb9aed76bb00188661eeba8efd7e8f3186ed76cb6ab57ae2fe591b5dd7cdde7b628c8808799e63ada5aaaa67b9bbdd6e6e9a06ef3d755d3f29fec7eafb7ebebdbd9dadb5735996f3fdfdfdfca2e3dfd5c3c3c3dc340dd334b1d96cfe1e184e63dceff7a494fe26f61fe90bbc4c5e59d614caf40000000049454e44ae426082 + + + + + fileNewAction + activated() + Eficas + fileNew() + + + fileOpenAction + activated() + Eficas + fileOpen() + + + fileSaveAction + activated() + Eficas + fileSave() + + + fileSaveAsAction + activated() + Eficas + fileSaveAs() + + + fileExitAction + activated() + Eficas + fileExit() + + + editUndoAction + activated() + Eficas + editUndo() + + + editRedoAction + activated() + Eficas + editRedo() + + + editCutAction + activated() + Eficas + editCut() + + + editPasteAction + activated() + Eficas + editPaste() + + + editFindAction + activated() + Eficas + editFind() + + + helpIndexAction + activated() + Eficas + helpIndex() + + + helpContentsAction + activated() + Eficas + helpContents() + + + helpAboutAction + activated() + Eficas + helpAbout() + + + fileCloseAction + activated() + Eficas + fileClose() + + + fileNewViewAction + activated() + Eficas + fileNewView() + + + fileCloseAllAction + activated() + Eficas + fileCloseAll() + + + editCopyAction + activated() + Eficas + editCopy() + + + jdcRapportDeValidationAction + activated() + Eficas + jdcRapport() + + + jdcFichierSourceAction + activated() + Eficas + jdcFichierSource() + + + + fileNew() + fileOpen() + fileSave() + fileSaveAs() + filePrint() + fileExit() + editUndo() + editRedo() + jdcFichierSource() + fileNewView() + editPaste() + editFind() + helpIndex() + helpContents() + helpAbout() + fileClose() + fileCloseAll() + jdcRapport() + editCut() + editCopy() + + + -- 2.39.2