Bug 342456 Remove dependencies on obsolete strres.js, r=mvl

git-svn-id: svn://10.0.0.236/trunk@208200 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
jminta%gmail.com
2006-08-23 18:06:46 +00:00
parent a32b652a6d
commit 2108c032de
5 changed files with 18 additions and 37 deletions

View File

@@ -518,30 +518,6 @@ function openReleaseNotes() {
launchBrowser(relNotesURL);
}
var strBundleService = null;
function srGetStrBundle(path)
{
var strBundle = null;
if (!strBundleService) {
try {
strBundleService =
Components.classes["@mozilla.org/intl/stringbundle;1"].getService();
strBundleService =
strBundleService.QueryInterface(Components.interfaces.nsIStringBundleService);
} catch (ex) {
dump("\n--** strBundleService failed: " + ex + "\n");
return null;
}
}
strBundle = strBundleService.createBundle(path);
if (!strBundle) {
dump("\n--** strBundle createInstance failed **--\n");
}
return strBundle;
}
function CalendarCustomizeToolbar()
{
// Disable the toolbar context menu items

View File

@@ -48,7 +48,9 @@ var emailStringBundle;
function checkForMailNews()
{
emailStringBundle = srGetStrBundle("chrome://calendar/locale/email.properties");
var sbs = Components.classes["@mozilla.org/intl/stringbundle;1"]
.getService(Components.interfaces.nsIStringBundleService);
emailStringBundle = sbs.createBundle("chrome://calendar/locale/email.properties");
var AccountManagerComponent;
var AccountManagerService;
@@ -516,6 +518,8 @@ function hasDefaultAccount()
var AccountManager = AccountManagerService.QueryInterface(Components.interfaces.nsIMsgAccountManager);
var DefaultAccount = AccountManager.defaultAccount;
var DefaultIncomingServer = DefaultAccount.incomingServer;
var sbs = Components.classes["@mozilla.org/intl/stringbundle;1"]
.getService(Components.interfaces.nsIStringBundleService);
emailStringBundle = srGetStrBundle("chrome://messenger/locale/messenger.properties");
var LocalFolders = emailStringBundle.GetStringFromName( "localFolders" );
if (DefaultIncomingServer.hostName == LocalFolders)

View File

@@ -65,9 +65,6 @@
xmlns:nc="http://home.netscape.com/NC-rdf#">
<!-- Javascript includes -->
<script type="application/x-javascript"
src="chrome://global/content/strres.js" />
<script type="application/x-javascript"
src="chrome://calendar/content/goToDateDialog.js"/>

View File

@@ -204,11 +204,13 @@ function publishItemArray(aItemArray, aPath, aProgressDialog) {
try {
channel.asyncOpen(publishingListener, aProgressDialog);
} catch (e) {
var calendarStringBundle = srGetStrBundle("chrome://calendar/locale/calendar.properties");
var sbs = Components.classes["@mozilla.org/intl/stringbundle;1"]
.getService(Components.interfaces.nsIStringBundleService);
var props = sbs.createBundle("chrome://calendar/locale/calendar.properties");
var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
.getService(Components.interfaces.nsIPromptService);
promptService.alert(null, calendarStringBundle.GetStringFromName('errorTitle'),
calendarStringBundle.formatStringFromName('otherPutError',[e.message],1));
promptService.alert(null, calGetString("calendar", "errorTitle"),
props.formatStringFromName('otherPutError',[e.message],1));
}
}
@@ -250,7 +252,9 @@ var publishingListener =
ctxt.wrappedJSObject.onStopUpload();
var channel;
var calendarStringBundle = srGetStrBundle("chrome://calendar/locale/calendar.properties");
var sbs = Components.classes["@mozilla.org/intl/stringbundle;1"]
.getService(Components.interfaces.nsIStringBundleService);
var props = sbs.createBundle("chrome://calendar/locale/calendar.properties");
var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
.getService(Components.interfaces.nsIPromptService);
try {
@@ -259,13 +263,13 @@ var publishingListener =
} catch(e) {
}
if (channel && !channel.requestSucceeded) {
promptService.alert(null, calendarStringBundle.GetStringFromName('errorTitle'),
calendarStringBundle.formatStringFromName('httpPutError',[channel.responseStatus, channel.responseStatusText],2));
promptService.alert(null, calGetString("calenar", 'errorTitle'),
props.formatStringFromName('httpPutError',[channel.responseStatus, channel.responseStatusText],2));
}
else if (!channel && !Components.isSuccessCode(request.status)) {
// XXX this should be made human-readable.
promptService.alert(null, calendarStringBundle.GetStringFromName('errorTitle'),
calendarStringBundle.formatStringFromName('otherPutError',[request.status.toString(16)],1));
promptService.alert(null, calGetString("calenar", 'errorTitle'),
props.formatStringFromName('otherPutError',[request.status.toString(16)],1));
}
},

View File

@@ -64,7 +64,7 @@
<!-- Javascript includes -->
<script type="application/x-javascript" src="chrome://global/content/strres.js"/>
<script type="application/x-javascript" src="chrome://calendar/content/calendarUtils.js"/>
<script type="application/x-javascript" src="chrome://calendar/content/publishDialog.js"/>
<script type="application/x-javascript" >