Fix bug 455542 - Soon is subjective and should be configurable. r=berend, p=decathlon
authorDaniel Boelzle [:dbo] <daniel.boelzle@sun.com>
Thu, 25 Sep 2008 11:42:45 +0200
changeset 436 8bbc55aa65500094564a2289748e2ba7941a4563
parent 435 daa9cfd3fa34798a6cc90df181a549349d5c0dce
child 437 223f113ae510bd687e50b59c295798e6b4f7bd28
push idunknown
push userunknown
push dateunknown
reviewersberend
bugs455542
Fix bug 455542 - Soon is subjective and should be configurable. r=berend, p=decathlon
calendar/base/content/agenda-listbox.js
calendar/lightning/content/lightning.js
--- a/calendar/base/content/agenda-listbox.js
+++ b/calendar/base/content/agenda-listbox.js
@@ -53,17 +53,18 @@ function initAgendaListbox() {
     this.agendaListboxControl = document.getElementById("agenda-listbox");
     this.agendaListboxControl.removeAttribute("suppressonselect");
     var showTodayHeader = (document.getElementById("today-header-hidden").getAttribute("checked") == "true");
     var showTomorrowHeader = (document.getElementById("tomorrow-header-hidden").getAttribute("checked") == "true");
     var showSoonHeader = (document.getElementById("nextweek-header-hidden").getAttribute("checked") == "true");
     this.today = new Synthetic(showTodayHeader, 1);
     this.addPeriodListItem(this.today, "today-header");
     this.tomorrow = new Synthetic(showTomorrowHeader, 1);
-    this.soon = new Synthetic(showSoonHeader, 5);
+    var soondays = getPrefSafe("calendar.agendaListbox.soondays", 5);
+    this.soon = new Synthetic(showSoonHeader, soondays);
     this.periods = [this.today, this.tomorrow, this.soon];
 
     // Make sure the agenda listbox is unloaded
     var self = this;
     window.addEventListener("unload",
                             function unload_agendaListbox() {
                                 self.uninit();
                             },
--- a/calendar/lightning/content/lightning.js
+++ b/calendar/lightning/content/lightning.js
@@ -41,16 +41,19 @@
 
 // general settings
 pref("calendar.date.format", 0);
 pref("calendar.event.defaultlength", 60);
 
 // default transparency of allday items; could be switched to e.g. "OPAQUE":
 pref("calendar.allday.defaultTransparency", "TRANSPARENT");
 
+// number of days in "Soon" section
+pref("calendar.agendaListbox.soondays", 5);
+
 // alarm settings
 pref("calendar.alarms.show", true);
 pref("calendar.alarms.showmissed", true);
 pref("calendar.alarms.playsound", true);
 pref("calendar.alarms.soundURL", "chrome://calendar/content/sound.wav");
 pref("calendar.alarms.defaultsnoozelength", 5);
 pref("calendar.alarms.indicator.show", true);
 pref("calendar.alarms.indicator.totaltime", 3600);