Commit be54c7d3 authored by Ola Bini's avatar Ola Bini

Rename all modules in package to have an Enigmail prefix. Rename files

that started with enigmail or enig in package, and make the naming
consistent so that all module names start with Enigmail and no files in
package start with enigmal (except for enigmail.js).

Contributed by Fan Jiang, Iván Pazmiño, Reinaldo de Souza and Ola Bini.
parent 96151681
......@@ -19,8 +19,8 @@ COMPFILES = \
enigmail.js \
mimeDecrypt.js \
mimeEncrypt.js \
enigprefs-service.js \
enigMsgCompFields.js
prefs-service.js \
msgCompFields.js
PREFFILES = prefs/enigmail.js
......@@ -37,11 +37,11 @@ MODFILES = \
decryptPermanently.jsm \
dialog.jsm \
encryption.jsm \
enigmailCore.jsm \
enigmailErrorHandling.jsm \
enigmailFuncs.jsm \
enigmailGpgAgent.jsm \
enigmailProtocolHandler.jsm \
core.jsm \
errorHandling.jsm \
funcs.jsm \
gpgAgent.jsm \
protocolHandler.jsm \
events.jsm \
execution.jsm \
files.jsm \
......
......@@ -8,21 +8,21 @@
"use strict";
const EXPORTED_SYMBOLS = [ "App" ];
const EXPORTED_SYMBOLS = [ "EnigmailApp" ];
const Cc = Components.classes;
const Ci = Components.interfaces;
const Cu = Components.utils;
Cu.import("resource://gre/modules/AddonManager.jsm"); /*global AddonManager: false */
Cu.import("resource://enigmail/log.jsm"); /*global Log: false */
Cu.import("resource://enigmail/log.jsm"); /*global EnigmailLog: false */
const DIR_SERV_CONTRACTID = "@mozilla.org/file/directory_service;1";
const ENIG_EXTENSION_GUID = "{847b3a00-7ab1-11d4-8f02-006008948af5}";
const SEAMONKEY_ID = "{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}";
const XPCOM_APPINFO = "@mozilla.org/xre/app-info;1";
const App = {
const EnigmailApp = {
/**
* Platform application name (e.g. Thunderbird)
*/
......@@ -44,35 +44,35 @@ const App = {
},
getVersion: function() {
Log.DEBUG("app.jsm: getVersion\n");
Log.DEBUG("app.jsm: installed version: "+App.version+"\n");
return App.version;
EnigmailLog.DEBUG("app.jsm: getVersion\n");
EnigmailLog.DEBUG("app.jsm: installed version: "+EnigmailApp.version+"\n");
return EnigmailApp.version;
},
getInstallLocation: function() {
return App.installLocation;
return EnigmailApp.installLocation;
},
setVersion: function(version) {
App.version = version;
EnigmailApp.version = version;
},
setInstallLocation: function(location) {
App.installLocation = location;
EnigmailApp.installLocation = location;
},
registerAddon: function(addon) {
App.setVersion(addon.version);
App.setInstallLocation(addon.getResourceURI("").QueryInterface(Ci.nsIFileURL).file);
EnigmailApp.setVersion(addon.version);
EnigmailApp.setInstallLocation(addon.getResourceURI("").QueryInterface(Ci.nsIFileURL).file);
},
initAddon: function() {
try {
AddonManager.getAddonByID(ENIG_EXTENSION_GUID, App.registerAddon);
AddonManager.getAddonByID(ENIG_EXTENSION_GUID, EnigmailApp.registerAddon);
} catch (ex) {
dump("enigmailCommon.jsm: init error: "+ex+"\n");
}
}
};
App.initAddon();
EnigmailApp.initAddon();
/*global Components: false, Log: false */
/*global Components: false, EnigmailLog: false */
/*jshint -W097 */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
......@@ -91,7 +91,7 @@ const EnigmailArmor = {
// endIndex = offset of last character of block (newline)
// If block is not found, the null string is returned;
locateArmoredBlock: function (text, offset, indentStr, beginIndexObj, endIndexObj, indentStrObj) {
Log.DEBUG("enigmail.js: Enigmail.locateArmoredBlock: "+offset+", '"+indentStr+"'\n");
EnigmailLog.DEBUG("enigmail.js: Enigmail.locateArmoredBlock: "+offset+", '"+indentStr+"'\n");
beginIndexObj.value = -1;
endIndexObj.value = -1;
......@@ -140,7 +140,7 @@ const EnigmailArmor = {
var blockType = "";
if (matches && (matches.length > 1)) {
blockType = matches[1];
Log.DEBUG("enigmail.js: Enigmail.locateArmoredBlock: blockType="+blockType+"\n");
EnigmailLog.DEBUG("enigmail.js: Enigmail.locateArmoredBlock: blockType="+blockType+"\n");
}
if (blockType == "UNVERIFIED MESSAGE") {
......@@ -185,12 +185,12 @@ const EnigmailArmor = {
i = endObj.value;
}
Log.DEBUG("enigmail.js: locateArmorBlocks: Found " + blocks.length + " Blocks\n");
EnigmailLog.DEBUG("enigmail.js: locateArmorBlocks: Found " + blocks.length + " Blocks\n");
return blocks;
},
extractSignaturePart: function (signatureBlock, part) {
Log.DEBUG("enigmail.js: Enigmail.extractSignaturePart: part="+part+"\n");
EnigmailLog.DEBUG("enigmail.js: Enigmail.extractSignaturePart: part="+part+"\n");
return searchBlankLine(signatureBlock, function(offset) {
return indexOfNewline(signatureBlock, offset+1, function(offset) {
......
......@@ -40,34 +40,34 @@
"use strict";
const EXPORTED_SYMBOLS = [ "Attachment" ];
const EXPORTED_SYMBOLS = [ "EnigmailAttachment" ];
const Cu = Components.utils;
Cu.import("resource://enigmail/execution.jsm"); /*global Execution: false */
Cu.import("resource://enigmail/log.jsm"); /*global Log: false */
Cu.import("resource://enigmail/enigmailGpgAgent.jsm"); /*global EnigmailGpgAgent: false */
Cu.import("resource://enigmail/gpg.jsm"); /*global Gpg: false */
Cu.import("resource://enigmail/passwords.jsm"); /*global Passwords: false */
Cu.import("resource://enigmail/data.jsm"); /*global Data: false */
Cu.import("resource://enigmail/execution.jsm"); /*global EnigmailExecution: false */
Cu.import("resource://enigmail/log.jsm"); /*global EnigmailLog: false */
Cu.import("resource://enigmail/gpgAgent.jsm"); /*global EnigmailGpgAgent: false */
Cu.import("resource://enigmail/passwords.jsm"); /*global EnigmailPassword: false */
Cu.import("resource://enigmail/gpg.jsm"); /*global EnigmailGpg: false */
Cu.import("resource://enigmail/data.jsm"); /*global EnigmailData: false */
const Attachment = {
const EnigmailAttachment = {
getFileName: function (parent, byteData) {
Log.DEBUG("attachment.jsm: getFileName\n");
EnigmailLog.DEBUG("attachment.jsm: getFileName\n");
const args = Gpg.getStandardArgs(true).
concat(Passwords.command()).
const args = EnigmailGpg.getStandardArgs(true).
concat(EnigmailPassword.command()).
concat(["--list-packets"]);
const listener = Execution.newSimpleListener(
const listener = EnigmailExecution.newSimpleListener(
function _stdin (pipe) {
Log.DEBUG("attachment.jsm: getFileName: _stdin\n");
EnigmailLog.DEBUG("attachment.jsm: getFileName: _stdin\n");
pipe.write(byteData);
pipe.write("\n");
pipe.close();
});
const proc = Execution.execStart(EnigmailGpgAgent.agentPath, args, false, parent, listener, {});
const proc = EnigmailExecution.execStart(EnigmailGpgAgent.agentPath, args, false, parent, listener, {});
if (!proc) {
return null;
......@@ -78,7 +78,7 @@ const Attachment = {
const matches = listener.stdoutData.match(/:literal data packet:\r?\n.*name="(.*)",/m);
if (matches && (matches.length > 1)) {
var filename = escape(matches[1]).replace(/%5Cx/g, "%");
return Data.convertToUnicode(unescape(filename), "utf-8");
return EnigmailData.convertToUnicode(unescape(filename), "utf-8");
} else {
return null;
}
......
......@@ -41,23 +41,23 @@
"use strict";
const EXPORTED_SYMBOLS = [ "Card" ];
const EXPORTED_SYMBOLS = [ "EnigmailCard" ];
const Cu = Components.utils;
Cu.import("resource://enigmail/log.jsm"); /*global Log: false */
Cu.import("resource://enigmail/execution.jsm"); /*global Execution: false */
Cu.import("resource://enigmail/gpg.jsm"); /*global Gpg: false */
Cu.import("resource://enigmail/log.jsm"); /*global EnigmailLog: false */
Cu.import("resource://enigmail/execution.jsm"); /*global EnigmailExecution: false */
Cu.import("resource://enigmail/gpg.jsm"); /*global EnigmailGpg: false */
const Card = {
const EnigmailCard = {
getCardStatus: function(exitCodeObj, errorMsgObj) {
Log.DEBUG("enigmail.js: Enigmail.getCardStatus\n");
const args = Gpg.getStandardArgs(false).
EnigmailLog.DEBUG("card.jsm: EnigmailCard.getCardStatus\n");
const args = EnigmailGpg.getStandardArgs(false).
concat(["--status-fd", "2", "--fixed-list-mode", "--with-colons", "--card-status"]);
const statusMsgObj = {};
const statusFlagsObj = {};
const outputTxt = Execution.execCmd(Gpg.agentPath, args, "", exitCodeObj, statusFlagsObj, statusMsgObj, errorMsgObj);
const outputTxt = EnigmailExecution.execCmd(EnigmailGpg.agentPath, args, "", exitCodeObj, statusFlagsObj, statusMsgObj, errorMsgObj);
if ((exitCodeObj.value === 0) && !outputTxt) {
exitCodeObj.value = -1;
......
......@@ -41,7 +41,7 @@
"use strict";
const EXPORTED_SYMBOLS = [ "CommandLine" ];
const EXPORTED_SYMBOLS = [ "EnigmailCommandLine" ];
const Cc = Components.classes;
const Ci = Components.interfaces;
......@@ -84,6 +84,6 @@ Handler.prototype = {
lockFactory: function (lock) {}
};
const CommandLine = {
const EnigmailCommandLine = {
Handler: Handler
};
/*global Components: false, Log: false, Prefs: false, Timer: false, App: false, Locale: false, Dialog: false, Windows: false */
/*global Components: false, EnigmailLog: false, EnigmailPrefs: false, EnigmailTimer: false, EnigmailApp: false, EnigmailLocale: false, EnigmailDialog: false, EnigmailWindows: false */
/*jshint -W097 */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
......@@ -41,7 +41,7 @@
"use strict";
const EXPORTED_SYMBOLS = [ "Configure" ];
const EXPORTED_SYMBOLS = [ "EnigmailConfigure" ];
const Cc = Components.classes;
const Ci = Components.interfaces;
......@@ -59,8 +59,8 @@ function upgradeRecipientsSelection () {
// Upgrade perRecipientRules and recipientsSelectionOption to
// new recipientsSelection
var keySel = Prefs.getPref("recipientsSelectionOption");
var perRecipientRules = Prefs.getPref("perRecipientRules");
var keySel = EnigmailPrefs.getPref("recipientsSelectionOption");
var perRecipientRules = EnigmailPrefs.getPref("perRecipientRules");
var setVal = 2;
......@@ -99,54 +99,54 @@ function upgradeRecipientsSelection () {
}
// set new pref
Prefs.setPref("recipientsSelection", setVal);
EnigmailPrefs.setPref("recipientsSelection", setVal);
// clear old prefs
Prefs.getPrefBranch().clearUserPref("perRecipientRules");
Prefs.getPrefBranch().clearUserPref("recipientsSelectionOption");
EnigmailPrefs.getPrefBranch().clearUserPref("perRecipientRules");
EnigmailPrefs.getPrefBranch().clearUserPref("recipientsSelectionOption");
}
function upgradePrefsSending () {
Log.DEBUG("enigmailCommon.jsm: upgradePrefsSending()\n");
EnigmailLog.DEBUG("enigmailCommon.jsm: upgradePrefsSending()\n");
var cbs = Prefs.getPref("confirmBeforeSend");
var ats = Prefs.getPref("alwaysTrustSend");
var ksfr = Prefs.getPref("keepSettingsForReply");
Log.DEBUG("enigmailCommon.jsm: upgradePrefsSending cbs="+cbs+" ats="+ats+" ksfr="+ksfr+"\n");
var cbs = EnigmailPrefs.getPref("confirmBeforeSend");
var ats = EnigmailPrefs.getPref("alwaysTrustSend");
var ksfr = EnigmailPrefs.getPref("keepSettingsForReply");
EnigmailLog.DEBUG("enigmailCommon.jsm: upgradePrefsSending cbs="+cbs+" ats="+ats+" ksfr="+ksfr+"\n");
// Upgrade confirmBeforeSend (bool) to confirmBeforeSending (int)
switch (cbs) {
case false:
Prefs.setPref("confirmBeforeSending", 0); // never
EnigmailPrefs.setPref("confirmBeforeSending", 0); // never
break;
case true:
Prefs.setPref("confirmBeforeSending", 1); // always
EnigmailPrefs.setPref("confirmBeforeSending", 1); // always
break;
}
// Upgrade alwaysTrustSend (bool) to acceptedKeys (int)
switch (ats) {
case false:
Prefs.setPref("acceptedKeys", 0); // valid
EnigmailPrefs.setPref("acceptedKeys", 0); // valid
break;
case true:
Prefs.setPref("acceptedKeys", 1); // all
EnigmailPrefs.setPref("acceptedKeys", 1); // all
break;
}
// if all settings are default settings, use convenient encryption
if (cbs===false && ats===true && ksfr===true) {
Prefs.setPref("encryptionModel", 0); // convenient
Log.DEBUG("enigmailCommon.jsm: upgradePrefsSending() encryptionModel=0 (convenient)\n");
EnigmailPrefs.setPref("encryptionModel", 0); // convenient
EnigmailLog.DEBUG("enigmailCommon.jsm: upgradePrefsSending() encryptionModel=0 (convenient)\n");
}
else {
Prefs.setPref("encryptionModel", 1); // manually
Log.DEBUG("enigmailCommon.jsm: upgradePrefsSending() encryptionModel=1 (manually)\n");
EnigmailPrefs.setPref("encryptionModel", 1); // manually
EnigmailLog.DEBUG("enigmailCommon.jsm: upgradePrefsSending() encryptionModel=1 (manually)\n");
}
// clear old prefs
Prefs.getPrefBranch().clearUserPref("confirmBeforeSend");
Prefs.getPrefBranch().clearUserPref("alwaysTrustSend");
EnigmailPrefs.getPrefBranch().clearUserPref("confirmBeforeSend");
EnigmailPrefs.getPrefBranch().clearUserPref("alwaysTrustSend");
}
......@@ -154,22 +154,22 @@ function upgradeHeadersView() {
// all headers hack removed -> make sure view is correct
var hdrMode = null;
try {
hdrMode = Prefs.getPref("show_headers");
hdrMode = EnigmailPrefs.getPref("show_headers");
}
catch (ex) {}
if (!hdrMode) hdrMode = 1;
try {
Prefs.getPrefBranch().clearUserPref("show_headers");
EnigmailPrefs.getPrefBranch().clearUserPref("show_headers");
}
catch (ex) {}
Prefs.getPrefRoot().setIntPref("mail.show_headers", hdrMode);
EnigmailPrefs.getPrefRoot().setIntPref("mail.show_headers", hdrMode);
}
function upgradeCustomHeaders() {
try {
var extraHdrs = " " + Prefs.getPrefRoot().getCharPref("mailnews.headers.extraExpandedHeaders").toLowerCase() + " ";
var extraHdrs = " " + EnigmailPrefs.getPrefRoot().getCharPref("mailnews.headers.extraExpandedHeaders").toLowerCase() + " ";
var extraHdrList = [
"x-enigmail-version",
......@@ -184,7 +184,7 @@ function upgradeCustomHeaders() {
}
extraHdrs = extraHdrs.replace(/^ */, "").replace(/ *$/, "");
Prefs.getPrefRoot().setCharPref("mailnews.headers.extraExpandedHeaders", extraHdrs);
EnigmailPrefs.getPrefRoot().setCharPref("mailnews.headers.extraExpandedHeaders", extraHdrs);
}
catch(ex) {}
}
......@@ -192,7 +192,7 @@ function upgradeCustomHeaders() {
function upgradePgpMime() {
var pgpMimeMode = false;
try {
pgpMimeMode = (Prefs.getPref("usePGPMimeOption") == 2);
pgpMimeMode = (EnigmailPrefs.getPref("usePGPMimeOption") == 2);
}
catch (ex) {
return;
......@@ -220,21 +220,21 @@ function upgradePgpMime() {
}
}
}
Prefs.getPrefBranch().clearUserPref("usePGPMimeOption");
EnigmailPrefs.getPrefBranch().clearUserPref("usePGPMimeOption");
}
catch (ex) {}
}
const Configure = {
const EnigmailConfigure = {
configureEnigmail: function(win, startingPreferences) {
Log.DEBUG("enigmailCommon.jsm: ConfigureEnigmail\n");
let oldVer=Prefs.getPref("configuredVersion");
EnigmailLog.DEBUG("configure.jsm: configureEnigmail\n");
let oldVer=EnigmailPrefs.getPref("configuredVersion");
try {
let vc = Cc["@mozilla.org/xpcom/version-comparator;1"].getService(Ci.nsIVersionComparator);
if (oldVer === "") {
Windows.openSetupWizard(win, false);
EnigmailWindows.openSetupWizard(win, false);
}
else {
if (oldVer < "0.95") {
......@@ -268,15 +268,15 @@ const Configure = {
if (vc.compare(oldVer, "1.7") < 0) {
// open a modal dialog. Since this might happen during the opening of another
// window, we have to do this asynchronously
Timer.setTimeout(
EnigmailTimer.setTimeout(
function _cb() {
var doIt = Dialog.confirmDlg(win,
Locale.getString("enigmailCommon.versionSignificantlyChanged"),
Locale.getString("enigmailCommon.checkPreferences"),
Locale.getString("dlg.button.close"));
var doIt = EnigmailDialog.confirmDlg(win,
EnigmailLocale.getString("enigmailCommon.versionSignificantlyChanged"),
EnigmailLocale.getString("enigmailCommon.checkPreferences"),
EnigmailLocale.getString("dlg.button.close"));
if (!startingPreferences && doIt) {
// same as:
// - Windows.openPrefWindow(window, true, 'sendingTab');
// - EnigmailWindows.openPrefWindow(window, true, 'sendingTab');
// but
// - without starting the service again because we do that right now
// - and modal (waiting for its end)
......@@ -293,7 +293,7 @@ const Configure = {
}
catch(ex) {}
Prefs.setPref("configuredVersion", App.getVersion());
Prefs.savePrefs();
EnigmailPrefs.setPref("configuredVersion", EnigmailApp.getVersion());
EnigmailPrefs.savePrefs();
}
};
......@@ -40,9 +40,9 @@
"use strict";
const EXPORTED_SYMBOLS = [ "Constants" ];
const EXPORTED_SYMBOLS = [ "EnigmailConstants" ];
const Constants = {
const EnigmailConstants = {
POSSIBLE_PGPMIME: -2081,
// possible values for
......
......@@ -80,7 +80,7 @@ const EnigmailCore = {
return enigmailHolder.svc;
},
getKeyRing: lazy("keyRing.jsm", "KeyRing"),
getKeyRing: lazy("keyRing.jsm", "EnigmailKeyRing"),
/**
* obtain a list of all environment variables
......
/*global Components: false, Log: false, unescape: false */
/*global Components: false, EnigmailLog: false, unescape: false */
/*jshint -W097 */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
......@@ -40,7 +40,7 @@
"use strict";
const EXPORTED_SYMBOLS = [ "Data" ];
const EXPORTED_SYMBOLS = [ "EnigmailData" ];
const Cc = Components.classes;
const Ci = Components.interfaces;
......@@ -55,7 +55,7 @@ function converter(charset) {
return unicodeConv;
}
const Data = {
const EnigmailData = {
getUnicodeData: function(data) {
// convert output from subprocess to Unicode
var tmpStream = Cc["@mozilla.org/io/string-input-stream;1"].createInstance(Ci.nsIStringInputStream);
......@@ -130,7 +130,7 @@ const Data = {
a=text.search(/\\x[0-9a-fA-F]{2}/);
}
text = Data.convertToUnicode(text, "utf-8").replace(/\\e3A/g, ":");
text = EnigmailData.convertToUnicode(text, "utf-8").replace(/\\e3A/g, ":");
}
return text;
......
This diff is collapsed.
This diff is collapsed.
/*global Components: false, Locale: false, Log: false, Windows: false, Prefs: false */
/*global Components: false, EnigmailLocale: false, EnigmailLog: false, EnigmailWindows: false, EnigmailPrefs: false */
/*jshint -W097 */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
......@@ -40,7 +40,7 @@
"use strict";
const EXPORTED_SYMBOLS = [ "Dialog" ];
const EXPORTED_SYMBOLS = [ "EnigmailDialog" ];
const Cc = Components.classes;
const Ci = Components.interfaces;
......@@ -59,7 +59,7 @@ const gPromptSvc = Cc["@mozilla.org/embedcomp/prompt-service;1"].getService(Ci.n
const LOCAL_FILE_CONTRACTID = "@mozilla.org/file/local;1";
const Dialog = {
const EnigmailDialog = {
/***
* Confirmation dialog with OK / Cancel buttons (both customizable)
*
......@@ -90,7 +90,7 @@ const Dialog = {
}
let buttonPressed = gPromptSvc.confirmEx(win,
Locale.getString("enigConfirm"),
EnigmailLocale.getString("enigConfirm"),
mesg,
buttonTitles,
okLabel, cancelLabel, null,
......@@ -109,13 +109,13 @@ const Dialog = {
*/
alert: function (win, mesg) {
if (mesg.length > 1000) {
Dialog.longAlert(win, mesg, null, Locale.getString("dlg.button.close"));
EnigmailDialog.longAlert(win, mesg, null, EnigmailLocale.getString("dlg.button.close"));
} else {
try {
gPromptSvc.alert(win, Locale.getString("enigAlert"), mesg);
gPromptSvc.alert(win, EnigmailLocale.getString("enigAlert"), mesg);
}
catch(ex) {
Log.writeException("alert" , ex);
EnigmailLog.writeException("alert" , ex);
}
}
},
......@@ -143,7 +143,7 @@ const Dialog = {
};
if (! win) {
win = Windows.getBestParentWin();
win = EnigmailWindows.getBestParentWin();
}
win.openDialog("chrome://enigmail/content/enigmailAlertDlg.xul", "",
......@@ -173,7 +173,7 @@ const Dialog = {
* @return: Boolean - true if OK was pressed / false otherwise
*/
promptValue: function (win, mesg, valueObj) {
return gPromptSvc.prompt(win, Locale.getString("enigPrompt"),
return gPromptSvc.prompt(win, EnigmailLocale.getString("enigPrompt"),
mesg, valueObj, "", {});
},
......@@ -191,17 +191,17 @@ const Dialog = {
const display = true;
const dontDisplay = false;
let prefValue = Prefs.getPref(prefText);
let prefValue = EnigmailPrefs.getPref(prefText);
if(prefValue === display) {
let checkBoxObj = { value: false } ;
let buttonPressed = gPromptSvc.confirmEx(win,
Locale.getString("enigAlert"),
EnigmailLocale.getString("enigAlert"),
mesg,
(gPromptSvc.BUTTON_TITLE_OK * BUTTON_POS_0),
null, null, null,
Locale.getString("dlgNoPrompt"), checkBoxObj);
EnigmailLocale.getString("dlgNoPrompt"), checkBoxObj);
if (checkBoxObj.value && buttonPressed === 0) {
Prefs.setPref(prefText, dontDisplay);
EnigmailPrefs.setPref(prefText, dontDisplay);
}
}
},
......@@ -218,22 +218,22 @@ const Dialog = {
*
*/
alertCount: function (win, countPrefName, mesg) {
let alertCount = Prefs.getPref(countPrefName);
let alertCount = EnigmailPrefs.getPref(countPrefName);
if (alertCount <= 0)
return;
alertCount--;
Prefs.setPref(countPrefName, alertCount);
EnigmailPrefs.setPref(countPrefName, alertCount);
if (alertCount > 0) {
mesg += Locale.getString("repeatPrefix", [ alertCount ]) + " ";
mesg += (alertCount == 1) ? Locale.getString("repeatSuffixSingular") : Locale.getString("repeatSuffixPlural");
mesg += EnigmailLocale.getString("repeatPrefix", [ alertCount ]) + " ";
mesg += (alertCount == 1) ? EnigmailLocale.getString("repeatSuffixSingular") : EnigmailLocale.getString("repeatSuffixPlural");
} else {
mesg += Locale.getString("noRepeat");
mesg += EnigmailLocale.getString("noRepeat");
}
Dialog.alert(win, mesg);
EnigmailDialog.alert(win, mesg);
},
/**
......@@ -280,7 +280,7 @@ const Dialog = {
}
}
var prefValue = Prefs.getPref(prefText);
var prefValue = EnigmailPrefs.getPref(prefText);
if (typeof(prefValue) != "boolean") {
// number: remember user's choice
......@@ -288,13 +288,13 @@ const Dialog = {
case notSet:
let checkBoxObj = { value: false} ;
let buttonPressed = gPromptSvc.confirmEx(win,
Locale.getString("enigConfirm"),
EnigmailLocale.getString("enigConfirm"),
mesg,
buttonTitles,
okLabel, cancelLabel, null,
Locale.getString("dlgKeepSetting"), checkBoxObj);
EnigmailLocale.getString("dlgKeepSetting"), checkBoxObj);
if (checkBoxObj.value) {
Prefs.setPref(prefText, (buttonPressed===0 ? yes : no));
EnigmailPrefs.setPref(prefText, (buttonPressed===0 ? yes : no));
}
return (buttonPressed===0 ? 1 : 0);
case yes:
......@@ -310,13 +310,13 @@ const Dialog = {
case display:
let checkBoxObj = { value: false} ;
let buttonPressed = gPromptSvc.confirmEx(win,
Locale.getString("enigConfirm"),
EnigmailLocale.getString("enigConfirm"),
mesg,
buttonTitles,
okLabel, cancelLabel, null,
Locale.getString("dlgNoPrompt"), checkBoxObj);
EnigmailLocale.getString("dlgNoPrompt"), checkBoxObj);
if (checkBoxObj.value) {
Prefs.setPref(prefText, false);
EnigmailPrefs.setPref(prefText, false);
}
return (buttonPressed===0 ? 1 : 0);
case dontDisplay:
......@@ -342,7 +342,7 @@ const Dialog = {
* return value: nsIFile object representing the file to load or save
*/
filePicker: function (win, title, displayDir, save, defaultExtension, defaultName, filterPairs) {
Log.DEBUG("enigmailCommon.jsm: filePicker: "+save+"\n");
EnigmailLog.DEBUG("enigmailCommon.jsm: filePicker: "+save+"\n");
let filePicker = Cc["@mozilla.org/filepicker;1"].createInstance();
filePicker = filePicker.QueryInterface(Ci.nsIFilePicker);
......@@ -395,4 +395,4 @@ const Dialog = {
}
};
Windows.alert = Dialog.alert;
EnigmailWindows.alert = EnigmailDialog.alert;
This diff is collapsed.
This diff is collapsed.
/*global Components: false, Log: false, Locale: false, Data: false, EnigmailCore: false */
/*global Components: false, EnigmailLog: false, EnigmailLocale: false, EnigmailData: false, EnigmailCore: false */
/*jshint -W097 */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
......@@ -47,7 +47,7 @@ const Cu = Components.utils;
Cu.import("resource://enigmail/log.jsm");
Cu.import("resource://enigmail/locale.jsm");
Cu.import("resource://enigmail/data.jsm");
Cu.import("resource://enigmail/enigmailCore.jsm");
Cu.import("resource://enigmail/core.jsm");
const EXPORTED_SYMBOLS = [ "EnigmailErrorHandling" ];
......@@ -104,7 +104,7 @@ function missingPassphrase(c) {
c.statusFlags |= Ci.nsIEnigmail.MISSING_PASSPHRASE;
c.statusFlags |= Ci.nsIEnigmail.DISPLAY_MESSAGE;
c.flag = 0;
Log.DEBUG("enigmailCommon.jsm: parseErrorOutput: missing passphrase"+"\n");
EnigmailLog.DEBUG("enigmailCommon.jsm: parseErrorOutput: missing passphrase"+"\n");
c.retStatusObj.statusMsg += "Missing Passphrase\n";
}
......@@ -112,17 +112,17 @@ function invalidSignature(c) {
var lineSplit = c.statusLine.split(/ +/);
c.statusFlags |= Ci.nsIEnigmail.DISPLAY_MESSAGE;
c.flag = 0;
Log.DEBUG("enigmailCommon.jsm: parseErrorOutput: detected invalid sender: "+lineSplit[2]+" / code: "+lineSplit[1]+"\n");
c.retStatusObj.statusMsg += Locale.getString("gnupg.invalidKey.desc", [ lineSplit[2] ]);
EnigmailLog.DEBUG("enigmailCommon.jsm: parseErrorOutput: detected invalid sender: "+lineSplit[2]+" / code: "+lineSplit[1]+"\n");
c.retStatusObj.statusMsg += EnigmailLocale.getString("gnupg.invalidKey.desc", [ lineSplit[2] ]);
}
function importOk(c) {
var lineSplit = c.statusLine.split(/ +/);
if (lineSplit.length > 1) {
Log.DEBUG("enigmailCommon.jsm: parseErrorOutput: key imported: "+ lineSplit[2]+ "\n");
EnigmailLog.DEBUG("enigmailCommon.jsm: parseErrorOutput: key imported: "+ lineSplit[2]+ "\n");
}
else {
Log.DEBUG("enigmailCommon.jsm: parseErrorOutput: key without FPR imported\n");
EnigmailLog.DEBUG("enigmailCommon.jsm: parseErrorOutput: key without FPR imported\n");
}
let importFlag = Number(lineSplit[1]);
......@@ -280,27 +280,27 @@ function buildErrorMessageForCardCtrl(c, errCode, detectedCard) {
switch (errCode) {
case 1:
if (detectedCard) {
errorMsg = Locale.getString("sc.wrongCardAvailable", [ c.detectedCard, c.requestedCard ]);
errorMsg = EnigmailLocale.getString("sc.wrongCardAvailable", [ c.detectedCard, c.requestedCard ]);
}
else {
errorMsg = Locale.getString("sc.insertCard", [ c.requestedCard ]);
errorMsg = EnigmailLocale.getString("sc.insertCard", [ c.requestedCard ]);
}
break;
case 2:
errorMsg = Locale.getString("sc.removeCard");
errorMsg = EnigmailLocale.getString("sc.removeCard");
break;
case 4:
errorMsg = Locale.getString("sc.noCardAvailable");
errorMsg = EnigmailLocale.getString("sc.noCardAvailable");
break;
case 5:
errorMsg = Locale.getString("sc.noReaderAvailable");