Closed Bug 329582 Opened 14 years ago Closed 11 years ago

remove gCalendarWindow

Categories

(Calendar :: Sunbird Only, defect)

defect
Not set

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: jminta, Assigned: martinschroeder)

References

Details

Attachments

(2 files, 1 obsolete file)

The fact that so many separate areas depend on gCalendarWindow was one of the reasons why the new views patch had to be as large as it was.  Instead, I think a much better code model is to have many smaller, independent areas of the code.  This helps in making other fixes of bugs much smaller and easier to review.

After the landing of the new views, gCalendarWindow became dramatically smaller, and non-essential to proper Sunbird functioning.  This bug is to finish removing the remaining areas of the code that depend on it and eventually stop packaging calendarWindow.js all together.  Some of the smaller parts of gCalendarWindow can be removed by patches directly in this bug.  However, this also depends on:
Bug 321384 - to remove gCalendarWindow.EventSelection
Bug 306079 - to remove gCalendarWindow.CalendarPreferences
Bug 322768 - to remove gCalendarWindow.dateFormater
When the new views landed, I changed gCalendarWindow.currentView from an actual pointer to a view into a shim to minimize patch size.  This patch removes that extra object, updating the areas that relied on it to use the new appropriate calls.  This also allows us to remove several uses of jsDateToDateTime, which is generally a plus.

For the most part, this patch changes no behavior.  The one thing that it does change is that the arguments for newEvent and newToDo are now calDateTime objects, rather than jsDate objects.  No one actually passed arguments in, so this change is rather moot, but I thought I'd point it out.

This patch also removes/consolidates a few onmouseup functions that were watching splitters.
Attachment #214282 - Flags: first-review?(mvl)
Blocks: 283512
Blocks: 317786
Blocks: 337531
Comment on attachment 214282 [details] [diff] [review]
remove gCalendarWindow.currentView

This patch is horribly rotted at this point :-(
Attachment #214282 - Flags: first-review?(mvl)
No longer blocks: 317786
This patch takes care of a bunch of the easily removed stuff, resulting especially from the introduction of nice new helper functions in calendar-views.js.  We have:

-remove .currentView.goToNext/goToPrevious in favor of moveView(1);
-remove obsolete event handlers (for splitter movement)
-remove .getSelectedDate() in favor of currentView().selectedDay.jsDate (we should work to remove the jsDate stuff here later
-remove calendarMail.js, which depends on the nonexistent gCalendarWindow.EventSelection
-remove various other .currentView stuff that's no longer used.
Attachment #214282 - Attachment is obsolete: true
Attachment #247622 - Flags: second-review?(mvl)
Attachment #247622 - Flags: first-review?(lilmatt)
Comment on attachment 247622 [details] [diff] [review]
[checked in] remove easy stuff

r=lilmatt

Are we not cvs rm-ing calendarMail.js on purpose in this patch?
Attachment #247622 - Flags: first-review?(lilmatt) → first-review+
Comment on attachment 247622 [details] [diff] [review]
[checked in] remove easy stuff

>Index: calendar/resources/jar.mn
>-    content/calendar/calendarMail.js (content/calendarMail.js)
http://lxr.mozilla.org/seamonkey/source/calendar/sunbird/base/content/calendar-sets.inc#56 still calls a function from that file.

> CalendarWindow.prototype.pickAndGoToDate = function calWin_pickAndGoToDate( )
> {
>-  var currentView = document.getElementById("view-deck").selectedPanel;
>   var args = new Object();
>-  args.initialDate = this.getSelectedDate();  
>+  args.initialDate = currentView().selectedDay.getInTimezone("floating").jsDate;
>   args.onOk = function receiveAndGoToDate( pickedDate ) {
>-    currentView.goToDay( jsDateToDateTime(pickedDate) );
>+    currentView().goToDay( jsDateToDateTime(pickedDate) );

Why are you converting from calIDAteTime to jsDate first, and then vonverting back? That looks silly.

r2=mvl with that fixed
Attachment #247622 - Flags: second-review?(mvl) → second-review+
Assignee: nobody → jminta
Whiteboard: [needs checkin]
Target Milestone: --- → Sunbird 0.5
Patch checked in with the mail bits removed.  I need to convert back and forth for the js-bits because we use a datepicker that needs a js-date.
(In reply to comment #5)
> >-    content/calendar/calendarMail.js (content/calendarMail.js)
> http://lxr.mozilla.org/seamonkey/source/calendar/sunbird/base/content/calendar-sets.inc#56
> still calls a function from that file.

Perhaps the link is outdated, but that link points to PrintUtils.showPageSetup(); which is part of toolkit, not calendarMail.js.


(In reply to comment #7)
> Perhaps the link is outdated,
The link previously pointed to "send_event_command".
(In reply to comment #8)
I think "send_event_command" can be removed from Sunbird.

It hasn't worked in forever, and it's not going to for a bit.

Then we can get the rest of the dependencies cleaned up from this patch. 

(In reply to comment #9)
> (In reply to comment #8)
> I think "send_event_command" can be removed from Sunbird.
I did get rid of it when I landed the patch last night.  That's what I meant about 'mail bits removed'.

Whiteboard: [needs checkin]
Not going to make the 0.5 train.
Target Milestone: Sunbird 0.5 → ---
No longer blocks: 283512
Re-assigning my bugs to nobody@mozilla.org due to recent developments.
Assignee: jminta → nobody
Is this bug still valid? What actions are remaining? According to MXR there are still 6 references to gCalendarWindow: http://mxr.mozilla.org/seamonkey/search?string=gCalendarWindow
I'll try to finish this.
Assignee: nobody → mschroeder
Version: Trunk → unspecified
Status: NEW → ASSIGNED
Attachment #247622 - Attachment description: remove easy stuff → [checked in] remove easy stuff
Comment on attachment 344049 [details] [diff] [review]
(Re-)Move remaining gCalendarWindow stuff v1

r=dbo
Attachment #344049 - Flags: review?(daniel.boelzle) → review+
Pushed to comm-central <http://hg.mozilla.org/comm-central/rev/1b5f6939cb84>

-> FIXED
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → 1.0
Checked in lightning and sunbird build 20090128 -> VERIFIED.
Status: RESOLVED → VERIFIED
Target Milestone: 1.0 → 1.0b1
You need to log in before you can comment on or make changes to this bug.