From c922968d372fe273a7e7bfefad7ef1409d560f48 Mon Sep 17 00:00:00 2001 From: "jminta%gmail.com" Date: Thu, 21 Dec 2006 04:31:06 +0000 Subject: [PATCH] Bug 362876 Offer a chance to save changes to an item if the app is trying to restart r=lilmatt,mvl --- calendar/base/content/calendar-event-dialog.js | 10 ++++++++++ .../locales/en-US/chrome/calendar/calendar.properties | 4 ++++ 2 files changed, 14 insertions(+) diff --git a/calendar/base/content/calendar-event-dialog.js b/calendar/base/content/calendar-event-dialog.js index 7305b3c267a7..29588eab9aa3 100644 --- a/calendar/base/content/calendar-event-dialog.js +++ b/calendar/base/content/calendar-event-dialog.js @@ -1154,3 +1154,13 @@ var gCategoriesPane = { catList.selectedIndex = index; } }; + +// Make sure that an AUS update triggered restart doesn't automatically nuke +// what the user is working on +window.tryToClose = function calItemDialogAttemptClose() { + var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"] + .getService(Components.interfaces.nsIPromptService); + return promptService.confirm(window, + calGetString("calendar", "confirmCloseTitle"), + calGetString("calendar", "confirmCloseText")); +} diff --git a/calendar/locales/en-US/chrome/calendar/calendar.properties b/calendar/locales/en-US/chrome/calendar/calendar.properties index bd176009b94d..0a8b29f2269a 100644 --- a/calendar/locales/en-US/chrome/calendar/calendar.properties +++ b/calendar/locales/en-US/chrome/calendar/calendar.properties @@ -259,6 +259,10 @@ yesterday=Yesterday go=Go +# Confirming whether or not to close the new/edit item dialog +confirmCloseTitle=Discard changes? +confirmCloseText=Discard changes and close the dialog? + # Some languages have different conjugations of 'next' and 'last'. If yours # does not, simply repeat the value. This will be used with day names, as in # 'next Sunday'.