Skip to content
This repository was archived by the owner on Dec 9, 2021. It is now read-only.

Fixes #347 - Support multiple auto-type matches per entry#132

Open
lightvector wants to merge 5 commits intokeepassx:masterfrom
lightvector:entry-multi-autotypes
Open

Fixes #347 - Support multiple auto-type matches per entry#132
lightvector wants to merge 5 commits intokeepassx:masterfrom
lightvector:entry-multi-autotypes

Conversation

@lightvector
Copy link
Copy Markdown

This adds support for choosing between multiple auto-type sequences for an entry if more than one matches, including adding a new model+view so that the auto-type select dialog displays what the auto-type sequence is. This more closely matches Keepass's behavior here.

(Motivated by switching from Keepass and finding global-autotype became unusable with my setup since I wouldn't be able to see whether username+password vs just password was about to be entered, or be able to choose between them).

@debfx
Copy link
Copy Markdown
Member

debfx commented Oct 14, 2015

Haven't tested it yet but looks good in general except for one thing:
Deleted entries aren't removed from AutoTypeMatchModel.
This leads to a crash if you activate global auto-type, delete an entry that appears in the select dialog and then click on that entry in the dialog.

You could do this by connecting to the entries' destroyed() signal.

Also tests would be nice :)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I didn't write this code :P
Same in the other files.

@lightvector
Copy link
Copy Markdown
Author

Thanks for the comments. I'll handle these in the next couple of weeks (a bit busy with other things recently).
:)

@lightvector
Copy link
Copy Markdown
Author

Bug fixed! And the other minor stuff.

I haven't added tests since I'm not sure how to trigger global autotype in the gui test code (with focus on what window?) or generally how to verify that what gets displayed is correct upon updates of the entries. It looks like the setup for the regular tests and the gui tests are subtly different - I tried to trigger global autotype with two matches in the non-gui tests but got a failure saying that "Cannot create a QWidget when no GUI is being used".

I've mostly been learning by example - prior to this I haven't ever used the qt stuff nor done any gui programming in c++ - so it's tricky for me without an existing example of autotype in the gui tests. I did play around with the gui a bit manually though. Things seem to work now with updating and deleting of entries. In the case where you change the sequence or the association, it doesn't update, but instead uses whatever it was at the time of autotype key press. But I guess that's okay.

@lightvector
Copy link
Copy Markdown
Author

Ping. I think this is done here, but let me know if you disagree. There's not a new automated gui test as per the previous comment, but otherwise I do think things work from testing by hand. If there's something simple and quick I can do that would help you out here I'm happy to do so, otherwise feel free to do whatever you like with this code submission.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants