Bug 385189

Summary: Save dialog: Return key only bound to Save button when text field has focus
Product: [Frameworks and Libraries] frameworks-kio Reporter: Nate Graham <nate>
Component: Open/save dialogsAssignee: David Faure <faure>
Status: RESOLVED FIXED    
Severity: normal CC: bugseforuns, kdelibs-bugs, meven29
Priority: NOR Keywords: junior-jobs, usability
Version: 5.43.0   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In: 5.57

Description Nate Graham 2017-09-29 03:30:09 UTC
STEPS TO REPRODUCE
1. Save a file in any KDE program in a way that triggers the Save dialog
2. Modify the filename to your liking
3. Navigate to the location that you want to save the file to, either using the places panel or the main navigation view
4. Hit the return or enter key


EXPECTED RESULTS:
 The return or enter key triggers the Save button and dismisses the dialog


ACTUAL RESULTS:
Nothing happens.


REPRODUCIBILITY
The enter/return keys only seem to trigger the Save button when the text field has focus.

Still a problem in up-to-date KDE Neon and when on git master.
Comment 1 Nate Graham 2017-09-29 03:32:00 UTC
Oh, and the Open dialog is fine. only the Save dialog is affected.
Comment 2 Christoph Feck 2018-03-29 15:31:46 UTC
The difference was probably intended to make it harder to accidentally overwrite a file, see also bug 267749.

I think in the meantime the overwrite dialog is enabled by default (I remember seeing it popping up twice because the application assumed there was no dialog). With this safety net, input handling could be unified between Open and Save dialog modes.
Comment 3 Méven Car 2019-03-15 19:38:24 UTC
I tried to reproduce this bug, it seems to me it is fixed.
Can someone confirm ?
Comment 4 Patrick Silva 2019-03-15 22:24:39 UTC
Bug is still reproducible here.

Operating System: Arch Linux 
KDE Plasma Version: 5.15.2
KDE Frameworks Version: 5.56.0
Qt Version: 5.12.2
Comment 5 Méven Car 2019-03-16 08:02:18 UTC
I used kate to reproduce it and using it didn't reproduce but saving a screenshot with spectacle is affected.
Comment 6 Nate Graham 2019-03-16 21:22:48 UTC
I'm the opposite! I can reproduce with Kate but it works fine for me in Spectacle! :p
Comment 7 Méven Car 2019-03-16 22:46:34 UTC
I believe this is always reproducible in fact, it is just that the steps to reproduce must be followed precisely.

STEPS TO REPRODUCE
1. Save a file in any KDE program in a way that triggers the Save dialog
2. Modify the filename to your liking
3. Navigate to the location that you want to save the file to, either using the places panel or the main navigation view
4. Hit the return or enter key

I believe the bug is due to the KDirOperator widget not notifying the kfilewidget when the user press enter/return.
Comment 8 Nate Graham 2019-03-16 22:48:25 UTC
Ah you're right!

Seems like good patch material. :)
Comment 9 Méven Car 2019-03-18 09:47:35 UTC
I have a patch proposal :
https://phabricator.kde.org/D19824
Comment 10 Méven Car 2019-03-28 21:34:39 UTC
Git commit bea5b68142e4f018a956fd2174152d9a3e0679cf by Méven Car.
Committed on 28/03/2019 at 21:34.
Pushed by meven into branch 'master'.

KFileWidget In saving single file mode an enter/return press on the KDirOperator triggers slotOk

Summary:
Draw inspiration from inspiration from https://phabricator.kde.org/D12538 for reference.

The issue at hand:
 * the KDirOperator did not signal when it received an enter/return event when it should.
 * This prevents expected behavior
FIXED-IN: 5.57

Test Plan:
1 compile kio and its test kfilewidgettest_saving_gui.cpp
2 launch kfilewidgettest_saving_gui
4 click on an place on the left
5 Hit enter
6 The dialog closes, the filename selected is printed out in the terminal

Reviewers: #frameworks, #dolphin, ngraham, dfaure

Reviewed By: #dolphin, ngraham, dfaure

Subscribers: ngraham, kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D19824

M  +2    -0    src/filewidgets/kdiroperator.cpp
M  +6    -0    src/filewidgets/kdiroperator.h
M  +12   -0    src/filewidgets/kfilewidget.cpp
M  +1    -0    src/filewidgets/kfilewidget.h
M  +1    -0    tests/CMakeLists.txt
A  +58   -0    tests/kfilewidgettest_saving_gui.cpp     [License: LGPL (v2+)]

https://commits.kde.org/kio/bea5b68142e4f018a956fd2174152d9a3e0679cf