Selected calendar will not be restored after restart

VERIFIED FIXED

Status

VERIFIED FIXED
12 years ago
12 years ago

People

(Reporter: frank.loehmann, Assigned: thomas.benisch)

Tracking

Details

Attachments

(2 attachments)

(Reporter)

Description

12 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1) Gecko/20061010 Firefox/2.0
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1) Gecko/20061010 Firefox/2.0

The selected calendar is used to create new events by default.

Lightning creates a local default calendar. If the user creates a new calendar (i.e. linked to a network) and selects this calendar after creating it, this calendar selection will not be remembered/restored if Lightning gets restarted. Thus new created events are going to the wrong calendar.

Proposed solution: Restoring the latest selection in the calendar tab would solve this problem.

Reproducible: Always

Steps to Reproduce:
1. Install Lightning 
2. Create calendar from network (i.e. WCAP)
3. Select the new calendar 
4. Close Thunderbird/Lightning
5. Start Thunderbird/Lightning

Actual Results:  
First calendar gets selected after restart.

Comment 1

12 years ago
I'll pre-emptively give a ui-review+ to a patch that does what's described here,   since it makes the calendar act more like a physical object.
(Assignee)

Comment 2

12 years ago
*** Bug 363432 has been marked as a duplicate of this bug. ***
(Assignee)

Updated

12 years ago
Assignee: nobody → thomas.benisch
(Assignee)

Comment 3

12 years ago
Created attachment 248253 [details] [diff] [review]
select default calendar patch

This patch selects the stored default calendar in the calendar tab list
right after application start.
Attachment #248253 - Flags: first-review?(lilmatt)
Comment on attachment 248253 [details] [diff] [review]
select default calendar patch

>+function getIndexForCalendar(calendar) {
Please use aCalendar here...

>+    // Special trick to compare interface pointers, since normal, ==
>+    // comparison can fail due to javascript wrapping.
>+    var sip = Components.classes["@mozilla.org/supports-interface-pointer;1"]
>+                        .createInstance(Components.interfaces.nsISupportsInterfacePointer);
>+    sip.data = calendar;
...and here.


r=lilmatt

I would love a similar patch for Sunbird
Attachment #248253 - Flags: first-review?(lilmatt) → first-review+
(Assignee)

Comment 5

12 years ago
Created attachment 248504 [details] [diff] [review]
Sunbird select default calendar patch

This patch selects the stored default calendar in the Sunbird calendar list
right after application start.
Attachment #248504 - Flags: first-review?(lilmatt)
Comment on attachment 248504 [details] [diff] [review]
Sunbird select default calendar patch

>+++ mozilla/calendar/resources/content/calendarManagement.js	2006-12-13 12:37:04.625000000 >         calendarList.appendChild(listItem);
>     }
>+    // Ensure that a calendar is selected in calendar list after startup.
>+    if (!oldSelection || oldSelection < 0) {
>+        var defaultCalendar = composite.defaultCalendar;
>+        var item = defaultCalendar ? getListItem(defaultCalendar) : null;
>+        oldSelection = item ? calendarList.getIndexOfItem(item) : 0;
>+    }
>+    if (oldSelection >= calendars.length) {
>+        oldSelection = calendars.length-1;
>+    }
>     calendarList.selectedIndex = oldSelection;

Please put a blank line on either side of what you added for increased readability.

Otherwise, r=lilmatt
Attachment #248504 - Flags: first-review?(lilmatt) → first-review+
(Assignee)

Comment 7

12 years ago
patch checked in on HEAD and MOZILLA_1_8_BRANCH
(Assignee)

Updated

12 years ago
Status: UNCONFIRMED → RESOLVED
Last Resolved: 12 years ago
Resolution: --- → FIXED
Summary: Selected calendar will not be restored after restart of Lightning → Selected calendar will not be restored after restart

Comment 8

12 years ago
verified with
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20061215 Calendar/0.4a1
Status: RESOLVED → VERIFIED
Whiteboard: [litmus testcase wanted]

Comment 9

12 years ago
Litmus testcase 2899 created
Whiteboard: [litmus testcase wanted]
You need to log in before you can comment on or make changes to this bug.