mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-25 18:07:31 +09:00
Issue #1258 - Part 1: Import mailnews, ldap, and mork from comm-esr52.9.1
This commit is contained in:
parent
23e0d82436
commit
e400f4130a
1564 changed files with 510348 additions and 0 deletions
99
mailnews/base/content/shutdownWindow.js
Normal file
99
mailnews/base/content/shutdownWindow.js
Normal file
|
|
@ -0,0 +1,99 @@
|
|||
/*
|
||||
# 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/.
|
||||
*/
|
||||
|
||||
var curTaskIndex = 0;
|
||||
var numTasks = 0;
|
||||
var stringBundle;
|
||||
|
||||
var msgShutdownService = Components.classes["@mozilla.org/messenger/msgshutdownservice;1"]
|
||||
.getService(Components.interfaces.nsIMsgShutdownService);
|
||||
|
||||
function onLoad()
|
||||
{
|
||||
numTasks = msgShutdownService.getNumTasks();
|
||||
|
||||
stringBundle = document.getElementById("bundle_shutdown");
|
||||
document.title = stringBundle.getString("shutdownDialogTitle");
|
||||
|
||||
updateTaskProgressLabel(1);
|
||||
updateProgressMeter(0);
|
||||
|
||||
msgShutdownService.startShutdownTasks();
|
||||
}
|
||||
|
||||
function updateProgressLabel(inTaskName)
|
||||
{
|
||||
var curTaskLabel = document.getElementById("shutdownStatus_label");
|
||||
curTaskLabel.value = inTaskName;
|
||||
}
|
||||
|
||||
function updateTaskProgressLabel(inCurTaskNum)
|
||||
{
|
||||
var taskProgressLabel = document.getElementById("shutdownTask_label");
|
||||
taskProgressLabel.value = stringBundle.getFormattedString("taskProgress", [inCurTaskNum, numTasks]);
|
||||
}
|
||||
|
||||
function updateProgressMeter(inPercent)
|
||||
{
|
||||
var taskProgressmeter = document.getElementById('shutdown_progressmeter');
|
||||
taskProgressmeter.value = inPercent;
|
||||
}
|
||||
|
||||
function onCancel()
|
||||
{
|
||||
msgShutdownService.cancelShutdownTasks();
|
||||
}
|
||||
|
||||
function nsMsgShutdownTaskListener()
|
||||
{
|
||||
msgShutdownService.setShutdownListener(this);
|
||||
}
|
||||
|
||||
nsMsgShutdownTaskListener.prototype =
|
||||
{
|
||||
QueryInterface : function(iid)
|
||||
{
|
||||
if (iid.equals(Components.interfaces.nsIWebProgressListener) ||
|
||||
iid.equals(Components.interfaces.nsISupportsWeakReference) ||
|
||||
iid.equals(Components.interfaces.nsISupports))
|
||||
return this;
|
||||
|
||||
throw Components.results.NS_NOINTERFACE;
|
||||
},
|
||||
|
||||
onStateChange: function(aWebProgress, aRequest, aStateFlags, aStatus)
|
||||
{
|
||||
if (aStateFlags & Components.interfaces.nsIWebProgressListener.STATE_STOP)
|
||||
{
|
||||
window.close();
|
||||
}
|
||||
},
|
||||
|
||||
onProgressChange: function(aWebProgress, aRequest, aCurSelfProgress, aMaxSelfProgress, aCurTotalProgress, aMaxTotalProgress)
|
||||
{
|
||||
updateProgressMeter(((aCurTotalProgress / aMaxTotalProgress) * 100));
|
||||
updateTaskProgressLabel(aCurTotalProgress + 1);
|
||||
},
|
||||
|
||||
onLocationChange: function(aWebProgress, aRequest, aLocation, aFlags)
|
||||
{
|
||||
// we can ignore this notification
|
||||
},
|
||||
|
||||
onStatusChange: function(aWebProgress, aRequest, aStatus, aMessage)
|
||||
{
|
||||
if (aMessage)
|
||||
updateProgressLabel(aMessage);
|
||||
},
|
||||
|
||||
onSecurityChange: function(aWebProgress, aRequest, state)
|
||||
{
|
||||
// we can ignore this notification
|
||||
}
|
||||
}
|
||||
|
||||
var MsgShutdownTaskListener = new nsMsgShutdownTaskListener();
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue