Bug 278419 - Setting a text box as Read Only allows changes to be made nevertheless
Summary: Setting a text box as Read Only allows changes to be made nevertheless
Status: CLOSED FIXED
Alias: None
Product: KEXI
Classification: Applications
Component: Forms (show other bugs)
Version: 2.4 rc2 (Calligra 2.4 rc2)
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Jarosław Staniek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-24 20:56 UTC by Dimitrios T Tanis
Modified: 2012-08-11 11:43 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 2.4 (Calligra 2.4)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitrios T Tanis 2011-07-24 20:56:46 UTC
Version:           2.4 alpha3 (Calligra 2.4 alpha3) (using KDE 4.6.0) 
OS:                Linux

Setting a text box as Read Only allows changes to be made to it while editing the record even though the changes are discarded when saving the record.

Reproducible: Always

Steps to Reproduce:
Open a form and set a text box as Read only.
Switch to data view. 
Change the text box'es value > Hit save
Go to the next record then back to the previous one.

Actual Results:  
Changing the value of a read only text box is allowed although not saved.

Expected Results:  
1) Either disable editing a read only text box or
2) Display a message when text box gets focus saying that data in that field is marked as read only and any changes to it will be lost when saving the record.
Comment 1 Jarosław Staniek 2012-03-28 10:38:19 UTC
This behaviour is here to allow keyboard access for selection, cursor movement, text copying to clipboard. Default QLineEdit does not let this. 
Blocking text editing will be fixed though.
Comment 2 Jarosław Staniek 2012-03-30 23:29:35 UTC
Git commit e2be53e6ede1f6c27d8b8fa6d7f14b07b73f7205 by Jaroslaw Staniek.
Committed on 29/03/2012 at 00:14.
Pushed by staniek into branch 'calligra/2.4'.

Fix forms bug: Setting a text box as readonly allows changes to be made

Extra:
*Properly updated context menu when read-only flag is set for line edits and text boxes

REVIEW:104434

M  +7    -0    kexi/doc/dev/CHANGELOG-Kexi-js
M  +55   -27   kexi/plugins/forms/widgets/kexidblineedit.cpp
M  +15   -4    kexi/plugins/forms/widgets/kexidblineedit.h
M  +8    -9    kexi/plugins/forms/widgets/kexidbtextedit.cpp
M  +2    -1    kexi/plugins/forms/widgets/kexidbtextedit.h
M  +29   -29   kexi/plugins/forms/widgets/kexidbutils.cpp
M  +8    -6    kexi/plugins/forms/widgets/kexidbutils.h
M  +6    -4    kexi/widget/utils/kexicontextmenuutils.cpp

http://commits.kde.org/calligra/e2be53e6ede1f6c27d8b8fa6d7f14b07b73f7205
Comment 3 Jarosław Staniek 2012-03-30 23:29:35 UTC
Git commit 7a0b3e796ba2d4fda19700e96c96a880dcf242fe by Jaroslaw Staniek.
Committed on 31/03/2012 at 01:28.
Pushed by staniek into branch 'calligra/2.4'.

Forms: Setting a text boxes to Read Only changes the look to dimmed

Setting a text box or text editor to Read Only mode changes the look to a bit dimmed (as in disabled widget) to indicate the mode

M  +1    -0    kexi/doc/dev/CHANGELOG-Kexi-js
M  +11   -1    kexi/kexiutils/utils.cpp
M  +4    -1    kexi/kexiutils/utils.h
M  +21   -15   kexi/plugins/forms/widgets/kexidblineedit.cpp
M  +7    -3    kexi/plugins/forms/widgets/kexidblineedit.h
M  +21   -1    kexi/plugins/forms/widgets/kexidbtextedit.cpp
M  +6    -1    kexi/plugins/forms/widgets/kexidbtextedit.h

http://commits.kde.org/calligra/7a0b3e796ba2d4fda19700e96c96a880dcf242fe
Comment 4 Jarosław Staniek 2012-03-30 23:30:08 UTC
Git commit d5679f3879ab3cf6192b942adef69e4a7ff8cce1 by Jaroslaw Staniek.
Committed on 29/03/2012 at 00:08.
Pushed by staniek into branch 'master'.

Fix forms bug: Setting a text box as readonly allows changes to be made

Extra:
*Properly updated context menu when read-only flag is set for line edits and text boxes

M  +7    -0    kexi/doc/dev/CHANGELOG-Kexi-js
M  +55   -27   kexi/plugins/forms/widgets/kexidblineedit.cpp
M  +15   -4    kexi/plugins/forms/widgets/kexidblineedit.h
M  +6    -7    kexi/plugins/forms/widgets/kexidbtextedit.cpp
M  +2    -1    kexi/plugins/forms/widgets/kexidbtextedit.h
M  +29   -29   kexi/plugins/forms/widgets/kexidbutils.cpp
M  +8    -6    kexi/plugins/forms/widgets/kexidbutils.h
M  +6    -4    kexi/widget/utils/kexicontextmenuutils.cpp

http://commits.kde.org/calligra/d5679f3879ab3cf6192b942adef69e4a7ff8cce1
Comment 5 Adam Pigg 2012-03-31 07:32:57 UTC
Ah, and is it an extra validator because it is not a property of the field, but a property of the widget?
Comment 6 Jarosław Staniek 2012-03-31 09:13:16 UTC
Yes, it is a property of the widget.

Interestingly, if the widget had other validator (e.g. number data validator), it's replaced by the readonly validator for readonly==true what is OK because the data validator wouldn't be used anyway in readonly mode. When readonly is set to false again, the original validator is assigned back.