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."));
if (choice == NSAlertOtherReturn) { /* Cancel */
return NO;
} else if (choice != NSAlertAlternateReturn) { /* Review unsaved; Quit Anyway falls through */
/* If the document is in a .rtfd and it's name is TXT.rtf or index.rtf, open the parent dir... This is because on windows it doesn't seem trivial to double-click to open folders as documents.
if (![NSBundle loadNibNamed:@"Info" owner:self]) {
NSLog(@"Failed to load Info.nib");
NSBeep();
return;
}
[infoPanel center];
}
[infoPanel makeKeyAndOrderFront:nil];
}
- (void)setVersionField:(id)versionField {
extern char TextEdit_VERS_NUM[];
if (strlen(TextEdit_VERS_NUM) > 0) {
NSString *versionString = [NSString stringWithFormat:NSLocalizedString(@"Release 4 (v%s)", @"Version string. %s is replaced by the version number."), TextEdit_VERS_NUM];