Plugins/VcsPlugins/vcsMercurial/HgClientPromptDialog.py

changeset 4471
2dedc0c4a8fa
parent 4021
195a471c327b
child 4475
dde2aa51ac0b
equal deleted inserted replaced
4470:0a8b94711aea 4471:2dedc0c4a8fa
9 9
10 from __future__ import unicode_literals 10 from __future__ import unicode_literals
11 11
12 from PyQt5.QtCore import pyqtSlot 12 from PyQt5.QtCore import pyqtSlot
13 from PyQt5.QtGui import QTextCursor 13 from PyQt5.QtGui import QTextCursor
14 from PyQt5.QtWidgets import QDialog, QDialogButtonBox 14 from PyQt5.QtWidgets import QDialog, QDialogButtonBox, QLineEdit
15 15
16 from .Ui_HgClientPromptDialog import Ui_HgClientPromptDialog 16 from .Ui_HgClientPromptDialog import Ui_HgClientPromptDialog
17 17
18 18
19 class HgClientPromptDialog(QDialog, Ui_HgClientPromptDialog): 19 class HgClientPromptDialog(QDialog, Ui_HgClientPromptDialog):
48 48
49 @param txt text entered by the user (string) 49 @param txt text entered by the user (string)
50 """ 50 """
51 self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(bool(txt)) 51 self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(bool(txt))
52 52
53 @pyqtSlot(bool)
54 def on_passwordCheckBox_toggled(self, isOn):
55 """
56 Private slot to handle the password checkbox toggled.
57
58 @param isOn flag indicating the status of the check box (boolean)
59 """
60 if isOn:
61 self.inputEdit.setEchoMode(QLineEdit.Password)
62 else:
63 self.inputEdit.setEchoMode(QLineEdit.Normal)
64
53 def getInput(self): 65 def getInput(self):
54 """ 66 """
55 Public method to get the user input. 67 Public method to get the user input.
56 68
57 @return user input (string) 69 @return user input (string)
58 """ 70 """
59 return self.inputEdit.text() 71 return self.inputEdit.text()
72
73 def isPassword(self):
74 """
75 Public method to check, if the input was a password.
76
77 @return flag indicating a password
78 @rtype bool
79 """
80 return self.passwordCheckBox.isChecked()

eric ide

mercurial