[PATCH] Fix KPasswordDialog to show ok button only when passwords match

Willy De la Court Willy.DelaCourt at pandora.be
Sat Apr 5 18:59:15 BST 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Saturday 05 April 2003 19:08, Jason Keirstead wrote:
> On April 5, 2003 01:05 pm, Willy De la Court wrote:
> > On Friday 04 April 2003 20:13, Ravikiran Rajagopal wrote:
> > > Hello,
> > >   The following patch disables the ok button when the two passwords do
> > > not match. We do it at the end anyway, but this is more user-friendly.
> > > (Thanks to Willy for the suggestion.) Is it ok to commit?
> >
> > Looks good can one of the core developers comments on this since there is
> > no real maintainer for the moment.
>
> It seems to be like this would be very user *un-friendly*.. like, I type in
> password 1, then type in password 2 and make a small typo, but the OK
> button does not work.. why not? How do I know that my passwords don't
> match? Seems like the OK button is broken, oh I guess KDE sucks...
>
> There is no way to tell without clicking OK that you made a typo. This
> seems very strange.
There is a label on the dialog box that sais "Passwords match" or "Passwords 
do not match"

see following code

+void KPasswordDialog::enableOkBtn()
+{
+    if (m_Type == NewPassword) {
+      bool match = ((strcmp(m_pEdit->password(), m_pEdit2->password()))==0)
+                   && (strcmp(m_pEdit->password(), "") != 0);
+      enableButtonOK( match );
+      d->m_MatchLabel->setText( match?QString(i18n("Passwords
match")):QString(i18n("Passwords do not match")) );
+   }
- -- 
Simple things make people happy.
Willy De la Court
PGP Public Key at http://www.linux-lovers.be/download/public_key.asc
PGP Key fingerprint = 784E E18F 7F85 9C7C AC1A D5FB FE08 686C 37C7 A689
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE+jxlz/ghobDfHpokRAvlVAKDp8cGa3WVAo76MU7c+l1j/rSD3FACgh8L8
2bD156C/uU0kDFlETrZTteg=
=5Daf
-----END PGP SIGNATURE-----





More information about the kde-core-devel mailing list