Bug 145243: warning should be presented if user attempts cancellation of publish. r=kaie, sr=hewitt, moa=brade

This commit is contained in:
jaggernaut%netscape.com 2003-04-18 12:59:52 +00:00
parent 9d7d2a4332
commit 3121dbe55c
2 changed files with 24 additions and 0 deletions

View File

@ -87,6 +87,11 @@ AbandonChanges=Abandon unsaved changes to "%title%" and reload page?
DocumentTitle=Page Title
NeedDocTitle=Please enter a title for the current page.
DocTitleHelp=This identifies the page in the window title and bookmarks.
CancelPublishTitle=Cancel publishing?
## LOCALIZATION NOTE: "Continue" in this sentence must match the text for
## the CancelPublishContinue key below
CancelPublishMessage=Cancelling while publishing is in progress may result in your file(s) being incompletely transferred. Would you like to Continue or Cancel?
CancelPublishContinue=Continue
AttributesFor=Current attributes for:
MissingImageError=Please enter or choose an image of type gif, jpg, or png.
EmptyHREFError=Please choose a location to create a new link.

View File

@ -309,6 +309,25 @@ function CheckKeepOpen()
function onClose()
{
if (!gFinished)
{
const nsIPromptService = Components.interfaces.nsIPromptService;
var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
.getService(nsIPromptService);
const buttonFlags = (nsIPromptService.BUTTON_TITLE_IS_STRING *
nsIPromptService.BUTTON_POS_0) +
(nsIPromptService.BUTTON_TITLE_CANCEL *
nsIPromptService.BUTTON_POS_1);
var button = promptService.confirmEx(window,
GetString("CancelPublishTitle"),
GetString("CancelPublishMessage"),
buttonFlags,
GetString("CancelPublishContinue"),
null, null, null, {});
if (button == 0)
return false;
}
if (gTimerID)
{
clearTimeout(gTimerID);