Synchronizer: Set the focus on the Compare button after selecting a profile

Authored by asensi on Jan 17 2020, 10:24 PM.



When a Krusader user launches Synchronizer, the Compare button is the default one, therefore the user only has to press Return to start the comparison.
However, if then the user selects a Synchronizer profile, the focus switches from the Compare button to the Close button, therefore pressing Return closes Synchronizer ("but I have selected a profile for something, haven't I?"). This proposal solves that.

Test Plan

Open Synchronizer, create two profiles. Select one, press Return and see that the comparison starts. Do the same with the other profile.

Additionally, a useraction can also be made and executed, one like:

%_Sync("one_profile")% %_Sync("another_profile")%

Diff Detail

R167 Krusader
Lint Skipped
Unit Tests Skipped
asensi requested review of this revision.Jan 17 2020, 10:24 PM
asensi created this revision.
yurchor accepted this revision as: yurchor.Jan 18 2020, 12:45 PM
yurchor added a subscriber: yurchor.

Works as expected. Thanks.

This revision is now accepted and ready to land.Jan 18 2020, 12:45 PM
abika accepted this revision as: abika.Jan 27 2020, 3:10 PM
abika added a subscriber: abika.

Thanks Toni. Works as expected.
But i still would recommend to either use btnCompareDirs->setFocus(); directly instead, or to add a short comment that syncList is focused to have the compare dirs button (which is set as default) being executed on pressing "Enter".
Otherwise it is a bit confusing why the empty tree widget is focused.

asensi updated this revision to Diff 74467.Jan 27 2020, 10:57 PM

Previously, syncList->setFocus(); was utilized as it was used in three other places in the same file, although with btnCompareDirs->setFocus(); the intentions becomes clearer. Thanks, Alex! (and Yuri :-)

This revision was automatically updated to reflect the committed changes.