Comment 56 for bug 849624

Revision history for this message
In , Giermann (giermann) wrote :

Created attachment 338838
Commandline options v6 working

(In reply to comment #48)
> * Something is fishy with the menus, starting with -taskmode or -calendar gives
> a mix of both mail and calendar menus, works when switching back and forth
> modes
I solved this by an initial call to swapPopupMenus() in ltnInitializeMenus().

> * Something is keeping -calendar from working. I'm too tired to debug this now
> but I think its a minor issue
This seems to be related to WHEN commonInitCalendar() is called. I shifted it down in ltnOnLoad() which works for me now and also prevents its call twice, as it's positioned after the removal of the onLoad listener.

There was also a minor case-typo in calHandleChromeStartupOptions():
- if (showDate && showdate.length) {
+ if (showDate && showDate.length) {

Futhermore I completed your addition of return values, also to selectCalendarView() and ltnSelectCalendarView().

I did not change any names of the command-line switches, which is rather quickly done.

There are still some possibilities to consolidate some code:

- The check for existence of requested views and the current mode could be removed from ltnShowCalendarView() as this is already done in switchToView() and ltnSwitch2Calendar():
>function ltnShowCalendarView(type) {
> if (ltnSelectCalendarView(type)) {
> ltnSwitch2Calendar();
> return true;
> }
> return false;
>}

- change ltnSwitch2Calendar() to also call ltnSelectCalendarView() or switchToView() instead of showCalendarView()

- take care of and hand over the result code from switchToView() also in ltnSwitch2Calendar()

I did not change these mainly because of the existing comment for showCalendarView():
  * XXX Kind of confusing. This function calls the app specific function, which
  * again calls the common switchToView function. They should be consolidated in
  * a different bug.