Backed out changeset: 6eb5c2543073 because of mozmill failures. a=Paenglab

This commit is contained in:
Richard Marti 2014-12-27 21:50:30 +01:00
Родитель 4b598314a3
Коммит 03de528138
13 изменённых файлов: 111 добавлений и 76 удалений

Просмотреть файл

@ -4,8 +4,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
Components.utils.import("resource://calendar/modules/calUtils.jsm");
/**
* Global Object to hold methods for the general pref pane
*/
@ -31,33 +29,6 @@ var gCalendarGeneralPane = {
updateSelectedLabel("dateformat");
updateUnitLabelPlural("defaultlength", "defaultlengthunit", "minutes");
this.updateDefaultTodoDates();
let tzMenuList = document.getElementById("calendar-timezone-menulist");
let tzMenuPopup = document.getElementById("calendar-timezone-menupopup");
let tzService = cal.getTimezoneService();
let tzids = {};
let displayNames = [];
// don't rely on what order the timezone-service gives you
for (let tzid in fixIterator(tzService.timezoneIds)) {
let tz = tzService.getTimezone(tzid);
if (tz && !tz.isFloating && !tz.isUTC) {
let displayName = tz.displayName;
displayNames.push(displayName);
tzids[displayName] = tz.tzid;
}
}
// the display names need to be sorted
displayNames.sort(String.localeCompare);
for (let displayName of displayNames) {
addMenuItem(tzMenuPopup, displayName, tzids[displayName]);
}
let prefValue = document.getElementById("calendar-timezone-local").value;
if (!prefValue) {
prefValue = calendarDefaultTimezone().tzid;
}
tzMenuList.value = prefValue;
},
updateDefaultTodoDates: function gCGP_updateDefaultTodoDates() {
@ -80,3 +51,4 @@ var gCalendarGeneralPane = {
document.getElementById("defaults-itemtype-deck").selectedPanel = panel;
}
};

Просмотреть файл

@ -18,12 +18,8 @@
<vbox id="calPreferencesBoxGeneral">
<script type="application/javascript"
src="chrome://calendar/content/preferences/general.js"/>
<script type="application/javascript"
src="chrome://calendar/content/preferences/timezones.js"/>
<script type="application/javascript"
src="chrome://calendar/content/calendar-ui-utils.js"/>
<script type="application/javascript"
src="chrome://calendar/content/calUtils.js"/>
<!-- Get the localized text for use in the .js -->
<script type="application/javascript">
@ -38,9 +34,6 @@
<preference id="calendar.event.defaultlength"
name="calendar.event.defaultlength"
type="int"/>
<preference id="calendar-timezone-local"
name="calendar.timezone.local"
type="string"/>
<preference id="calendar.task.defaultstart"
name="calendar.task.defaultstart"
type="string"/>
@ -84,19 +77,17 @@
</hbox>
</groupbox>
#ifndef XP_MACOSX
<groupbox>
<caption label="&pref.timezones.caption;"/>
<caption label="&pref.accessibility.label;"/>
<hbox align="center">
<label value="&pref.timezones.label;"
accesskey="&pref.timezones.accesskey;"
control="calendar-timezone-menulist"/>
<menulist id="calendar-timezone-menulist"
flex="1"
preference="calendar-timezone-local">
<menupopup id="calendar-timezone-menupopup"/>
</menulist>
<checkbox id="systemColors" pack="end"
label="&pref.systemcolors.label;"
accesskey="&pref.systemcolors.accesskey;"
preference="calendar.view.useSystemColors"/>
</hbox>
</groupbox>
#endif
<groupbox id="defaults-itemtype-groupbox">
<caption id="defaults-itemtype-caption" label="&pref.defaults.label;"/>
@ -250,17 +241,5 @@
</grid>
</deck>
</groupbox>
#ifndef XP_MACOSX
<groupbox>
<caption label="&pref.accessibility.label;"/>
<hbox align="center">
<checkbox id="systemColors" pack="end"
label="&pref.systemcolors.label;"
accesskey="&pref.systemcolors.accesskey;"
preference="calendar.view.useSystemColors"/>
</hbox>
</groupbox>
#endif
</vbox>
</overlay>

Просмотреть файл

@ -0,0 +1,45 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
Components.utils.import("resource://calendar/modules/calUtils.jsm");
/**
* Global Object to hold methods for the timezones dialog.
*/
var gTimezonesPane = {
/**
* Initialize the timezones pref pane. Sets up dialog controls to match the
* values set in prefs.
*/
init: function gTP_init() {
var tzMenuList = document.getElementById("calendar-timezone-menulist");
var tzMenuPopup = document.getElementById("calendar-timezone-menupopup");
var tzService = cal.getTimezoneService();
var enumerator = tzService.timezoneIds;
var tzids = {};
var displayNames = [];
// don't rely on what order the timezone-service gives you
while (enumerator.hasMore()) {
var tz = tzService.getTimezone(enumerator.getNext());
if (tz && !tz.isFloating && !tz.isUTC) {
var displayName = tz.displayName;
displayNames.push(displayName);
tzids[displayName] = tz.tzid;
}
}
// the display names need to be sorted
displayNames.sort(String.localeCompare);
for (var i = 0; i < displayNames.length; ++i) {
var displayName = displayNames[i];
addMenuItem(tzMenuPopup, displayName, tzids[displayName]);
}
var prefValue = document.getElementById("calendar-timezone-local").value;
if (!prefValue) {
prefValue = calendarDefaultTimezone().tzid;
}
tzMenuList.value = prefValue;
}
};

Просмотреть файл

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!DOCTYPE overlay SYSTEM "chrome://calendar/locale/preferences/timezones.dtd">
<overlay id="TimezonesPaneOverlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<vbox id="calPreferencesBoxTimezones">
<script type="application/javascript"
src="chrome://calendar/content/preferences/timezones.js"/>
<script type="application/javascript"
src="chrome://calendar/content/calendar-ui-utils.js"/>
<script type="application/javascript"
src="chrome://calendar/content/calUtils.js"/>
<preferences>
<preference id="calendar-timezone-local"
name="calendar.timezone.local"
type="string"/>
</preferences>
<groupbox>
<caption label="&pref.calendar.timezones.list.caption;"/>
<menulist id="calendar-timezone-menulist"
preference="calendar-timezone-local">
<menupopup id="calendar-timezone-menupopup"/>
</menulist>
</groupbox>
</vbox>
</overlay>

Просмотреть файл

@ -91,6 +91,8 @@ calendar.jar:
content/calendar/preferences/editCategory.js (content/preferences/editCategory.js)
content/calendar/preferences/general.js (content/preferences/general.js)
* content/calendar/preferences/general.xul (content/preferences/general.xul)
content/calendar/preferences/timezones.js (content/preferences/timezones.js)
content/calendar/preferences/timezones.xul (content/preferences/timezones.xul)
content/calendar/preferences/views.js (content/preferences/views.js)
content/calendar/preferences/views.xul (content/preferences/views.xul)
content/calendar/widgets/minimonth.xml (content/widgets/minimonth.xml)

Просмотреть файл

@ -16,18 +16,18 @@
<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<prefwindow id="MailPreferences">
<prefpane id="paneLightning"
<prefpane id="paneLightning"
label="&lightning.preferencesLabel;"
onpaneload="gCalendarGeneralPane.init(); gAlarmsPane.init();
onpaneload="gCalendarGeneralPane.init(); gAlarmsPane.init();
gCategoriesPane.init(); gViewsPane.init();
gLightningPane.init();">
gTimezonesPane.init(); gLightningPane.init();">
<preferences>
<preference id="calendar.preferences.lightning.selectedTabIndex"
name="calendar.preferences.lightning.selectedTabIndex"
type="int"/>
</preferences>
<tabbox id="calPreferencesTabbox"
flex="1"
<tabbox id="calPreferencesTabbox"
flex="1"
onselect="gLightningPane.tabSelectionChanged();">
<tabs>
<tab id="calPreferencesTabGeneral"
@ -38,6 +38,8 @@
label="&paneCategories.title;"/>
<tab id="calPreferencesTabViews"
label="&paneViews.title;"/>
<tab id="calPreferencesTabTimezones"
label="&paneTimezones.title;"/>
</tabs>
<tabpanels flex="1">
<tabpanel orient="vertical">
@ -52,6 +54,9 @@
<tabpanel orient="vertical">
<vbox id="calPreferencesBoxViews"/>
</tabpanel>
<tabpanel orient="vertical">
<vbox id="calPreferencesBoxTimezones"/>
</tabpanel>
</tabpanels>
</tabbox>
</prefpane>

Просмотреть файл

