eric6/Plugins/VcsPlugins/vcsPySvn/SvnTagBranchListDialog.py

changeset 8143
2c730d5fd177
parent 7923
91e843545d9a
child 8218
7c09585bd960
--- a/eric6/Plugins/VcsPlugins/vcsPySvn/SvnTagBranchListDialog.py	Mon Mar 01 17:48:43 2021 +0100
+++ b/eric6/Plugins/VcsPlugins/vcsPySvn/SvnTagBranchListDialog.py	Tue Mar 02 17:17:09 2021 +0100
@@ -43,15 +43,17 @@
         super(SvnTagBranchListDialog, self).__init__(parent)
         self.setupUi(self)
         SvnDialogMixin.__init__(self)
-        self.setWindowFlags(Qt.Window)
+        self.setWindowFlags(Qt.WindowType.Window)
         
-        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.vcs = vcs
         
         self.tagList.headerItem().setText(self.tagList.columnCount(), "")
-        self.tagList.header().setSortIndicator(3, Qt.AscendingOrder)
+        self.tagList.header().setSortIndicator(3, Qt.SortOrder.AscendingOrder)
         
         self.client = self.vcs.getClient()
         self.client.callback_cancel = self._clientCancelCallback
@@ -118,7 +120,7 @@
                 self.tr("Subversion List"),
                 self.tr("Enter the repository URL containing the"
                         " tags or branches"),
-                QLineEdit.Normal,
+                QLineEdit.EchoMode.Normal,
                 self.vcs.svnNormalizeURL(reposURL))
             if not ok:
                 self.close()
@@ -170,9 +172,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.__resizeColumns()
         self.__resort()
@@ -185,9 +190,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.__finish()
         
     def __showError(self, msg):
@@ -212,7 +221,8 @@
         """
         Private method to resize the list columns.
         """
-        self.tagList.header().resizeSections(QHeaderView.ResizeToContents)
+        self.tagList.header().resizeSections(
+            QHeaderView.ResizeMode.ResizeToContents)
         self.tagList.header().setStretchLastSection(True)
         
     def __generateItem(self, revision, author, date, name):
@@ -225,11 +235,11 @@
         @param name name (path) of the tag (string)
         """
         itm = QTreeWidgetItem(self.tagList)
-        itm.setData(0, Qt.DisplayRole, revision)
-        itm.setData(1, Qt.DisplayRole, author)
-        itm.setData(2, Qt.DisplayRole, date)
-        itm.setData(3, Qt.DisplayRole, name)
-        itm.setTextAlignment(0, Qt.AlignRight)
+        itm.setData(0, Qt.ItemDataRole.DisplayRole, revision)
+        itm.setData(1, Qt.ItemDataRole.DisplayRole, author)
+        itm.setData(2, Qt.ItemDataRole.DisplayRole, date)
+        itm.setData(3, Qt.ItemDataRole.DisplayRole, name)
+        itm.setTextAlignment(0, Qt.AlignmentFlag.AlignRight)
         
     def getTagList(self):
         """

eric ide

mercurial