From: Pascale Noyret Date: Mon, 29 Oct 2007 12:46:44 +0000 (+0000) Subject: pour les includes X-Git-Tag: V1_13b1~34 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=35c4882d6d0ee51ce4b386423675d6081c64e0a2;p=modules%2Feficas.git pour les includes --- diff --git a/InterfaceQT/qtEficas.py b/InterfaceQT/qtEficas.py index 149b166f..299637f8 100644 --- a/InterfaceQT/qtEficas.py +++ b/InterfaceQT/qtEficas.py @@ -66,7 +66,6 @@ class Appli(Eficas): self.ihm="QT" self.salome=0 self.code=code - #self.ouvreFichers() def ouvreFichiers(self) : @@ -76,7 +75,8 @@ class Appli(Eficas): for study in session.d_env.studies: os.chdir(cwd) d=session.get_unit(study,self) - self.viewmanager.handleOpen(fn=study["comm"]) + #print study["comm"] + self.viewmanager.handleOpen(fn=study["comm"],units=d) def initPatrons(self) : @@ -185,6 +185,12 @@ class Appli(Eficas): def jdcRapport(self): self.viewmanager.handleViewJdcRapport() + def get_source(self,file): + from editor import JDCEditor + monEditeur=JDCEditor() + texte=monEditeur.get_source(file) + print "______________________________________" + return texte if __name__=='__main__': diff --git a/InterfaceQT/readercata.py b/InterfaceQT/readercata.py index 6f731a5c..2e3a3858 100644 --- a/InterfaceQT/readercata.py +++ b/InterfaceQT/readercata.py @@ -78,7 +78,7 @@ class READERCATA: for cata in liste_cata_possibles: if self.version_code == cata[1]: self.fic_cata = cata[2] - self.appli.format_fichier.set(cata[3]) + self.appli.format_fichier=cata[3] elif len(liste_cata_possibles)==1: self.fic_cata = liste_cata_possibles[0][2] self.code = self.appli.CONFIGURATION.catalogues[0][0] @@ -86,7 +86,11 @@ class READERCATA: self.appli.format_fichier=liste_cata_possibles[0][3] lab=QString("Eficas V1.13 pour ASTER avec le catalogue ") lab+=self.version_code - self.appli.parent.ui.setCaption(lab) + try : + # souci pour les includes + self.appli.parent.ui.setCaption(lab) + except : + pass #qApp.mainWidget().setCaption(lab) else: # plusieurs catalogues sont disponibles : il faut demander a l'utilisateur @@ -306,7 +310,6 @@ class READERCATA: 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] ) self.appli.format_fichier = self.dico_catalogues[self.version_cata][3] lab+=self.version_cata self.appli.parent.ui.setCaption(lab) diff --git a/InterfaceQT/viewManager.py b/InterfaceQT/viewManager.py index f5968dd0..483957f5 100644 --- a/InterfaceQT/viewManager.py +++ b/InterfaceQT/viewManager.py @@ -758,14 +758,14 @@ class ViewManager: pass - def displayJDC(self,jdc): + def displayJDC(self,jdc,fn=None): """ 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) + newWin, editor = self.getEditor(None, jdc, title = fn) if newWin: self.handleModificationStatusChanged(editor.modified, editor) @@ -907,7 +907,7 @@ class ViewManager: return filenames - def getEditor(self, fn, jdc = None): + def getEditor(self, fn, jdc = None, title = None, units = None): """ Private method to return the editor displaying the given file. @@ -926,7 +926,7 @@ class ViewManager: break else: from editor import JDCEditor - editor = JDCEditor(fn, jdc, self) + editor = JDCEditor(fn, jdc, self,units=units) if editor.jdc: # le fichier est bien un jdc self.editors.append(editor) @@ -946,7 +946,7 @@ class ViewManager: editor.closeIt() if newWin: - self.addView(editor, fn) + self.addView(editor, fn , title) elif editor.jdc: self.showView(editor, fn) @@ -2136,7 +2136,7 @@ class Tabview(QSplitter, ViewManager): self.activeWindow().setFocus() break - def addView(self, win, fn=None): + def addView(self, win, fn=None, title=None): """ Private method to add a view (i.e. window) @@ -2145,8 +2145,11 @@ class Tabview(QSplitter, ViewManager): """ win.show() if fn is None: - self.untitledCount += 1 - self.currentTabWidget.addTab(win, self.trUtf8("Untitled %1").arg(self.untitledCount)) + if title== None : + self.untitledCount += 1 + self.currentTabWidget.addTab(win, self.trUtf8("Untitled %1").arg(self.untitledCount)) + else : + self.currentTabWidget.addTab(win, title) else: txt = os.path.basename(fn) if not QFileInfo(fn).isWritable(): @@ -2409,7 +2412,7 @@ class MyTabview(Tabview): if len(self.recent) > 9: self.recent = self.recent[:9] - def handleOpen(self,fn=None,patron=0): + def handleOpen(self,fn=None,patron=0,units=None): """ Public slot to open a Python JDC file. @@ -2428,7 +2431,7 @@ class MyTabview(Tabview): fn = normabspath(unicode(fn)) - newWin, editor = self.getEditor(fn) + newWin, editor = self.getEditor(fn,units=units) if newWin: self.handleModificationStatusChanged(editor.modified, editor)