aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
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