8257:28146736bbfc | 8258:82b608e352ec |
---|---|
934 | 934 |
935 @param fn filename to be deleted | 935 @param fn filename to be deleted |
936 @type str | 936 @type str |
937 """ | 937 """ |
938 try: | 938 try: |
939 from ThirdParty.Send2Trash.send2trash import send2trash as s2t | 939 from send2trash import send2trash as s2t |
940 trashMsg = self.tr("Do you really want to move this file to the" | 940 trashMsg = self.tr("Do you really want to move this file to the" |
941 " trash?") | 941 " trash?") |
942 except ImportError: | 942 except ImportError: |
943 s2t = os.remove | 943 s2t = os.remove |
944 trashMsg = self.tr("Do you really want to delete this file?") | 944 trashMsg = self.tr("Do you really want to delete this file?") |
970 | 970 |
971 @param dn directory name to be removed from the project | 971 @param dn directory name to be removed from the project |
972 @type str | 972 @type str |
973 """ | 973 """ |
974 try: | 974 try: |
975 from ThirdParty.Send2Trash.send2trash import send2trash | 975 from send2trash import send2trash |
976 s2tAvailable = True | 976 s2tAvailable = True |
977 trashMsg = self.tr("Do you really want to move this directory to" | 977 trashMsg = self.tr("Do you really want to move this directory to" |
978 " the trash?") | 978 " the trash?") |
979 except ImportError: | 979 except ImportError: |
980 s2tAvailable = False | 980 s2tAvailable = False |
1015 fileNames = [] | 1015 fileNames = [] |
1016 for itm in self.getSelectedItems(): | 1016 for itm in self.getSelectedItems(): |
1017 fileNames.append(itm.fileName()) | 1017 fileNames.append(itm.fileName()) |
1018 | 1018 |
1019 try: | 1019 try: |
1020 from ThirdParty.Send2Trash.send2trash import send2trash as s2t | 1020 from send2trash import send2trash as s2t |
1021 trashMsg = self.tr("Do you really want to move these files to the" | 1021 trashMsg = self.tr("Do you really want to move these files to the" |
1022 " trash?") | 1022 " trash?") |
1023 except ImportError: | 1023 except ImportError: |
1024 s2t = os.remove | 1024 s2t = os.remove |
1025 trashMsg = self.tr("Do you really want to delete these files?") | 1025 trashMsg = self.tr("Do you really want to delete these files?") |