eric6/Plugins/VcsPlugins/vcsPySvn/SvnLoginDialog.py

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

eric ide

mercurial