Project/ProjectFormsBrowser.py

changeset 541
00e1a5d060c5
parent 539
87f9bce38a44
child 553
5af61623ae3c
equal deleted inserted replaced
540:2631831b4052 541:00e1a5d060c5
509 ex = selectedFilter.split("(*")[1].split(")")[0] 509 ex = selectedFilter.split("(*")[1].split(")")[0]
510 if ex: 510 if ex:
511 fname += ex 511 fname += ex
512 512
513 if os.path.exists(fname): 513 if os.path.exists(fname):
514 res = E5MessageBox.warning(self, 514 res = E5MessageBox.yesNo(self,
515 self.trUtf8("New Form"), 515 self.trUtf8("New Form"),
516 self.trUtf8("The file already exists! Overwrite it?"), 516 self.trUtf8("The file already exists! Overwrite it?"),
517 QMessageBox.StandardButtons(\ 517 type_ = E5MessageBox.Warning)
518 QMessageBox.No | \ 518 if not res:
519 QMessageBox.Yes),
520 QMessageBox.No)
521 if res != QMessageBox.Yes:
522 # user selected to not overwrite 519 # user selected to not overwrite
523 return 520 return
524 521
525 try: 522 try:
526 shutil.copy(templateFile, fname) 523 shutil.copy(templateFile, fname)

eric ide

mercurial