|
Lines 26-46
Link Here
|
| 26 |
#include "themer/kdmthemer.h" |
26 |
#include "themer/kdmthemer.h" |
| 27 |
#include "themer/kdmitem.h" |
27 |
#include "themer/kdmitem.h" |
| 28 |
|
28 |
|
|
|
29 |
#include <kglobal.h> |
| 29 |
#include <klocale.h> |
30 |
#include <klocale.h> |
| 30 |
#include <klineedit.h> |
31 |
#include <klineedit.h> |
| 31 |
#include <kpassdlg.h> |
|
|
| 32 |
#include <kuser.h> |
32 |
#include <kuser.h> |
| 33 |
|
33 |
|
| 34 |
#include <tqregexp.h> |
34 |
#include <tqregexp.h> |
| 35 |
#include <tqlayout.h> |
35 |
#include <tqlayout.h> |
| 36 |
#include <tqlabel.h> |
36 |
#include <tqlabel.h> |
| 37 |
|
37 |
|
| 38 |
class KDMPasswordEdit : public KPasswordEdit { |
38 |
class KDMPasswordEdit : public KLineEdit { |
| 39 |
public: |
39 |
public: |
| 40 |
KDMPasswordEdit( TQWidget *parent ) : KPasswordEdit( parent, 0 ) {} |
40 |
KDMPasswordEdit( TQWidget *parent ) : KLineEdit( parent ) |
| 41 |
KDMPasswordEdit( KPasswordEdit::EchoModes echoMode, TQWidget *parent ) : KPasswordEdit( echoMode, parent, 0 ) {} |
41 |
{ |
|
|
42 |
setEchoMode(TQLineEdit::Password); |
| 43 |
} |
| 44 |
|
| 45 |
KDMPasswordEdit( TQLineEdit::EchoMode echoMode, TQWidget *parent ) : KLineEdit( parent ) |
| 46 |
{ |
| 47 |
setEchoMode(echoMode); |
| 48 |
} |
| 49 |
|
| 50 |
|
| 42 |
protected: |
51 |
protected: |
| 43 |
virtual void contextMenuEvent( TQContextMenuEvent * ) {} |
52 |
virtual void contextMenuEvent( TQContextMenuEvent * ) {} |
| 44 |
}; |
53 |
}; |
| 45 |
|
54 |
|
| 46 |
static int echoMode; |
55 |
static int echoMode; |
|
Lines 104-114
Link Here
|
| 104 |
grid->addWidget( loginLabel, line, 0 ); |
113 |
grid->addWidget( loginLabel, line, 0 ); |
| 105 |
grid->addWidget( new TQLabel( fixedUser, parent ), line++, 1 ); |
114 |
grid->addWidget( new TQLabel( fixedUser, parent ), line++, 1 ); |
| 106 |
} |
115 |
} |
| 107 |
if (echoMode == -1) |
116 |
if (echoMode == -1) { |
| 108 |
passwdEdit = new KDMPasswordEdit( parent ); |
117 |
passwdEdit = new KDMPasswordEdit( parent ); |
| 109 |
else |
118 |
} else { |
| 110 |
passwdEdit = new KDMPasswordEdit( (KPasswordEdit::EchoModes)echoMode, |
119 |
passwdEdit = new KDMPasswordEdit( (TQLineEdit::EchoMode)echoMode, parent ); |
| 111 |
parent ); |
120 |
} |
| 112 |
connect( passwdEdit, TQT_SIGNAL(textChanged( const TQString & )), |
121 |
connect( passwdEdit, TQT_SIGNAL(textChanged( const TQString & )), |
| 113 |
TQT_SLOT(slotActivity()) ); |
122 |
TQT_SLOT(slotActivity()) ); |
| 114 |
connect( passwdEdit, TQT_SIGNAL(lostFocus()), TQT_SLOT(slotActivity()) ); |
123 |
connect( passwdEdit, TQT_SIGNAL(lostFocus()), TQT_SLOT(slotActivity()) ); |
|
Lines 135-142
Link Here
|
| 135 |
} |
144 |
} |
| 136 |
if (func != Authenticate) { |
145 |
if (func != Authenticate) { |
| 137 |
if (echoMode == -1) { |
146 |
if (echoMode == -1) { |
| 138 |
passwd1Edit = new KDMPasswordEdit( (KPasswordEdit::EchoModes)echoMode, parent ); |
147 |
passwd1Edit = new KDMPasswordEdit( (TQLineEdit::EchoMode)echoMode, parent ); |
| 139 |
passwd2Edit = new KDMPasswordEdit( (KPasswordEdit::EchoModes)echoMode, parent ); |
148 |
passwd2Edit = new KDMPasswordEdit( (TQLineEdit::EchoMode)echoMode, parent ); |
| 140 |
} else { |
149 |
} else { |
| 141 |
passwd1Edit = new KDMPasswordEdit( parent ); |
150 |
passwd1Edit = new KDMPasswordEdit( parent ); |
| 142 |
passwd2Edit = new KDMPasswordEdit( parent ); |
151 |
passwd2Edit = new KDMPasswordEdit( parent ); |
|
Lines 247-262
Link Here
|
| 247 |
KGreeterPluginHandler::IsUser ); |
256 |
KGreeterPluginHandler::IsUser ); |
| 248 |
break; |
257 |
break; |
| 249 |
case 1: |
258 |
case 1: |
| 250 |
handler->gplugReturnText( passwdEdit->password(), |
259 |
handler->gplugReturnText( passwdEdit->text().utf8(), |
| 251 |
KGreeterPluginHandler::IsPassword | |
260 |
KGreeterPluginHandler::IsPassword | |
| 252 |
KGreeterPluginHandler::IsSecret ); |
261 |
KGreeterPluginHandler::IsSecret ); |
| 253 |
break; |
262 |
break; |
| 254 |
case 2: |
263 |
case 2: |
| 255 |
handler->gplugReturnText( passwd1Edit->password(), |
264 |
handler->gplugReturnText( passwd1Edit->text().utf8(), |
| 256 |
KGreeterPluginHandler::IsSecret ); |
265 |
KGreeterPluginHandler::IsSecret ); |
| 257 |
break; |
266 |
break; |
| 258 |
default: // case 3: |
267 |
default: // case 3: |
| 259 |
handler->gplugReturnText( passwd2Edit->password(), |
268 |
handler->gplugReturnText( passwd2Edit->text().utf8(), |
| 260 |
KGreeterPluginHandler::IsNewPassword | |
269 |
KGreeterPluginHandler::IsNewPassword | |
| 261 |
KGreeterPluginHandler::IsSecret ); |
270 |
KGreeterPluginHandler::IsSecret ); |
| 262 |
break; |
271 |
break; |
|
Lines 405-415
Link Here
|
| 405 |
// assert( !running ); |
414 |
// assert( !running ); |
| 406 |
setActive2( true ); |
415 |
setActive2( true ); |
| 407 |
if (authTok) { |
416 |
if (authTok) { |
| 408 |
passwd1Edit->erase(); |
417 |
passwd1Edit->clear(); |
| 409 |
passwd2Edit->erase(); |
418 |
passwd2Edit->clear(); |
| 410 |
passwd1Edit->setFocus(); |
419 |
passwd1Edit->setFocus(); |
| 411 |
} else { |
420 |
} else { |
| 412 |
passwdEdit->erase(); |
421 |
passwdEdit->clear(); |
| 413 |
if (loginEdit && loginEdit->isEnabled()) |
422 |
if (loginEdit && loginEdit->isEnabled()) |
| 414 |
passwdEdit->setEnabled( true ); |
423 |
passwdEdit->setEnabled( true ); |
| 415 |
else { |
424 |
else { |
|
Lines 426-432
Link Here
|
| 426 |
KClassicGreeter::clear() |
435 |
KClassicGreeter::clear() |
| 427 |
{ |
436 |
{ |
| 428 |
// assert( !running && !passwd1Edit ); |
437 |
// assert( !running && !passwd1Edit ); |
| 429 |
passwdEdit->erase(); |
438 |
passwdEdit->clear(); |
| 430 |
if (loginEdit) { |
439 |
if (loginEdit) { |
| 431 |
loginEdit->clear(); |
440 |
loginEdit->clear(); |
| 432 |
loginEdit->setFocus(); |
441 |
loginEdit->setFocus(); |
|
Lines 484-492
Link Here
|
| 484 |
TQVariant (*getConf)( void *, const char *, const TQVariant & ), |
493 |
TQVariant (*getConf)( void *, const char *, const TQVariant & ), |
| 485 |
void *ctx ) |
494 |
void *ctx ) |
| 486 |
{ |
495 |
{ |
| 487 |
echoMode = getConf( ctx, "EchoMode", TQVariant( -1 ) ).toInt(); |
496 |
echoMode = getConf( ctx, "EchoMode", TQVariant( -1 ) ).toInt(); |
| 488 |
KGlobal::locale()->insertCatalogue( "kgreet_classic" ); |
497 |
switch (echoMode) |
| 489 |
return true; |
498 |
{ |
|
|
499 |
case (0): |
| 500 |
case (1): |
| 501 |
echoMode = TQLineEdit::Password; |
| 502 |
break; |
| 503 |
|
| 504 |
case (2): |
| 505 |
echoMode = TQLineEdit::NoEcho; |
| 506 |
break; |
| 507 |
|
| 508 |
default: |
| 509 |
echoMode = TQLineEdit::Password; |
| 510 |
} |
| 511 |
|
| 512 |
KGlobal::locale()->insertCatalogue( "kgreet_classic" ); |
| 513 |
return true; |
| 490 |
} |
514 |
} |
| 491 |
|
515 |
|
| 492 |
static void done( void ) |
516 |
static void done( void ) |