From bc2057c290c49f8186843f74946458892d126cc1 Mon Sep 17 00:00:00 2001 From: "pascale.noyret" Date: Thu, 12 Apr 2018 17:47:47 +0200 Subject: [PATCH] pour tests Telemac --- InterfaceQT4/editorSsIhm.py | 11 ++++++----- InterfaceQT4/viewManagerSsIhm.py | 25 +++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 5 deletions(-) diff --git a/InterfaceQT4/editorSsIhm.py b/InterfaceQT4/editorSsIhm.py index bcda1c0c..aa2da8e2 100755 --- a/InterfaceQT4/editorSsIhm.py +++ b/InterfaceQT4/editorSsIhm.py @@ -519,16 +519,17 @@ class JDCEditorSsIhm : #-----------------------------------------------------------------# if fileName != None : self.fichier = fileName - return self.saveFileLeger() + return self.saveFileLeger(fileName) return self.saveFileLeger() #-----------------------------------------------------------------# - def saveFileLeger(self, fichier, formatLigne="beautifie"): + def saveFileComplet(self, fichier = None, formatLigne="beautifie"): #-----------------------------------------------------------------# fn = fichier self.generator=generator.plugins[self.format]() - if hasattr(self.generator, "writeLeger"): - self.generator.writeLeger(fichier,self.jdc,config=self.appliEficas.maConfiguration,appli=self.appliEficas) + print (self.generator) + if hasattr(self.generator, "writeComplet"): + self.generator.writeComplet(fichier,self.jdc,config=self.appliEficas.maConfiguration,appli=self.appliEficas) # --------------------------------------------- @@ -580,7 +581,7 @@ class JDCEditorSsIhm : if not (self.writeFile(fichier,formatLigne=formatLigne)): return (0, None) self.fichierOut = fichier - if self.jdc.isvalid() != 0 and hasattr(self.generator, "writeDefault"): + if self.jdc.isValid() != 0 and hasattr(self.generator, "writeDefault"): self.generator.writeDefault(fichier) elif self.code=="TELEMAC" and hasattr(self.generator, "writeDefault"): self.generator.writeDefault(fichier) diff --git a/InterfaceQT4/viewManagerSsIhm.py b/InterfaceQT4/viewManagerSsIhm.py index c0d856d1..a588c792 100644 --- a/InterfaceQT4/viewManagerSsIhm.py +++ b/InterfaceQT4/viewManagerSsIhm.py @@ -67,6 +67,14 @@ class JdcSsIhmHandler(object): # ------------------------- return self.viewManagerSsIhm.isJdcValid(self) + def fileSaveAs(self,fileName): +# ------------------------- + return self.viewManagerSsIhm.fileSaveAs(self,fileName) + + def fileLegerSaveAs(self,fileName): +# ----------------------------------- + return self.viewManagerSsIhm.fileLegerSaveAs(self,fileName) + #-------------------------------- @@ -202,6 +210,23 @@ class MyViewManagerSsIhm(object): return self.dictEditors[handler].jdc.isValid() +# --------------------------------------------- + def fileSaveAs(self,handler,fileName): +# --------------------------------------------- + print (handler) + if not (handler in self.dictEditors) : + print ('editor non trouve') + return + return self.dictEditors[handler].saveFile(fileName) + +# --------------------------------------------- + def fileLegerSaveAs(self, handler,fileName): +# --------------------------------------------- +# print (handler) + if not (handler in self.dictEditors) : + print ('editor non trouve') + return + self.dictEditors[handler].saveFileLegerAs(fileName) # def handleClose(self,doitSauverRecent = 1,texte=tr('&Quitter')): -- 2.39.2