diff options
author | Bibiko <bibiko@eva.mpg.de> | 2010-01-13 20:53:39 +0000 |
---|---|---|
committer | Bibiko <bibiko@eva.mpg.de> | 2010-01-13 20:53:39 +0000 |
commit | 08fb692301568e7143271ffad9bbcb3a5b247de5 (patch) | |
tree | eedeb574fb2859cb1bcb9ae2d237206f9c4f38fd /Source/TablesList.m | |
parent | aeb5ec548006a76e926a2bd982b362e13251841b (diff) | |
download | sequelpro-08fb692301568e7143271ffad9bbcb3a5b247de5.tar.gz sequelpro-08fb692301568e7143271ffad9bbcb3a5b247de5.tar.bz2 sequelpro-08fb692301568e7143271ffad9bbcb3a5b247de5.zip |
• fixed several sheetDidEnd selectors to close a NSAlert or NSWindow properly to avoid overlapping sheets
• F5 completion
- if a table is selected and no further parsing info is given show that table and its fields at the top of the suggestions
Diffstat (limited to 'Source/TablesList.m')
-rw-r--r-- | Source/TablesList.m | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/Source/TablesList.m b/Source/TablesList.m index 742ac458..baca3e8a 100644 --- a/Source/TablesList.m +++ b/Source/TablesList.m @@ -510,6 +510,8 @@ // Order out current sheet to suppress overlapping of sheets if ([sheet respondsToSelector:@selector(orderOut:)]) [sheet orderOut:nil]; + else if ([sheet respondsToSelector:@selector(window)]) + [[sheet window] orderOut:nil]; if ([contextInfo isEqualToString:@"addRow"]) { alertSheetOpened = NO; @@ -1886,9 +1888,24 @@ // Couldn't truncate table if (![[mySQLConnection getLastErrorMessage] isEqualTo:@""]) { - NSBeginAlertSheet(NSLocalizedString(@"Error truncating table", @"error truncating table message"), - NSLocalizedString(@"OK", @"OK button"), nil, nil, tableWindow, self, nil, nil, nil, - [NSString stringWithFormat:NSLocalizedString(@"An error occurred while trying to truncate the table '%@'.\n\nMySQL said: %@", @"error truncating table informative message"), [filteredTables objectAtIndex:currentIndex], [mySQLConnection getLastErrorMessage]]); + // NSBeginAlertSheet(NSLocalizedString(@"Error truncating table", @"error truncating table message"), + // NSLocalizedString(@"OK", @"OK button"), nil, nil, tableWindow, self, @selector(sheetDidEnd:returnCode:contextInfo:), nil, nil, + // [NSString stringWithFormat:NSLocalizedString(@"An error occurred while trying to truncate the table '%@'.\n\nMySQL said: %@", @"error truncating table informative message"), [filteredTables objectAtIndex:currentIndex], [mySQLConnection getLastErrorMessage]]); + + NSAlert *alert = [NSAlert alertWithMessageText:NSLocalizedString(@"Error truncating table", @"error truncating table message") + defaultButton:NSLocalizedString(@"OK", @"OK button") + alternateButton:nil + otherButton:nil + informativeTextWithFormat:[NSString stringWithFormat:NSLocalizedString(@"An error occurred while trying to truncate the table '%@'.\n\nMySQL said: %@", @"error truncating table informative message"), + [filteredTables objectAtIndex:currentIndex], [mySQLConnection getLastErrorMessage]]]; + + [alert setAlertStyle:NSCriticalAlertStyle]; + // NSArray *buttons = [alert buttons]; + // // Change the alert's cancel button to have the key equivalent of return + // [[buttons objectAtIndex:0] setKeyEquivalent:@"t"]; + // [[buttons objectAtIndex:0] setKeyEquivalentModifierMask:NSCommandKeyMask]; + // [[buttons objectAtIndex:1] setKeyEquivalent:@"\r"]; + [alert beginSheetModalForWindow:tableWindow modalDelegate:self didEndSelector:@selector(sheetDidEnd:returnCode:contextInfo:) contextInfo:@"truncateTableError"]; } // Get next index (beginning from the end) |