self.ihm="QT"
self.salome=0
self.code=code
- #self.ouvreFichers()
def ouvreFichiers(self) :
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) :
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__':
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]
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
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)
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)
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.
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)
editor.closeIt()
if newWin:
- self.addView(editor, fn)
+ self.addView(editor, fn , title)
elif editor.jdc:
self.showView(editor, fn)
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)
"""
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():
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.
fn = normabspath(unicode(fn))
- newWin, editor = self.getEditor(fn)
+ newWin, editor = self.getEditor(fn,units=units)
if newWin:
self.handleModificationStatusChanged(editor.modified, editor)