7957 selectedCrashSessionFile = "" |
7957 selectedCrashSessionFile = "" |
7958 crashedSessionsList = self.__getCrashedSessions() |
7958 crashedSessionsList = self.__getCrashedSessions() |
7959 if crashedSessionsList: |
7959 if crashedSessionsList: |
7960 dlg = CrashedSessionsSelectionDialog( |
7960 dlg = CrashedSessionsSelectionDialog( |
7961 sorted(crashedSessionsList), parent=self |
7961 sorted(crashedSessionsList), parent=self |
7962 |
|
7963 ) |
7962 ) |
7964 if dlg.exec() == QDialog.DialogCode.Accepted: |
7963 if dlg.exec() == QDialog.DialogCode.Accepted: |
7965 selectedCrashSessionFile = dlg.getSelectedCrashSession() |
7964 selectedCrashSessionFile = dlg.getSelectedCrashSession() |
7966 |
7965 |
7967 return selectedCrashSessionFile |
7966 return selectedCrashSessionFile |
8019 @pyqtSlot() |
8018 @pyqtSlot() |
8020 def __cleanCrashSessions(self): |
8019 def __cleanCrashSessions(self): |
8021 """ |
8020 """ |
8022 Private slot to clean all stale crash sessions. |
8021 Private slot to clean all stale crash sessions. |
8023 """ |
8022 """ |
8024 from .DeleteFilesConfirmationDialog import DeleteFilesConfirmationDialog |
|
8025 |
|
8026 crashedSessionsList = self.__getCrashedSessions() |
8023 crashedSessionsList = self.__getCrashedSessions() |
8027 if crashedSessionsList: |
8024 if crashedSessionsList: |
8028 dlg = DeleteFilesConfirmationDialog( |
8025 dlg = CrashedSessionsSelectionDialog( |
8029 parent=self, |
8026 sorted(crashedSessionsList), deleteMode=True, parent=self |
8030 caption=self.tr("Clean stale crash sessions"), |
|
8031 message=self.tr( |
|
8032 "Do you really want to delete these stale crash session files?" |
|
8033 ), |
|
8034 files=sorted(crashedSessionsList), |
|
8035 ) |
8027 ) |
8036 if dlg.exec() == QDialog.DialogCode.Accepted: |
8028 if dlg.exec() == QDialog.DialogCode.Accepted: |
8037 for crashSession in crashedSessionsList: |
8029 selectedCrashSessionFiles = dlg.getSelectedCrashSessions() |
|
8030 for crashSession in selectedCrashSessionFiles: |
8038 os.remove(crashSession) |
8031 os.remove(crashSession) |
8039 |
8032 |
8040 def showFindFileByNameDialog(self): |
8033 def showFindFileByNameDialog(self): |
8041 """ |
8034 """ |
8042 Public slot to show the Find File by Name dialog. |
8035 Public slot to show the Find File by Name dialog. |