[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-usability
Subject: Allowing No Hide mode in passwords
From: bj () altern ! org
Date: 2004-01-18 23:45:29
Message-ID: 200401190044.45006.bj () altern ! org
[Download RAW message or body]
[Attachment #2 (multipart/signed)]
[Attachment #4 (multipart/mixed)]
Hello !
First post to this list :-). As maintainer of KGpg, a user told me he was
using long passwords, and that it was hard to tell if he made a mistake
because currently KPasswordDialog only displays ************** when you type
a password. He would like to be able to actually see the password he is
typing.
I think this could be a usability enhancement (for example for people that
have problem with typing) to allow the user to choose a "No Hide" mode from
the "passwords" module in the Control Center. In this "No Hide" mode,
passwords would appear in clear in the password dialogs.
I had a look at it and created 2 small patches (attached) that implement this
feature. What do you think of the idea ?
["passwd.patch" (text/x-diff)]
Index: kdeui/kpassdlg.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdeui/kpassdlg.cpp,v
retrieving revision 1.29
diff -u -3 -r1.29 kpassdlg.cpp
--- kdeui/kpassdlg.cpp 7 Dec 2003 23:27:14 -0000 1.29
+++ kdeui/kpassdlg.cpp 18 Jan 2004 23:32:56 -0000
@@ -57,18 +57,21 @@
KPasswordEdit::KPasswordEdit(QWidget *parent, const char *name)
: QLineEdit(parent, name)
{
- init();
KConfig *cfg = KGlobal::config();
KConfigGroupSaver saver(cfg, "Passwords");
QString val = cfg->readEntry("EchoMode", "OneStar");
- if (val == "ThreeStars")
+ if (val == "NoHide")
+ m_EchoMode = NoHide;
+ else if (val == "ThreeStars")
m_EchoMode = ThreeStars;
else if (val == "NoEcho")
m_EchoMode = NoEcho;
else
m_EchoMode = OneStar;
+
+ init();
}
KPasswordEdit::KPasswordEdit(QWidget *parent, const char *name, int echoMode)
@@ -92,7 +95,8 @@
void KPasswordEdit::init()
{
- setEchoMode(QLineEdit::Password); // Just in case
+ if (m_EchoMode == NoHide) setEchoMode(QLineEdit::Normal); // No Hide mode
+ else setEchoMode(QLineEdit::Password); // Just in case
setAcceptDrops(false);
m_Password = new char[PassLen];
m_Password[0] = '\000';
@@ -209,8 +213,10 @@
void KPasswordEdit::showPass()
{
QString tmp;
-
switch (m_EchoMode) {
+ case NoHide:
+ setText(m_Password);
+ break;
case OneStar:
tmp.fill('*', m_Length);
setText(tmp);
Index: kdeui/kpassdlg.h
===================================================================
RCS file: /home/kde/kdelibs/kdeui/kpassdlg.h,v
retrieving revision 1.31
diff -u -3 -r1.31 kpassdlg.h
--- kdeui/kpassdlg.h 3 Oct 2003 18:15:33 -0000 1.31
+++ kdeui/kpassdlg.h 18 Jan 2004 23:32:56 -0000
@@ -41,7 +41,7 @@
Q_OBJECT
public:
- enum EchoModes { OneStar, ThreeStars, NoEcho };
+ enum EchoModes { OneStar, ThreeStars, NoEcho, NoHide };
/**
* Constructs a password input widget using the user's global "echo mode" setting.
["passwd2.patch" (text/x-diff)]
Index: kcontrol/passwords/passwords.cpp
===================================================================
RCS file: /home/kde/kdebase/kcontrol/passwords/passwords.cpp,v
retrieving revision 1.26
diff -u -3 -r1.26 passwords.cpp
--- kcontrol/passwords/passwords.cpp 8 Nov 2003 23:43:52 -0000 1.26
+++ kcontrol/passwords/passwords.cpp 18 Jan 2004 23:34:08 -0000
@@ -49,6 +49,7 @@
new QRadioButton(i18n("&1 star"), m_EMGroup);
new QRadioButton(i18n("&3 stars"), m_EMGroup);
new QRadioButton(i18n("&No echo"), m_EMGroup);
+ new QRadioButton(i18n("&Do not hide"), m_EMGroup);
connect(m_EMGroup, SIGNAL(clicked(int)), SLOT(slotEchoMode(int)));
// Keep password
@@ -102,6 +103,8 @@
m_Echo = KPasswordEdit::ThreeStars;
else if (val == "NoEcho")
m_Echo = KPasswordEdit::NoEcho;
+ else if (val == "NoHide")
+ m_Echo = KPasswordEdit::NoHide;
else
m_Echo = defEchoMode;
@@ -123,6 +126,8 @@
val = "OneStar";
else if (m_Echo == KPasswordEdit::ThreeStars)
val = "ThreeStars";
+ else if (m_Echo == KPasswordEdit::NoHide)
+ val = "NoHide";
else
val = "NoEcho";
m_pConfig->writeEntry("EchoMode", val, true, true);
[Attachment #9 (application/pgp-signature)]
_______________________________________________
kde-usability mailing list
kde-usability@kde.org
https://mail.kde.org/mailman/listinfo/kde-usability
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic