Bug 353696 - View/Number-of-weeks is not updated/synced with Option weeks-to-show;patch=gekacheka;r=berend;
authorBerend Cornelius [:berend] <berend.cornelius@sun.com>
Mon, 01 Dec 2008 10:54:55 +0100
changeset 1269 081c4c69d34fbfdbf5cc0a13eb01dae0b3eaf82e
parent 1268 8fcff769ca761830179262a0aca474ebe4a4bfdd
child 1270 499087a4319531ae07a314b9777abd830727442b
push id992
push userBerend.Cornelius@sun.com
push dateMon, 01 Dec 2008 09:55:17 +0000
treeherdercomm-central@081c4c69d34f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersberend
bugs353696
Bug 353696 - View/Number-of-weeks is not updated/synced with Option weeks-to-show;patch=gekacheka;r=berend;
calendar/base/content/calendar-decorated-multiweek-view.xml
calendar/locales/en-US/chrome/calendar/preferences/views.dtd
calendar/locales/en-US/chrome/sunbird/sunbird.dtd
calendar/sunbird/base/content/calendar-menubar.inc
--- a/calendar/base/content/calendar-decorated-multiweek-view.xml
+++ b/calendar/base/content/calendar-decorated-multiweek-view.xml
@@ -65,16 +65,18 @@
             <field name="mWeeksInView">4</field>
 
             <property name="weeksInView">
                 <getter><![CDATA[
                     return this.mWeeksInView;
                 ]]></getter>
                 <setter><![CDATA[
                     this.mWeeksInView = val;
+                    setPref("calendar.weeks.inview", "INT", val);
+
                     if (this.selectedDay) {
                         this.goToDay(this.selectedDay);
                     }
                     return val;
                 ]]></setter>
             </property>
 
             <property name="observerID">
--- a/calendar/locales/en-US/chrome/calendar/preferences/views.dtd
+++ b/calendar/locales/en-US/chrome/calendar/preferences/views.dtd
@@ -56,17 +56,17 @@
 <!ENTITY pref.calendar.view.daystart.label "Day starts at:">
 <!ENTITY pref.calendar.view.daystart.accesskey "D">
 <!ENTITY pref.calendar.view.dayend.label "Day ends at:">
 <!ENTITY pref.calendar.view.dayend.accesskey "y">
 <!ENTITY pref.calendar.view.visiblehours.label "Show:">
 <!ENTITY pref.calendar.view.visiblehours.accesskey "o">
 <!ENTITY pref.calendar.view.visiblehoursend.label "hours at a time">
 
-<!ENTITY pref.numberofweeks.label "Default weeks to show (including previous weeks):">
+<!ENTITY pref.numberofweeks.label "Number of weeks to show (including previous weeks):">
 <!ENTITY pref.numberofweeks.accesskey "e">
 <!ENTITY pref.numberofpreviousweeks.label "Previous weeks to show:">
 <!ENTITY pref.numberofpreviousweeks.accesskey "P">
 <!ENTITY pref.numberofweeks.0 "none">
 <!ENTITY pref.numberofweeks.1 "1 week">
 <!ENTITY pref.numberofweeks.2 "2 weeks">
 <!ENTITY pref.numberofweeks.3 "3 weeks">
 <!ENTITY pref.numberofweeks.4 "4 weeks">
--- a/calendar/locales/en-US/chrome/sunbird/sunbird.dtd
+++ b/calendar/locales/en-US/chrome/sunbird/sunbird.dtd
@@ -64,16 +64,17 @@
 <!ENTITY sunbird.calendartab.label                         "Date">
 <!ENTITY sunbird.listofcalendarstab.label                  "Calendars">
 
 <!ENTITY sunbird.find.key                                  "F">
 <!ENTITY sunbird.close.key                                 "W">
 
 <!ENTITY sunbird.menu.numberofweeks.label                  "Number of Weeks" >
 <!ENTITY sunbird.menu.numberofweeks.accesskey              "N" >
+<!ENTITY sunbird.menu.numberofweeks.1                      "1 Week" >
 <!ENTITY sunbird.menu.numberofweeks.2                      "2 Weeks" >
 <!ENTITY sunbird.menu.numberofweeks.3                      "3 Weeks" >
 <!ENTITY sunbird.menu.numberofweeks.4                      "4 Weeks" >
 <!ENTITY sunbird.menu.numberofweeks.5                      "5 Weeks" >
 <!ENTITY sunbird.menu.numberofweeks.6                      "6 Weeks" >
 
 <!-- customizable toolbars -->
 <!ENTITY sunbird.context.customize.label                   "Customize…">
--- a/calendar/sunbird/base/content/calendar-menubar.inc
+++ b/calendar/sunbird/base/content/calendar-menubar.inc
@@ -288,36 +288,46 @@
                      label="&calendar.completedtasks.checkbox.label;"
                      accesskey="&calendar.completedtasks.checkbox.accesskey;"
                      observes="calendar_toggle_show_completed_in_view_command"/>
            <menu id="menu-numberofweeks-inview"
                  label="&sunbird.menu.numberofweeks.label;"
                  accesskey="&sunbird.menu.numberofweeks.accesskey;"
                  oncommand="changeNumberOfWeeks(event.target)"
                  disabled="true">
-           <menupopup>
+           <menupopup onpopupshowing="this.childNodes.item(currentView().weeksInView - 1).setAttribute('checked', true);">
+             <menuitem type="radio"
+                       value="1"
+                       name="menunbofweeks"
+                       accesskey="1"
+                       label="&sunbird.menu.numberofweeks.1;"/>
              <menuitem type="radio"
                        value="2"
                        name="menunbofweeks"
+                       accesskey="2"
                        label="&sunbird.menu.numberofweeks.2;"/>
              <menuitem type="radio"
                        value="3"
                        name="menunbofweeks"
+                       accesskey="3"
                        label="&sunbird.menu.numberofweeks.3;"/>
              <menuitem type="radio"
                        value="4"
                        name="menunbofweeks"
+                       accesskey="4"
                        label="&sunbird.menu.numberofweeks.4;"/>
              <menuitem type="radio"
                        value="5"
                        name="menunbofweeks"
+                       accesskey="5"
                        label="&sunbird.menu.numberofweeks.5;"/>
              <menuitem type="radio"
                        value="6"
                        name="menunbofweeks"
+                       accesskey="6"
                        label="&sunbird.menu.numberofweeks.6;"/>
            </menupopup>
            </menu>
            <menuseparator/>
            <!-- XXX lilmatt: Finish this! -->
            <menuitem id="calendar-fullscreen-menu"
                      label="&calendar.fullscreen.label;"
                      accesskey="&calendar.fullscreen.accesskey;"