• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeio/tdeio
 

tdeio/tdeio

  • TDEIO
  • PasswordDialog
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
TDEIO::PasswordDialog Class Reference

#include <passdlg.h>

Inherits KDialogBase.

Public Member Functions

 PasswordDialog (const TQString &prompt, const TQString &user, bool enableKeep=false, bool modal=true, TQWidget *parent=0, const char *name=0)
 
 ~PasswordDialog ()
 
void setPrompt (const TQString &prompt)
 
void addCommentLine (const TQString &label, const TQString comment)
 
TQString password () const
 
TQString username () const
 
bool keepPassword () const
 
void setKeepPassword (bool b)
 
void setUserReadOnly (bool readOnly)
 
TDE_DEPRECATED void setEnableUserField (bool enable, bool=false)
 
void setPassword (const TQString &password)
 
void setKnownLogins (const TQMap< TQString, TQString > &knownLogins)
 

Static Public Member Functions

static int getNameAndPassword (TQString &user, TQString &pass, bool *keep, const TQString &prompt=TQString::null, bool readOnly=false, const TQString &caption=TQString::null, const TQString &comment=TQString::null, const TQString &label=TQString::null)
 

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.

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

dialog for requesting login and password from the end user

Definition at line 36 of file passdlg.h.

Constructor & Destructor Documentation

◆ PasswordDialog()

PasswordDialog::PasswordDialog ( const TQString &  prompt,
const TQString &  user,
bool  enableKeep = false,
bool  modal = true,
TQWidget *  parent = 0,
const char *  name = 0 
)

Create a password dialog.

Parameters
promptinstructional text to be shown.
userusername, if known initially.
enableKeepif true, shows checkbox that makes password persistent until KDE is shutdown.
modalif true, the dialog will be modal (default:true).
parentthe parent widget (default:NULL).
namethe dialog name (default:NULL).

Definition at line 54 of file passdlg.cpp.

◆ ~PasswordDialog()

PasswordDialog::~PasswordDialog ( )

Destructor.

Definition at line 62 of file passdlg.cpp.

Member Function Documentation

◆ addCommentLine()

void PasswordDialog::addCommentLine ( const TQString &  label,
const TQString  comment 
)

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.

Parameters
labellabel for comment (ex:"Command:")
commentthe actual comment text.

Definition at line 233 of file passdlg.cpp.

◆ getNameAndPassword()

int PasswordDialog::getNameAndPassword ( TQString &  user,
TQString &  pass,
bool *  keep,
const TQString &  prompt = TQString::null,
bool  readOnly = false,
const TQString &  caption = TQString::null,
const TQString &  comment = TQString::null,
const TQString &  label = TQString::null 
)
static

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

Parameters
userusername
passpassword
keeppointer to flag that indicates whether to keep password (can be null)
prompttext to display to user.
readOnlymake the username field read-only.
captionset the title bar to given text.
commentextra comment to display to user.
labeloptinal label for extra comment.
Returns
Accepted/Rejected based on the user choice.

Definition at line 330 of file passdlg.cpp.

◆ keepPassword()

bool PasswordDialog::keepPassword ( ) const

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

Returns
true to keep the password

Definition at line 187 of file passdlg.cpp.

◆ password()

TQString PasswordDialog::password ( ) const

Returns the password entered by the user.

Returns
the password

Definition at line 176 of file passdlg.cpp.

◆ setEnableUserField()

TDE_DEPRECATED void TDEIO::PasswordDialog::setEnableUserField ( bool  enable,
bool  = false 
)
inline
Deprecated:
.

Use setUserReadOnly(bool).

Definition at line 116 of file passdlg.h.

◆ setKeepPassword()

void PasswordDialog::setKeepPassword ( bool  b)

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.

Definition at line 181 of file passdlg.cpp.

◆ setKnownLogins()

void PasswordDialog::setKnownLogins ( const TQMap< TQString, TQString > &  knownLogins)

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 is incompatible with setUserReadOnly(true).

Parameters
knownLoginsmap of known logins: the keys are usernames, the values are passwords.
Since
3.4

Definition at line 291 of file passdlg.cpp.

◆ setPassword()

void PasswordDialog::setPassword ( const TQString &  password)

Presets the password.

Parameters
passwordthe password to set
Since
3.1

Definition at line 279 of file passdlg.cpp.

◆ setPrompt()

void PasswordDialog::setPrompt ( const TQString &  prompt)

Sets the prompt to show to the user.

Parameters
promptinstructional text to be shown.

Definition at line 272 of file passdlg.cpp.

◆ setUserReadOnly()

void PasswordDialog::setUserReadOnly ( bool  readOnly)

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

Parameters
readOnlytrue to set the user field to read-only

Definition at line 284 of file passdlg.cpp.

◆ username()

TQString PasswordDialog::username ( ) const

Returns the username entered by the user.

Returns
the user name

Definition at line 171 of file passdlg.cpp.


The documentation for this class was generated from the following files:
  • passdlg.h
  • passdlg.cpp

tdeio/tdeio

Skip menu "tdeio/tdeio"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

tdeio/tdeio

Skip menu "tdeio/tdeio"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeio/tdeio by doxygen 1.9.1
This website is maintained by Timothy Pearson.