diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2015-09-18 23:01:01 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2015-09-18 23:01:01 -0500 |
commit | 6f5e7b211009bf3a5b6816ee3cb064d7f393dfb9 (patch) | |
tree | e30e480a7524c15acd02901d3e6f0e48a9f6a12b /tdmlib/kgreet_classic.cpp | |
parent | 1ec002a8ee0c9165bedbcb6e273d9bacb0588e47 (diff) | |
download | tdebase-6f5e7b211009bf3a5b6816ee3cb064d7f393dfb9.tar.gz tdebase-6f5e7b211009bf3a5b6816ee3cb064d7f393dfb9.zip |
Streamline cryptographic card logon process
Diffstat (limited to 'tdmlib/kgreet_classic.cpp')
-rw-r--r-- | tdmlib/kgreet_classic.cpp | 45 |
1 files changed, 37 insertions, 8 deletions
diff --git a/tdmlib/kgreet_classic.cpp b/tdmlib/kgreet_classic.cpp index 7eb983583..f99acfb3c 100644 --- a/tdmlib/kgreet_classic.cpp +++ b/tdmlib/kgreet_classic.cpp @@ -67,6 +67,7 @@ KClassicGreeter::KClassicGreeter( KGreeterPluginHandler *_handler, exp( -1 ), pExp( -1 ), running( false ), + userEntryLocked(false), suppressInfoMsg(false) { KdmItem *user_entry = 0, *pw_entry = 0; @@ -224,6 +225,7 @@ KClassicGreeter::setUser( const TQString &user ) } void KClassicGreeter::lockUserEntry( const bool lock ) { + userEntryLocked = lock; loginEdit->setEnabled(!lock); } @@ -251,6 +253,23 @@ void KClassicGreeter::setInfoMessageDisplay(bool enable) { suppressInfoMsg = !enable; } +void KClassicGreeter::setPasswordPrompt(const TQString &prompt) { + if (passwdLabel) { + passwdPromptCustomString = prompt; + + if (prompt != TQString::null) { + passwdLabel->setText(prompt); + } + else { + passwdLabel->setText(passwordPrompt()); + } + if (grid) { + grid->invalidate(); + grid->activate(); + } + } +} + void // private KClassicGreeter::returnData() { @@ -311,7 +330,9 @@ KClassicGreeter::textPrompt( const char *prompt, bool echo, bool nonBlocking ) passwdLabel->setText(prompt); } else { - passwdLabel->setText(passwordPrompt()); + if (passwdPromptCustomString == TQString::null) { + passwdLabel->setText(passwordPrompt()); + } } if (grid) { grid->invalidate(); @@ -349,8 +370,9 @@ KClassicGreeter::textPrompt( const char *prompt, bool echo, bool nonBlocking ) has = -1; } - if (has >= exp || nonBlocking) + if (has >= exp || nonBlocking) { returnData(); + } } bool // virtual @@ -432,7 +454,7 @@ KClassicGreeter::succeeded() void // virtual KClassicGreeter::failed() { - if (passwdLabel) { + if (passwdLabel && (passwdPromptCustomString == TQString::null)) { // reset password prompt passwdLabel->setText(passwordPrompt()); if (grid) { @@ -451,7 +473,7 @@ KClassicGreeter::failed() void // virtual KClassicGreeter::revive() { - if (passwdLabel) { + if (passwdLabel && (passwdPromptCustomString == TQString::null)) { // reset password prompt passwdLabel->setText(passwordPrompt()); if (grid) { @@ -483,7 +505,7 @@ KClassicGreeter::revive() void // virtual KClassicGreeter::clear() { - if (passwdLabel) { + if (passwdLabel && (passwdPromptCustomString == TQString::null)) { // reset password prompt passwdLabel->setText(passwordPrompt()); if (grid) { @@ -508,10 +530,17 @@ KClassicGreeter::clear() void KClassicGreeter::setActive( bool enable ) { - if (loginEdit) - loginEdit->setEnabled( enable ); - if (passwdEdit) + if (loginEdit) { + if (userEntryLocked) { + loginEdit->setEnabled( false ); + } + else { + loginEdit->setEnabled( enable ); + } + } + if (passwdEdit) { passwdEdit->setEnabled( enable ); + } } void |