Thu, 03 Apr 2025 19:50:43 +0200
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
11206
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1 | # -*- coding: utf-8 -*- |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
2 | |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
3 | # Copyright (c) 2025 Detlev Offenbach <detlev@die-offenbachs.de> |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
4 | # |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
5 | |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
6 | """ |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
7 | Module implementing a dialog to show a list of existing crash session files. |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
8 | """ |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
9 | |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
10 | import json |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
11 | import os |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
12 | import time |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
13 | |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
14 | from PyQt6.QtCore import Qt, pyqtSlot |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
15 | from PyQt6.QtWidgets import QDialog, QDialogButtonBox, QListWidgetItem |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
16 | |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
17 | from eric7.EricWidgets import EricMessageBox |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
18 | |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
19 | from .Ui_CrashedSessionsSelectionDialog import Ui_CrashedSessionsSelectionDialog |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
20 | |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
21 | |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
22 | class CrashedSessionsSelectionDialog(QDialog, Ui_CrashedSessionsSelectionDialog): |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
23 | """ |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
24 | Class implementing a dialog to show a list of existing crash session files. |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
25 | """ |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
26 | |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
27 | def __init__(self, sessionFiles, parent=None): |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
28 | """ |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
29 | Constructor |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
30 | |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
31 | @param sessionFiles list of crash session file names |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
32 | @type list of str |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
33 | @param parent reference to the parent widget (defaults to None) |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
34 | @type QWidget (optional) |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
35 | """ |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
36 | super().__init__(parent) |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
37 | self.setupUi(self) |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
38 | |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
39 | self.crashedSessionsList.itemDoubleClicked.connect(self.accept) |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
40 | self.crashedSessionsList.itemActivated.connect(self.accept) |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
41 | self.crashedSessionsList.itemSelectionChanged.connect(self.__updateOk) |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
42 | |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
43 | for sessionFile in sessionFiles: |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
44 | self.__addSessionFileEntry(sessionFile) |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
45 | |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
46 | self.__updateOk() |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
47 | |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
48 | @pyqtSlot() |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
49 | def __updateOk(self): |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
50 | """ |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
51 | Private method to update the enabled state of the OK button. |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
52 | """ |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
53 | self.buttonBox.button(QDialogButtonBox.StandardButton.Ok).setEnabled( |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
54 | bool(self.crashedSessionsList.selectedItems()) |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
55 | ) |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
56 | |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
57 | def __addSessionFileEntry(self, sessionFile): |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
58 | """ |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
59 | Private method to read the given session file and add a list entry for it. |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
60 | |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
61 | @param sessionFile file name of the session to be read |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
62 | @type str |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
63 | """ |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
64 | if os.path.exists(sessionFile): |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
65 | try: |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
66 | with open(sessionFile, "r") as f: |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
67 | jsonString = f.read() |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
68 | sessionDict = json.loads(jsonString) |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
69 | except (OSError, json.JSONDecodeError) as err: |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
70 | EricMessageBox.critical( |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
71 | None, |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
72 | self.tr("Read Crash Session"), |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
73 | self.tr( |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
74 | "<p>The crash session file <b>{0}</b> could not be read.</p>" |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
75 | "<p>Reason: {1}</p>" |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
76 | ).format(sessionFile, str(err)), |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
77 | ) |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
78 | |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
79 | mtime = os.path.getmtime(sessionFile) |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
80 | timestamp = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(mtime)) |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
81 | if sessionDict["Project"]: |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
82 | labelText = self.tr( |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
83 | "{0}\nTimestamp: {1}\nProject: {2}", |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
84 | "Crash Session, Timestamp, Project Path", |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
85 | ).format(sessionFile, timestamp, sessionDict["Project"]) |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
86 | else: |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
87 | labelText = self.tr( |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
88 | "{0}\nTimestamp: {1}", "Crash Session, Timestamp" |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
89 | ).format(sessionFile, timestamp) |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
90 | itm = QListWidgetItem(labelText, self.crashedSessionsList) |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
91 | itm.setData(Qt.ItemDataRole.UserRole, sessionFile) |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
92 | |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
93 | def getSelectedCrashSession(self): |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
94 | """ |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
95 | Public method to get the selected crash session file name. |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
96 | |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
97 | @return file name of the selected crash session |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
98 | @rtype str |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
99 | """ |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
100 | # TODO: not implemented yet |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
101 | selectedItems = self.crashedSessionsList.selectedItems() |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
102 | |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
103 | if selectedItems: |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
104 | return selectedItems[0].data(Qt.ItemDataRole.UserRole) |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
105 | else: |
9271719f43a7
Modified the display of the crash session dialog to show the time stamp of the found crash session file and the path of the project file (if a project was open) (see issue584).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
106 | return None |