Plugins/VcsPlugins/vcsPySvn/SvnLoginDialog.py

Sat, 14 Dec 2013 23:44:25 +0100

author
T.Rzepka <Tobias.Rzepka@gmail.com>
date
Sat, 14 Dec 2013 23:44:25 +0100
branch
Py2 comp.
changeset 3145
a9de05d4a22f
parent 3058
0a02c433f52d
child 3161
06f57a834adf
permissions
-rw-r--r--

# __IGNORE_WARNING__ added/ removed.

# -*- coding: utf-8 -*-

# Copyright (c) 2006 - 2013 Detlev Offenbach <detlev@die-offenbachs.de>
#

"""
Module implementing the login dialog for pysvn.
"""

from __future__ import unicode_literals

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)
        @param parent reference to the parent widget (QWidget)
        """
        super(SvnLoginDialog, self).__init__(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