32 self.setupUi(self) |
32 self.setupUi(self) |
33 |
33 |
34 self.historyList.addItems(history) |
34 self.historyList.addItems(history) |
35 for row in range(self.historyList.count()): |
35 for row in range(self.historyList.count()): |
36 itm = self.historyList.item(row) |
36 itm = self.historyList.item(row) |
37 flags = itm.flags() | Qt.ItemIsEditable |
37 flags = itm.flags() | Qt.ItemFlag.ItemIsEditable |
38 itm.setFlags(flags) |
38 itm.setFlags(flags) |
39 |
39 |
40 self.__updateEditButtons() |
40 self.__updateEditButtons() |
41 |
41 |
42 def __updateEditButtons(self): |
42 def __updateEditButtons(self): |
63 itm = self.historyList.selectedItems()[0] |
63 itm = self.historyList.selectedItems()[0] |
64 historyText, ok = QInputDialog.getText( |
64 historyText, ok = QInputDialog.getText( |
65 self, |
65 self, |
66 self.tr("Edit History Entry"), |
66 self.tr("Edit History Entry"), |
67 self.tr("Enter the new text:"), |
67 self.tr("Enter the new text:"), |
68 QLineEdit.Normal, |
68 QLineEdit.EchoMode.Normal, |
69 itm.text()) |
69 itm.text()) |
70 if ok: |
70 if ok: |
71 itm.setText(historyText) |
71 itm.setText(historyText) |
72 |
72 |
73 @pyqtSlot() |
73 @pyqtSlot() |