From acd48924661a483634d9ea5c0794549882600b6b Mon Sep 17 00:00:00 2001 From: Pascale Noyret Date: Thu, 25 Oct 2007 10:10:21 +0000 Subject: [PATCH] Pn pour prefs --- InterfaceQT/composimp.py | 2 +- InterfaceQT/editor.py | 3 +- InterfaceQT/eficas.py | 2 + InterfaceQT/eficas_go.py | 61 +++++++++++++++++++++++++++ InterfaceQT/monCommentairePanel.py | 2 +- InterfaceQT/monParamPanel.py | 2 +- InterfaceQT/monPlusieursASSDPanel.py | 2 +- InterfaceQT/monPlusieursBasePanel.py | 2 +- InterfaceQT/monPlusieursIntoPanel.py | 2 +- InterfaceQT/monUniqueASSDPanel.py | 2 +- InterfaceQT/monUniqueBasePanel.py | 2 +- InterfaceQT/monUniqueCompPanel.py | 2 +- InterfaceQT/monUniqueIntoPanel.py | 2 +- InterfaceQT/monUniqueSDCOIntoPanel.py | 2 +- InterfaceQT/monUniqueSDCOPanel.py | 2 +- InterfaceQT/qtEficas.py | 11 +++-- InterfaceQT/readercata.py | 10 +++-- InterfaceQT/viewManager.py | 2 +- InterfaceTK/appli.py | 3 +- InterfaceTK/bureau.py | 2 +- InterfaceTK/change_comm.py | 2 +- InterfaceTK/composimp.py | 2 +- InterfaceTK/eficas_go.py | 2 +- InterfaceTK/faq.py | 2 +- InterfaceTK/fonctionpanel.py | 2 +- InterfaceTK/images.py | 2 +- InterfaceTK/newsimppanel.py | 2 +- InterfaceTK/panels.py | 2 +- InterfaceTK/plusieursassdpanel.py | 2 +- InterfaceTK/plusieursbasepanel.py | 2 +- InterfaceTK/plusieursintopanel.py | 2 +- InterfaceTK/plusieurspanel.py | 2 +- InterfaceTK/styles.py | 2 +- InterfaceTK/uniqueassdpanel.py | 2 +- InterfaceTK/uniquebasepanel.py | 2 +- InterfaceTK/uniquecomppanel.py | 2 +- InterfaceTK/uniqueintopanel.py | 2 +- InterfaceTK/uniquepanel.py | 2 +- InterfaceTK/uniquesdcopanel.py | 2 +- 39 files changed, 113 insertions(+), 43 deletions(-) create mode 100644 InterfaceQT/eficas_go.py diff --git a/InterfaceQT/composimp.py b/InterfaceQT/composimp.py index 4253185d..df6266f0 100644 --- a/InterfaceQT/composimp.py +++ b/InterfaceQT/composimp.py @@ -8,10 +8,10 @@ from qt import * # Modules Eficas from Editeur import Objecttreeitem -from Aster import prefs from InterfaceQT import browser from Noyau.N_CR import justify_text +import prefs class Node(browser.JDCNode): def getPanel(self): diff --git a/InterfaceQT/editor.py b/InterfaceQT/editor.py index 5321d7fc..30d6efe9 100644 --- a/InterfaceQT/editor.py +++ b/InterfaceQT/editor.py @@ -11,11 +11,11 @@ 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 prefs import qtCommun VERSION_EFICAS = "EFICAS v1.12" @@ -70,7 +70,6 @@ class JDCEditor(QSplitter): readercata.reader = readercata.READERCATA( self, self ) self.readercata = readercata.reader - #------- construction du jdc -------------- jdc_item = None diff --git a/InterfaceQT/eficas.py b/InterfaceQT/eficas.py index 731589d0..a335ded9 100644 --- a/InterfaceQT/eficas.py +++ b/InterfaceQT/eficas.py @@ -1,3 +1,5 @@ +# -*- coding: iso-8859-15 -*- + class UserInterface(Eficas): """ Class implementing the main user interface. diff --git a/InterfaceQT/eficas_go.py b/InterfaceQT/eficas_go.py new file mode 100644 index 00000000..e2d29990 --- /dev/null +++ b/InterfaceQT/eficas_go.py @@ -0,0 +1,61 @@ +# -*- 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 permet de lancer l'application EFICAS en affichant + un ecran Splash pour faire patienter l'utilisateur +""" +# Modules Python +import sys +from qt import * + +# Modules Eficas +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 + +from Editeur import import_code +from Editeur import session + +def lance_eficas(code=None,fichier=None): + """ + Lance l'appli EFICAS + """ + # Analyse des arguments de la ligne de commande + if code !=None : prefs.code=code + import qtEficas + options=session.parse(sys.argv) + code=options.code + + app = QApplication(sys.argv) + mw = qtEficas.Appli(code=code) + app.setMainWidget(mw) + app.connect(app, SIGNAL("lastWindowClosed()"), app, SLOT("quit()")) + if fichier != None : mw.ouvreFichiers() + mw.show() + res = app.exec_loop() + sys.exit(res) + + diff --git a/InterfaceQT/monCommentairePanel.py b/InterfaceQT/monCommentairePanel.py index ae6ce6e3..2a60ddbd 100644 --- a/InterfaceQT/monCommentairePanel.py +++ b/InterfaceQT/monCommentairePanel.py @@ -27,7 +27,7 @@ from qt import * from desCommentaire import DComment from qtCommun import QTPanel -from Aster import prefs +import prefs # Import des panels diff --git a/InterfaceQT/monParamPanel.py b/InterfaceQT/monParamPanel.py index 33145e9e..a3760ae1 100644 --- a/InterfaceQT/monParamPanel.py +++ b/InterfaceQT/monParamPanel.py @@ -22,7 +22,7 @@ import string,types,os,re # Modules Eficas -from Aster import prefs +import prefs from qt import * diff --git a/InterfaceQT/monPlusieursASSDPanel.py b/InterfaceQT/monPlusieursASSDPanel.py index 92ec2b6c..9b7ea7f9 100644 --- a/InterfaceQT/monPlusieursASSDPanel.py +++ b/InterfaceQT/monPlusieursASSDPanel.py @@ -22,7 +22,7 @@ import string,types,os # Modules Eficas -from Aster import prefs +import prefs from qt import * from monPlusieursIntoPanel import MonPlusieursIntoPanel diff --git a/InterfaceQT/monPlusieursBasePanel.py b/InterfaceQT/monPlusieursBasePanel.py index c6e59a8d..2cc00e5d 100644 --- a/InterfaceQT/monPlusieursBasePanel.py +++ b/InterfaceQT/monPlusieursBasePanel.py @@ -22,7 +22,7 @@ import string,types,os # Modules Eficas -from Aster import prefs +import prefs from qt import * diff --git a/InterfaceQT/monPlusieursIntoPanel.py b/InterfaceQT/monPlusieursIntoPanel.py index 7aa23d7c..2d088067 100644 --- a/InterfaceQT/monPlusieursIntoPanel.py +++ b/InterfaceQT/monPlusieursIntoPanel.py @@ -22,7 +22,7 @@ import string,types,os # Modules Eficas -from Aster import prefs +import prefs from qt import * diff --git a/InterfaceQT/monUniqueASSDPanel.py b/InterfaceQT/monUniqueASSDPanel.py index d41c7082..88754153 100644 --- a/InterfaceQT/monUniqueASSDPanel.py +++ b/InterfaceQT/monUniqueASSDPanel.py @@ -22,7 +22,7 @@ import string,types,os # Modules Eficas -from Aster import prefs +import prefs from qt import * diff --git a/InterfaceQT/monUniqueBasePanel.py b/InterfaceQT/monUniqueBasePanel.py index bbac7773..a5795772 100644 --- a/InterfaceQT/monUniqueBasePanel.py +++ b/InterfaceQT/monUniqueBasePanel.py @@ -22,7 +22,7 @@ import string,types,os # Modules Eficas -from Aster import prefs +import prefs from qt import * diff --git a/InterfaceQT/monUniqueCompPanel.py b/InterfaceQT/monUniqueCompPanel.py index e47f2940..03a6bba0 100644 --- a/InterfaceQT/monUniqueCompPanel.py +++ b/InterfaceQT/monUniqueCompPanel.py @@ -22,7 +22,7 @@ import string,types,os,re # Modules Eficas -from Aster import prefs +import prefs from qt import * diff --git a/InterfaceQT/monUniqueIntoPanel.py b/InterfaceQT/monUniqueIntoPanel.py index 144dc700..43319181 100644 --- a/InterfaceQT/monUniqueIntoPanel.py +++ b/InterfaceQT/monUniqueIntoPanel.py @@ -22,7 +22,7 @@ import string,types,os # Modules Eficas -from Aster import prefs +import prefs from qt import * diff --git a/InterfaceQT/monUniqueSDCOIntoPanel.py b/InterfaceQT/monUniqueSDCOIntoPanel.py index 7890d151..f0368f3d 100644 --- a/InterfaceQT/monUniqueSDCOIntoPanel.py +++ b/InterfaceQT/monUniqueSDCOIntoPanel.py @@ -22,7 +22,7 @@ import string,types,os # Modules Eficas -from Aster import prefs +import prefs from qt import * diff --git a/InterfaceQT/monUniqueSDCOPanel.py b/InterfaceQT/monUniqueSDCOPanel.py index dd23f829..61e5d746 100644 --- a/InterfaceQT/monUniqueSDCOPanel.py +++ b/InterfaceQT/monUniqueSDCOPanel.py @@ -22,7 +22,7 @@ import string,types,os # Modules Eficas -from Aster import prefs +import prefs from qt import * diff --git a/InterfaceQT/qtEficas.py b/InterfaceQT/qtEficas.py index 5cb6ee38..a6d03abe 100644 --- a/InterfaceQT/qtEficas.py +++ b/InterfaceQT/qtEficas.py @@ -11,15 +11,18 @@ from myMain_ui import Eficas from viewManager import MyTabview from Editeur import configuration -from Aster import prefs +from Editeur import session + from InterfaceQT import utilIcons utilIcons.initializeMimeSourceFactory() +import prefs + class Appli(Eficas): """ Class implementing the main user interface. """ - def __init__(self): + def __init__(self,code="ASTER"): """ Constructor @@ -58,6 +61,8 @@ class Appli(Eficas): self.ficPatrons={} self.initPatrons() self.ihm="QT" + self.salome=0 + self.code=code #self.ouvreFichers() @@ -181,7 +186,7 @@ class Appli(Eficas): if __name__=='__main__': # Modules Eficas - from Aster import prefs + import prefs if hasattr(prefs,'encoding'): # Hack pour changer le codage par defaut des strings import sys diff --git a/InterfaceQT/readercata.py b/InterfaceQT/readercata.py index 6ffb6590..174f6373 100644 --- a/InterfaceQT/readercata.py +++ b/InterfaceQT/readercata.py @@ -31,7 +31,7 @@ import cPickle import re # Modules Eficas -from Aster import prefs +import prefs from Noyau.N_CR import CR from utils import init_rep_cata_dev @@ -84,9 +84,10 @@ class READERCATA: self.code = self.appli.CONFIGURATION.catalogues[0][0] self.version_code = liste_cata_possibles[0][1] self.appli.format_fichier=liste_cata_possibles[0][3] - lab=QString("Eficas V1.12 pour ASTER avec le catalogue ") + lab=QString("Eficas V1.13 pour ASTER avec le catalogue ") lab+=self.version_code - qApp.mainWidget().setCaption(lab) + self.appli.parent.ui.setCaption(lab) + #qApp.mainWidget().setCaption(lab) else: # plusieurs catalogues sont disponibles : il faut demander a l'utilisateur # lequel il veut utiliser ... @@ -308,7 +309,8 @@ class READERCATA: #self.appli.format_fichier.set( self.dico_catalogues[self.version_cata][3] ) self.appli.format_fichier = self.dico_catalogues[self.version_cata][3] lab+=self.version_cata - qApp.mainWidget().setCaption(lab) + self.appli.parent.ui.setCaption(lab) + #qApp.mainWidget().setCaption(lab) else : sys.exit(0) diff --git a/InterfaceQT/viewManager.py b/InterfaceQT/viewManager.py index afa9cc82..f5968dd0 100644 --- a/InterfaceQT/viewManager.py +++ b/InterfaceQT/viewManager.py @@ -2498,7 +2498,7 @@ class MyTabview(Tabview): if __name__=='__main__': import sys - from Aster import prefs + import prefs if hasattr(prefs,'encoding'): # Hack pour changer le codage par defaut des strings import sys diff --git a/InterfaceTK/appli.py b/InterfaceTK/appli.py index 60314e3f..8b4e4f7d 100644 --- a/InterfaceTK/appli.py +++ b/InterfaceTK/appli.py @@ -35,7 +35,7 @@ from widgets import showerror # Modules Eficas import splash -from Aster import prefs +import prefs import styles from styles import style from InterfaceTK import fontes @@ -60,6 +60,7 @@ class APPLI: def __init__ (self,master,code=prefs.code,fichier=None,test=0,ihm="TK") : self.ihm=ihm self.code=code + self.salome=0 self.top=master self.top.protocol("WM_DELETE_WINDOW",self.exitEFICAS) diff --git a/InterfaceTK/bureau.py b/InterfaceTK/bureau.py index f9263e06..b02a06ef 100644 --- a/InterfaceTK/bureau.py +++ b/InterfaceTK/bureau.py @@ -30,7 +30,7 @@ from widgets import showinfo,askyesno,showerror # Modules Eficas import splash -import Aster.prefs +import prefs import convert import generator import AIDE diff --git a/InterfaceTK/change_comm.py b/InterfaceTK/change_comm.py index a664e27c..ae48ba0c 100755 --- a/InterfaceTK/change_comm.py +++ b/InterfaceTK/change_comm.py @@ -29,7 +29,7 @@ import os # Modules Eficas from Editeur import import_code from Editeur import session -from Aster import prefs +import prefs import convert import generator import string diff --git a/InterfaceTK/composimp.py b/InterfaceTK/composimp.py index 6f9d7b98..be59ce65 100644 --- a/InterfaceTK/composimp.py +++ b/InterfaceTK/composimp.py @@ -27,7 +27,7 @@ import traceback # Modules Eficas from Editeur import Objecttreeitem -from Aster import prefs +import prefs import panels import images from widgets import ListeChoix diff --git a/InterfaceTK/eficas_go.py b/InterfaceTK/eficas_go.py index b4e99366..c0d54ecc 100644 --- a/InterfaceTK/eficas_go.py +++ b/InterfaceTK/eficas_go.py @@ -27,7 +27,7 @@ import sys import Tkinter # Modules Eficas -from Aster import prefs +import prefs if hasattr(prefs,'encoding'): # Hack pour changer le codage par defaut des strings import sys diff --git a/InterfaceTK/faq.py b/InterfaceTK/faq.py index afa09fed..34358e2f 100644 --- a/InterfaceTK/faq.py +++ b/InterfaceTK/faq.py @@ -28,7 +28,7 @@ import Pmw from Tkinter import END # Modules Eficas -from Aster import prefs +import prefs from InterfaceTK import fontes class FAQ: diff --git a/InterfaceTK/fonctionpanel.py b/InterfaceTK/fonctionpanel.py index 7b1646fc..b17704d5 100644 --- a/InterfaceTK/fonctionpanel.py +++ b/InterfaceTK/fonctionpanel.py @@ -27,7 +27,7 @@ import traceback # Modules Eficas from Editeur import Objecttreeitem -from Aster import prefs +import prefs import panels import images from widgets import ListeChoix diff --git a/InterfaceTK/images.py b/InterfaceTK/images.py index 08401ffd..18d8c9ce 100644 --- a/InterfaceTK/images.py +++ b/InterfaceTK/images.py @@ -41,7 +41,7 @@ if __name__ == '__main__': sys.exit() try: - from Aster import prefs + import prefs ICONDIR=prefs.ICONDIR except: # Par defaut on utilise le repertoire local icons diff --git a/InterfaceTK/newsimppanel.py b/InterfaceTK/newsimppanel.py index 0a04ce0f..77ca83aa 100644 --- a/InterfaceTK/newsimppanel.py +++ b/InterfaceTK/newsimppanel.py @@ -27,7 +27,7 @@ import traceback # Modules Eficas from Editeur import Objecttreeitem -from Aster import prefs +import prefs import panels import images import composimp diff --git a/InterfaceTK/panels.py b/InterfaceTK/panels.py index 15ab8ca9..636473a1 100644 --- a/InterfaceTK/panels.py +++ b/InterfaceTK/panels.py @@ -28,7 +28,7 @@ import traceback import widgets from widgets import ListeChoix from widgets import ListeChoixParGroupes -from Aster import prefs +import prefs import options SEPARATEUR = '-'*30 diff --git a/InterfaceTK/plusieursassdpanel.py b/InterfaceTK/plusieursassdpanel.py index 3d77f39f..3e5eb99b 100644 --- a/InterfaceTK/plusieursassdpanel.py +++ b/InterfaceTK/plusieursassdpanel.py @@ -27,7 +27,7 @@ import traceback # Modules Eficas from Editeur import Objecttreeitem -from Aster import prefs +import prefs import panels import images from widgets import ListeChoix diff --git a/InterfaceTK/plusieursbasepanel.py b/InterfaceTK/plusieursbasepanel.py index 550b98eb..dde20a8d 100644 --- a/InterfaceTK/plusieursbasepanel.py +++ b/InterfaceTK/plusieursbasepanel.py @@ -27,7 +27,7 @@ import traceback # Modules Eficas from Editeur import Objecttreeitem -from Aster import prefs +import prefs import panels import images from widgets import showinfo diff --git a/InterfaceTK/plusieursintopanel.py b/InterfaceTK/plusieursintopanel.py index 3484a83a..d5ef1e15 100644 --- a/InterfaceTK/plusieursintopanel.py +++ b/InterfaceTK/plusieursintopanel.py @@ -27,7 +27,7 @@ import traceback # Modules Eficas from Editeur import Objecttreeitem -from Aster import prefs +import prefs import panels import images from widgets import ListeChoix diff --git a/InterfaceTK/plusieurspanel.py b/InterfaceTK/plusieurspanel.py index b79906f6..0a21907e 100644 --- a/InterfaceTK/plusieurspanel.py +++ b/InterfaceTK/plusieurspanel.py @@ -27,7 +27,7 @@ import traceback # Modules Eficas from Editeur import Objecttreeitem -from Aster import prefs +import prefs import panels import images from widgets import ListeChoix diff --git a/InterfaceTK/styles.py b/InterfaceTK/styles.py index ead56a55..4d89ef6f 100644 --- a/InterfaceTK/styles.py +++ b/InterfaceTK/styles.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- import os -from Aster import prefs +import prefs import basestyle from basestyle import STYLE,style diff --git a/InterfaceTK/uniqueassdpanel.py b/InterfaceTK/uniqueassdpanel.py index ad9ed244..27edcd97 100644 --- a/InterfaceTK/uniqueassdpanel.py +++ b/InterfaceTK/uniqueassdpanel.py @@ -26,7 +26,7 @@ import traceback # Modules Eficas from Editeur import Objecttreeitem -from Aster import prefs +import prefs import panels import images from widgets import ListeChoix diff --git a/InterfaceTK/uniquebasepanel.py b/InterfaceTK/uniquebasepanel.py index 707fc285..b7a71beb 100644 --- a/InterfaceTK/uniquebasepanel.py +++ b/InterfaceTK/uniquebasepanel.py @@ -28,7 +28,7 @@ import traceback # Modules Eficas from Editeur import Objecttreeitem -from Aster import prefs +import prefs import panels import images from widgets import FenetreDeParametre diff --git a/InterfaceTK/uniquecomppanel.py b/InterfaceTK/uniquecomppanel.py index b7fdf618..80d9aa77 100644 --- a/InterfaceTK/uniquecomppanel.py +++ b/InterfaceTK/uniquecomppanel.py @@ -27,7 +27,7 @@ import traceback # Modules Eficas from Editeur import Objecttreeitem -from Aster import prefs +import prefs import panels import images from widgets import ListeChoix diff --git a/InterfaceTK/uniqueintopanel.py b/InterfaceTK/uniqueintopanel.py index caa0a3a3..76133cd5 100644 --- a/InterfaceTK/uniqueintopanel.py +++ b/InterfaceTK/uniqueintopanel.py @@ -27,7 +27,7 @@ import traceback # Modules Eficas from Editeur import Objecttreeitem -from Aster import prefs +import prefs import panels import images from widgets import ListeChoix diff --git a/InterfaceTK/uniquepanel.py b/InterfaceTK/uniquepanel.py index 4e3a6037..90b3b9d9 100644 --- a/InterfaceTK/uniquepanel.py +++ b/InterfaceTK/uniquepanel.py @@ -27,7 +27,7 @@ import traceback # Modules Eficas from Editeur import Objecttreeitem -from Aster import prefs +import prefs import panels import images from widgets import ListeChoix diff --git a/InterfaceTK/uniquesdcopanel.py b/InterfaceTK/uniquesdcopanel.py index 9722862c..a9e326c5 100644 --- a/InterfaceTK/uniquesdcopanel.py +++ b/InterfaceTK/uniquesdcopanel.py @@ -27,7 +27,7 @@ import traceback # Modules Eficas from Editeur import Objecttreeitem -from Aster import prefs +import prefs import panels import images from widgets import ListeChoix -- 2.39.2