Plugins/VcsPlugins/vcsPySvn/SvnLoginDialog.py

changeset 0
de9c2efb9d02
child 12
1d8dd9706f46
equal deleted inserted replaced
-1:000000000000 0:de9c2efb9d02
1 # -*- coding: utf-8 -*-
2
3 # Copyright (c) 2006 - 2009 Detlev Offenbach <detlev@die-offenbachs.de>
4 #
5
6 """
7 Module implementing the login dialog for pysvn.
8 """
9
10 from PyQt4.QtGui import QDialog
11
12 from Ui_SvnLoginDialog import Ui_SvnLoginDialog
13
14 class SvnLoginDialog(QDialog, Ui_SvnLoginDialog):
15 """
16 Class implementing the login dialog for pysvn.
17 """
18 def __init__(self, realm, username, may_save, parent = None):
19 """
20 Constructor
21
22 @param realm name of the realm of the requested credentials (string)
23 @param username username as supplied by subversion (string)
24 @param may_save flag indicating, that subversion is willing to save
25 the answers returned (boolean)
26 """
27 QDialog.__init__(self, parent)
28 self.setupUi(self)
29
30 self.realmLabel.setText(self.trUtf8("<b>Enter login data for realm {0}.</b>")\
31 .format(realm))
32 self.usernameEdit.setText(username)
33 self.saveCheckBox.setEnabled(may_save)
34 if not may_save:
35 self.saveCheckBox.setChecked(False)
36
37 def getData(self):
38 """
39 Public method to retrieve the login data.
40
41 @return tuple of three values (username, password, save)
42 """
43 return (self.usernameEdit.text(),
44 self.passwordEdit.text(),
45 self.saveCheckBox.isChecked())

eric ide

mercurial