Browse Source

[COMM] Use a common function in Communicator.jsm to invoke the license window

custom-2020
Matt A. Tobin 3 years ago committed by Roy Tam
parent
commit
de6e73caf7
  1. 3
      communicator/components/eula/content/eula.js
  2. 12
      communicator/modules/Communicator.jsm
  3. 13
      projects/mail/components/mailGlue.js
  4. 14
      projects/navigator/components/nsSuiteGlue.js

3
communicator/components/eula/content/eula.js

@ -9,8 +9,7 @@ function Startup() {
textbox.setAttribute("cols", "80");
textbox.setAttribute("rows", "20");
textbox.setAttribute("style", "resize: none; font-family: -moz-fixed;");
textbox.setAttribute("value",
Communicator.readfile("GreD", "license.txt"));
textbox.setAttribute("value", Communicator.readfile("GreD", "license.txt"));
main.appendChild(textbox);
}

12
communicator/modules/Communicator.jsm

@ -34,6 +34,18 @@ this.Communicator = {
return platform == this.platform &&
Services.vc.compare(platformVersion, version) <= 0;
},
showLicenseWindow: function() {
var eulaDone = null;
try {
eulaDone = Services.prefs.getBoolPref("app.eula.accepted");
}
catch (ex) { }
if (!eulaDone || aReviewOnly) {
Services.ww.openWindow(null, "chrome://communicator/content/eula/eula.xul",
"_blank", "chrome,centerscreen,modal,resizable=no");
}
},
readfile: function(aDSDir, aFile) {
Components.utils.import("resource://gre/modules/FileUtils.jsm");
Components.utils.import("resource://gre/modules/NetUtil.jsm");

13
projects/mail/components/mailGlue.js

@ -7,6 +7,7 @@ var Ci = Components.interfaces;
var Cc = Components.classes;
var Cu = Components.utils;
Cu.import("resource://gre/modules/Communicator.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/AddonManager.jsm");
@ -65,17 +66,7 @@ MailGlue.prototype = {
this._handleLink(aSubject, aData);
break;
case "profile-after-change":
// EULA
var eulaDone = null;
try {
eulaDone = Services.prefs.getBoolPref("app.eula.accepted");
}
catch (ex) { }
if (!eulaDone) {
Services.ww.openWindow(null, "chrome://communicator/content/eula/eula.xul",
"_blank", "chrome,centerscreen,modal,resizable=no", null);
}
Communicator.showLicenseWindow();
// Override Toolkit's nsITransfer implementation with the one from the
// JavaScript API for downloads. This will eventually be removed when

14
projects/navigator/components/nsSuiteGlue.js

@ -4,6 +4,7 @@
const XULNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
Components.utils.import("resource://gre/modules/Communicator.jsm");
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
Components.utils.import("resource://gre/modules/Services.jsm");
Components.utils.import("resource://gre/modules/AddonManager.jsm");
@ -328,18 +329,7 @@ SuiteGlue.prototype = {
// profile is available
_onProfileAfterChange: function()
{
// EULA
var eulaDone = null;
try {
eulaDone = Services.prefs.getBoolPref("app.eula.accepted");
}
catch (ex) { }
if (!eulaDone) {
Services.ww.openWindow(null, "chrome://communicator/content/eula/eula.xul",
"_blank", "chrome,centerscreen,modal,resizable=no", null);
}
Communicator.showLicenseWindow();
this._copyDefaultProfileFiles();
},

Loading…
Cancel
Save