eric6/Plugins/VcsPlugins/vcsMercurial/HgConflictsListDialog.py

changeset 8143
2c730d5fd177
parent 7970
c4ee8a81584c
child 8218
7c09585bd960
--- a/eric6/Plugins/VcsPlugins/vcsMercurial/HgConflictsListDialog.py	Mon Mar 01 17:48:43 2021 +0100
+++ b/eric6/Plugins/VcsPlugins/vcsMercurial/HgConflictsListDialog.py	Tue Mar 02 17:17:09 2021 +0100
@@ -26,8 +26,8 @@
     Class implementing a dialog to show a list of files which had or still
     have conflicts.
     """
-    StatusRole = Qt.UserRole + 1
-    FilenameRole = Qt.UserRole + 2
+    StatusRole = Qt.ItemDataRole.UserRole + 1
+    FilenameRole = Qt.ItemDataRole.UserRole + 2
     
     def __init__(self, vcs, parent=None):
         """
@@ -41,15 +41,18 @@
         
         self.__position = QPoint()
         
-        self.buttonBox.button(QDialogButtonBox.Close).setEnabled(False)
-        self.buttonBox.button(QDialogButtonBox.Cancel).setDefault(True)
+        self.buttonBox.button(
+            QDialogButtonBox.StandardButton.Close).setEnabled(False)
+        self.buttonBox.button(
+            QDialogButtonBox.StandardButton.Cancel).setDefault(True)
         
         self.conflictsList.headerItem().setText(
             self.conflictsList.columnCount(), "")
-        self.conflictsList.header().setSortIndicator(0, Qt.AscendingOrder)
+        self.conflictsList.header().setSortIndicator(
+            0, Qt.SortOrder.AscendingOrder)
         
         self.refreshButton = self.buttonBox.addButton(
-            self.tr("&Refresh"), QDialogButtonBox.ActionRole)
+            self.tr("&Refresh"), QDialogButtonBox.ButtonRole.ActionRole)
         self.refreshButton.setToolTip(
             self.tr("Press to refresh the list of conflicts"))
         self.refreshButton.setEnabled(False)
@@ -119,9 +122,12 @@
         Private slot called when the process finished or the user pressed
         the button.
         """
-        self.buttonBox.button(QDialogButtonBox.Close).setEnabled(True)
-        self.buttonBox.button(QDialogButtonBox.Cancel).setEnabled(False)
-        self.buttonBox.button(QDialogButtonBox.Close).setDefault(True)
+        self.buttonBox.button(
+            QDialogButtonBox.StandardButton.Close).setEnabled(True)
+        self.buttonBox.button(
+            QDialogButtonBox.StandardButton.Cancel).setEnabled(False)
+        self.buttonBox.button(
+            QDialogButtonBox.StandardButton.Close).setDefault(True)
         
         self.refreshButton.setEnabled(True)
         
@@ -136,9 +142,13 @@
         
         @param button button that was clicked (QAbstractButton)
         """
-        if button == self.buttonBox.button(QDialogButtonBox.Close):
+        if button == self.buttonBox.button(
+            QDialogButtonBox.StandardButton.Close
+        ):
             self.close()
-        elif button == self.buttonBox.button(QDialogButtonBox.Cancel):
+        elif button == self.buttonBox.button(
+            QDialogButtonBox.StandardButton.Cancel
+        ):
             self.__hgClient.cancel()
         elif button == self.refreshButton:
             self.on_refreshButton_clicked()
@@ -156,7 +166,7 @@
         Private method to resize the list columns.
         """
         self.conflictsList.header().resizeSections(
-            QHeaderView.ResizeToContents)
+            QHeaderView.ResizeMode.ResizeToContents)
         self.conflictsList.header().setStretchLastSection(True)
     
     def __generateItem(self, status, name):
@@ -202,9 +212,12 @@
         """
         Private slot to refresh the log.
         """
-        self.buttonBox.button(QDialogButtonBox.Close).setEnabled(False)
-        self.buttonBox.button(QDialogButtonBox.Cancel).setEnabled(True)
-        self.buttonBox.button(QDialogButtonBox.Cancel).setDefault(True)
+        self.buttonBox.button(
+            QDialogButtonBox.StandardButton.Close).setEnabled(False)
+        self.buttonBox.button(
+            QDialogButtonBox.StandardButton.Cancel).setEnabled(True)
+        self.buttonBox.button(
+            QDialogButtonBox.StandardButton.Cancel).setDefault(True)
         
         self.refreshButton.setEnabled(False)
         self.start()

eric ide

mercurial