RefactoringRope/ChangesPreviewDialog.py

branch
eric7
changeset 365
f740b50380df
parent 347
b5048b5ff454
child 374
958f34e97952
equal deleted inserted replaced
364:a92b3272f4c1 365:f740b50380df
5 5
6 """ 6 """
7 Module implementing the Changes preview dialog. 7 Module implementing the Changes preview dialog.
8 """ 8 """
9 9
10 from PyQt5.QtCore import Qt, pyqtSlot 10 from PyQt6.QtCore import Qt, pyqtSlot
11 from PyQt5.QtWidgets import QDialogButtonBox, QListWidgetItem 11 from PyQt6.QtWidgets import QDialogButtonBox, QListWidgetItem
12 12
13 from .PreviewDialogBase import PreviewDialogBase 13 from .PreviewDialogBase import PreviewDialogBase
14 14
15 15
16 class ChangesPreviewDialog(PreviewDialogBase): 16 class ChangesPreviewDialog(PreviewDialogBase):
17 """ 17 """
18 Class implementing the Changes preview dialog. 18 Class implementing the Changes preview dialog.
19 """ 19 """
20 ChangeRole = Qt.UserRole 20 ChangeRole = Qt.ItemDataRole.UserRole
21 21
22 def __init__(self, description, changes, parent): 22 def __init__(self, description, changes, parent):
23 """ 23 """
24 Constructor 24 Constructor
25 25
31 @type QWidget 31 @type QWidget
32 """ 32 """
33 PreviewDialogBase.__init__(self, parent) 33 PreviewDialogBase.__init__(self, parent)
34 34
35 self.buttonBox.addButton( 35 self.buttonBox.addButton(
36 self.tr("&Apply Changes"), QDialogButtonBox.AcceptRole) 36 self.tr("&Apply Changes"), QDialogButtonBox.ButtonRole.AcceptRole)
37 self.buttonBox.addButton(QDialogButtonBox.Cancel) 37 self.buttonBox.addButton(QDialogButtonBox.StandardButton.Cancel)
38 38
39 self.description.setText(description) 39 self.description.setText(description)
40 for changeTitle, changeText in changes: 40 for changeTitle, changeText in changes:
41 itm = QListWidgetItem(changeTitle, self.changesList) 41 itm = QListWidgetItem(changeTitle, self.changesList)
42 if changeText is None: 42 if changeText is None:

eric ide

mercurial