459 @param coord the position of the mouse pointer (QPoint) |
460 @param coord the position of the mouse pointer (QPoint) |
460 """ |
461 """ |
461 if not self.project.isOpen(): |
462 if not self.project.isOpen(): |
462 return |
463 return |
463 |
464 |
464 try: |
465 with contextlib.suppress(Exception): |
465 categories = self.getSelectedItemsCountCategorized( |
466 categories = self.getSelectedItemsCountCategorized( |
466 [ProjectBrowserFileItem, ProjectBrowserSimpleDirectoryItem]) |
467 [ProjectBrowserFileItem, ProjectBrowserSimpleDirectoryItem]) |
467 cnt = categories["sum"] |
468 cnt = categories["sum"] |
468 if cnt <= 1: |
469 if cnt <= 1: |
469 index = self.indexAt(coord) |
470 index = self.indexAt(coord) |
487 self.dirMenu.popup(self.mapToGlobal(coord)) |
488 self.dirMenu.popup(self.mapToGlobal(coord)) |
488 else: |
489 else: |
489 self.backMenu.popup(self.mapToGlobal(coord)) |
490 self.backMenu.popup(self.mapToGlobal(coord)) |
490 else: |
491 else: |
491 self.backMenu.popup(self.mapToGlobal(coord)) |
492 self.backMenu.popup(self.mapToGlobal(coord)) |
492 except Exception: # secok |
|
493 pass |
|
494 |
493 |
495 def __showContextMenu(self): |
494 def __showContextMenu(self): |
496 """ |
495 """ |
497 Private slot called by the menu aboutToShow signal. |
496 Private slot called by the menu aboutToShow signal. |
498 """ |
497 """ |
961 |
960 |
962 for index in range(len(self.__pylupdateProcesses)): |
961 for index in range(len(self.__pylupdateProcesses)): |
963 if proc == self.__pylupdateProcesses[index][0]: |
962 if proc == self.__pylupdateProcesses[index][0]: |
964 tmpProjectFile = self.__pylupdateProcesses[index][1] |
963 tmpProjectFile = self.__pylupdateProcesses[index][1] |
965 if tmpProjectFile: |
964 if tmpProjectFile: |
966 try: |
965 with contextlib.suppress(OSError): |
967 self.__tmpProjects.remove(tmpProjectFile) |
966 self.__tmpProjects.remove(tmpProjectFile) |
968 os.remove(tmpProjectFile) |
967 os.remove(tmpProjectFile) |
969 except OSError: |
|
970 pass |
|
971 del self.__pylupdateProcesses[index] |
968 del self.__pylupdateProcesses[index] |
972 break |
969 break |
973 |
970 |
974 if not self.__pylupdateProcesses: |
971 if not self.__pylupdateProcesses: |
975 # all done |
972 # all done |
1128 self.tr( |
1125 self.tr( |
1129 'Could not start {0}.<br>' |
1126 'Could not start {0}.<br>' |
1130 'Ensure that it is in the search path.' |
1127 'Ensure that it is in the search path.' |
1131 ).format(self.pylupdate)) |
1128 ).format(self.pylupdate)) |
1132 # cleanup |
1129 # cleanup |
1133 try: |
1130 with contextlib.suppress(OSError): |
1134 self.__tmpProjects.remove(tempProjectFile) |
1131 self.__tmpProjects.remove(tempProjectFile) |
1135 os.remove(tempProjectFile) |
1132 os.remove(tempProjectFile) |
1136 except OSError: |
|
1137 pass |
|
1138 |
1133 |
1139 def __generateAll(self): |
1134 def __generateAll(self): |
1140 """ |
1135 """ |
1141 Private method to generate all translation files (.ts) for Qt Linguist. |
1136 Private method to generate all translation files (.ts) for Qt Linguist. |
1142 |
1137 |