1756 res = E5MessageBox.yesNo(self.ui, |
1756 res = E5MessageBox.yesNo(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 type_ = E5MessageBox.Warning) |
1761 icon = E5MessageBox.Warning) |
1762 if not res: |
1762 if not res: |
1763 return # don't overwrite |
1763 return # don't overwrite |
1764 |
1764 |
1765 shutil.copy(fn, target) |
1765 shutil.copy(fn, target) |
1766 except IOError as why: |
1766 except IOError as why: |
1831 res = E5MessageBox.yesNo(self.ui, |
1831 res = E5MessageBox.yesNo(self.ui, |
1832 self.trUtf8("Add directory"), |
1832 self.trUtf8("Add directory"), |
1833 self.trUtf8("<p>The file <b>{0}</b> already exists.</p>" |
1833 self.trUtf8("<p>The file <b>{0}</b> already exists.</p>" |
1834 "<p>Overwrite it?</p>") |
1834 "<p>Overwrite it?</p>") |
1835 .format(targetfile), |
1835 .format(targetfile), |
1836 type_ = E5MessageBox.Warning) |
1836 icon = E5MessageBox.Warning) |
1837 if not res: |
1837 if not res: |
1838 continue # don't overwrite, carry on with next file |
1838 continue # don't overwrite, carry on with next file |
1839 |
1839 |
1840 shutil.copy(file, target) |
1840 shutil.copy(file, target) |
1841 except EnvironmentError: |
1841 except EnvironmentError: |
2021 res = E5MessageBox.yesNo(self.ui, |
2021 res = E5MessageBox.yesNo(self.ui, |
2022 self.trUtf8("Rename File"), |
2022 self.trUtf8("Rename File"), |
2023 self.trUtf8("""<p>The file <b>{0}</b> already exists.""" |
2023 self.trUtf8("""<p>The file <b>{0}</b> already exists.""" |
2024 """ Overwrite it?</p>""") |
2024 """ Overwrite it?</p>""") |
2025 .format(newfn), |
2025 .format(newfn), |
2026 type_ = E5MessageBox.Warning) |
2026 icon = E5MessageBox.Warning) |
2027 if not res: |
2027 if not res: |
2028 return False |
2028 return False |
2029 |
2029 |
2030 try: |
2030 try: |
2031 os.rename(oldfn, newfn) |
2031 os.rename(oldfn, newfn) |
2876 if QFileInfo(fn).exists(): |
2876 if QFileInfo(fn).exists(): |
2877 res = E5MessageBox.yesNo(self.ui, |
2877 res = E5MessageBox.yesNo(self.ui, |
2878 self.trUtf8("Save File"), |
2878 self.trUtf8("Save File"), |
2879 self.trUtf8("""<p>The file <b>{0}</b> already exists.""" |
2879 self.trUtf8("""<p>The file <b>{0}</b> already exists.""" |
2880 """ Overwrite it?</p>""").format(fn), |
2880 """ Overwrite it?</p>""").format(fn), |
2881 type_ = E5MessageBox.Warning) |
2881 icon = E5MessageBox.Warning) |
2882 if not res: |
2882 if not res: |
2883 return False |
2883 return False |
2884 |
2884 |
2885 self.name = QFileInfo(fn).baseName() |
2885 self.name = QFileInfo(fn).baseName() |
2886 ok = self.__writeProject(fn) |
2886 ok = self.__writeProject(fn) |
4440 if os.path.exists(pkglist): |
4440 if os.path.exists(pkglist): |
4441 res = E5MessageBox.yesNo(self.ui, |
4441 res = E5MessageBox.yesNo(self.ui, |
4442 self.trUtf8("Create Package List"), |
4442 self.trUtf8("Create Package List"), |
4443 self.trUtf8("<p>The file <b>PKGLIST</b> already" |
4443 self.trUtf8("<p>The file <b>PKGLIST</b> already" |
4444 " exists.</p><p>Overwrite it?</p>"), |
4444 " exists.</p><p>Overwrite it?</p>"), |
4445 type_ = E5MessageBox.Warning) |
4445 icon = E5MessageBox.Warning) |
4446 if not res: |
4446 if not res: |
4447 return # don't overwrite |
4447 return # don't overwrite |
4448 |
4448 |
4449 # build the list of entries |
4449 # build the list of entries |
4450 lst = [] |
4450 lst = [] |