src/eric7/UI/AuthenticationDialog.py

branch
eric7
changeset 9221
bf71ee032bb4
parent 9209
b99e7fd55fd3
child 9653
e67609152c5e
equal deleted inserted replaced
9220:e9e7eca7efee 9221:bf71ee032bb4
14 14
15 class AuthenticationDialog(QDialog, Ui_AuthenticationDialog): 15 class AuthenticationDialog(QDialog, Ui_AuthenticationDialog):
16 """ 16 """
17 Class implementing the authentication dialog for the help browser. 17 Class implementing the authentication dialog for the help browser.
18 """ 18 """
19 def __init__(self, info, username, showSave=False, saveIt=False, 19
20 parent=None): 20 def __init__(self, info, username, showSave=False, saveIt=False, parent=None):
21 """ 21 """
22 Constructor 22 Constructor
23 23
24 @param info information to be shown (string) 24 @param info information to be shown (string)
25 @param username username as supplied by subversion (string) 25 @param username username as supplied by subversion (string)
26 @param showSave flag to indicate to show the save checkbox (boolean) 26 @param showSave flag to indicate to show the save checkbox (boolean)
27 @param saveIt flag indicating the value for the save checkbox (boolean) 27 @param saveIt flag indicating the value for the save checkbox (boolean)
28 @param parent reference to the parent widget (QWidget) 28 @param parent reference to the parent widget (QWidget)
29 """ 29 """
30 super().__init__(parent) 30 super().__init__(parent)
31 self.setupUi(self) 31 self.setupUi(self)
32 32
33 self.infoLabel.setText(info) 33 self.infoLabel.setText(info)
34 self.usernameEdit.setText(username) 34 self.usernameEdit.setText(username)
35 self.saveCheckBox.setVisible(showSave) 35 self.saveCheckBox.setVisible(showSave)
36 self.saveCheckBox.setChecked(saveIt) 36 self.saveCheckBox.setChecked(saveIt)
37 37
38 self.iconLabel.setText("") 38 self.iconLabel.setText("")
39 self.iconLabel.setPixmap( 39 self.iconLabel.setPixmap(
40 self.style().standardIcon( 40 self.style()
41 QStyle.StandardPixmap.SP_MessageBoxQuestion) 41 .standardIcon(QStyle.StandardPixmap.SP_MessageBoxQuestion)
42 .pixmap(32, 32)) 42 .pixmap(32, 32)
43 43 )
44
44 msh = self.minimumSizeHint() 45 msh = self.minimumSizeHint()
45 self.resize(max(self.width(), msh.width()), msh.height()) 46 self.resize(max(self.width(), msh.width()), msh.height())
46 47
47 def setData(self, username, password): 48 def setData(self, username, password):
48 """ 49 """
49 Public method to set the login data. 50 Public method to set the login data.
50 51
51 @param username username (string) 52 @param username username (string)
52 @param password password (string) 53 @param password password (string)
53 """ 54 """
54 self.usernameEdit.setText(username) 55 self.usernameEdit.setText(username)
55 self.passwordEdit.setText(password) 56 self.passwordEdit.setText(password)
56 57
57 def getData(self): 58 def getData(self):
58 """ 59 """
59 Public method to retrieve the login data. 60 Public method to retrieve the login data.
60 61
61 @return tuple of two string values (username, password) 62 @return tuple of two string values (username, password)
62 """ 63 """
63 return (self.usernameEdit.text(), self.passwordEdit.text()) 64 return (self.usernameEdit.text(), self.passwordEdit.text())
64 65
65 def shallSave(self): 66 def shallSave(self):
66 """ 67 """
67 Public method to check, if the login data shall be saved. 68 Public method to check, if the login data shall be saved.
68 69
69 @return flag indicating that the login data shall be saved (boolean) 70 @return flag indicating that the login data shall be saved (boolean)
70 """ 71 """
71 return self.saveCheckBox.isChecked() 72 return self.saveCheckBox.isChecked()

eric ide

mercurial