HaikuArchives / Calendar

:calendar: A native Calendar application for Haiku.
MIT License
29 stars 20 forks source link

Saving/Loading for events and GUI Changes for Calendar #127

Closed harshit-sharma-gits closed 1 year ago

harshit-sharma-gits commented 1 year ago

For issue: #122

The scope of this PR: Get the events to be saved with the Reminder as per the user's requirement

The GUI looks like this:

EventManagerGUI Revised

harshit-sharma-gits commented 1 year ago

Could you explain in the commit message/PR description what the data model is going to be like? When is a reminder set?

While creating the event, the user can (if needed) set the reminder, let's say x hours/minutes/seconds before the event start time. If the reminder is set by the user, it gets stored in the event file as EVENT:REMINDER attribute with the value start time minus x And if, the reminder is not set by the user then no such attribute is added to the file.

How to change/remove a reminder?

Simply click on the event inside the Calendar. It'll open the Event Window with the Event's details in it. The reminder is also modifiable there.

harshit-sharma-gits commented 1 year ago

Some more notes. I see two edge cases that need to be handled:

  • Entering invalid characters in the reminder time.

Now this is sorted by TextView()'s DisallowChar()

  • Updating the event time should update the reminder time.

This already is being handled. If the user changes the event's start time from the Calendar, the Reminder time changes as well.

nielx commented 1 year ago

I did some testing and I found two issues. The first I want you to fix as part of this commit. The second you can create a ticket for to solve later.

  1. When you create an entry with a reminder, and save it. And then you reopen the event and untick the reminder box, the reminder does not get deleted when you close the event. It will still be there when you reopen. Please fix.
  2. If you put in a large number for the reminder, the data gets saved wrong. There should be some sort of validation/limits on how/when can be reminded. This can be deferred to later, though please create a follow up
harshit-sharma-gits commented 1 year ago
  1. When you create an entry with a reminder, and save it. And then you reopen the event and untick the reminder box, the reminder does not get deleted when you close the event. It will still be there when you reopen. Please fix.

This issue is now fixed.

  1. If you put in a large number for the reminder, the data gets saved wrong. There should be some sort of validation/limits on how/when can be reminded. This can be deferred to later, though please create a follow up

I'll open an issue for this, and also mention this issue in the wrap-up blog post.