76 """ |
76 """ |
77 if current is None: |
77 if current is None: |
78 return |
78 return |
79 |
79 |
80 self.previewEdit.clear() |
80 self.previewEdit.clear() |
81 id = current.data(HistoryDialog.ChangeIDRole) |
81 changeId = current.data(HistoryDialog.ChangeIDRole) |
82 change = self.__changes[id] |
82 change = self.__changes[changeId] |
83 for line in change.get_description().splitlines(True): |
83 for line in change.get_description().splitlines(True): |
84 try: |
84 try: |
85 format = self.formats[line[0]] |
85 charFormat = self.formats[line[0]] |
86 except (IndexError, KeyError): |
86 except (IndexError, KeyError): |
87 format = self.formats[' '] |
87 charFormat = self.formats[' '] |
88 self._appendText(line, format) |
88 self._appendText(line, charFormat) |
89 |
89 |
90 def accept(self): |
90 def accept(self): |
91 """ |
91 """ |
92 Public slot to undo the selected set of changes. |
92 Public slot to undo the selected set of changes. |
93 """ |
93 """ |
94 id = self.changesList.currentItem()\ |
94 changeId = self.changesList.currentItem()\ |
95 .data(HistoryDialog.ChangeIDRole) |
95 .data(HistoryDialog.ChangeIDRole) |
96 change = self.__changes[id] |
96 change = self.__changes[changeId] |
97 |
97 |
98 if self.__isUndo: |
98 if self.__isUndo: |
99 res = E5MessageBox.yesNo( |
99 res = E5MessageBox.yesNo( |
100 None, |
100 None, |
101 self.tr("Undo refactorings"), |
101 self.tr("Undo refactorings"), |