1751 try: |
1751 try: |
1752 if not os.path.isdir(target): |
1752 if not os.path.isdir(target): |
1753 os.makedirs(target) |
1753 os.makedirs(target) |
1754 |
1754 |
1755 if os.path.exists(targetfile): |
1755 if os.path.exists(targetfile): |
1756 res = QMessageBox.warning(None, |
1756 res = E5MessageBox.warning(self.ui, |
1757 self.trUtf8("Add file"), |
1757 self.trUtf8("Add file"), |
1758 self.trUtf8("<p>The file <b>{0}</b> already" |
1758 self.trUtf8("<p>The file <b>{0}</b> already" |
1759 " exists.</p><p>Overwrite it?</p>") |
1759 " exists.</p><p>Overwrite it?</p>") |
1760 .format(targetfile), |
1760 .format(targetfile), |
1761 QMessageBox.StandardButtons(\ |
1761 QMessageBox.StandardButtons(\ |
1829 |
1829 |
1830 targetfile = os.path.join(target, os.path.basename(file)) |
1830 targetfile = os.path.join(target, os.path.basename(file)) |
1831 if not Utilities.samepath(target, source): |
1831 if not Utilities.samepath(target, source): |
1832 try: |
1832 try: |
1833 if os.path.exists(targetfile): |
1833 if os.path.exists(targetfile): |
1834 res = QMessageBox.warning(self.ui, |
1834 res = E5MessageBox.warning(self.ui, |
1835 self.trUtf8("Add directory"), |
1835 self.trUtf8("Add directory"), |
1836 self.trUtf8("<p>The file <b>{0}</b> already exists.</p>" |
1836 self.trUtf8("<p>The file <b>{0}</b> already exists.</p>" |
1837 "<p>Overwrite it?</p>") |
1837 "<p>Overwrite it?</p>") |
1838 .format(targetfile), |
1838 .format(targetfile), |
1839 QMessageBox.StandardButtons(\ |
1839 QMessageBox.StandardButtons(\ |
2022 if not newfn: |
2022 if not newfn: |
2023 return False |
2023 return False |
2024 newfn = Utilities.toNativeSeparators(newfn) |
2024 newfn = Utilities.toNativeSeparators(newfn) |
2025 |
2025 |
2026 if os.path.exists(newfn): |
2026 if os.path.exists(newfn): |
2027 canceled = QMessageBox.warning(None, |
2027 canceled = E5MessageBox.warning(self.ui, |
2028 self.trUtf8("Rename File"), |
2028 self.trUtf8("Rename File"), |
2029 self.trUtf8("""<p>The file <b>{0}</b> already exists.""" |
2029 self.trUtf8("""<p>The file <b>{0}</b> already exists.""" |
2030 """ Overwrite it?</p>""") |
2030 """ Overwrite it?</p>""") |
2031 .format(newfn), |
2031 .format(newfn), |
2032 QMessageBox.StandardButtons(\ |
2032 QMessageBox.StandardButtons(\ |
2895 if not ext: |
2895 if not ext: |
2896 ex = selectedFilter.split("(*")[1].split(")")[0] |
2896 ex = selectedFilter.split("(*")[1].split(")")[0] |
2897 if ex: |
2897 if ex: |
2898 fn += ex |
2898 fn += ex |
2899 if QFileInfo(fn).exists(): |
2899 if QFileInfo(fn).exists(): |
2900 res = QMessageBox.warning(None, |
2900 res = E5MessageBox.warning(self.ui, |
2901 self.trUtf8("Save File"), |
2901 self.trUtf8("Save File"), |
2902 self.trUtf8("""<p>The file <b>{0}</b> already exists.</p>""") |
2902 self.trUtf8("""<p>The file <b>{0}</b> already exists.</p>""") |
2903 .format(fn), |
2903 .format(fn), |
2904 QMessageBox.StandardButtons(\ |
2904 QMessageBox.StandardButtons(\ |
2905 QMessageBox.Abort | \ |
2905 QMessageBox.Abort | \ |
2935 Public method to check dirty status and open a message window. |
2935 Public method to check dirty status and open a message window. |
2936 |
2936 |
2937 @return flag indicating whether this operation was successful (boolean) |
2937 @return flag indicating whether this operation was successful (boolean) |
2938 """ |
2938 """ |
2939 if self.isDirty(): |
2939 if self.isDirty(): |
2940 res = QMessageBox.warning(self.parent(), |
2940 res = E5MessageBox.warning(self.parent(), |
2941 self.trUtf8("Close Project"), |
2941 self.trUtf8("Close Project"), |
2942 self.trUtf8("The current project has unsaved changes."), |
2942 self.trUtf8("The current project has unsaved changes."), |
2943 QMessageBox.StandardButtons(\ |
2943 QMessageBox.StandardButtons(\ |
2944 QMessageBox.Abort | \ |
2944 QMessageBox.Abort | \ |
2945 QMessageBox.Discard | \ |
2945 QMessageBox.Discard | \ |
4473 """ |
4473 """ |
4474 Private slot to create a PKGLIST file needed for archive file creation. |
4474 Private slot to create a PKGLIST file needed for archive file creation. |
4475 """ |
4475 """ |
4476 pkglist = os.path.join(self.ppath, "PKGLIST") |
4476 pkglist = os.path.join(self.ppath, "PKGLIST") |
4477 if os.path.exists(pkglist): |
4477 if os.path.exists(pkglist): |
4478 res = QMessageBox.warning(None, |
4478 res = E5MessageBox.warning(self.ui, |
4479 self.trUtf8("Create Package List"), |
4479 self.trUtf8("Create Package List"), |
4480 self.trUtf8("<p>The file <b>PKGLIST</b> already" |
4480 self.trUtf8("<p>The file <b>PKGLIST</b> already" |
4481 " exists.</p><p>Overwrite it?</p>"), |
4481 " exists.</p><p>Overwrite it?</p>"), |
4482 QMessageBox.StandardButtons(\ |
4482 QMessageBox.StandardButtons(\ |
4483 QMessageBox.No | \ |
4483 QMessageBox.No | \ |