]> SALOME platform Git repositories - modules/eficas.git/commitdiff
Salome HOME
pour map
authorPascale Noyret <pascale.noyret@edf.fr>
Tue, 8 Jun 2010 09:17:13 +0000 (09:17 +0000)
committerPascale Noyret <pascale.noyret@edf.fr>
Tue, 8 Jun 2010 09:17:13 +0000 (09:17 +0000)
InterfaceQT4/editor.py

index 56253a095c81ccf72184c1c0e8c144b61a9eae41..04752e7afe697e5e9f8ee16e06cf71c1096633c2 100644 (file)
@@ -544,6 +544,29 @@ class JDCEditor(QSplitter):
       else:
          return self.textePython
     
+    #-----------------------------#
+    def saveRun(self):
+    #-----------------------------#
+        texte=self.run(execution="non")
+        path=self.CONFIGURATION.savedir
+        fn = QFileDialog.getSaveFileName( self,
+             self.trUtf8("sauvegarde"), path,
+             self.trUtf8("JDC (*.sh);;" "All Files (*)"),None,
+             QFileDialog.DontConfirmOverwrite)
+        if fn.isNull(): return 
+        ext = QFileInfo(fn).suffix()
+        if ext.isEmpty(): fn.append(".xml")
+
+        if QFileInfo(fn).exists():
+                abort = QMessageBox.warning(self,
+                       self.trUtf8("Sauvegarde du Fichier"),
+                       self.trUtf8("Le fichier <b>%1</b> existe deja.").arg(fn),
+                       self.trUtf8("&Ecraser"),
+                       self.trUtf8("&Abandonner"))
+                if abort == 1 :  return
+
+        fn = unicode(QDir.convertSeparators(fn))
+        self.writeFile( fn, txt = texte)
     
     #-----------------------------#
     def saveYACS(self):
@@ -569,7 +592,6 @@ class JDCEditor(QSplitter):
         fn = unicode(QDir.convertSeparators(fn))
         self.writeFile( fn, txt = texte)
       
-      
     #-----------------------------------------#e
     def cherche_Groupes(self):
         listeMA,listeNO=self.get_text_JDC("GroupMA")