eric6/Templates/TemplateViewer.py

branch
jsonfiles
changeset 8021
a8ba35ce81ad
parent 8018
641c7c312f26
child 8143
2c730d5fd177
--- a/eric6/Templates/TemplateViewer.py	Thu Jan 28 16:35:55 2021 +0100
+++ b/eric6/Templates/TemplateViewer.py	Thu Jan 28 16:36:29 2021 +0100
@@ -595,7 +595,17 @@
                 ex = selectedFilter.split("(*")[1].split(")")[0]
                 if ex:
                     fn += ex
-            self.writeTemplates(fn)
+            if os.path.exists(fn):
+                ok = E5MessageBox.yesNo(
+                    self,
+                    self.tr("Export Templates"),
+                    self.tr("""<p>The templates file <b>{0}</b> exists"""
+                            """ already. Overwrite it?</p>""").format(fn))
+            else:
+                ok = True
+            
+            if ok:
+                self.writeTemplates(fn)
     
     def __reload(self):
         """

eric ide

mercurial