diff options
author | Bibiko <bibiko@eva.mpg.de> | 2010-02-17 15:54:12 +0000 |
---|---|---|
committer | Bibiko <bibiko@eva.mpg.de> | 2010-02-17 15:54:12 +0000 |
commit | 299e8821edf9a1705a556c482a2a0ea4d6f9a0a8 (patch) | |
tree | c5f262a1b0920c796283dd008c2679396ab4cd66 /Source/TableDump.m | |
parent | 9e3ee6a65342adb3c30ee744c95467e469d17f96 (diff) | |
download | sequelpro-299e8821edf9a1705a556c482a2a0ea4d6f9a0a8.tar.gz sequelpro-299e8821edf9a1705a556c482a2a0ea4d6f9a0a8.tar.bz2 sequelpro-299e8821edf9a1705a556c482a2a0ea4d6f9a0a8.zip |
• TableDump
- introduced new method:
- (void)showErrorSheetWithMessage:(NSString*)message
to unify it and made all error sheets doc-modal (not app-modal)
- Close button of the errorSheet now also listens at ESC
Diffstat (limited to 'Source/TableDump.m')
-rw-r--r-- | Source/TableDump.m | 42 |
1 files changed, 17 insertions, 25 deletions
diff --git a/Source/TableDump.m b/Source/TableDump.m index 4854aad3..2a39aca5 100644 --- a/Source/TableDump.m +++ b/Source/TableDump.m @@ -113,7 +113,8 @@ */ - (IBAction)closeSheet:(id)sender { - [NSApp stopModalWithCode:[sender tag]]; + [NSApp endSheet:[sender window] returnCode:[sender tag]]; + [[sender window] orderOut:self]; } /** @@ -734,11 +735,7 @@ // Display any errors if ([errors length]) { - [errorsView setString:errors]; - [NSApp beginSheet:errorsSheet modalForWindow:tableWindow modalDelegate:self didEndSelector:nil contextInfo:nil]; - [NSApp runModalForWindow:errorsSheet]; - [NSApp endSheet:errorsSheet]; - [errorsSheet orderOut:nil]; + [self showErrorSheetWithMessage:errors]; } // Update available databases @@ -1051,11 +1048,7 @@ // Display any errors if ([errors length]) { - [errorsView setString:errors]; - [NSApp beginSheet:errorsSheet modalForWindow:tableWindow modalDelegate:self didEndSelector:nil contextInfo:nil]; - [NSApp runModalForWindow:errorsSheet]; - [NSApp endSheet:errorsSheet]; - [errorsSheet orderOut:nil]; + [self showErrorSheetWithMessage:errors]; } // Import finished Growl notification @@ -1741,13 +1734,7 @@ // Show errors sheet if there have been errors if ( [errors length] ) { - [errorsView setString:errors]; - [NSApp beginSheet:errorsSheet - modalForWindow:tableWindow modalDelegate:self - didEndSelector:nil contextInfo:nil]; - [NSApp runModalForWindow:errorsSheet]; - [NSApp endSheet:errorsSheet]; - [errorsSheet orderOut:nil]; + [self showErrorSheetWithMessage:errors]; } [tableDocumentInstance setQueryMode:SPInterfaceQueryMode]; @@ -2556,13 +2543,7 @@ // Show the errors sheet if there have been errors if ( [errors length] ) { - [errorsView setString:errors]; - [NSApp beginSheet:errorsSheet - modalForWindow:tableWindow modalDelegate:self - didEndSelector:nil contextInfo:nil]; - [NSApp runModalForWindow:errorsSheet]; - [NSApp endSheet:errorsSheet]; - [errorsSheet orderOut:nil]; + [self showErrorSheetWithMessage:errors]; } [tableDocumentInstance setQueryMode:SPInterfaceQueryMode]; @@ -2838,6 +2819,17 @@ return items; } +- (void)showErrorSheetWithMessage:(NSString*)message +{ + [errorsView setString:message]; + [NSApp beginSheet:errorsSheet + modalForWindow:tableWindow + modalDelegate:self + didEndSelector:@selector(sheetDidEnd:returnCode:contextInfo:) + contextInfo:nil]; + [errorsSheet makeKeyWindow]; +} + #pragma mark - #pragma mark New Export methods |