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

# Copyright (c) 2002, 2003 Detlev Offenbach <detlev@die-offenbachs.de>
#

"""
Module implementing a dialog to enter the logout data for a VCS system.
"""

from qt import *

from LogoutForm import vcsLogoutForm
from Config import ConfigVcsAuthSystems

class vcsLogoutDialog(vcsLogoutForm):
    """
    Class implementing a dialog to enter the logout data for a VCS system.
    """
    def __init__(self, parent=None):
        """
        Constructor
        
        Arguments
        
            parent -- parent widget (QWidget)
        """
        vcsLogoutForm.__init__(self, parent, None, 1)
        
        vcsSystems = QStringList()
        for vcssys in ConfigVcsAuthSystems:
            vcsSystems.append(vcssys)
        self.vcsComboBox.insertStringList(vcsSystems)
        
        dummy = self.trUtf8('dummy')
        
    def getData(self):
        """
        Public slot to retrieve the data entered into the dialog.
        
        Returns
        
            a tuple of 4 strings (vcs system, username, 
            remote hostname and repository).
        """
        return (str(self.vcsComboBox.currentText()),
            str(self.usernameEdit.text()),
            str(self.hostEdit.text()),
            str(self.repositoryEdit.text())
        )
