зеркало из https://github.com/mozilla/pjs.git
Fix for bug # 95122. Implementation of UI for simple MAPI
r=rdayal, sr=sspitzer
This commit is contained in:
Родитель
2a9cc6a409
Коммит
b9534eb89f
|
@ -59,6 +59,45 @@ function getInvalidAccounts(accounts)
|
|||
return invalidAccounts;
|
||||
}
|
||||
|
||||
// This function gets called from verifyAccounts.
|
||||
// We do not have to do anything on
|
||||
// unix and mac but on windows we have to bring up a
|
||||
// dialog based on the settings the user has.
|
||||
// This will bring up the dialog only once per session and only if we
|
||||
// are not the default mail client.
|
||||
function showMailIntegrationDialog() {
|
||||
try {
|
||||
var mapiRegistry = Components.classes[ "@mozilla.org/mapiregistry;1" ].
|
||||
getService( Components.interfaces.nsIMapiRegistry );
|
||||
}
|
||||
catch (ex) {
|
||||
mapiRegistry = null;
|
||||
}
|
||||
// showDialog is TRUE only if we did not bring up this dialog already
|
||||
// and we are not the default mail client
|
||||
var prefLocked = false;
|
||||
if (mapiRegistry && mapiRegistry.showDialog) {
|
||||
const prefbase = "system.windows.lock_ui.";
|
||||
try {
|
||||
prefService = Components.classes["@mozilla.org/preferences-service;1"]
|
||||
.getService()
|
||||
.QueryInterface(Components.interfaces.nsIPrefService);
|
||||
prefBranch = prefService.getBranch(prefbase);
|
||||
|
||||
if (prefBranch && prefBranch.prefIsLocked("defaultMailClient")) {
|
||||
prefLocked = true;
|
||||
if (prefBranch.getBoolPref("defaultMailClient"))
|
||||
mapiRegistry.setDefaultMailClient();
|
||||
else
|
||||
mapiRegistry.unsetDefaultMailClient();
|
||||
}
|
||||
}
|
||||
catch (ex) {}
|
||||
if (!prefLocked && !mapiRegistry.isDefaultMailClient)
|
||||
mapiRegistry.showMailIntegrationDialog();
|
||||
}
|
||||
}
|
||||
|
||||
function verifyAccounts(wizardcallback) {
|
||||
//check to see if the function is called with the callback and if so set the global variable returnmycall to true
|
||||
if(wizardcallback)
|
||||
|
@ -104,7 +143,8 @@ function verifyAccounts(wizardcallback) {
|
|||
MsgAccountWizard(prefillAccount);
|
||||
ret = false;
|
||||
}
|
||||
return ret;
|
||||
showMailIntegrationDialog();
|
||||
return ret;
|
||||
}
|
||||
catch (ex) {
|
||||
dump("error verifying accounts " + ex + "\n");
|
||||
|
|
|
@ -1,3 +1,17 @@
|
|||
function Init()
|
||||
{
|
||||
parent.initPanel('chrome://messenger/content/pref-mailnews.xul');
|
||||
var initFunc;
|
||||
try {
|
||||
initFunc = document.getElementById("mailnewsEnableMapi").getAttribute('initFunc');
|
||||
}
|
||||
catch (ex) {
|
||||
initFunc = null;
|
||||
}
|
||||
if (initFunc)
|
||||
eval(initFunc);
|
||||
}
|
||||
|
||||
function setColorWell(menu)
|
||||
{
|
||||
// Find the colorWell and colorPicker in the hierarchy.
|
||||
|
|
|
@ -30,7 +30,7 @@ Contributor(s):
|
|||
<window xmlns:html="http://www.w3.org/1999/xhtml"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
class="color-dialog"
|
||||
onload="parent.initPanel('chrome://messenger/content/pref-mailnews.xul');"
|
||||
onload="Init();"
|
||||
orient="vertical">
|
||||
|
||||
<script type="application/x-javascript">
|
||||
|
@ -65,6 +65,7 @@ Contributor(s):
|
|||
pref="true" preftype="bool" prefstring="mailnews.confirm.moveFoldersToTrash"
|
||||
prefattribute="checked"/>
|
||||
</hbox>
|
||||
<hbox autostretch="never" id="mapi"/>
|
||||
|
||||
</groupbox>
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
DEPTH=..
|
||||
|
||||
DIRS=public base db local news imap mime compose addrbook import absync
|
||||
DIRS=public base db local news imap mime compose addrbook import absync mapi
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
#
|
||||
# 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.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 2001 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
# Srilatha Moturi <srilatha@netscape.com>
|
||||
#
|
||||
|
||||
DEPTH=..\..
|
||||
|
||||
DIRS=resources
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
|
@ -0,0 +1,125 @@
|
|||
<?xml version="1.0"?>
|
||||
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
|
||||
|
||||
<!-- list all the packages being supplied by this jar -->
|
||||
<RDF:Seq about="urn:mozilla:package:root">
|
||||
<RDF:li resource="urn:mozilla:package:messenger"/>
|
||||
</RDF:Seq>
|
||||
|
||||
<!-- package information -->
|
||||
<RDF:Description about="urn:mozilla:package:messenger"
|
||||
chrome:displayName="Messenger"
|
||||
chrome:author="mozilla.org"
|
||||
chrome:name="messenger"
|
||||
chrome:localeVersion="0.9.4"
|
||||
chrome:skinVersion="0.9.4">
|
||||
</RDF:Description>
|
||||
|
||||
<!-- overlay information -->
|
||||
<RDF:Seq about="urn:mozilla:overlays">
|
||||
<RDF:li resource="chrome://communicator/content/pref/preftree.xul"/>
|
||||
<RDF:li resource="chrome://communicator/content/pref/pref-appearance.xul"/>
|
||||
<RDF:li resource="chrome://communicator/content/pref/pref-advanced.xul"/>
|
||||
<RDF:li resource="chrome://communicator/content/tasksOverlay.xul"/>
|
||||
<RDF:li resource="chrome://navigator/content/navigatorOverlay.xul"/>
|
||||
<RDF:li resource="chrome://communicator/content/history/history.xul"/>
|
||||
<RDF:li resource="chrome://communicator/content/bookmarks/bookmarks.xul"/>
|
||||
<RDF:li resource="chrome://communicator/content/bookmarks/bm-find.xul"/>
|
||||
<RDF:li resource="chrome://messenger/content/messenger.xul"/>
|
||||
<RDF:li resource="chrome://messenger/content/mail3PaneWindowVertLayout.xul"/>
|
||||
<RDF:li resource="chrome://messenger/content/messengercompose/messengercompose.xul"/>
|
||||
<RDF:li resource="chrome://messenger/content/addressbook/addressbook.xul"/>
|
||||
<RDF:li resource="chrome://messenger/content/addressbook/abSelectAddressesDialog.xul"/>
|
||||
<RDF:li resource="chrome://editor/content/editor.xul"/>
|
||||
<RDF:li resource="chrome://messenger/content/pref-mailnews.xul"/>
|
||||
<RDF:li resource="chrome://messenger/content/messenger.xul"/>
|
||||
<RDF:li resource="chrome://messenger/content/mail3PaneWindowVertLayout.xul"/>
|
||||
</RDF:Seq>
|
||||
|
||||
|
||||
<!-- messenger preferences branches -->
|
||||
<RDF:Seq about="chrome://communicator/content/pref/preftree.xul">
|
||||
<RDF:li>chrome://messenger/content/mailPrefsOverlay.xul</RDF:li>
|
||||
</RDF:Seq>
|
||||
|
||||
<!-- messenger startup pref -->
|
||||
<RDF:Seq about="chrome://communicator/content/pref/pref-appearance.xul">
|
||||
<RDF:li>chrome://messenger/content/mailPrefsOverlay.xul</RDF:li>
|
||||
</RDF:Seq>
|
||||
|
||||
<!-- messenger js toggle pref -->
|
||||
<RDF:Seq about="chrome://communicator/content/pref/pref-advanced.xul">
|
||||
<RDF:li>chrome://messenger/content/mailPrefsOverlay.xul</RDF:li>
|
||||
</RDF:Seq>
|
||||
|
||||
<!-- messenger taskbar/tasks menu items -->
|
||||
<RDF:Seq about="chrome://communicator/content/tasksOverlay.xul">
|
||||
<RDF:li>chrome://messenger/content/mailTasksOverlay.xul</RDF:li>
|
||||
</RDF:Seq>
|
||||
|
||||
<!-- messenger items for History -->
|
||||
<RDF:Seq about="chrome://communicator/content/history/history.xul">
|
||||
<RDF:li>chrome://messenger/content/mailNavigatorOverlay.xul</RDF:li>
|
||||
</RDF:Seq>
|
||||
|
||||
<!-- messenger items for Bookmarks -->
|
||||
<RDF:Seq about="chrome://communicator/content/bookmarks/bookmarks.xul">
|
||||
<RDF:li>chrome://messenger/content/mailNavigatorOverlay.xul</RDF:li>
|
||||
</RDF:Seq>
|
||||
|
||||
<!-- messenger items for History -->
|
||||
<RDF:Seq about="chrome://communicator/content/bookmarks/bm-find.xul">
|
||||
<RDF:li>chrome://messenger/content/mailNavigatorOverlay.xul</RDF:li>
|
||||
</RDF:Seq>
|
||||
|
||||
<!-- messenger items for Navigator -->
|
||||
<RDF:Seq about="chrome://navigator/content/navigatorOverlay.xul">
|
||||
<RDF:li>chrome://messenger/content/mailNavigatorOverlay.xul</RDF:li>
|
||||
</RDF:Seq>
|
||||
|
||||
<!-- messenger items for Messenger -->
|
||||
<RDF:Seq about="chrome://messenger/content/messenger.xul">
|
||||
<RDF:li>chrome://messenger/content/mailMessengerOverlay.xul</RDF:li>
|
||||
</RDF:Seq>
|
||||
<RDF:Seq about="chrome://messenger/content/mail3PaneWindowVertLayout.xul">
|
||||
<RDF:li>chrome://messenger/content/mailMessengerOverlay.xul</RDF:li>
|
||||
</RDF:Seq>
|
||||
|
||||
<!-- messenger items for Mail Compose -->
|
||||
<RDF:Seq about="chrome://messenger/content/messengercompose/messengercompose.xul">
|
||||
<RDF:li>chrome://messenger/content/mailMessengerComposeOverlay.xul</RDF:li>
|
||||
</RDF:Seq>
|
||||
|
||||
<!-- messenger items for Addressbook -->
|
||||
<RDF:Seq about="chrome://messenger/content/addressbook/addressbook.xul">
|
||||
<RDF:li>chrome://messenger/content/mailABOverlay.xul</RDF:li>
|
||||
</RDF:Seq>
|
||||
|
||||
<!-- messenger items for Select Addresses dialog -->
|
||||
<RDF:Seq about="chrome://messenger/content/addressbook/abSelectAddressesDialog.xul">
|
||||
<RDF:li>chrome://messenger/content/mailOverlay.xul</RDF:li>
|
||||
</RDF:Seq>
|
||||
|
||||
|
||||
<!-- messenger items for Composer -->
|
||||
<RDF:Seq about="chrome://editor/content/editor.xul">
|
||||
<RDF:li>chrome://messenger/content/mailEditorOverlay.xul</RDF:li>
|
||||
</RDF:Seq>
|
||||
|
||||
<!-- mapi items for Mail And Newsgroups preferences pane -->
|
||||
<RDF:Seq about="chrome://messenger/content/pref-mailnews.xul">
|
||||
<RDF:li>chrome://messenger/content/pref-mailnewsOverlay.xul</RDF:li>
|
||||
</RDF:Seq>
|
||||
|
||||
<!-- mail Integration dialog -->
|
||||
<RDF:Seq about="chrome://messenger/content/messenger.xul">
|
||||
<RDF:li>chrome://messenger/content/mailIntegrationOverlay.xul</RDF:li>
|
||||
</RDF:Seq>
|
||||
|
||||
<!-- mail Integration dialog -->
|
||||
<RDF:Seq about="chrome://messenger/content/mail3PaneWindowVertLayout.xul">
|
||||
<RDF:li>chrome://messenger/content/mailIntegrationOverlay.xul</RDF:li>
|
||||
</RDF:Seq>
|
||||
|
||||
</RDF:RDF>
|
|
@ -0,0 +1,4 @@
|
|||
messenger.jar:
|
||||
content/messenger/pref-mailnewsOverlay.xul
|
||||
+ content/messenger/contents.rdf
|
||||
content/messenger/pref-mailnewsOverlay.js
|
|
@ -0,0 +1,26 @@
|
|||
#!nmake
|
||||
#
|
||||
# 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.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 2001 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
# Srilatha Moturi <srilatha@netscape.com>
|
||||
#
|
||||
|
||||
DEPTH=..\..\..\..
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
|
@ -0,0 +1,24 @@
|
|||
<?xml version="1.0"?>
|
||||
<RDF:RDF xmlns:chrome="http://www.mozilla.org/rdf/chrome#"
|
||||
xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
|
||||
|
||||
<!-- mapi items for mailnews preferences -->
|
||||
<RDF:Seq about="urn:mozilla:overlays">
|
||||
<RDF:li resource="chrome://messenger/content/pref-mailnews.xul"/>
|
||||
<RDF:li resource="chrome://messenger/content/messenger.xul"/>
|
||||
<RDF:li resource="chrome://messenger/content/mail3PaneWindowVertLayout.xul"/>
|
||||
</RDF:Seq>
|
||||
|
||||
<RDF:Seq about="chrome://messenger/content/pref-mailnews.xul">
|
||||
<RDF:li>chrome://messenger/content/pref-mailnewsOverlay.xul</RDF:li>
|
||||
</RDF:Seq>
|
||||
|
||||
<RDF:Seq about="chrome://messenger/content/messenger.xul">
|
||||
<RDF:li>chrome://messenger/content/mailIntegrationOverlay.xul</RDF:li>
|
||||
</RDF:Seq>
|
||||
|
||||
<RDF:Seq about="chrome://messenger/content/mail3PaneWindowVertLayout.xul">
|
||||
<RDF:li>chrome://messenger/content/mailIntegrationOverlay.xul</RDF:li>
|
||||
</RDF:Seq>
|
||||
|
||||
</RDF:RDF>
|
|
@ -0,0 +1,70 @@
|
|||
/*
|
||||
* 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.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 2001 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Srilatha Moturi <srilatha@netscape.com>
|
||||
*/
|
||||
|
||||
parent.hPrefWindow.registerOKCallbackFunc( onOK );
|
||||
try {
|
||||
var mapiRegistry = Components.classes[ "@mozilla.org/mapiregistry;1" ].
|
||||
getService( Components.interfaces.nsIMapiRegistry );
|
||||
}
|
||||
catch(ex){
|
||||
mapiRegistry = null;
|
||||
}
|
||||
|
||||
function mailnewsOverlayInit() {
|
||||
const prefbase = "system.windows.lock_ui.";
|
||||
var mailnewsEnableMapi = document.getElementById("mailnewsEnableMapi");
|
||||
if (mapiRegistry) {
|
||||
// initialise preference component.
|
||||
// While the data is coming from the system registry, we use a set
|
||||
// of parallel preferences to indicate if the ui should be locked.
|
||||
try {
|
||||
var prefService = Components.classes["@mozilla.org/preferences-service;1"]
|
||||
.getService()
|
||||
.QueryInterface(Components.interfaces.nsIPrefService);
|
||||
var prefBranch = prefService.getBranch(prefbase);
|
||||
if (prefBranch && prefBranch.prefIsLocked("defaultMailClient")) {
|
||||
if (prefBranch.getBoolPref("defaultMailClient"))
|
||||
mapiRegistry.setDefaultMailClient();
|
||||
else
|
||||
mapiRegistry.unsetDefaultMailClient();
|
||||
mailnewsEnableMapi.setAttribute("disabled", "true");
|
||||
}
|
||||
}
|
||||
catch(ex) {}
|
||||
if (mapiRegistry.isDefaultMailClient)
|
||||
mailnewsEnableMapi.setAttribute("checked", "true");
|
||||
else
|
||||
mailnewsEnableMapi.setAttribute("checked", "false");
|
||||
}
|
||||
else
|
||||
mailnewsEnableMapi.setAttribute("disabled", "true");
|
||||
}
|
||||
|
||||
function onOK()
|
||||
{
|
||||
if (mapiRegistry) {
|
||||
if (document.getElementById("mailnewsEnableMapi").checked)
|
||||
mapiRegistry.setDefaultMailClient();
|
||||
else
|
||||
mapiRegistry.unsetDefaultMailClient();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
<?xml version="1.0"?>
|
||||
<!--
|
||||
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/
|
||||
|
||||
oftware 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.org code.
|
||||
The Initial Developer of the Original Code is Netscape
|
||||
Communications Corporation. Portions created by Netscape are
|
||||
Copyright (C) 2001 Netscape Communications Corporation. All
|
||||
Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Srilatha Moturi <srilatha@netscape.com>
|
||||
-->
|
||||
|
||||
<!DOCTYPE window [
|
||||
<!ENTITY % brandDTD SYSTEM "chrome://global/locale/brand.dtd" >
|
||||
%brandDTD;
|
||||
<!ENTITY % prefMailnewsOverlayDTD SYSTEM "chrome://messenger/locale/pref-mailnewsOverlay.dtd" >
|
||||
%prefMailnewsOverlayDTD;
|
||||
]>
|
||||
<overlay id="prefMailnewsOverlay"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<script type="application/x-javascript">
|
||||
<![CDATA[
|
||||
_elementIDs.push("mailnewsEnableMapi");
|
||||
]]>
|
||||
</script>
|
||||
<script type="application/x-javascript" src="chrome://messenger/content/pref-mailnewsOverlay.js"/>
|
||||
<hbox autostretch="never" id="mapi">
|
||||
<checkbox id="mailnewsEnableMapi" label="&enableMapi.label;"
|
||||
accesskey="&enableMapi.accesskey;"
|
||||
initFunc="mailnewsOverlayInit();"/>
|
||||
</hbox>
|
||||
</overlay>
|
|
@ -0,0 +1,3 @@
|
|||
en-US.jar:
|
||||
locale/en-US/messenger/pref-mailnewsOverlay.dtd
|
||||
locale/en-US/messenger/mapi.properties
|
|
@ -0,0 +1,26 @@
|
|||
#!nmake
|
||||
#
|
||||
# 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.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 2001 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
# Srilatha Moturi <srilatha@netscape.com>
|
||||
#
|
||||
|
||||
DEPTH=..\..\..\..\..
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
|
@ -0,0 +1,14 @@
|
|||
# Mail Integration Dialog
|
||||
dialogTitle=%S Mail
|
||||
dialogText=Do you want to use %S as the default mail application?
|
||||
checkboxText=Do not display this dialog again
|
||||
|
||||
# MAPI Messages
|
||||
loginText=Please enter your password for %S:
|
||||
loginTextwithName=Please enter your username and password
|
||||
loginTitle=%S Mail
|
||||
PasswordTitle=%S Mail
|
||||
|
||||
# MAPI Error Messages
|
||||
errorMessage=%S Mail could not be set as the default mail application because a registry key could not be updated. Verify with your system administrator that you have write access to your system registry, and then try again.
|
||||
errorMessageTitle=%S Mail
|
|
@ -0,0 +1,3 @@
|
|||
<!ENTITY enableMapiTitle.label "When sending mail from other applications">
|
||||
<!ENTITY enableMapi.label "Use &vendorShortName; Mail as the default mail application.">
|
||||
<!ENTITY enableMapi.accesskey "u">
|
Загрузка…
Ссылка в новой задаче