CVS commit by ossi: make line edits eat context menu events M +22 -7 kgreet_classic.cpp 1.3 --- kdebase/kdm/kfrontend/kgreet_classic.cpp #1.2:1.3 @@ -32,4 +32,19 @@ #include +class KDMPasswordEdit : public KPasswordEdit { +public: + KDMPasswordEdit( QWidget *parent ) : KPasswordEdit( parent, 0 ) {} + KDMPasswordEdit( KPasswordEdit::EchoModes echoMode, QWidget *parent ) : KPasswordEdit( echoMode, parent, 0 ) {} +protected: + virtual void contextMenuEvent( QContextMenuEvent * ) {} +}; + +class KDMLineEdit : public QLineEdit { +public: + KDMLineEdit( QWidget *parent ) : QLineEdit( parent ) {} +protected: + virtual void contextMenuEvent( QContextMenuEvent * ) {} +}; + static int echoMode; @@ -57,5 +72,5 @@ KClassicGreeter::KClassicGreeter( if (func != ChAuthTok) { if (fixedUser.isEmpty()) { - loginEdit = new QLineEdit( parent ); + loginEdit = new KDMLineEdit( parent ); loginLabel = new QLabel( loginEdit, i18n("&Username:"), parent ); connect( loginEdit, SIGNAL(lostFocus()), SLOT(slotLoginLostFocus()) ); @@ -72,7 +87,7 @@ KClassicGreeter::KClassicGreeter( } if (echoMode == -1) - passwdEdit = new KPasswordEdit( parent, 0 ); + passwdEdit = new KDMPasswordEdit( parent ); else - passwdEdit = new KPasswordEdit( (KPasswordEdit::EchoModes)echoMode, parent, 0 ); + passwdEdit = new KDMPasswordEdit( (KPasswordEdit::EchoModes)echoMode, parent ); passwdLabel = new QLabel( passwdEdit, func == Authenticate ? i18n("&Password:") : i18n("Current &password:"), parent ); @@ -86,9 +101,9 @@ KClassicGreeter::KClassicGreeter( if (func != Authenticate) { if (echoMode == -1) { - passwd1Edit = new KPasswordEdit( (KPasswordEdit::EchoModes)echoMode, parent, 0 ); - passwd2Edit = new KPasswordEdit( (KPasswordEdit::EchoModes)echoMode, parent, 0 ); + passwd1Edit = new KDMPasswordEdit( (KPasswordEdit::EchoModes)echoMode, parent ); + passwd2Edit = new KDMPasswordEdit( (KPasswordEdit::EchoModes)echoMode, parent ); } else { - passwd1Edit = new KPasswordEdit( parent, 0 ); - passwd2Edit = new KPasswordEdit( parent, 0 ); + passwd1Edit = new KDMPasswordEdit( parent ); + passwd2Edit = new KDMPasswordEdit( parent ); } passwd1Label = new QLabel( passwd1Edit, i18n("&New password:"), parent );