eric6/Plugins/VcsPlugins/vcsMercurial/HgClientPromptDialog.py

changeset 8143
2c730d5fd177
parent 7923
91e843545d9a
child 8218
7c09585bd960
equal deleted inserted replaced
8141:27f636beebad 8143:2c730d5fd177
27 @param parent reference to the parent widget (QWidget) 27 @param parent reference to the parent widget (QWidget)
28 """ 28 """
29 super(HgClientPromptDialog, self).__init__(parent) 29 super(HgClientPromptDialog, self).__init__(parent)
30 self.setupUi(self) 30 self.setupUi(self)
31 31
32 self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(False) 32 self.buttonBox.button(
33 QDialogButtonBox.StandardButton.Ok).setEnabled(False)
33 34
34 self.inputEdit.setMaxLength(size) 35 self.inputEdit.setMaxLength(size)
35 self.messageEdit.setPlainText(message) 36 self.messageEdit.setPlainText(message)
36 37
37 tc = self.messageEdit.textCursor() 38 tc = self.messageEdit.textCursor()
38 tc.movePosition(QTextCursor.End) 39 tc.movePosition(QTextCursor.MoveOperation.End)
39 self.messageEdit.setTextCursor(tc) 40 self.messageEdit.setTextCursor(tc)
40 self.messageEdit.ensureCursorVisible() 41 self.messageEdit.ensureCursorVisible()
41 42
42 self.inputEdit.setFocus(Qt.OtherFocusReason) 43 self.inputEdit.setFocus(Qt.FocusReason.OtherFocusReason)
43 44
44 @pyqtSlot(str) 45 @pyqtSlot(str)
45 def on_inputEdit_textChanged(self, txt): 46 def on_inputEdit_textChanged(self, txt):
46 """ 47 """
47 Private slot to handle changes of the user input. 48 Private slot to handle changes of the user input.
48 49
49 @param txt text entered by the user (string) 50 @param txt text entered by the user (string)
50 """ 51 """
51 self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(bool(txt)) 52 self.buttonBox.button(
53 QDialogButtonBox.StandardButton.Ok).setEnabled(bool(txt))
52 54
53 @pyqtSlot(bool) 55 @pyqtSlot(bool)
54 def on_passwordCheckBox_toggled(self, isOn): 56 def on_passwordCheckBox_toggled(self, isOn):
55 """ 57 """
56 Private slot to handle the password checkbox toggled. 58 Private slot to handle the password checkbox toggled.
57 59
58 @param isOn flag indicating the status of the check box (boolean) 60 @param isOn flag indicating the status of the check box (boolean)
59 """ 61 """
60 if isOn: 62 if isOn:
61 self.inputEdit.setEchoMode(QLineEdit.Password) 63 self.inputEdit.setEchoMode(QLineEdit.EchoMode.Password)
62 else: 64 else:
63 self.inputEdit.setEchoMode(QLineEdit.Normal) 65 self.inputEdit.setEchoMode(QLineEdit.EchoMode.Normal)
64 66
65 def getInput(self): 67 def getInput(self):
66 """ 68 """
67 Public method to get the user input. 69 Public method to get the user input.
68 70

eric ide

mercurial