309 if not ext: |
309 if not ext: |
310 ex = selectedFilter.split("(*")[1].split(")")[0] |
310 ex = selectedFilter.split("(*")[1].split(")")[0] |
311 if ex: |
311 if ex: |
312 fname += ex |
312 fname += ex |
313 if QFileInfo(fname).exists(): |
313 if QFileInfo(fname).exists(): |
314 res = E5MessageBox.warning(self, |
314 res = E5MessageBox.yesNo(self, |
315 self.trUtf8("Save regular expression"), |
315 self.trUtf8("Save regular expression"), |
316 self.trUtf8("<p>The file <b>{0}</b> already exists.</p>") |
316 self.trUtf8("<p>The file <b>{0}</b> already exists." |
317 .format(fname), |
317 " Overwrite it?</p>").format(fname), |
318 QMessageBox.StandardButtons(\ |
318 type_ = E5MessageBox.Warning) |
319 QMessageBox.Abort | \ |
319 if not res: |
320 QMessageBox.Save), |
|
321 QMessageBox.Abort) |
|
322 if res == QMessageBox.Abort or res == QMessageBox.Cancel: |
|
323 return |
320 return |
324 |
321 |
325 try: |
322 try: |
326 f=open(Utilities.toNativeSeparators(fname), "w", encoding = "utf-8") |
323 f=open(Utilities.toNativeSeparators(fname), "w", encoding = "utf-8") |
327 f.write(self.regexpTextEdit.toPlainText()) |
324 f.write(self.regexpTextEdit.toPlainText()) |