Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the date and time when pressing Alt+Enter or Page Up/Down in edit widget #1346

Merged
merged 3 commits into from
Apr 23, 2024

Conversation

Pi2048
Copy link

@Pi2048 Pi2048 commented Apr 21, 2024

This PR aims to fix issues #1274 and #1345

The keypress methods in DateTimeWidget and ValidatedEdit did not account for leaving the field by pressing page up/down or meta+enter. I've added these.

Also, the keypress method of EventEditor did not propagate a keypress of 'meta enter' to its children (i.e. the time and date fields). Therefore, they were not able to update the event before the EventEditor closed. I've changed the order of the calls. I'm not 100% confident about my understanding of urwid keypress hierarchy, so I've made the conservative choice to save the return value of super().keypress(size, key) and return that after saving (i.e. where it originally was).

The reference to 'meta enter' should probably be replaced by referring to the proper keybinding, but I'm not entirely sure how those work.

P added 2 commits April 21, 2024 13:08
Add page up and page down to keys that trigger an event update
Meta+enter will also trigger an event validation
@geier
Copy link
Member

geier commented Apr 22, 2024

@Pi2048 Thank you for your contribution! I can confirm that this works.

Would you please

  • add an entry to the CHANGELOG (in the project root)
  • add yourself to the AUTHORS.txt file (also in the project root)

@geier geier self-requested a review April 23, 2024 07:19
@Pi2048
Copy link
Author

Pi2048 commented Apr 23, 2024

I've added the requested information.

I'm confused about the CHANGELOG file, though. It says version 0.11.3 is not released yet, but that version is actually listed under Releases, and it's also the one I installed through pip.

I think perhaps there needs to be a new listing under there for all changes since 0.11.3?

@geier
Copy link
Member

geier commented Apr 23, 2024

@Pi2048 you are totally right, somebody (me!?!) fucked up doing the last release. I'll merge this now anyway and sort that out afterwards.

@geier geier enabled auto-merge April 23, 2024 21:53
@geier geier merged commit 120692f into pimutils:master Apr 23, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants