aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2010-02-17 15:54:12 +0000
committerBibiko <bibiko@eva.mpg.de>2010-02-17 15:54:12 +0000
commit299e8821edf9a1705a556c482a2a0ea4d6f9a0a8 (patch)
treec5f262a1b0920c796283dd008c2679396ab4cd66 /Source
parent9e3ee6a65342adb3c30ee744c95467e469d17f96 (diff)
downloadsequelpro-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')
-rw-r--r--Source/TableDump.h1
-rw-r--r--Source/TableDump.m42
2 files changed, 18 insertions, 25 deletions
diff --git a/Source/TableDump.h b/Source/TableDump.h
index 3db8c908..8054bf06 100644
--- a/Source/TableDump.h
+++ b/Source/TableDump.h
@@ -162,6 +162,7 @@ typedef enum _SPExportModes {
// Additional methods
- (void)setConnection:(MCPConnection *)theConnection;
+- (void)showErrorSheetWithMessage:(NSString*)message;
// Import/export delegate notifications
- (void)panelSelectionDidChange:(id)sender;
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