38 |
38 |
39 self.historyList.addItems(history) |
39 self.historyList.addItems(history) |
40 index = shell.getHistoryIndex() |
40 index = shell.getHistoryIndex() |
41 if index < 0 or index >= len(history): |
41 if index < 0 or index >= len(history): |
42 self.historyList.setCurrentRow( |
42 self.historyList.setCurrentRow( |
43 self.historyList.count() - 1, QItemSelectionModel.Select) |
43 self.historyList.count() - 1, |
|
44 QItemSelectionModel.SelectionFlag.Select) |
44 else: |
45 else: |
45 self.historyList.setCurrentRow(index, QItemSelectionModel.Select) |
46 self.historyList.setCurrentRow( |
|
47 index, QItemSelectionModel.SelectionFlag.Select) |
46 self.historyList.scrollToItem(self.historyList.currentItem()) |
48 self.historyList.scrollToItem(self.historyList.currentItem()) |
47 |
49 |
48 @pyqtSlot() |
50 @pyqtSlot() |
49 def on_historyList_itemSelectionChanged(self): |
51 def on_historyList_itemSelectionChanged(self): |
50 """ |
52 """ |
124 |
126 |
125 self.historyList.clear() |
127 self.historyList.clear() |
126 self.historyList.addItems(history) |
128 self.historyList.addItems(history) |
127 if index < 0 or index >= len(history): |
129 if index < 0 or index >= len(history): |
128 self.historyList.setCurrentRow( |
130 self.historyList.setCurrentRow( |
129 self.historyList.count() - 1, QItemSelectionModel.Select) |
131 self.historyList.count() - 1, |
|
132 QItemSelectionModel.SelectionFlag.Select) |
130 else: |
133 else: |
131 self.historyList.setCurrentRow(index, QItemSelectionModel.Select) |
134 self.historyList.setCurrentRow( |
|
135 index, QItemSelectionModel.SelectionFlag.Select) |
132 self.historyList.scrollToItem(self.historyList.currentItem()) |
136 self.historyList.scrollToItem(self.historyList.currentItem()) |
133 |
137 |
134 self.historyList.setFocus(Qt.OtherFocusReason) |
138 self.historyList.setFocus(Qt.FocusReason.OtherFocusReason) |
135 |
139 |
136 def getHistory(self): |
140 def getHistory(self): |
137 """ |
141 """ |
138 Public method to retrieve the history from the dialog. |
142 Public method to retrieve the history from the dialog. |
139 |
143 |