eric7/Plugins/VcsPlugins/vcsPySvn/SvnLoginDialog.py

branch
eric7
changeset 8312
800c432b34c8
parent 8218
7c09585bd960
child 8318
962bce857696
equal deleted inserted replaced
8311:4e8b98454baa 8312:800c432b34c8
1 # -*- coding: utf-8 -*-
2
3 # Copyright (c) 2006 - 2021 Detlev Offenbach <detlev@die-offenbachs.de>
4 #
5
6 """
7 Module implementing the login dialog for pysvn.
8 """
9
10 from PyQt5.QtWidgets import QDialog
11
12 from .Ui_SvnLoginDialog import Ui_SvnLoginDialog
13
14
15 class SvnLoginDialog(QDialog, Ui_SvnLoginDialog):
16 """
17 Class implementing the login dialog for pysvn.
18 """
19 def __init__(self, realm, username, may_save, parent=None):
20 """
21 Constructor
22
23 @param realm name of the realm of the requested credentials (string)
24 @param username username as supplied by subversion (string)
25 @param may_save flag indicating, that subversion is willing to save
26 the answers returned (boolean)
27 @param parent reference to the parent widget (QWidget)
28 """
29 super().__init__(parent)
30 self.setupUi(self)
31
32 self.realmLabel.setText(
33 self.tr("<b>Enter login data for realm {0}.</b>")
34 .format(realm))
35 self.usernameEdit.setText(username)
36 self.saveCheckBox.setEnabled(may_save)
37 if not may_save:
38 self.saveCheckBox.setChecked(False)
39
40 msh = self.minimumSizeHint()
41 self.resize(max(self.width(), msh.width()), msh.height())
42
43 def getData(self):
44 """
45 Public method to retrieve the login data.
46
47 @return tuple of three values (username, password, save)
48 """
49 return (self.usernameEdit.text(),
50 self.passwordEdit.text(),
51 self.saveCheckBox.isChecked())

eric ide

mercurial