Plugins/VcsPlugins/vcsPySvn/SvnLoginDialog.py

changeset 0
de9c2efb9d02
child 12
1d8dd9706f46
diff -r 000000000000 -r de9c2efb9d02 Plugins/VcsPlugins/vcsPySvn/SvnLoginDialog.py
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Plugins/VcsPlugins/vcsPySvn/SvnLoginDialog.py	Mon Dec 28 16:03:33 2009 +0000
@@ -0,0 +1,45 @@
+# -*- coding: utf-8 -*-
+
+# Copyright (c) 2006 - 2009 Detlev Offenbach <detlev@die-offenbachs.de>
+#
+
+"""
+Module implementing the login dialog for pysvn.
+"""
+
+from PyQt4.QtGui import QDialog
+
+from Ui_SvnLoginDialog import Ui_SvnLoginDialog
+
+class SvnLoginDialog(QDialog, Ui_SvnLoginDialog):
+    """
+    Class implementing the login dialog for pysvn.
+    """
+    def __init__(self, realm, username, may_save, parent = None):
+        """
+        Constructor
+        
+        @param realm name of the realm of the requested credentials (string)
+        @param username username as supplied by subversion (string)
+        @param may_save flag indicating, that subversion is willing to save
+            the answers returned (boolean)
+        """
+        QDialog.__init__(self, parent)
+        self.setupUi(self)
+        
+        self.realmLabel.setText(self.trUtf8("<b>Enter login data for realm {0}.</b>")\
+                                .format(realm))
+        self.usernameEdit.setText(username)
+        self.saveCheckBox.setEnabled(may_save)
+        if not may_save:
+            self.saveCheckBox.setChecked(False)
+        
+    def getData(self):
+        """
+        Public method to retrieve the login data.
+        
+        @return tuple of three values (username, password, save)
+        """
+        return (self.usernameEdit.text(),
+               self.passwordEdit.text(),
+               self.saveCheckBox.isChecked())

eric ide

mercurial