if (document && [document isDocumentEdited]) needsSaving = YES;
}
if (needsSaving) {
int choice = NSRunAlertPanel(NSLocalizedString(@"Quit", @"Title of alert panel which comes up when user chooses Quit and there are unsaved documents."),
NSLocalizedString(@"You have unsaved documents.", @"Message in the alert panel which comes up when user chooses Quit and there are unsaved documents."),
NSLocalizedString(@"Review Unsaved", @"Choice (on a button) given to user which allows him/her to review all unsaved documents if he/she quits the application without saving them all first."),
NSLocalizedString(@"Quit Anyway", @"Choice (on a button) given to user which allows him/her to quit the application even though there are unsaved documents."),
NSLocalizedString(@"Cancel", @"Button choice allowing user to cancel quit"));
NSString *alternate = (cnt + 1 == numFiles) ? nil : NSLocalizedString(@"Abort", @"Button allowing user to abort opening multiple files after one couldn't be opened");
unsigned choice = NSRunAlertPanel(NSLocalizedString(@"File system error", @"Title of alert indicating file couldn't be opened"),
NSLocalizedString(@"Couldn't open file %@.", @"Message indicating file couldn't be opened."),
/* Returns the directory in which open/save panels should come up... If the OpenPanelFollowsMainWindow default is set, we have the open panel follow the main window.
*/
+ (NSString *)openSavePanelDirectory {
if ([[NSUserDefaults standardUserDefaults] boolForKey:@"OpenPanelFollowsMainWindow"]) {