Bug 288313 copy old connection/proxy prefs to Sunbird.

patch by sipaq, r=mvl


git-svn-id: svn://10.0.0.236/trunk@173754 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mvl%exedo.nl
2005-05-24 19:41:49 +00:00
parent 0cf6c0ee3e
commit 23e8025479
7 changed files with 438 additions and 4 deletions

View File

@@ -44,6 +44,9 @@
[
<!ENTITY % dtd1 SYSTEM "chrome://calendar/locale/prefs.dtd" > %dtd1;
<!ENTITY % dtd2 SYSTEM "chrome://calendar/locale/global.dtd" > %dtd2;
#ifdef MOZ_SUNBIRD
<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd" > %brandDTD;
#endif
]>
<page xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
@@ -279,6 +282,13 @@
}
}
#ifdef MOZ_SUNBIRD
function showConnections()
{
openDialog("chrome://calendar/content/pref/connectionPrefs.xul", "", "chrome,dialog");
}
#endif
/*
** NOTE:
** When you add a pref to this page, you have to add its ID to the following list.
@@ -316,6 +326,17 @@
<checkbox id="reloadonlaunch" preftype="bool" prefstring="calendar.servers.reloadonlaunch" label="&pref.reloadonlaunch;" />
</groupbox>
#ifdef MOZ_SUNBIRD
<groupbox>
<caption label="&pref.connectionsInfo.caption;"/>
<hbox align="center">
<description flex="1">&pref.proxiesInfo.label;</description>
<button id="catProxiesButton" icon="network" label="&pref.showConnections.label;"
accesskey="&pref.showConnections.accesskey;"
oncommand="showConnections()"/>
</hbox>
</groupbox>
#endif
<groupbox flex="1">
<caption label="&pref.categories.label;"/>
<hbox flex="1">

View File

@@ -69,7 +69,7 @@ calendar.jar:
content/calendar/datetimepickers/minimonth.xml (content/datetimepickers/minimonth.xml)
content/calendar/pref/pref.xul (content/pref/pref.xul)
content/calendar/pref/alarmPrefs.xul (content/pref/alarmPrefs.xul)
content/calendar/pref/calendarPref.xul (content/pref/calendarPref.xul)
* content/calendar/pref/calendarPref.xul (content/pref/calendarPref.xul)
content/calendar/pref/prefBird.xul (content/pref/prefBird.xul)
content/calendar/pref/prefBirdOverlay.xul (content/pref/prefBirdOverlay.xul)
content/calendar/pref/prefOverlay.xul (content/pref/prefOverlay.xul)
@@ -92,8 +92,12 @@ calendar.jar:
locale/en-US/calendar/global.dtd (locale/en-US/global.dtd)
locale/en-US/calendar/menuOverlay.dtd (locale/en-US/menuOverlay.dtd)
locale/en-US/calendar/overlay.dtd (locale/en-US/overlay.dtd)
locale/en-US/calendar/prefs.dtd (locale/en-US/prefs.dtd)
* locale/en-US/calendar/prefs.dtd (locale/en-US/prefs.dtd)
locale/en-US/calendar/selectAddresses.dtd (locale/en-US/selectAddresses.dtd)
#ifdef MOZ_SUNBIRD
locale/en-US/calendar/connectionPrefs.dtd (locale/en-US/connectionPrefs.dtd)
locale/en-US/calendar/prefutilities.properties (locale/en-US/prefutilities.properties)
#endif
skin/classic/calendar/alertDialog.css (skin/classic/alertDialog.css)
skin/classic/calendar/all_day_event.png (skin/classic/all_day_event.png)
skin/classic/calendar/all_day_event_down.png (skin/classic/all_day_event_down.png)

View File

@@ -53,6 +53,13 @@
<!ENTITY pref.alarmgoesoff.label "When an alarm goes off:">
<!ENTITY pref.playasound "Play a sound" >
#ifdef MOZ_SUNBIRD
<!ENTITY pref.showConnections.label "Connection Settings...">
<!ENTITY pref.showConnections.accesskey "o">
<!ENTITY pref.proxiesInfo.label "Determine how &brandShortName; connects to the Internet.">
<!ENTITY pref.connectionsInfo.caption "Connection">
#endif
<!ENTITY pref.alarmbox.label "Alarms" >
<!ENTITY pref.showalarmbox "Show an alarm box" >
<!ENTITY pref.defaultemail.label "Default address to send alarms to:">

View File

@@ -522,6 +522,24 @@
persist="hidden ordinal width sortDirection sortActive"
hidden="true"
flex="1" label="&calendar.unifinder.tree.categories.label;"/>
<splitter class="tree-splitter"/>
<treecol id="unifinder-todo-tree-col-location"
persist="hidden ordinal width sortDirection sortActive"
flex="1"
hidden="true"
label="&calendar.unifinder.tree.location.label;"/>
<splitter class="tree-splitter"/>
<treecol id="unifinder-todo-tree-col-status"
persist="hidden ordinal width sortDirection sortActive"
flex="1"
hidden="true"
label="&calendar.unifinder.tree.status.label;"/>
<splitter class="tree-splitter"/>
<treecol id="unifinder-todo-tree-col-calendarname"
persist="hidden ordinal width sortDirection sortActive"
flex="1"
hidden="true"
label="&calendar.unifinder.tree.calendarname.label;"/>
</treecols>
<treechildren tooltip="taskTooltip"
@@ -609,11 +627,11 @@
flex="1"
hidden="true"
label="&calendar.unifinder.tree.status.label;"/>
<treecol id="unifinder-search-results-tree-col-filename"
<treecol id="unifinder-search-results-tree-col-calendarname"
persist="hidden ordinal width sortDirection sortActive"
flex="1"
hidden="true"
label="&calendar.unifinder.tree.filename.label;"/>
label="&calendar.unifinder.tree.calendarname.label;"/>
</treecols>
<!-- on mousedown here happens before onclick above -->

View File

@@ -0,0 +1,227 @@
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is Mozilla Communicator client code, released
# March 31, 1998.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998-1999
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Simon Paquet <bugzilla@babylonsounds.com>
#
# 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
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
var _elementIDs = ["networkProxyType",
"networkProxyFTP", "networkProxyFTP_Port",
"networkProxyGopher", "networkProxyGopher_Port",
"networkProxyHTTP", "networkProxyHTTP_Port",
"networkProxySOCKS", "networkProxySOCKS_Port",
"networkProxySOCKSVersion",
"networkProxySSL", "networkProxySSL_Port",
"networkProxyNone", "networkProxyAutoconfigURL", "shareAllProxies"];
function Startup()
{
DoEnabling();
}
function DoEnabling()
{
var i;
var ftp = document.getElementById("networkProxyFTP");
var ftpPort = document.getElementById("networkProxyFTP_Port");
var http = document.getElementById("networkProxyHTTP");
var httpPort = document.getElementById("networkProxyHTTP_Port");
var socks = document.getElementById("networkProxySOCKS");
var socksPort = document.getElementById("networkProxySOCKS_Port");
var socksVersion = document.getElementById("networkProxySOCKSVersion");
var socksVersion4 = document.getElementById("networkProxySOCKSVersion4");
var socksVersion5 = document.getElementById("networkProxySOCKSVersion5");
var ssl = document.getElementById("networkProxySSL");
var sslPort = document.getElementById("networkProxySSL_Port");
var noProxy = document.getElementById("networkProxyNone");
var autoURL = document.getElementById("networkProxyAutoconfigURL");
var autoReload = document.getElementById("autoReload");
var shareAllProxies = document.getElementById("shareAllProxies");
// convenience arrays
var manual = [ftp, ftpPort, http, httpPort, socks, socksPort, socksVersion, socksVersion4, socksVersion5, ssl, sslPort, noProxy, shareAllProxies];
var manual2 = [http, httpPort, noProxy, shareAllProxies];
var auto = [autoURL, autoReload];
// radio buttons
var radiogroup = document.getElementById("networkProxyType");
switch ( radiogroup.value ) {
case "0":
case "4":
for (i = 0; i < manual.length; i++)
manual[i].setAttribute( "disabled", "true" );
for (i = 0; i < auto.length; i++)
auto[i].setAttribute( "disabled", "true" );
break;
case "1":
for (i = 0; i < auto.length; i++)
auto[i].setAttribute( "disabled", "true" );
if (!radiogroup.disabled && !shareAllProxies.checked) {
for (i = 0; i < manual.length; i++) {
prefstring = manual[i].getAttribute( "prefstring" );
if (!window.opener.top.hPrefWindow.getPrefIsLocked(prefstring))
manual[i].removeAttribute( "disabled" );
}
} else {
for (i = 0; i < manual.length; i++)
manual[i].setAttribute("disabled", "true");
for (i = 0; i < manual2.length; i++) {
prefstring = manual2[i].getAttribute( "prefstring" );
if (!window.opener.top.hPrefWindow.getPrefIsLocked(prefstring))
manual2[i].removeAttribute( "disabled" );
}
}
break;
case "2":
default:
for (i = 0; i < manual.length; i++)
manual[i].setAttribute("disabled", "true");
if (!radiogroup.disabled)
for (i = 0; i < auto.length; i++)
auto[i].removeAttribute("disabled");
break;
}
}
const nsIProtocolProxyService = Components.interfaces.nsIProtocolProxyService;
const kPROTPROX_CID = '{e9b301c0-e0e4-11D3-a1a8-0050041caf44}';
function ReloadPAC()
{
var autoURL = document.getElementById("networkProxyAutoconfigURL");
var pps = Components.classesByID[kPROTPROX_CID]
.getService(nsIProtocolProxyService);
pps.configureFromPAC(autoURL.value);
}
function onConnectionsDialogOK()
{
var autoURL = document.getElementById("networkProxyAutoconfigURL");
var URIFixup = Components.classes["@mozilla.org/docshell/urifixup;1"]
.getService(Components.interfaces.nsIURIFixup);
try {
var fixedUpURI = URIFixup.createFixupURI(autoURL.value, 0);
autoURL.value = fixedUpURI.spec;
}
catch(ex) {
}
window.opener.top.hPrefWindow.wsm.savePageData(window.location.href, window);
return true;
}
var oldUrls = ["","",""];
var oldPorts = ["0","0","0"];
function toggleProxySettings()
{
var http = document.getElementById("networkProxyHTTP");
var httpPort = document.getElementById("networkProxyHTTP_Port");
var ftp = document.getElementById("networkProxyFTP");
var ftpPort = document.getElementById("networkProxyFTP_Port");
var ssl = document.getElementById("networkProxySSL");
var sslPort = document.getElementById("networkProxySSL_Port");
var socks = document.getElementById("networkProxySOCKS");
var socksPort = document.getElementById("networkProxySOCKS_Port");
var socksVersion = document.getElementById("networkProxySOCKSVersion");
var socksVersion4 = document.getElementById("networkProxySOCKSVersion4");
var socksVersion5 = document.getElementById("networkProxySOCKSVersion5");
// arrays
var urls = [ftp,ssl];
var ports = [ftpPort,sslPort];
var allFields = [ftp,ssl,ftpPort,sslPort,socks,socksPort,socksVersion,socksVersion4,socksVersion5];
if (document.getElementById("shareAllProxies").checked) {
for (i = 0; i < allFields.length; i++)
allFields[i].setAttribute("disabled", "true");
for (i = 0; i < urls.length; i++) {
oldUrls[i] = urls[i].value;
prefstring = urls[i].getAttribute("prefstring");
if (!window.opener.top.hPrefWindow.getPrefIsLocked(prefstring))
urls[i].value = http.value;
}
for (i = 0; i < ports.length; i++) {
oldPorts[i] = ports[i].value;
prefstring = ports[i].getAttribute("prefstring");
if (!window.opener.top.hPrefWindow.getPrefIsLocked(prefstring))
ports[i].value = httpPort.value;
}
} else {
for (i = 0; i < allFields.length; i++) {
prefstring = allFields[i].getAttribute("prefstring");
if (!window.opener.top.hPrefWindow.getPrefIsLocked(prefstring))
allFields[i].removeAttribute("disabled");
}
for (i = 0; i < urls.length; i++) {
prefstring = urls[i].getAttribute("prefstring");
if (!window.opener.top.hPrefWindow.getPrefIsLocked(prefstring))
urls[i].value = oldUrls[i];
}
for (i = 0; i < ports.length; i++) {
prefstring = ports[i].getAttribute("prefstring");
if (!window.opener.top.hPrefWindow.getPrefIsLocked(prefstring))
ports[i].value = oldPorts[i];
}
}
}
function copyProxySettings()
{
if (!document.getElementById("shareAllProxies").checked)
return;
var http = document.getElementById("networkProxyHTTP");
var httpPort = document.getElementById("networkProxyHTTP_Port");
var ftp = document.getElementById("networkProxyFTP");
var ftpPort = document.getElementById("networkProxyFTP_Port");
var ssl = document.getElementById("networkProxySSL");
var sslPort = document.getElementById("networkProxySSL_Port");
var urls = [ftp,ssl];
var ports = [ftpPort,sslPort];
for (i = 0; i < urls.length; i++) {
prefstring = urls[i].getAttribute("prefstring");
if (!window.opener.top.hPrefWindow.getPrefIsLocked(prefstring))
urls[i].value = http.value;
}
for (i = 0; i < ports.length; i++) {
prefstring = ports[i].getAttribute("prefstring");
if (!window.opener.top.hPrefWindow.getPrefIsLocked(prefstring))
ports[i].value = httpPort.value;
}
}

View File

@@ -0,0 +1,155 @@
<?xml version="1.0"?>
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is Mozilla Communicator client code, released
# March 31, 1998.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998-1999
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Jason Eager <jce2@po.cwru.edu>
# Simon Paquet <bugzilla@babylonsounds.com>
#
# 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
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://calendar/locale/connectionPrefs.dtd" >
<dialog xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="window.opener.top.initPanel('chrome://calendar/content/pref/connectionPrefs.xul', window);"
buttons="accept,cancel" ondialogaccept="return onConnectionsDialogOK(event);"
title="&lHeader;">
<stringbundle id="bundle_prefutilities"
src="chrome://calendar/locale/prefutilities.properties"/>
<script type="application/x-javascript" src="chrome://calendar/content/pref/connectionPrefs.js"/>
<groupbox>
<caption label="&proxyTitle.label;"/>
<radiogroup id="networkProxyType" prefstring="network.proxy.type">
<radio value="0" label="&directTypeRadio.label;" accesskey="&directTypeRadio.accesskey;" oncommand="DoEnabling();"/>
<radio value="4" label="&autoTypeRadio.label;" accesskey="&autoTypeRadio.accesskey;" oncommand="DoEnabling()"/>
<radio value="1" label="&manualTypeRadio.label;" accesskey="&manualTypeRadio.accesskey;" oncommand="DoEnabling();"/>
<grid class="indent" flex="1">
<columns>
<column/>
<column flex="1"/>
</columns>
<rows>
<row>
<hbox/>
<hbox>
<checkbox id="shareAllProxies" oncommand="toggleProxySettings();"
label="&shareproxy.label;" accesskey="&shareproxy.accesskey;"
preftype="bool" prefstring="network.proxy.share_proxy_settings"/>
</hbox>
</row>
<row align="center">
<hbox align="center" pack="end">
<label value="&http.label;" accesskey="&http.accesskey;" control="networkProxyHTTP"/>
</hbox>
<hbox align="center">
<textbox id="networkProxyHTTP" preftype="string" prefstring="network.proxy.http"
flex="1" onblur="copyProxySettings()"/>
<label value="&port.label;" accesskey="&HTTPport.accesskey;" control="networkProxyHTTP_Port"/>
<textbox id="networkProxyHTTP_Port" preftype="int" prefstring="network.proxy.http_port"
size="5" onblur="copyProxySettings()"/>
</hbox>
</row>
<row align="center">
<hbox align="center" pack="end">
<label value="&ssl.label;" accesskey="&ssl.accesskey;" control="networkProxySSL"/>
</hbox>
<hbox align="center">
<textbox id="networkProxySSL" preftype="string" prefstring="network.proxy.ssl"
flex="1"/>
<label value="&port.label;" accesskey="&SSLport.accesskey;" control="networkProxySSL_Port"/>
<textbox id="networkProxySSL_Port" preftype="int" prefstring="network.proxy.ssl_port"
size="5"/>
</hbox>
</row>
<row align="center">
<hbox align="center" pack="end">
<label value="&ftp.label;" accesskey="&ftp.accesskey;" control="networkProxyFTP"/>
</hbox>
<hbox align="center">
<textbox id="networkProxyFTP" preftype="string" prefstring="network.proxy.ftp"
flex="1"/>
<label value="&port.label;" accesskey="&FTPport.accesskey;" control="networkProxyFTP_Port"/>
<textbox id="networkProxyFTP_Port" preftype="int" prefstring="network.proxy.ftp_port"
size="5"/>
</hbox>
</row>
<row align="center">
<hbox align="center" pack="end">
<label value="&socks.label;" accesskey="&socks.accesskey;" control="networkProxySOCKS"/>
</hbox>
<hbox align="center">
<textbox id="networkProxySOCKS" preftype="string" prefstring="network.proxy.socks"
flex="1"/>
<label value="&port.label;" accesskey="&SOCKSport.accesskey;" control="networkProxySOCKS_Port"/>
<textbox id="networkProxySOCKS_Port" preftype="int" prefstring="network.proxy.socks_port"
size="5"/>
</hbox>
</row>
<row>
<spacer/>
<radiogroup id="networkProxySOCKSVersion" orient="horizontal"
prefstring="network.proxy.socks_version">
<radio id="networkProxySOCKSVersion4" value="4" label="&socks4.label;" accesskey="&socks4.accesskey;" />
<radio id="networkProxySOCKSVersion5" value="5" label="&socks5.label;" accesskey="&socks5.accesskey;" />
</radiogroup>
</row>
<row align="center">
<hbox align="center" pack="end">
<label value="&noproxy.label;" accesskey="&noproxy.accesskey;" control="networkProxyNone"/>
</hbox>
<textbox id="networkProxyNone" preftype="string" prefstring="network.proxy.no_proxies_on"/>
</row>
<row>
<spacer/>
<label value="&noproxyExplain.label;" control="networkProxyNone"/>
</row>
</rows>
</grid>
<radio value="2" label="&autoTypeRadio.label;" accesskey="&autoTypeRadio.accesskey;" oncommand="DoEnabling();"/>
<hbox class="indent" flex="1" align="center">
<textbox id="networkProxyAutoconfigURL" flex="1"
preftype="string" prefstring="network.proxy.autoconfig_url"/>
<button id="autoReload" label="&reload.label;" accesskey="&reload.accesskey;"
oncommand="ReloadPAC();"
prefstring="pref.advanced.proxies.disable_button.reload"/>
</hbox>
</radiogroup>
</groupbox>
</dialog>

View File

@@ -10,3 +10,5 @@ calendar.jar:
* content/calendar/customizeToolbar.xul (content/customizeToolbar.xul)
* content/calendar/hiddenWindow.xul (content/hiddenWindow.xul)
* content/calendar/hiddenWindow.js (content/hiddenWindow.js)
* content/calendar/pref/connectionPrefs.xul (content/pref/connectionPrefs.xul)
* content/calendar/pref/connectionPrefs.js (content/pref/connectionPrefs.js)