284 if not ext: |
284 if not ext: |
285 ex = selectedFilter.split("(*")[1].split(")")[0] |
285 ex = selectedFilter.split("(*")[1].split(")")[0] |
286 if ex: |
286 if ex: |
287 fileName += ex |
287 fileName += ex |
288 if QFileInfo(fname).exists(): |
288 if QFileInfo(fname).exists(): |
289 res = E5MessageBox.warning(self, |
289 res = E5MessageBox.yesNo(self, |
290 self.trUtf8("Save Diff"), |
290 self.trUtf8("Save Diff"), |
291 self.trUtf8("<p>The patch file <b>{0}</b> already exists.</p>") |
291 self.trUtf8("<p>The patch file <b>{0}</b> already exists." |
292 .format(fname), |
292 " Overwrite it?</p>").format(fname), |
293 QMessageBox.StandardButtons(\ |
293 type_ = E5MessageBox.Warning) |
294 QMessageBox.Abort | \ |
294 if not res: |
295 QMessageBox.Save), |
|
296 QMessageBox.Abort) |
|
297 if res != QMessageBox.Save: |
|
298 return |
295 return |
299 fname = Utilities.toNativeSeparators(fname) |
296 fname = Utilities.toNativeSeparators(fname) |
300 |
297 |
301 try: |
298 try: |
302 f = open(fname, "w", encoding = "utf-8") |
299 f = open(fname, "w", encoding = "utf-8") |