Plugins/VcsPlugins/vcsPySvn/SvnLoginDialog.py

Wed, 02 Jan 2013 10:31:48 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Wed, 02 Jan 2013 10:31:48 +0100
changeset 2302
f29e9405c851
parent 1509
c0b5e693b0eb
child 2525
8b507a9a2d40
child 2963
745d38097b7f
child 3163
9f50365a0870
permissions
-rw-r--r--

Updated copyright for 2013.

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

# Copyright (c) 2006 - 2013 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)
        """
        super().__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