Closed Bug 949444 Opened 11 years ago Closed 10 years ago

[Today Pane] Create new event/task from agenda list box by double click is not covered by command controller

Categories

(Calendar :: Lightning Only, defect)

Lightning 2.6.3
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: MakeMyDay, Assigned: MakeMyDay)

Details

Attachments

(1 file, 1 obsolete file)

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:26.0) Gecko/20100101 Firefox/26.0 (Beta/Release)
Build ID: 20131205075310

Steps to reproduce:

1. Go to calendar tab select a calendar and mark is readonly
2. Switch to Mail tab with today Pane enabled
3. Double click in agenda list box (either events or tasks)


Actual results:

A new item dialog opens on double click, while the according menu controls (new event butoon and task text input field) are disabled.


Expected results:

The double click command should handled the same way as the respective control element.
To solve this, it may either require 

1) a check on commandController's isCommandEnabled before firing the createEventWithDialog in agenda-listbox.js (see http://mxr.mozilla.org/comm-central/source/calendar/base/content/agenda-listbox.js#569) or 

2) - probably better - implement doCommandWithParams (see http://mxr.mozilla.org/comm-central/source/mozilla/content/xul/document/public/nsIController.idl#29) and use this in agenda-list.js instead of firing the createEventWithDialog directly

The attached  patch takes the introduces the check as in 1), even though the second would be the more elegant way. Double click into todo part of today pane is not yet covered, because I just have not figured out from where the dialog is launched. Any hint is appreciated.

For notice: there are some more places where the createNewEventDialog is launched (see http://mxr.mozilla.org/comm-central/ident?i=createEventWithDialog&tree=comm-central), so it may require to patch it in the same way to reflect the CommandEnabled status consequently throughout the calendar, but I have not investigated this so far.
Attachment #8348724 - Flags: review?(philipp)
Assignee: nobody → makemyday
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Comment on attachment 8348724 [details] [diff] [review]
CheckCommandStateBeforeCreateEventInAgendaListbox-V1.patch

Review of attachment 8348724 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good, r=philipp
Attachment #8348724 - Flags: review?(philipp) → review+
Attached patch Fix - v2 — — Splinter Review
Some minor whitespace cleanup and patch header ready for checkin.
Attachment #8348724 - Attachment is obsolete: true
Attachment #8392459 - Flags: review+
https://hg.mozilla.org/comm-central/rev/297a405a9c85
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → 3.1
Target Milestone: 3.1 → 3.3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: