Bug 274452 - When accounts are removed, offer to delete files in the Local Directory path. ui-r=paenglab, r=mkmelin,IanN a=IanN

This commit is contained in:
aceman 2016-10-22 15:51:00 +02:00
Родитель a5e2b05da8
Коммит dde0a10acc
21 изменённых файлов: 466 добавлений и 79 удалений

Просмотреть файл

@ -30,9 +30,6 @@ WizardContinue=Cancel
# when the wizard already has a domain (Should we say something different?)
enterValidServerName=Please enter a valid server name.
failedRemoveAccount=Failed to remove this account.
#LOCALIZATION NOTE: confirmRemoveAccount: %S is the account pretty name
confirmRemoveAccount=Are you sure you want to remove the account "%S"?
confirmRemoveAccountTitle=Remove Account
#LOCALIZATION NOTE: accountName: %1$S is server name, %2$S is user name
accountName=%1$S - %2$S

Просмотреть файл

@ -0,0 +1,19 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!ENTITY dialogTitle "Remove Account and Data">
<!ENTITY removeButton.label "Remove">
<!ENTITY removeButton.accesskey "R">
<!ENTITY removeAccount.label "Remove account information">
<!ENTITY removeAccount.accesskey "a">
<!ENTITY removeAccount.desc "Removes only &brandShortName;'s knowledge of this account. Does not affect the account itself on the server.">
<!ENTITY removeData.label "Remove message data">
<!ENTITY removeData.accesskey "d">
<!ENTITY removeDataLocalAccount.desc "Removes all messages, folders and filters associated with this account from your local disk. This does not affect some messages which may still be kept on the server. Do not choose this if you plan to archive the local data or re-use it in &brandShortName; later.">
<!ENTITY removeDataServerAccount.desc "Removes all messages, folders and filters associated with this account from your local disk. Your messages and folders are still kept on the server.">
<!ENTITY showData.label "Show data location">
<!ENTITY showData.accesskey "S">
<!ENTITY progressPending "Removing selected data…">
<!ENTITY progressSuccess "Removal succeeded.">
<!ENTITY progressFailure "Removal failed.">

Просмотреть файл

@ -0,0 +1,5 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
removeQuestion=Are you sure you want to remove the account "%S"?

Просмотреть файл

@ -52,6 +52,8 @@
locale/@AB_CD@/messenger/smtpEditOverlay.dtd (%chrome/messenger/smtpEditOverlay.dtd)
locale/@AB_CD@/messenger/am-smime.dtd (%chrome/messenger/am-smime.dtd)
locale/@AB_CD@/messenger/am-smime.properties (%chrome/messenger/am-smime.properties)
locale/@AB_CD@/messenger/removeAccount.dtd (%chrome/messenger/removeAccount.dtd)
locale/@AB_CD@/messenger/removeAccount.properties (%chrome/messenger/removeAccount.properties)
locale/@AB_CD@/messenger/messenger.properties (%chrome/messenger/messenger.properties)
locale/@AB_CD@/messenger/newFolderDialog.dtd (%chrome/messenger/newFolderDialog.dtd)
locale/@AB_CD@/messenger/newTagDialog.dtd (%chrome/messenger/newTagDialog.dtd)

Просмотреть файл

@ -0,0 +1,105 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
/**
* This test checks proper deletion of an account from the Account manager.
*/
var MODULE_NAME = "test-account-deletion";
var RELATIVE_ROOT = "../shared-modules";
var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers",
"account-manager-helpers"];
var gPopAccount, gImapAccount, gNntpAccount, gOriginalAccountCount;
function setupModule(module) {
for (let lib of MODULE_REQUIRES) {
collector.getModule(lib).installInto(module);
}
// There may be pre-existing accounts from other tests.
gOriginalAccountCount = MailServices.accounts.allServers.length;
// Create a POP server
let popServer = MailServices.accounts
.createIncomingServer("nobody", "pop.foo.invalid", "pop3")
.QueryInterface(Ci.nsIPop3IncomingServer);
let identity = MailServices.accounts.createIdentity();
identity.email = "tinderbox@pop.foo.invalid";
gPopAccount = MailServices.accounts.createAccount();
gPopAccount.incomingServer = popServer;
gPopAccount.addIdentity(identity);
// Create an IMAP server
let imapServer = MailServices.accounts
.createIncomingServer("nobody", "imap.foo.invalid", "imap")
.QueryInterface(Ci.nsIImapIncomingServer);
identity = MailServices.accounts.createIdentity();
identity.email = "tinderbox@imap.foo.invalid";
gImapAccount = MailServices.accounts.createAccount();
gImapAccount.incomingServer = imapServer;
gImapAccount.addIdentity(identity);
assert_equals(MailServices.accounts.allServers.length, gOriginalAccountCount + 2);
}
function teardownModule(module) {
// There should be only the original accounts left.
assert_equals(MailServices.accounts.allServers.length, gOriginalAccountCount);
}
function test_account_data_deletion() {
open_advanced_settings(function(amc) {
subtest_account_data_deletion1(amc);
});
open_advanced_settings(function(amc) {
subtest_account_data_deletion2(amc);
});
}
/**
* Bug 274452
* Check if files of an account are preserved.
*
* @param amc The account options controller.
*/
function subtest_account_data_deletion1(amc)
{
let accountDir = gPopAccount.incomingServer.localPath;
assert_true(accountDir.isDirectory());
// Get some existing file in the POP3 account data dir.
let inboxFile = accountDir.clone();
inboxFile.append("Inbox.msf");
assert_true(inboxFile.isFile());
remove_account(gPopAccount, amc, true, false);
assert_true(accountDir.exists());
}
/**
* Bug 274452
* Check if files of an account can be deleted.
*
* @param amc The account options controller.
*/
function subtest_account_data_deletion2(amc)
{
let accountDir = gImapAccount.incomingServer.localPath;
assert_true(accountDir.isDirectory());
// Get some file in the IMAP account data dir.
let inboxFile = accountDir.clone();
inboxFile.append("INBOX.msf");
assert_true(inboxFile.isFile());
remove_account(gImapAccount, amc, true, true);
assert_false(accountDir.exists());
}

Просмотреть файл

@ -151,10 +151,6 @@ function test_selection_after_account_deletion() {
*/
function subtest_check_selection_after_account_deletion(amc)
{
// Select the default account.
let accountRow = get_account_tree_row(gPopAccount.key, "am-server.xul", amc);
click_account_tree_row(amc, accountRow);
let accountList = [];
let accountTreeNode = amc.e("account-tree-children");
// Build the list of accounts in the account tree (order is important).
@ -169,14 +165,8 @@ function subtest_check_selection_after_account_deletion(amc)
// Get position of the current account in the account list.
let accountIndex = accountList.indexOf(gPopAccount);
plan_for_modal_dialog("commonDialog", function(cdc) {
// Account removal confirmation dialog. Just accept it.
cdc.window.document.documentElement.acceptDialog();
});
// Use the Remove item in the Account actions menu.
amc.click_menus_in_sequence(amc.e("accountActionsDropdown"),
[ {id: "accountActionsDropdownRemove"} ]);
wait_for_modal_dialog("commonDialog");
// Remove our account.
remove_account(gPopAccount, amc);
// Now there should be only the original accounts left.
assert_equals(MailServices.accounts.allServers.length, gOriginalAccountCount);

Просмотреть файл

@ -43,8 +43,8 @@ function open_mail_account_setup_wizard(k) {
return wait_for_modal_dialog("mail:autoconfig");
}
// Remove an account on the Account Manager
function remove_account(amc, aAccount, aOutgoing) {
// Remove an account in the Account Manager, but not via the UI.
function remove_account_internal(amc, aAccount, aOutgoing) {
let win = amc.window;
try {
@ -140,7 +140,7 @@ function subtest_verify_account(amc) {
}
}
} finally {
remove_account(amc, account, outgoing);
remove_account_internal(amc, account, outgoing);
}
}

Просмотреть файл

@ -10,6 +10,8 @@ var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers"];
var utils = {};
Cu.import('resource://mozmill/modules/utils.js', utils);
var elib = {};
Components.utils.import("resource://mozmill/modules/elementslib.js", elib);
var wh, fdh, mc;
@ -28,6 +30,7 @@ function installInto(module) {
open_advanced_settings_from_account_wizard;
module.click_account_tree_row = click_account_tree_row;
module.get_account_tree_row = get_account_tree_row;
module.remove_account = remove_account;
}
/**
@ -130,3 +133,36 @@ function get_account_tree_row(aAccountKey, aPaneId, aController) {
dump("The treerow for account " + aAccountKey + " was not found!\n");
return -1;
}
/**
* Remove an account via the account manager UI.
*
* @param aAccount The account to remove.
* @param aController The controller of the account manager window.
* @param aRemoveAccount Remove the account itself.
* @param aRemoveData Remove the message data of the account.
*/
function remove_account(aAccount, aController, aRemoveAccount = true, aRemoveData = false) {
let accountRow = get_account_tree_row(aAccount.key, "am-server.xul", aController);
click_account_tree_row(aController, accountRow);
wh.plan_for_modal_dialog("removeAccountDialog", function(cdc) {
// Account removal confirmation dialog. Select what to remove.
if (aRemoveAccount)
cdc.click(new elib.Elem(cdc.window.document.getElementById("removeAccount")));
if (aRemoveData)
cdc.click(new elib.Elem(cdc.window.document.getElementById("removeData")));
cdc.window.document.documentElement.acceptDialog();
cdc.waitFor(() => !cdc.window.document.documentElement.getButton("accept").disabled,
"Timeout waiting for finish of account removal",
5000, 100);
cdc.window.document.documentElement.acceptDialog();
});
// Use the Remove item in the Account actions menu.
aController.click_menus_in_sequence(aController.e("accountActionsDropdown"),
[ {id: "accountActionsDropdownRemove"} ]);
wh.wait_for_modal_dialog("removeAccountDialog");
// TODO: For unknown reason this also closes the whole account manager.
}

Просмотреть файл

@ -682,6 +682,9 @@ function AddIMAccount()
* Can be given as null if there was none.
*/
function markDefaultServer(newDefault, oldDefault) {
if (oldDefault == newDefault)
return;
let accountTreeNodes = document.getElementById("account-tree-children")
.childNodes;
for (let i = 0; i < accountTreeNodes.length; i++) {
@ -720,22 +723,11 @@ function onRemoveAccount(event) {
return;
let server = currentAccount.incomingServer;
let prettyName = server.prettyName;
let canDelete = server.protocolInfo.canDelete || server.canDelete;
if (!canDelete)
return;
let bundle = document.getElementById("bundle_prefs");
let confirmRemoveAccount = bundle.getFormattedString("confirmRemoveAccount",
[prettyName]);
let confirmTitle = bundle.getString("confirmRemoveAccountTitle");
if (!Services.prompt.confirm(window, confirmTitle, confirmRemoveAccount))
return;
let serverList = [];
let accountTreeNode = document.getElementById("account-tree-children");
// build the list of servers in the account tree (order is important)
@ -757,36 +749,30 @@ function onRemoveAccount(event) {
else
serverIndex++;
// Remove password information.
let serverUri = server.type + "://" + server.hostName;
// Need to save these before the account and its server is removed.
let serverId = server.serverURI;
let logins = Services.logins.findLogins({}, serverUri, null, serverUri);
// Confirm account deletion.
let removeArgs = { server: server, account: currentAccount,
result: false };
for (let i = 0; i < logins.length; i++) {
if (logins[i].username == server.username) {
Services.logins.removeLogin(logins[i]);
break;
}
window.openDialog("chrome://messenger/content/removeAccount.xul",
"removeAccount",
"chrome,titlebar,modal,centerscreen,resizable=no",
removeArgs);
// If result is true, the account was removed.
if (!removeArgs.result)
return;
// clear cached data out of the account array
currentAccount = currentPageId = null;
if (serverId in accountArray) {
delete accountArray[serverId];
}
try {
let serverId = server.serverURI;
MailServices.accounts.removeAccount(currentAccount);
// clear cached data out of the account array
currentAccount = currentPageId = null;
if (serverId in accountArray) {
delete accountArray[serverId];
}
if ((serverIndex >= 0) && (serverIndex < serverList.length))
selectServer(serverList[serverIndex], null);
}
catch (ex) {
Components.utils.reportError("Failure to remove account: " + ex);
let alertText = bundle.getString("failedRemoveAccount");
Services.prompt.alert(window, null, alertText);
}
if ((serverIndex >= 0) && (serverIndex < serverList.length))
selectServer(serverList[serverIndex], null);
// Either the default account was deleted so there is a new one
// or the default account was not changed. Either way, there is

Просмотреть файл

@ -0,0 +1,140 @@
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
Components.utils.import("resource:///modules/mailServices.js");
Components.utils.import("resource://gre/modules/Services.jsm");
var gServer;
var gDialog;
function onLoad(event) {
gServer = window.arguments[0].account.incomingServer;
gDialog = document.documentElement;
let bundle = document.getElementById("bundle_removeAccount");
let removeQuestion = bundle.getFormattedString("removeQuestion",
[gServer.prettyName]);
document.getElementById("accountName").textContent = removeQuestion;
// Do not allow removal if localPath is outside of profile folder.
let profilePath = Services.dirsvc.get("ProfD", Components.interfaces.nsIFile)
profilePath.normalize();
let localDirectory = gServer.localPath
localDirectory.normalize();
// TODO: bug 77652, decide what to do for deferred accounts.
// And inform the user if the account localPath is outside the profile.
if ((gServer.isDeferredTo ||
(gServer instanceof Components.interfaces.nsIPop3IncomingServer &&
gServer.deferredToAccount)) ||
!profilePath.contains(localDirectory)) {
document.getElementById("removeData").disabled = true;
}
enableRemove();
window.sizeToContent();
}
function enableRemove() {
gDialog.getButton("accept").disabled =
(!document.getElementById("removeAccount").checked &&
!document.getElementById("removeData").checked);
}
/**
* Show the local directory.
*/
function openLocalDirectory() {
let nsLocalFile = Components.Constructor("@mozilla.org/file/local;1",
"nsILocalFile", "initWithPath");
let localDir = gServer.localPath.path;
try {
new nsLocalFile(localDir).reveal();
} catch(e) {
// Reveal may fail e.g. on Linux, then just show the path as a string.
document.getElementById("localDirectory").value = localDir;
document.getElementById("localDirectory").collapsed = false;
}
}
function showInfo() {
let descs = document.querySelectorAll("vbox.indent");
for (let desc of descs) {
desc.collapsed = false;
}
if (gServer.type == "imap" || gServer.type == "nntp") {
document.getElementById("serverAccount").collapsed = false;
} else {
document.getElementById("localAccount").collapsed = false;
}
window.sizeToContent();
gDialog.getButton("disclosure").disabled = true;
gDialog.getButton("disclosure").blur();
}
function removeAccount() {
let removeAccount = document.getElementById("removeAccount").checked;
let removeData = document.getElementById("removeData").checked;
try {
// Remove the requested account data.
if (removeAccount) {
// Remove account
// Need to save these before the account and its server is removed.
let serverUri = gServer.type + "://" + gServer.hostName;
let serverUsername = gServer.username;
MailServices.accounts.removeAccount(window.arguments[0].account, removeData);
window.arguments[0].result = true;
// Remove password information.
let logins = Services.logins.findLogins({}, serverUri, null, serverUri);
for (let i = 0; i < logins.length; i++) {
if (logins[i].username == serverUsername) {
Services.logins.removeLogin(logins[i]);
break;
}
}
} else if (removeData) {
// Remove files only.
// TODO: bug 1302193
window.arguments[0].result = false;
}
document.getElementById("status").selectedPanel =
document.getElementById("success");
} catch (ex) {
document.getElementById("status").selectedPanel =
document.getElementById("failure");
Components.utils.reportError("Failure to remove account: " + ex);
window.arguments[0].result = false;
}
}
function onAccept() {
// If Cancel is disabled, we already tried to remove the account
// and can only close the dialog.
if (gDialog.getButton("cancel").disabled)
return true;
gDialog.getButton("accept").disabled = true;
gDialog.getButton("cancel").disabled = true;
gDialog.getButton("disclosure").disabled = true;
// Change the "Remove" to an "OK" button by clearing the custom label.
gDialog.removeAttribute("buttonlabelaccept");
gDialog.removeAttribute("buttonaccesskeyaccept");
gDialog.getButton("accept").removeAttribute("label");
gDialog.getButton("accept").removeAttribute("accesskey");
gDialog.buttons = "accept";
document.getElementById("infoPane").selectedIndex = 1;
window.sizeToContent();
removeAccount();
gDialog.getButton("accept").disabled = false;
return false;
}

Просмотреть файл

@ -0,0 +1,79 @@
<?xml version="1.0"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<?xml-stylesheet href="chrome://messenger/skin/messenger.css" type="text/css"?>
<?xml-stylesheet href="chrome://messenger/skin/dialogs.css" type="text/css"?>
<!DOCTYPE dialog [
<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
%brandDTD;
<!ENTITY % removalDTD SYSTEM "chrome://messenger/locale/removeAccount.dtd">
%removalDTD;
]>
<dialog id="removeAccountDialog"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="&dialogTitle;"
width="600"
buttons="accept,disclosure,cancel"
buttonlabelaccept="&removeButton.label;"
buttonaccesskeyaccept="&removeButton.accesskey;"
defaultButton="cancel"
onload="onLoad();"
ondialogdisclosure="showInfo();"
ondialogaccept="return onAccept();">
<stringbundle id="bundle_removeAccount"
src="chrome://messenger/locale/removeAccount.properties"/>
<script type="application/javascript"
src="chrome://messenger/content/removeAccount.js"/>
<deck id="infoPane">
<vbox flex="1">
<label id="accountName"></label>
<separator class="thin"/>
<checkbox id="removeAccount"
label="&removeAccount.label;"
checked="true"
disabled="true"
accesskey="&removeAccount.accesskey;"
oncommand="enableRemove();"/>
<vbox class="indent" collapsed="true">
<description>
&removeAccount.desc;
</description>
</vbox>
<checkbox id="removeData"
label="&removeData.label;"
checked="false"
accesskey="&removeData.accesskey;"
oncommand="enableRemove();"/>
<vbox class="indent" collapsed="true">
<description id="localAccount" collapsed="true">
&removeDataLocalAccount.desc;
</description>
<description id="serverAccount" collapsed="true">
&removeDataServerAccount.desc;
</description>
<hbox align="center">
<button label="&showData.label;"
accesskey="&showData.accesskey;"
oncommand="openLocalDirectory();"/>
<label id="localDirectory" collapsed="true"/>
</hbox>
</vbox>
</vbox>
<vbox align="center">
<spacer flex="1"/>
<deck id="status">
<vbox align="center">
<label>&progressPending;</label>
<progressmeter mode="undetermined"/>
</vbox>
<label id="success">&progressSuccess;</label>
<label id="failure">&progressFailure;</label>
</deck>
<spacer flex="1"/>
</vbox>
</deck>
</dialog>

Просмотреть файл

@ -21,9 +21,15 @@ interface nsIMsgAccountManager : nsISupports {
* Return the account with the provided key, or null if none found.
*/
nsIMsgAccount getAccount(in ACString key);
void removeAccount(in nsIMsgAccount account);
/**
* Removes the account from the list of accounts.
*
* @param aAccount the account to remove
* @param aRemoveFiles remove data directory (local directory) of this account
*/
void removeAccount(in nsIMsgAccount aAccount, [optional] in boolean aRemoveFiles);
/*
* creates a new identity and assigns it a new, unique "key"
*/
@ -44,12 +50,12 @@ interface nsIMsgAccountManager : nsISupports {
* Removes the server from the list of servers
*
* @param aServer server to remove
* @param aCleanupFiles remove directory from profile
* @param aRemoveFiles remove directory from profile
*
* @throws NS_ERROR_FAILURE if server not found
*/
void removeIncomingServer(in nsIMsgIncomingServer aServer,
in boolean aCleanupFiles);
in boolean aRemoveFiles);
/*
* get the identity with the given key
* if the identity does not exist, it will be created

Просмотреть файл

@ -335,14 +335,14 @@ interface nsIMsgIncomingServer : nsISupports {
*/
void clearAllValues();
/**
* this is also very dangerous. this will remove the files
* associated with this server on disk.
/**
* This is also very dangerous. This will low-level remove the files
* associated with this server on disk. It does not notify any listeners.
*/
void removeFiles();
attribute boolean valid;
AString toString();
void displayOfflineMsg(in nsIMsgWindow aWindow);

Просмотреть файл

@ -497,7 +497,7 @@ nsMsgAccountManager::GetIncomingServer(const nsACString& key,
NS_IMETHODIMP
nsMsgAccountManager::RemoveIncomingServer(nsIMsgIncomingServer *aServer,
bool aCleanupFiles)
bool aRemoveFiles)
{
NS_ENSURE_ARG_POINTER(aServer);
@ -554,7 +554,7 @@ nsMsgAccountManager::RemoveIncomingServer(nsIMsgIncomingServer *aServer,
removeListenersFromFolder(rootFolder);
NotifyServerUnloaded(aServer);
if (aCleanupFiles)
if (aRemoveFiles)
{
rv = aServer->RemoveFiles();
NS_ENSURE_SUCCESS(rv, rv);
@ -631,7 +631,8 @@ nsMsgAccountManager::removeListenersFromFolder(nsIMsgFolder *aFolder)
}
NS_IMETHODIMP
nsMsgAccountManager::RemoveAccount(nsIMsgAccount *aAccount)
nsMsgAccountManager::RemoveAccount(nsIMsgAccount *aAccount,
bool aRemoveFiles = false)
{
NS_ENSURE_ARG_POINTER(aAccount);
nsresult rv = LoadAccounts();
@ -657,7 +658,7 @@ nsMsgAccountManager::RemoveAccount(nsIMsgAccount *aAccount)
nsCOMPtr<nsIMsgIncomingServer> server;
rv = aAccount->GetIncomingServer(getter_AddRefs(server));
if (NS_SUCCEEDED(rv) && server)
RemoveIncomingServer(server, false);
RemoveIncomingServer(server, aRemoveFiles);
nsCOMPtr<nsIArray> identityArray;
rv = aAccount->GetIdentities(getter_AddRefs(identityArray));

Просмотреть файл

@ -1030,11 +1030,7 @@ NS_IMETHODIMP
nsMsgIncomingServer::RemoveFiles()
{
// IMPORTANT, see bug #77652
// don't turn this code on yet. we don't inform the user that
// we are going to be deleting the directory, and they might have
// tweaked their localPath pref for this server to point to
// somewhere they didn't want deleted.
// until we tell them, we shouldn't do the delete.
// TODO: Decide what to do for deferred accounts.
nsCString deferredToAccount;
GetCharValue("deferred_to_account", deferredToAccount);
bool isDeferredTo = true;

Просмотреть файл

@ -63,6 +63,8 @@ messenger.jar:
content/messenger/SmtpServerEdit.js (base/prefs/content/SmtpServerEdit.js)
content/messenger/smtpEditOverlay.xul (base/prefs/content/smtpEditOverlay.xul)
content/messenger/smtpEditOverlay.js (base/prefs/content/smtpEditOverlay.js)
content/messenger/removeAccount.xul (base/prefs/content/removeAccount.xul)
content/messenger/removeAccount.js (base/prefs/content/removeAccount.js)
#ifdef MOZ_THUNDERBIRD
content/messenger/accountcreation/accountConfig.js (base/prefs/content/accountcreation/accountConfig.js)
content/messenger/accountcreation/createInBackend.js (base/prefs/content/accountcreation/createInBackend.js)

Просмотреть файл

@ -571,7 +571,7 @@ var make_new_sets_in_folder = make_new_sets_in_folders;
*/
function* _looperator(aList) {
if (aList.length == 0)
throw Exception("aList must have at least one item!");
throw new Exception("aList must have at least one item!");
let i = 0, length = aList.length;
while (true) {
@ -629,7 +629,7 @@ function add_sets_to_folders(aMsgFolders, aMessageSets, aDoNotForceUpdate) {
if (mis.injectionConfig.mode == "local") {
for (let folder of aMsgFolders) {
if (!(folder instanceof Components.interfaces.nsIMsgLocalMailFolder))
throw Exception("All folders in aMsgFolders must be local folders!");
throw new Exception("All folders in aMsgFolders must be local folders!");
}
folderList = aMsgFolders;
}

Просмотреть файл

@ -31,9 +31,6 @@ WizardContinue=Cancel
# when the wizard already has a domain (Should we say something different?)
enterValidServerName=Please enter a valid server name.
failedRemoveAccount=Failed to remove this account.
#LOCALIZATION NOTE: confirmRemoveAccount: %S is the account pretty name
confirmRemoveAccount=Are you sure you want to remove the account "%S"?
confirmRemoveAccountTitle=Remove Account
#LOCALIZATION NOTE: accountName: %1$S is server name, %2$S is user name
accountName=%1$S - %2$S

Просмотреть файл

@ -0,0 +1,19 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!ENTITY dialogTitle "Remove Account and Data">
<!ENTITY removeButton.label "Remove">
<!ENTITY removeButton.accesskey "R">
<!ENTITY removeAccount.label "Remove account information">
<!ENTITY removeAccount.accesskey "a">
<!ENTITY removeAccount.desc "Removes only &brandShortName;'s knowledge of this account. Does not affect the account itself on the server.">
<!ENTITY removeData.label "Remove message data">
<!ENTITY removeData.accesskey "d">
<!ENTITY removeDataLocalAccount.desc "Removes all messages, folders and filters associated with this account from your local disk. This does not affect some messages which may still be kept on the server. Do not choose this if you plan to archive the local data or re-use it in &brandShortName; later.">
<!ENTITY removeDataServerAccount.desc "Removes all messages, folders and filters associated with this account from your local disk. Your messages and folders are still kept on the server.">
<!ENTITY showData.label "Show data location">
<!ENTITY showData.accesskey "S">
<!ENTITY progressPending "Removing selected data…">
<!ENTITY progressSuccess "Removal succeeded.">
<!ENTITY progressFailure "Removal failed.">

Просмотреть файл

@ -0,0 +1,5 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
removeQuestion=Are you sure you want to remove the account "%S"?

Просмотреть файл

@ -252,6 +252,8 @@
locale/@AB_CD@/messenger/am-server-advanced.dtd (%chrome/mailnews/pref/am-server-advanced.dtd)
locale/@AB_CD@/messenger/am-server-top.dtd (%chrome/mailnews/pref/am-server-top.dtd)
locale/@AB_CD@/messenger/am-archiveoptions.dtd (%chrome/mailnews/pref/am-archiveoptions.dtd)
locale/@AB_CD@/messenger/removeAccount.dtd (%chrome/mailnews/pref/removeAccount.dtd)
locale/@AB_CD@/messenger/removeAccount.properties (%chrome/mailnews/pref/removeAccount.properties)
locale/@AB_CD@/messenger/appleMailImportMsgs.properties (%chrome/mailnews/appleMailImportMsgs.properties)
locale/@AB_CD@/messenger/beckyImportMsgs.properties (%chrome/mailnews/beckyImportMsgs.properties)
locale/@AB_CD@/messenger/charsetTitles.properties (%chrome/mailnews/charsetTitles.properties)