@ -7,6 +7,7 @@
<?xml-stylesheet href="chrome://lightning/skin/lightning.css"?>
<?xul-overlay href="chrome://calendar/content/preferences/general.xul"?>
<?xul-overlay href="chrome://calendar/content/preferences/timezones.xul"?>
<?xul-overlay href="chrome://calendar/content/preferences/alarms.xul"?>
<?xul-overlay href="chrome://calendar/content/preferences/categories.xul"?>
<?xul-overlay href="chrome://calendar/content/preferences/views.xul"?>
@ -43,8 +44,9 @@
<prefwindow id="prefDialog">
<prefpane id="paneLightning"
label="&lightning.preferencesLabel;"
onpaneload="gCalendarGeneralPane.init();">
onpaneload="gCalendarGeneralPane.init(); gTimezonesPane.init();">
<vbox id="calPreferencesBoxGeneral"/>
<vbox id="calPreferencesBoxTimezones"/>
</prefpane>
<prefpane id="paneLightningAlarms"
label="&paneAlarms.title;"

Просмотреть файл

@ -19,6 +19,7 @@ lightning.jar:
% overlay chrome://messenger/content/preferences/preferences.xul chrome://calendar/content/preferences/alarms.xul
% overlay chrome://messenger/content/preferences/preferences.xul chrome://calendar/content/preferences/categories.xul
% overlay chrome://messenger/content/preferences/preferences.xul chrome://calendar/content/preferences/general.xul
% overlay chrome://messenger/content/preferences/preferences.xul chrome://calendar/content/preferences/timezones.xul
% overlay chrome://messenger/content/preferences/preferences.xul chrome://calendar/content/preferences/views.xul
% overlay chrome://lightning/content/messenger-overlay-sidebar.xul chrome://calendar/content/calendar-unifinder.xul
% overlay chrome://lightning/content/messenger-overlay-sidebar.xul chrome://calendar/content/calendar-unifinder-todo.xul

Просмотреть файл

@ -13,10 +13,6 @@
<!ENTITY pref.dateformat.long "Long" >
<!ENTITY pref.dateformat.short "Short" >
<!ENTITY pref.timezones.caption "Timezone">
<!ENTITY pref.timezones.label "Select the closest city in your timezone:">
<!ENTITY pref.timezones.accesskey "S">
<!ENTITY pref.defaults.label "Default Values for New Items">
<!ENTITY pref.events.label "Events">
<!ENTITY pref.tasks.label "Tasks">

Просмотреть файл

@ -6,3 +6,4 @@
<!ENTITY paneAlarms.title "Reminders">
<!ENTITY paneCategories.title "Categories">
<!ENTITY paneViews.title "Views">
<!ENTITY paneTimezones.title "Timezone">

Просмотреть файл

@ -0,0 +1,5 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!ENTITY pref.calendar.timezones.list.caption "Select the closest city in your timezone:">

Просмотреть файл

@ -30,6 +30,7 @@ calendar-@AB_CD@.jar:
locale/@AB_CD@/calendar/preferences/categories.dtd (%chrome/calendar/preferences/categories.dtd)
locale/@AB_CD@/calendar/preferences/general.dtd (%chrome/calendar/preferences/general.dtd)
locale/@AB_CD@/calendar/preferences/preferences.dtd (%chrome/calendar/preferences/preferences.dtd)
locale/@AB_CD@/calendar/preferences/timezones.dtd (%chrome/calendar/preferences/timezones.dtd)
locale/@AB_CD@/calendar/preferences/views.dtd (%chrome/calendar/preferences/views.dtd)
locale/@AB_CD@/calendar/dialogs/calendar-event-dialog-reminder.dtd (%chrome/calendar/dialogs/calendar-event-dialog-reminder.dtd)
locale/@AB_CD@/calendar/calendar-event-dialog-attendees.properties (%chrome/calendar/calendar-event-dialog-attendees.properties)

Просмотреть файл

@ -109,15 +109,6 @@ function fixIterator(aEnum, aIface) {
return { __iterator__: iter };
}
// How about nsIStringEnumerator or nsIUTF8StringEnumerator?
if (aEnum instanceof Ci.nsIStringEnumerator || aEnum instanceof Ci.nsIUTF8StringEnumerator) {
let iter = function() {
while (aEnum.hasMore())
yield aEnum.getNext();
};
return { __iterator__: iter };
}
// How about nsISimpleEnumerator? This one is nice and simple.
if (aEnum instanceof Ci.nsISimpleEnumerator) {
let iter = function () {