From ad7328e56541556d23f527303deddaefd4253ef2 Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Thu, 14 Apr 2011 00:23:22 +0000 Subject: Make some minor changes after reviewing r3271: - Fix a few encoding issues - Recode a few [NSApp keyWindow] uses back to [SPDatabaseDocument parentWindow] following discussion; possibly for later refactoring into use of an error method --- Source/SPIndexesController.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Source/SPIndexesController.m') diff --git a/Source/SPIndexesController.m b/Source/SPIndexesController.m index 21320897..9c0c03a6 100644 --- a/Source/SPIndexesController.m +++ b/Source/SPIndexesController.m @@ -235,7 +235,7 @@ static const NSString *SPNewIndexKeyBlockSize = @"IndexKeyBlockSize"; // Begin the sheet [NSApp beginSheet:[self window] - modalForWindow:[NSApp keyWindow] + modalForWindow:[dbDocument parentWindow] modalDelegate:self didEndSelector:@selector(addIndexSheetDidEnd:returnCode:contextInfo:) contextInfo:nil]; @@ -293,7 +293,7 @@ static const NSString *SPNewIndexKeyBlockSize = @"IndexKeyBlockSize"; [[buttons objectAtIndex:0] setKeyEquivalentModifierMask:NSCommandKeyMask]; [[buttons objectAtIndex:1] setKeyEquivalent:@"\r"]; - [alert beginSheetModalForWindow:[NSApp keyWindow] modalDelegate:self didEndSelector:@selector(removeIndexSheetDidEnd:returnCode:contextInfo:) contextInfo:(hasForeignKey) ? @"removeIndexAndForeignKey" : @"removeIndex"]; + [alert beginSheetModalForWindow:[dbDocument parentWindow] modalDelegate:self didEndSelector:@selector(removeIndexSheetDidEnd:returnCode:contextInfo:) contextInfo:(hasForeignKey) ? @"removeIndexAndForeignKey" : @"removeIndex"]; } /** @@ -795,7 +795,7 @@ static const NSString *SPNewIndexKeyBlockSize = @"IndexKeyBlockSize"; // Check for errors, but only if the query wasn't cancelled if ([connection queryErrored] && ![connection queryCancelled]) { - SPBeginAlertSheet(NSLocalizedString(@"Unable to add index", @"add index error message"), NSLocalizedString(@"OK", @"OK button"), nil, nil, [NSApp keyWindow], self, nil, nil, + SPBeginAlertSheet(NSLocalizedString(@"Unable to add index", @"add index error message"), NSLocalizedString(@"OK", @"OK button"), nil, nil, [dbDocument parentWindow], self, nil, nil, [NSString stringWithFormat:NSLocalizedString(@"An error occured while trying to add the index.\n\nMySQL said: %@", @"add index error informative message"), [connection getLastErrorMessage]]); } else { -- cgit v1.2.3