pimutils / khal

:calendar: CLI calendar application
https://lostpackets.de/khal/
MIT License
2.54k stars 197 forks source link

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

Closed Pi2048 closed 2 months ago

Pi2048 commented 2 months ago

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.

geier commented 2 months ago

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

Would you please

Pi2048 commented 2 months ago

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 commented 2 months ago

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