kio Library API Documentation

KIO::PasswordDialog Class Reference

A dialog for requesting a login and a password from the end user. More...

#include <passdlg.h>

Inheritance diagram for KIO::PasswordDialog:

KDialogBase KDialog QDialog List of all members.

Public Member Functions

 PasswordDialog (const QString &prompt, const QString &user, bool enableKeep=false, bool modal=true, QWidget *parent=0, const char *name=0)
 Create a password dialog.

 ~PasswordDialog ()
 Destructor.

void setPrompt (const QString &prompt)
 Sets the prompt to show to the user.

void addCommentLine (const QString &label, const QString comment)
 Adds a comment line to the dialog.

QString password () const
 Returns the password entered by the user.

QString username () const
 Returns the username entered by the user.

bool keepPassword () const
 Determines whether supplied authorization should persist even after the application has been closed.

void setUserReadOnly (bool readOnly)
 Sets the username field read-only and sets the focus to the password field.

void setEnableUserField (bool enable, bool=false)
 This class or method is obsolete, it is provided for compatibility only..

void setPassword (const QString &password)
 Presets the password
Since:
3.1.



Static Public Member Functions

int getNameAndPassword (QString &user, QString &pass, bool *keep, const QString &prompt=QString::null, bool readOnly=false, const QString &caption=QString::null, const QString &comment=QString::null, const QString &label=QString::null)
 A convienence static method for obtaining authorization information from the end user.


Protected Member Functions

virtual void virtual_hook (int id, void *data)

Detailed Description

A dialog for requesting a login and a password from the end user.

KIO-Slave authors are encouraged to use SlaveBase::openPassDlg instead of directly instantiating this dialog.

Definition at line 35 of file passdlg.h.


Constructor & Destructor Documentation

PasswordDialog::PasswordDialog const QString prompt,
const QString user,
bool  enableKeep = false,
bool  modal = true,
QWidget parent = 0,
const char *  name = 0
 

Create a password dialog.

Parameters:
prompt instructional text to be shown.
user username, if known initially.
enableKeep if true, makes password persistent until KDE is shutdown.
modal if true, the dialog will be modal (default:true).
parent the parent widget (default:NULL).
name the dialog name (default:NULL).

Definition at line 51 of file passdlg.cpp.

References KStdAccel::name().

Referenced by getNameAndPassword().

PasswordDialog::~PasswordDialog  ) 
 

Destructor.

Definition at line 59 of file passdlg.cpp.


Member Function Documentation

void PasswordDialog::setPrompt const QString prompt  ) 
 

Sets the prompt to show to the user.

Definition at line 262 of file passdlg.cpp.

void PasswordDialog::addCommentLine const QString label,
const QString  comment
 

Adds a comment line to the dialog.

This function allows you to add one additional comment line to this widget. Calling this fucntion after a comment has already been added will not have any effect.

Parameters:
label label for comment (ex:"Command:")
comment the actual comment text.

Definition at line 223 of file passdlg.cpp.

References KStdAccel::label(), KDialogBase::mainWidget(), and QLabel::setAlignment().

Referenced by getNameAndPassword().

QString PasswordDialog::password  )  const
 

Returns the password entered by the user.

Definition at line 172 of file passdlg.cpp.

Referenced by getNameAndPassword().

QString PasswordDialog::username  )  const
 

Returns the username entered by the user.

Definition at line 167 of file passdlg.cpp.

Referenced by getNameAndPassword().

bool PasswordDialog::keepPassword  )  const
 

Determines whether supplied authorization should persist even after the application has been closed.

Definition at line 177 of file passdlg.cpp.

Referenced by getNameAndPassword().

void PasswordDialog::setUserReadOnly bool  readOnly  ) 
 

Sets the username field read-only and sets the focus to the password field.

Parameters:
readOnly 

Definition at line 274 of file passdlg.cpp.

Referenced by getNameAndPassword(), and setEnableUserField().

void KIO::PasswordDialog::setEnableUserField bool  enable,
bool  = false
[inline]
 

This class or method is obsolete, it is provided for compatibility only..

Use setUserReadOnly(bool).

Definition at line 103 of file passdlg.h.

References setUserReadOnly().

void PasswordDialog::setPassword const QString password  ) 
 

Presets the password

Since:
3.1.

Definition at line 269 of file passdlg.cpp.

int PasswordDialog::getNameAndPassword QString user,
QString pass,
bool *  keep,
const QString prompt = QString::null,
bool  readOnly = false,
const QString caption = QString::null,
const QString comment = QString::null,
const QString label = QString::null
[static]
 

A convienence static method for obtaining authorization information from the end user.

Parameters:
user username
pass password
keep pointer to flag that indicates
prompt text to display to user.
readOnly make the username field read-only.
caption set the title bar to given text.
comment extra comment to display to user.
label optinal label for extra comment.
Returns:
Accept/Reject based on the user choice.

Definition at line 281 of file passdlg.cpp.

References addCommentLine(), QDialog::exec(), QString::isEmpty(), keepPassword(), KStdAccel::label(), password(), PasswordDialog(), KDialog::setPlainCaption(), KWin::setState(), setUserReadOnly(), and username().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.4.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Mar 16 18:44:19 2005 by doxygen 1.3.3 written by Dimitri van Heesch, © 1997-2001