1502 Public slot to delete a translation from the project directory. |
1502 Public slot to delete a translation from the project directory. |
1503 |
1503 |
1504 @param langFile the translation file to be removed (string) |
1504 @param langFile the translation file to be removed (string) |
1505 """ |
1505 """ |
1506 try: |
1506 try: |
1507 from ThirdParty.Send2Trash.send2trash import send2trash as s2t |
1507 from send2trash import send2trash as s2t |
1508 except ImportError: |
1508 except ImportError: |
1509 s2t = os.remove |
1509 s2t = os.remove |
1510 |
1510 |
1511 langFile = self.getRelativePath(langFile) |
1511 langFile = self.getRelativePath(langFile) |
1512 qmFile = self.__binaryTranslationFile(langFile) |
1512 qmFile = self.__binaryTranslationFile(langFile) |
2274 """ |
2274 """ |
2275 if not os.path.isabs(dn): |
2275 if not os.path.isabs(dn): |
2276 dn = os.path.join(self.ppath, dn) |
2276 dn = os.path.join(self.ppath, dn) |
2277 try: |
2277 try: |
2278 try: |
2278 try: |
2279 from ThirdParty.Send2Trash.send2trash import send2trash |
2279 from send2trash import send2trash |
2280 send2trash(dn) |
2280 send2trash(dn) |
2281 except ImportError: |
2281 except ImportError: |
2282 shutil.rmtree(dn, True) |
2282 shutil.rmtree(dn, True) |
2283 except OSError as err: |
2283 except OSError as err: |
2284 E5MessageBox.critical( |
2284 E5MessageBox.critical( |