eric6/Plugins/VcsPlugins/vcsMercurial/HgDialog.py

branch
maintenance
changeset 8176
31965986ecd1
parent 8142
43248bafe9b2
parent 8143
2c730d5fd177
child 8273
698ae46f40a4
diff -r e01ae92db699 -r 31965986ecd1 eric6/Plugins/VcsPlugins/vcsMercurial/HgDialog.py
--- a/eric6/Plugins/VcsPlugins/vcsMercurial/HgDialog.py	Sat Mar 06 10:00:52 2021 +0100
+++ b/eric6/Plugins/VcsPlugins/vcsMercurial/HgDialog.py	Sun Mar 28 15:00:11 2021 +0200
@@ -36,10 +36,12 @@
         """
         super(HgDialog, self).__init__(parent)
         self.setupUi(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.username = ''
         self.password = ''
@@ -55,11 +57,15 @@
         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.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)
         
         if (
             Preferences.getVCS("AutoClose") and
@@ -74,9 +80,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.vcs.getClient().cancel()
     
     def startProcess(self, args, showArgs=True, environment=None, client=None):
@@ -207,7 +217,7 @@
         """
         self.inputGroup.show()
         self.input.setMaxLength(size)
-        self.input.setFocus(Qt.OtherFocusReason)
+        self.input.setFocus(Qt.FocusReason.OtherFocusReason)
 
         self.resultbox.ensureCursorVisible()
         self.errors.ensureCursorVisible()

eric ide

mercurial