Version: (using KDE KDE 3.3.0) Installed from: Compiled From Sources OS: Linux Make kdesu display a warning if Caps Lock is on, like kdesktop_lock does and I believe also KDM. This will be both helpfull and make KDE more consistent.
Good idea. Would be a good junior job.
Created attachment 9065 [details] Warns the user about caps lock state Just copied from kdesktop/lock/lockdlg.cc, adapted and simplified. The warning text is not red but makes the work :)
Created attachment 9075 [details] Caps Lock warning
Comment on attachment 9075 [details] Caps Lock warning I tok a look at this again when Waldo clasified it as an junior job. Looking at the code has convinced me it is not really a kdesu "bug". Since kdesu basicly only uses the KPasswordDialog class. So i think it makes more sense to make implement it there, would aslo increase consistency since it's used several places. KPasswordDialog is located in kdelibs/kdeui/kpassdlg.cpp so changes may give concerns regarding BIC and such. I have given it a try myself, like Matías I have copied and adapted from kdesktop/lock/lockdlg.cc. Sadly I can't get it to work right, having some problems with the event filtering and the layoutcode are not qyite right. But its a start. Made a few obsevations also: The layoutcode uses some obsolete functions like addRowSpacing. Why does kdesktop/lock/lockdlg.cc have its own implementation insted of using KPasswordDialog
Created attachment 10140 [details] Patchs to kpassdlg.cpp and kpassdlg.h I implemented it on KPasswordDialog. Notes: - I removed (commented) the obsoletes method calls to QGridLayout::addRowSpacing() and QGridLayout::addColSpacing(), so you need check if the layout still good. - I used hardcoded color (red) to display the warning, I think that this can cause problems if the user is using red, pink, etc as background color in your theme settings. P.S.: How to attach tow files on a single post? I have two diff files, so I "tar'ed" it.
Created attachment 10141 [details] KPasswordDialog capslock test Screenshot of KPasswordDialog with the patch.
I'm thinking in create a new widget "KPassiveTip" or any other name... KPassiveTip could be a ballon pointing to the widget (like WinXP) with some tip/text inside, it dissepear after a user definied time or when the parent widget lose the keyboard focus. It is like KPassivePopup (but more beautifull), but can be used on any widget. I'm posting it here because if anyone like this idea it can be used on KPasswordEdit to handle the capslock warning, etc... But on the other side... it can be only a extension to KPassivePopup.. I dont know... P.S.: English is not my natural language, need I post it on kde-devel maillist?
*** Bug 107274 has been marked as a duplicate of this bug. ***
*** Bug 119403 has been marked as a duplicate of this bug. ***
Why has this not been imported into svn?
I think it is necessary not only show tooltip, if caps lock is on, but also we need to show tooltip, if user's current locale is not english. Example use case - users with more than one locale. I.e. I'm russian and I have 2 locales, so now I have to look everytime I need to enter password at tray, to see, which locale is currently active.
*** Bug 153483 has been marked as a duplicate of this bug. ***
Regarding comment #4: Yes, you're right, this really needs to be fixed in KPasswordDialog in kdelibs. Reassigning.
*** Bug 131077 has been marked as a duplicate of this bug. ***
As I am not 100% sure what people mean by tooltip, I just wanted to say that the warning should not be modal. Also, the warning for keyboard layout (and the a way to change it) should have an option to only appear when the current one is not the default one. Along those lines, it might be an idea to allow _all_ keyboard layouts (and their variants) to be selected in a submenu.
*** Bug 221356 has been marked as a duplicate of this bug. ***
Created attachment 39852 [details] Patch to show a warning label Once patched with this patch, kpassworddialog shows a warning label when the capslock key is locked using KModifierKeyInfo. I'm working toward adding a keyboard locale icon button.
Thanks! Looking at the code, do you display an actual warning text explaining what is wrong or simply an icon?
Created attachment 39853 [details] Correction to the previous pathch. I forgot to add the diff for the ui file.
#18: So it's a label, the String is in the ui file so i guess it will be translatable. For the locale, i was thinking of a toolbutton, visible if there is more than one locale, with the current locale flag as an icon and a dropdown menu to select others.
In fact there is already keyboard layout widgets intended to be reused. The problem is it lies in kdebase/workspace/kcontrol/kxkb, and i guess kdelibs can't depends on kdebase. So my suggestion is to move that code in kdelibs and leave the control module in kdebase.
Created attachment 39874 [details] new KPasswordLineEdit widget This widget makes it easier to use capslock warning in various places, such as the kdm login manager.
Created attachment 39875 [details] Use a KPasswordLineEdit to show the warning Final patch against HEAD to show a warning when capslock is on.
I am not sure if it makes sense to create a special subclass for password line edit fields. The idea is that the application only uses the KPasswordDialog and the KNewPasswordDialog, without trying to create custom dialogs. At least it should not be public API. There are memory leaks in your code, formatting issues, as well as other problems. Please open a review request on http://reviewboard.kde.org/ for group kdelibs to discuss the issues. Thanks.
fwiw, http://reviewboard.kde.org/r/2591/
Since KWidgetsAddons cannot depend on KModifierKeyInfo from KGuiAddons, and Qt will not help either, we need minimal platform-specific code, e.g. http://stackoverflow.com/questions/2968336/qt-password-field