eric6/Plugins/VcsPlugins/vcsGit/GitRemoteRepositoriesDialog.py

changeset 8143
2c730d5fd177
parent 7923
91e843545d9a
child 8218
7c09585bd960
--- a/eric6/Plugins/VcsPlugins/vcsGit/GitRemoteRepositoriesDialog.py	Mon Mar 01 17:48:43 2021 +0100
+++ b/eric6/Plugins/VcsPlugins/vcsGit/GitRemoteRepositoriesDialog.py	Tue Mar 02 17:17:09 2021 +0100
@@ -43,17 +43,19 @@
         self.process.readyReadStandardError.connect(self.__readStderr)
         
         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 repositories display"))
         self.refreshButton.setEnabled(False)
-        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.__lastColumn = self.repolist.columnCount()
         
         self.repolist.headerItem().setText(self.__lastColumn, "")
-        self.repolist.header().setSortIndicator(0, Qt.AscendingOrder)
+        self.repolist.header().setSortIndicator(0, Qt.SortOrder.AscendingOrder)
         
         self.__ioEncoding = Preferences.getSystem("IOEncoding")
     
@@ -69,7 +71,8 @@
         """
         Private method to resize the list columns.
         """
-        self.repolist.header().resizeSections(QHeaderView.ResizeToContents)
+        self.repolist.header().resizeSections(
+            QHeaderView.ResizeMode.ResizeToContents)
         self.repolist.header().setStretchLastSection(True)
     
     def __generateItem(self, name, url, oper):
@@ -80,7 +83,8 @@
         @param url URL of the remote repository (string)
         @param oper operation the remote repository may be used for (string)
         """
-        foundItems = self.repolist.findItems(name, Qt.MatchExactly, 0)
+        foundItems = self.repolist.findItems(
+            name, Qt.MatchFlag.MatchExactly, 0)
         if foundItems:
             # modify the operations column only
             foundItems[0].setText(
@@ -96,7 +100,7 @@
         """
         if (
             self.process is not None and
-            self.process.state() != QProcess.NotRunning
+            self.process.state() != QProcess.ProcessState.NotRunning
         ):
             self.process.terminate()
             QTimer.singleShot(2000, self.process.kill)
@@ -149,9 +153,12 @@
                     'Ensure, that it is in the search path.'
                 ).format('git'))
         else:
-            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.inputGroup.setEnabled(True)
             self.inputGroup.show()
@@ -164,7 +171,7 @@
         """
         if (
             self.process is not None and
-            self.process.state() != QProcess.NotRunning
+            self.process.state() != QProcess.ProcessState.NotRunning
         ):
             self.process.terminate()
             QTimer.singleShot(2000, self.process.kill)
@@ -174,11 +181,15 @@
         self.inputGroup.hide()
         self.refreshButton.setEnabled(True)
         
-        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.Close).setFocus(
-            Qt.OtherFocusReason)
+        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.buttonBox.button(
+            QDialogButtonBox.StandardButton.Close).setFocus(
+                Qt.FocusReason.OtherFocusReason)
         
         self.__resort()
         self.__resizeColumns()
@@ -191,9 +202,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()
         elif button == self.refreshButton:
             self.on_refreshButton_clicked()
@@ -215,7 +230,7 @@
         the contents pane.
         """
         if self.process is not None:
-            self.process.setReadChannel(QProcess.StandardOutput)
+            self.process.setReadChannel(QProcess.ProcessChannel.StandardOutput)
             
             while self.process.canReadLine():
                 line = str(self.process.readLine(), self.__ioEncoding,
@@ -247,9 +262,9 @@
         @param isOn flag indicating the status of the check box (boolean)
         """
         if isOn:
-            self.input.setEchoMode(QLineEdit.Password)
+            self.input.setEchoMode(QLineEdit.EchoMode.Password)
         else:
-            self.input.setEchoMode(QLineEdit.Normal)
+            self.input.setEchoMode(QLineEdit.EchoMode.Normal)
     
     @pyqtSlot()
     def on_sendButton_clicked(self):

eric ide

mercurial