Closed Bug 324666 Opened 19 years ago Closed 18 years ago

dialog created by double-click should have better defaults

Categories

(Calendar :: Internal Components, defect)

defect
Not set
minor

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: dmosedale, Assigned: jminta)

References

Details

Attachments

(1 file, 1 obsolete file)

We should probably default the dialog with an event that should start around the time that was clicked and last for 1/2 hour or an hour.
See bug 321535 for a similar problem with creating events at the last clicked time.
Attached patch views-part (obsolete) — Splinter Review
This is the patch for the views-side of things.  We also need to modify the controllers, but I'm not going to go do that until they're unified.  Why do double work/testing?
Assignee: base → jminta
Status: NEW → ASSIGNED
Depends on: 337941
Boy, having this code unified rocks hard.

This patch computes the time that a user dblclicked on and passes that to the view controller, while not passing an end time.  I'm using this to signify that the dialog should be opened, defaulting to that time.  This is the behavior of Sunbird 0.2 and this bug marks one of the most annoying regressions from the new views landing (remember that?).  This also marks the beginning of moving Sunbird onto the more modern item creation functions.
Attachment #229324 - Attachment is obsolete: true
Attachment #230665 - Flags: first-review?(dmose)
*** Bug 345931 has been marked as a duplicate of this bug. ***
Comment on attachment 230665 [details] [diff] [review]
compute time, pass it around

+            var date = currentView().selectedDay.clone();
+            date.isDate = false;
+            var start = aStartTime || date;
We don't always need the |date| object, so only create it when we need to.

+            newStart.minute = (Math.floor(pos/interval + .5) * 15) + this.mStartMin;
+            newStart.normalize();
define 15 as a constant.  Also include a comment, or restructure about the way you're abusing floor here.  round might be better.

    * to aEndTime.
    */
   void createNewEvent (in calICalendar aCalendar,
 		       in calIDateTime aStartTime,
 		       in calIDateTime aEndTime);
Also doc what it might mean to call this with the calendar parameter as null.

r=dmose with that.
Attachment #230665 - Flags: first-review?(dmose) → first-review+
patch checked in.
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
it does not work perfect for midnight (clicking ~23.50 start time moves to next day), however it's ok for the rest cases

verified with
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20060909 Calendar/0.3a2+
Status: RESOLVED → VERIFIED
Whiteboard: [litmus testcase wanted]
Litmus testcase 2604 created
Whiteboard: [litmus testcase wanted]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: