Fixing bugs 156791 and 122646.
git-svn-id: svn://10.0.0.236/trunk@126662 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
* Mike Potter <mikep@oeone.com>
|
||||
* Colin Phillips <colinp@oeone.com>
|
||||
* Chris Charabaruk <ccharabaruk@meldstar.com>
|
||||
* ArentJan Banck <ajbanck@planet.nl>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
@@ -220,6 +221,31 @@ function loadCalendarEventDialog()
|
||||
|
||||
setFieldValue( "repeat-until-radio", (gEvent.recurForever == undefined || gEvent.recurForever == false), "selected" );
|
||||
|
||||
|
||||
// Load categories
|
||||
var categoriesString = opener.gCalendarWindow.calendarPreferences.getPref( "categories" );
|
||||
var categoriesList = categoriesString.split( "," );
|
||||
|
||||
// insert the category already in the task so it doesn't get lost
|
||||
if( gEvent.categories )
|
||||
if( categoriesString.indexOf( gEvent.categories ) == -1 )
|
||||
categoriesList[categoriesList.length] = gEvent.categories;
|
||||
|
||||
// categoriesList.sort();
|
||||
|
||||
var oldMenulist = document.getElementById( "categories-menulist-menupopup" );
|
||||
while( oldMenulist.hasChildNodes() )
|
||||
oldMenulist.removeChild( oldMenulist.lastChild );
|
||||
|
||||
for (var i = 0; i < categoriesList.length ; i++)
|
||||
{
|
||||
document.getElementById( "categories-field" ).appendItem(categoriesList[i], categoriesList[i]);
|
||||
}
|
||||
|
||||
document.getElementById( "categories-field" ).selectedIndex = -1;
|
||||
setFieldValue( "categories-field", gEvent.categories );
|
||||
|
||||
|
||||
// update enabling and disabling
|
||||
|
||||
updateRepeatItemEnabled();
|
||||
@@ -309,6 +335,9 @@ function onOKCommand()
|
||||
{
|
||||
gEvent.alarmEmailAddress = "";
|
||||
}
|
||||
|
||||
gEvent.categories = getFieldValue( "categories-field", "value" );
|
||||
|
||||
gEvent.recur = getFieldValue( "repeat-checkbox", "checked" );
|
||||
gEvent.recurUnits = getFieldValue( "repeat-length-units", "value" );
|
||||
gEvent.recurForever = getFieldValue( "repeat-forever-radio", "selected" );
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
- Mike Potter <mikep@oeone.com>
|
||||
- Colin Phillips <colinp@oeone.com>
|
||||
- Chris Charabaruk <ccharabaruk@meldstar.com>
|
||||
- ArentJan Banck <ajbanck@planet.nl>
|
||||
-
|
||||
- Alternatively, the contents of this file may be used under the terms of
|
||||
- either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
@@ -263,6 +264,19 @@
|
||||
</hbox>
|
||||
</vbox>
|
||||
</row>
|
||||
|
||||
|
||||
<!-- Categories -->
|
||||
<row align="center">
|
||||
<hbox class="field-label-box-class" pack="end">
|
||||
<label value="&newtodo.categories.label;"/>
|
||||
</hbox>
|
||||
<menulist id="categories-field" flex="1">
|
||||
<menupopup id="categories-menulist-menupopup">
|
||||
<menuitem label="&priority.level.none;" value="0"/>
|
||||
</menupopup>
|
||||
</menulist>
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
</tabpanel>
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
* Mike Potter <mikep@oeone.com>
|
||||
* Colin Phillips <colinp@oeone.com>
|
||||
* Chris Charabaruk <coldacid@meldstar.com>
|
||||
* ArentJan Banck <ajbanck@planet.nl>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
@@ -163,9 +164,8 @@ function loadCalendarToDoDialog()
|
||||
setFieldValue( "alarm-length-units", gToDo.alarmUnits );
|
||||
|
||||
|
||||
// Load default categories
|
||||
this.categoriesStringBundle = srGetStrBundle("chrome://calendar/locale/categories.properties");
|
||||
var categoriesString = this.categoriesStringBundle.GetStringFromName("categories" );
|
||||
// Load categories
|
||||
var categoriesString = opener.gCalendarWindow.calendarPreferences.getPref( "categories" );
|
||||
var categoriesList = categoriesString.split( "," );
|
||||
|
||||
// insert the category already in the task so it doesn't get lost
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
* Mike Potter <mikep@oeone.com>
|
||||
* Colin Phillips <colinp@oeone.com>
|
||||
* Chris Charabaruk <ccharabaruk@meldstar.com>
|
||||
* ArentJan Banck <ajbanck@planet.nl>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
@@ -220,6 +221,31 @@ function loadCalendarEventDialog()
|
||||
|
||||
setFieldValue( "repeat-until-radio", (gEvent.recurForever == undefined || gEvent.recurForever == false), "selected" );
|
||||
|
||||
|
||||
// Load categories
|
||||
var categoriesString = opener.gCalendarWindow.calendarPreferences.getPref( "categories" );
|
||||
var categoriesList = categoriesString.split( "," );
|
||||
|
||||
// insert the category already in the task so it doesn't get lost
|
||||
if( gEvent.categories )
|
||||
if( categoriesString.indexOf( gEvent.categories ) == -1 )
|
||||
categoriesList[categoriesList.length] = gEvent.categories;
|
||||
|
||||
// categoriesList.sort();
|
||||
|
||||
var oldMenulist = document.getElementById( "categories-menulist-menupopup" );
|
||||
while( oldMenulist.hasChildNodes() )
|
||||
oldMenulist.removeChild( oldMenulist.lastChild );
|
||||
|
||||
for (var i = 0; i < categoriesList.length ; i++)
|
||||
{
|
||||
document.getElementById( "categories-field" ).appendItem(categoriesList[i], categoriesList[i]);
|
||||
}
|
||||
|
||||
document.getElementById( "categories-field" ).selectedIndex = -1;
|
||||
setFieldValue( "categories-field", gEvent.categories );
|
||||
|
||||
|
||||
// update enabling and disabling
|
||||
|
||||
updateRepeatItemEnabled();
|
||||
@@ -309,6 +335,9 @@ function onOKCommand()
|
||||
{
|
||||
gEvent.alarmEmailAddress = "";
|
||||
}
|
||||
|
||||
gEvent.categories = getFieldValue( "categories-field", "value" );
|
||||
|
||||
gEvent.recur = getFieldValue( "repeat-checkbox", "checked" );
|
||||
gEvent.recurUnits = getFieldValue( "repeat-length-units", "value" );
|
||||
gEvent.recurForever = getFieldValue( "repeat-forever-radio", "selected" );
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
- Mike Potter <mikep@oeone.com>
|
||||
- Colin Phillips <colinp@oeone.com>
|
||||
- Chris Charabaruk <ccharabaruk@meldstar.com>
|
||||
- ArentJan Banck <ajbanck@planet.nl>
|
||||
-
|
||||
- Alternatively, the contents of this file may be used under the terms of
|
||||
- either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
@@ -263,6 +264,19 @@
|
||||
</hbox>
|
||||
</vbox>
|
||||
</row>
|
||||
|
||||
|
||||
<!-- Categories -->
|
||||
<row align="center">
|
||||
<hbox class="field-label-box-class" pack="end">
|
||||
<label value="&newtodo.categories.label;"/>
|
||||
</hbox>
|
||||
<menulist id="categories-field" flex="1">
|
||||
<menupopup id="categories-menulist-menupopup">
|
||||
<menuitem label="&priority.level.none;" value="0"/>
|
||||
</menupopup>
|
||||
</menulist>
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
</tabpanel>
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
-
|
||||
- Contributor(s):
|
||||
- Mike Potter <mikep@oeone.com>
|
||||
- ArentJan Banck <ajbanck@planet.nl>
|
||||
-
|
||||
- Alternatively, the contents of this file may be used under the terms of
|
||||
- either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
@@ -46,20 +47,20 @@
|
||||
|
||||
<page xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
onload="parent.initPanel('chrome://calendar/content/pref/calendarPref.xul');"
|
||||
headertitle="Calendar">
|
||||
headertitle="&calendarPanel.label;">
|
||||
|
||||
<script type="application/x-javascript" src="chrome://calendar/content/pref/calendarPref.js"/>
|
||||
|
||||
<script type="application/x-javascript">
|
||||
<![CDATA[
|
||||
var _elementIDs = [
|
||||
"alarmshow", "alarmplaysound", "dateformat", "weekstarts", "defaultlength", "defaultsnoozelength"
|
||||
"alarmshow", "alarmplaysound", "categories", "dateformat", "weekstarts", "defaultlength", "defaultsnoozelength"
|
||||
];
|
||||
]]>
|
||||
</script>
|
||||
|
||||
<groupbox align="start" orient="vertical">
|
||||
<caption label="&pref.mainbox.caption;"/>
|
||||
<caption label="&pref.mainbox.label;"/>
|
||||
<description>&pref.alarmgoesoff.label;</description>
|
||||
<checkbox id="alarmplaysound" prefstring="calendar.alarms.playsound"
|
||||
label="&pref.playasound;" />
|
||||
@@ -68,40 +69,45 @@
|
||||
label="&pref.showalarmbox;" />
|
||||
|
||||
<vbox>
|
||||
<description>Date Text Format: </description>
|
||||
<description>&pref.dateformat.label;</description>
|
||||
<menulist id="dateformat" crop="none" prefstring="calendar.date.format">
|
||||
<menupopup id="dateformat">
|
||||
<menuitem label="Long (ie. Apr 1, 2002)" value="0"/>
|
||||
<menuitem label="Short Format (ie. 04/01/02)" value="1"/>
|
||||
<menuitem label="&pref.dateformat.long;" value="0"/>
|
||||
<menuitem label="&pref.dateformat.short;" value="1"/>
|
||||
</menupopup>
|
||||
</menulist>
|
||||
</vbox>
|
||||
|
||||
<vbox>
|
||||
<description>First Day Of The Week: </description>
|
||||
<description>&pref.weekstarts.label;</description>
|
||||
<menulist id="weekstarts" prefstring="calendar.week.start">
|
||||
<menupopup id="weekstarts">
|
||||
<menuitem label="Sunday" value="0"/>
|
||||
<menuitem label="Monday" value="1"/>
|
||||
<menuitem label="Tuesday" value="2"/>
|
||||
<menuitem label="Wednesday" value="3"/>
|
||||
<menuitem label="Thursday" value="4"/>
|
||||
<menuitem label="Friday" value="5"/>
|
||||
<menuitem label="Saturday" value="6"/>
|
||||
<menuitem label="&pref.weekstarts.sunday;" value="0"/>
|
||||
<menuitem label="&pref.weekstarts.monday;" value="1"/>
|
||||
<menuitem label="&pref.weekstarts.tuesday;" value="2"/>
|
||||
<menuitem label="&pref.weekstarts.wednesday;" value="3"/>
|
||||
<menuitem label="&pref.weekstarts.thursday;" value="4"/>
|
||||
<menuitem label="&pref.weekstarts.friday;" value="5"/>
|
||||
<menuitem label="&pref.weekstarts.saturday;" value="6"/>
|
||||
</menupopup>
|
||||
</menulist>
|
||||
</vbox>
|
||||
|
||||
<hbox align="center">
|
||||
<description>Default Event Length: </description>
|
||||
<description>&pref.defaultlength.label;</description>
|
||||
<textbox id="defaultlength" preftype="int" prefstring="calendar.event.defaultlength" maxlength="3" size="3"/>
|
||||
<label value="Minutes"/>
|
||||
</hbox>
|
||||
|
||||
<hbox align="center">
|
||||
<description>Default Snooze Length: </description>
|
||||
<description>&pref.defaultsnoozelength.label;</description>
|
||||
<textbox id="defaultsnoozelength" preftype="int" prefstring="calendar.alarms.defaultsnoozelength" maxlength="3" size="3"/>
|
||||
<label value="Minutes"/>
|
||||
</hbox>
|
||||
|
||||
</groupbox>
|
||||
<groupbox>
|
||||
<caption label="&pref.categories.label;"/>
|
||||
<textbox id="categories" prefstring="calendar.categories.names"/>
|
||||
</groupbox>
|
||||
</page>
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Mike Potter <mikep@oeone.com>
|
||||
* ArentJan Banck <ajbanck@planet.nl>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
@@ -75,6 +76,15 @@ calendarPrefObserver.prototype =
|
||||
|
||||
function calendarPreferences( CalendarWindow )
|
||||
{
|
||||
function getDefaultCategories()
|
||||
{
|
||||
try {
|
||||
var categoriesStringBundle = srGetStrBundle("chrome://calendar/locale/categories.properties");
|
||||
return categoriesStringBundle.GetStringFromName("categories" );
|
||||
}
|
||||
catch(e) { return "" }
|
||||
}
|
||||
|
||||
window.calendarPrefObserver = new calendarPrefObserver( this );
|
||||
|
||||
this.calendarWindow = CalendarWindow;
|
||||
@@ -94,6 +104,7 @@ function calendarPreferences( CalendarWindow )
|
||||
this.calendarPref.setIntPref( "week.start", 0 );
|
||||
this.calendarPref.setIntPref( "event.defaultlength", 60 );
|
||||
this.calendarPref.setIntPref( "alarms.defaultsnoozelength", 10 );
|
||||
this.calendarPref.setCharPref( "categories.names", getDefaultCategories() );
|
||||
this.loadPreferences();
|
||||
}
|
||||
|
||||
@@ -113,6 +124,8 @@ calendarPreferences.prototype.loadPreferences = function()
|
||||
this.arrayOfPrefs.defaulteventlength = this.calendarPref.getIntPref( "event.defaultlength" );
|
||||
|
||||
this.arrayOfPrefs.defaultsnoozelength = this.calendarPref.getIntPref( "alarms.defaultsnoozelength" );
|
||||
|
||||
this.arrayOfPrefs.categories = this.calendarPref.getCharPref( "categories.names" );
|
||||
}
|
||||
|
||||
calendarPreferences.prototype.getPref = function( Preference )
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
* Mike Potter <mikep@oeone.com>
|
||||
* Colin Phillips <colinp@oeone.com>
|
||||
* Chris Charabaruk <coldacid@meldstar.com>
|
||||
* ArentJan Banck <ajbanck@planet.nl>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
@@ -163,9 +164,8 @@ function loadCalendarToDoDialog()
|
||||
setFieldValue( "alarm-length-units", gToDo.alarmUnits );
|
||||
|
||||
|
||||
// Load default categories
|
||||
this.categoriesStringBundle = srGetStrBundle("chrome://calendar/locale/categories.properties");
|
||||
var categoriesString = this.categoriesStringBundle.GetStringFromName("categories" );
|
||||
// Load categories
|
||||
var categoriesString = opener.gCalendarWindow.calendarPreferences.getPref( "categories" );
|
||||
var categoriesList = categoriesString.split( "," );
|
||||
|
||||
// insert the category already in the task so it doesn't get lost
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
- the Initial Developer. All Rights Reserved.
|
||||
-
|
||||
- Contributor(s): Mike Potter <mikep@oeone.com>
|
||||
- ArentJan Banck <ajbanck@planet.nl>
|
||||
-
|
||||
- Alternatively, the contents of this file may be used under the terms of
|
||||
- either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
@@ -36,9 +37,26 @@
|
||||
- ***** END LICENSE BLOCK ***** -->
|
||||
|
||||
<!ENTITY calendar.label "Calendar" >
|
||||
<!ENTITY calendarPanel.label "Calendar" >
|
||||
<!ENTITY calendar.accesskey "c" >
|
||||
|
||||
<!ENTITY pref.mainbox.caption "General Settings" >
|
||||
<!ENTITY pref.mainbox.label "General Settings" >
|
||||
<!ENTITY pref.alarmgoesoff.label "When an alarm goes off:">
|
||||
<!ENTITY pref.playasound "Play a sound" >
|
||||
<!ENTITY pref.showalarmbox "Show an alarm box" >
|
||||
<!ENTITY pref.dateformat.label "Date Text Format:" >
|
||||
<!ENTITY pref.dateformat.long "Long (ie. Apr 1, 2002)" >
|
||||
<!ENTITY pref.dateformat.short "Short Format (ie. 04/01/02)" >
|
||||
<!ENTITY pref.defaultlength.label "Default Event Length:" >
|
||||
<!ENTITY pref.defaultsnoozelength.label "Default Snooze Length:" >
|
||||
|
||||
<!ENTITY pref.weekstarts.label "First Day Of The Week:" >
|
||||
<!ENTITY pref.weekstarts.sunday "Sunday" >
|
||||
<!ENTITY pref.weekstarts.monday "Monday" >
|
||||
<!ENTITY pref.weekstarts.tuesday "Tuesday" >
|
||||
<!ENTITY pref.weekstarts.wednesday "Wednesday" >
|
||||
<!ENTITY pref.weekstarts.thursday "Thursday" >
|
||||
<!ENTITY pref.weekstarts.friday "Friday" >
|
||||
<!ENTITY pref.weekstarts.saturday "Saturday" >
|
||||
|
||||
<!ENTITY pref.categories.label "Categories" >
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
- the Initial Developer. All Rights Reserved.
|
||||
-
|
||||
- Contributor(s): Mike Potter <mikep@oeone.com>
|
||||
- ArentJan Banck <ajbanck@planet.nl>
|
||||
-
|
||||
- Alternatively, the contents of this file may be used under the terms of
|
||||
- either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
@@ -36,9 +37,26 @@
|
||||
- ***** END LICENSE BLOCK ***** -->
|
||||
|
||||
<!ENTITY calendar.label "Calendar" >
|
||||
<!ENTITY calendarPanel.label "Calendar" >
|
||||
<!ENTITY calendar.accesskey "c" >
|
||||
|
||||
<!ENTITY pref.mainbox.caption "General Settings" >
|
||||
<!ENTITY pref.mainbox.label "General Settings" >
|
||||
<!ENTITY pref.alarmgoesoff.label "When an alarm goes off:">
|
||||
<!ENTITY pref.playasound "Play a sound" >
|
||||
<!ENTITY pref.showalarmbox "Show an alarm box" >
|
||||
<!ENTITY pref.dateformat.label "Date Text Format:" >
|
||||
<!ENTITY pref.dateformat.long "Long (ie. Apr 1, 2002)" >
|
||||
<!ENTITY pref.dateformat.short "Short Format (ie. 04/01/02)" >
|
||||
<!ENTITY pref.defaultlength.label "Default Event Length:" >
|
||||
<!ENTITY pref.defaultsnoozelength.label "Default Snooze Length:" >
|
||||
|
||||
<!ENTITY pref.weekstarts.label "First Day Of The Week:" >
|
||||
<!ENTITY pref.weekstarts.sunday "Sunday" >
|
||||
<!ENTITY pref.weekstarts.monday "Monday" >
|
||||
<!ENTITY pref.weekstarts.tuesday "Tuesday" >
|
||||
<!ENTITY pref.weekstarts.wednesday "Wednesday" >
|
||||
<!ENTITY pref.weekstarts.thursday "Thursday" >
|
||||
<!ENTITY pref.weekstarts.friday "Friday" >
|
||||
<!ENTITY pref.weekstarts.saturday "Saturday" >
|
||||
|
||||
<!ENTITY pref.categories.label "Categories" >
|
||||
|
||||
Reference in New Issue
Block a user