Closed
Bug 386480
Opened 18 years ago
Closed 18 years ago
View mode is not remembered after thunderbird restart
Categories
(Calendar :: Lightning Only, defect)
Calendar
Lightning Only
Tracking
(Not tracked)
VERIFIED
FIXED
0.7
People
(Reporter: omar.bajraszewski, Assigned: giermann)
References
Details
Attachments
(1 file, 1 obsolete file)
5.81 KB,
patch
|
michael.buettner
:
review+
|
Details | Diff | Splinter Review |
Using lightning 0.7pre 2007063017 and thunderbird 2.0.0.4
When I switched to calendar mode I saw week view. I changed it to month view and then restarted thunderbird And after I switched to calendar mode I saw week view again
Comment 1•18 years ago
|
||
Christian, do you want to preserve the last visible view across sessions? I personally think it's a valid request.
OS: Windows XP → All
Hardware: PC → All
Comment 2•18 years ago
|
||
Makes sense for me, too.
- After restart the default should always be the mail mode
- In calendar mode the last selected view should be used.
Assignee | ||
Comment 3•18 years ago
|
||
(In reply to comment #2)
> - After restart the default should always be the mail mode
Maybe this is not, what the user wants - see Bug 359807.
I don't know, if it possible for Lightning to read the command-line options, but maybe someone knows how...
Assignee | ||
Comment 4•18 years ago
|
||
I agree with Stefan, to solve this one together with bug 386830.
Comment 5•18 years ago
|
||
Is this a regression? I'd say so, but I can't totally recall right now. If so, it needs the key word.
Comment 6•18 years ago
|
||
(In reply to comment #5)
This is no regression.
Assignee | ||
Comment 7•18 years ago
|
||
I chose to attach this patch here rather than to Bug 386830, because the main part regards the last visted view.
This makes the checked state (introduced in Bug 376086) persistant and restores the global variable gLastShownCalendarView in ltnOnLoad().
Attachment #274774 -
Flags: review?(michael.buettner)
Updated•18 years ago
|
Assignee: nobody → giermann
Updated•18 years ago
|
Status: NEW → ASSIGNED
Comment 8•18 years ago
|
||
Any chance of getting this reviewed soon? It is hard to "sell" Lightning when this isn't working as expected.
Assignee | ||
Comment 9•18 years ago
|
||
Comment on attachment 274774 [details] [diff] [review]
Make the last view persist and use it for choosing the initial view
Moving review to Philipp to get some progress...
Attachment #274774 -
Flags: review?(michael.buettner) → review?(philipp)
Comment 10•18 years ago
|
||
Comment on attachment 274774 [details] [diff] [review]
Make the last view persist and use it for choosing the initial view
I'd recommend to
>+++ mozilla/calendar/lightning/content/messenger-overlay-sidebar.js
>@@ -385,16 +369,29 @@ function ltnOnLoad(event)
>+ var availableViews = getViewDeck();
>+ for (var i = 0; i < availableViews.childNodes.length; i++) {
read availableViews.childNodes.length only once and store it in a variable
>+ var view = availableViews.childNodes[i];
>+ var command = document.getElementById(view.id+"-command");
>+ if( command.hasAttribute("checked") )
check for valid command value too: if ( command && command.hasAttribute(...
>+ gLastShownCalendarView = view.id.substring(0, view.id.indexOf('-'));
>+ }
add curly brackets and leave the for loop via break if we found the view
Assignee | ||
Comment 11•18 years ago
|
||
Updated patch with Stefan's recommendations addressed.
Attachment #274774 -
Attachment is obsolete: true
Attachment #281638 -
Flags: review?(philipp)
Attachment #274774 -
Flags: review?(philipp)
Comment 12•18 years ago
|
||
Comment on attachment 281638 [details] [diff] [review]
patch v2
Shifting review to mickey.
Attachment #281638 -
Flags: review?(philipp) → review?(michael.buettner)
Comment 13•18 years ago
|
||
Comment on attachment 281638 [details] [diff] [review]
patch v2
>+ // find last shown calendar view (persist="checked")
>+ try {
>+ var availableViews = getViewDeck();
>+ for (var i = availableViews.childNodes.length - 1; i >= 0; i--) {
As Stefan already suggested it is a bit more efficient to read availableViews.childNodes.length only once and store it in a variable.
>+ var view = availableViews.childNodes[i];
>+ var command = document.getElementById(view.id+"-command");
>+ if ( command && command.hasAttribute("checked") ) {
Superfluous blank after around braces, and more important we probably should explicitly check if the attribute equals the value 'true'.
>+ } catch(ex) {}
I also suggest to remove the try/catch block.
>+ if( gLastShownCalendarView == null )
>+ gLastShownCalendarView = 'month';
Curly braces are missing, no blank after 'if', superfluous blanks around braces.
> // show the last displayed type of calendar view
>- if(gLastShownCalendarView == null)
>- gLastShownCalendarView = 'week';
Missing blank after keyword, missing curly braces.
Since all these comments are just minor style nits and the patch is indeed working as advertised, I'm going to fix this before checking it in. r=mickey. Thanks for the patch, Sven. BTW, feel free to remind me from time to time that a patch you're waiting on is stuck in my review queue, I really didn't have this on my radar. Thanks again for being patient.
Attachment #281638 -
Flags: review?(michael.buettner) → review+
Comment 14•18 years ago
|
||
patch checked in on trunk and MOZILLA_1_8_BRANCH
-> FIXED
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Updated•18 years ago
|
Target Milestone: --- → 0.7
Comment 15•18 years ago
|
||
(In reply to comment #13)
> (From update of attachment 281638 [details] [diff] [review])
> >+ for (var i = availableViews.childNodes.length - 1; i >= 0; i--) {
> As Stefan already suggested it is a bit more efficient to read
> availableViews.childNodes.length only once and store it in a variable.
This was not the solution I had in mind during writting Comment #10 but the change as shown above reads availableViews.childNodes.length only once ;)
You need to log in
before you can comment on or make changes to this bug.
Description
•