class KPasswordDialog |
|
A dialog for requesting a password and optionaly a login from the end user.
Usage Exemple Requesting a simple password, assynchronous
KPasswordDialog *dlg = new KPasswordDialog( parent ); dlg->setPrompt( i18n( "Enter a password" ); connect( dlg, SIGNAL( gotPassword( const QString& , bool ) ) , this, SLOT( setPassword( const QString &) ) ); connect( dlg, SIGNAL( rejected() ) , this, SLOT( slotCancel() ) ); dlg->show(); Requesting a login and a password, synchronous
KPasswordDialog dlg( parent , KPasswordDialog.showUsername ); dlg.setPrompt( i18n( "Enter a login and a password" ); if( !dlg.exec() ) return; //the user canceled use( dlg.username() , dlg.password() ); dialog for requesting login and password from the end user |
|
create a password dialog
parent - the parent widget (default:NULL). flags - a set of KPasswordDialogFlag flags otherButtons - buttons to show in the dialog besides Ok and Cancel. Useful for adding application-specific buttons like "ignore" or "skip". |
|
|
|
Internal |
|
Adds a comment line to the dialog.
This function allows you to add one additional comment line to this widget. Calling this function after a comment has already been added will not have any effect. label - label for comment (ex:"Command:") comment - the actual comment text. |
|
Returns anonymous mode has been selected. @since 4.1 |
|
Virtual function that can be overridden to provide password checking in derived classes. It should return true if the password is valid, false otherwise. |
|
Returns the domain entered by the user. Returns the domain name @since 4.1 |
|
emitted when the dialog has been accepted
password - the entered password keep - true if the "remember password" checkbox was checked, false otherwhise. false if ShowKeepPassword was not set in the constructor |
|
emitted when the dialog has been accepted, and ShowUsernameLine was set on the constructor
username - the entered username password - the entered password keep - true if the "remember password" checkbox was checked, false otherwhise. false if ShowKeepPassword was not set in the constructor |
|
Determines whether supplied authorization should
persist even after the application has been closed.
this is set with the check password checkbox is the ShowKeepCheckBox flag is set in the constructor, if it is not set, this function return false Returns true to keep the password |
|
Returns the password entered by the user. Returns the password |
|
|
Returns the prompt |
|
set anonymous mode (all other fields will be grayed out) @since 4.1 |
|
set the default domain. @since 4.1 |
|
Check or uncheck the "keep password" checkbox.
This can be used to check it before showing the dialog, to tell
the user that the password is stored already (e.g. in the wallet).
enableKeep must have been set to true in the constructor.
has only effect if ShowKeepCheckBox is set in the constructor |
|
Presets a number of login+password pairs that the user can choose from.
The passwords can be empty if you simply want to offer usernames to choose from.
This require the flag ShowUnernameLine to be set in the constructoe, and not the flag UsernameReadOnly knownLogins - map of known logins: the keys are usernames, the values are passwords. |
|
Presets the password.
password - the password to set |
|
set an image that appears next to the prompt. |
|
Sets the prompt to show to the user.
prompt - instructional text to be shown. |
|
set the default username. |
|
Sets the username field read-only and sets the
focus to the password field.
this can also be set by passing UsernameReadOnly as flag in the constructor readOnly - true to set the user field to read-only |
|
Shows an error message in the dialog box. Prevents having to show a dialog-on-a-dialog.
message - the error message to show |
|
Returns the username entered by the user. Returns the user name |
UnknownError | - 0 | - | ||
UsernameError | - | - | ||
PasswordError | - | - | ||
FatalError | - | - | ||
DomainError | - | - |
UnknownError | - | - | ||
UsernameError | - | - | ||
PasswordError | - | - | ||
FatalError | - | - |
NoFlags | - 0x00 | - | ||
ShowKeepPassword | - 0x01 | - | ||
ShowUsernameLine | - 0x02 | - | ||
UsernameReadOnly | - 0x04 | - | ||
ShowAnonymousLoginCheckBox | - 0x08 | - | ||
ShowDomainLine | - 0x10 | - | ||
DomainReadOnly | - 0x20 | - |
NoFlags | - | - | ||
ShowKeepPassword | - | - | ||
ShowUsernameLine | - | - | ||
UsernameReadOnly | - | - |