RefactoringRope/ChangesPreviewDialog.py

branch
server_client_variant
changeset 172
c8890f852917
parent 151
5260100b6700
child 203
c38750e1bafd
--- a/RefactoringRope/ChangesPreviewDialog.py	Sun Sep 17 20:03:39 2017 +0200
+++ b/RefactoringRope/ChangesPreviewDialog.py	Mon Sep 18 20:05:28 2017 +0200
@@ -21,13 +21,16 @@
     """
     ChangeRole = Qt.UserRole
     
-    def __init__(self, changes, parent):
+    def __init__(self, description, changes, parent):
         """
         Constructor
         
-        @param changes reference to the Changes object
-            (rope.base.change.ChangeSet)
-        @param parent reference to the parent widget (QWidget)
+        @param description description of the changes
+        @type str
+        @param changes list of lists containing the change data
+        @type list of list of (str, str)
+        @param parent reference to the parent widget
+        @type QWidget
         """
         PreviewDialogBase.__init__(self, parent)
         
@@ -35,15 +38,12 @@
             self.tr("&Apply Changes"), QDialogButtonBox.AcceptRole)
         self.buttonBox.addButton(QDialogButtonBox.Cancel)
         
-        self.description.setText(changes.description)
-        for change in changes.changes:
-            itm = QListWidgetItem(str(change), self.changesList)
-            try:
-                changeDescription = change.get_description()
-            except AttributeError:
-                changeDescription = self.tr("No changes available.")
-            itm.setData(ChangesPreviewDialog.ChangeRole,
-                        changeDescription)
+        self.description.setText(description)
+        for changeTitle, changeText in changes:
+            itm = QListWidgetItem(changeTitle, self.changesList)
+            if changeText is None:
+                changeText = self.tr("No changes available.")
+            itm.setData(ChangesPreviewDialog.ChangeRole, changeText)
         if self.changesList.count():
             self.changesList.item(0).setSelected(True)
     
@@ -52,8 +52,10 @@
         """
         Private slot called when a change is selected.
         
-        @param current reference to the new current item (QListWidgetItem)
-        @param previous reference to the old current item (QListWidgetItem)
+        @param current reference to the new current item
+        @type QListWidgetItem
+        @param previous reference to the old current item
+        @type QListWidgetItem
         """
         if current is None:
             return

eric ide

mercurial