diff options
Diffstat (limited to 'Source/SPCopyTable.m')
-rw-r--r-- | Source/SPCopyTable.m | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/Source/SPCopyTable.m b/Source/SPCopyTable.m index 79fc89e6..637c3913 100644 --- a/Source/SPCopyTable.m +++ b/Source/SPCopyTable.m @@ -36,7 +36,11 @@ #import "SPBundleEditorController.h" #import "SPAppController.h" #import "SPTablesList.h" +#ifndef SP_REFACTOR #import "SPMySQL.h" +#else +#import <SPMySQL/SPMySQL.h> +#endif NSInteger SPEditMenuCopy = 2001; NSInteger SPEditMenuCopyWithColumns = 2002; @@ -112,6 +116,15 @@ static const NSInteger kBlobAsImageFile = 4; #endif } +#ifdef SP_REFACTOR + +- (void)delete:(id)sender +{ + [tableInstance removeRow:self]; +} + +#endif + /** * Get selected rows a string of newline separated lines of tab separated fields * the value in each field is from the objects description method @@ -979,6 +992,16 @@ static const NSInteger kBlobAsImageFile = 4; return (columnDefinitions != nil && [self numberOfSelectedRows] > 0); } #endif +#ifdef SP_REFACTOR + if ( [anItem action] == @selector(selectAll:) ) + return YES; + + if ( [anItem action] == @selector(delete:) ) + { + if ( [self numberOfSelectedRows] > 0 ) + return YES; + } +#endif return NO; } @@ -1158,7 +1181,18 @@ static const NSInteger kBlobAsImageFile = 4; { // Retrieve the column definition +#if SP_REFACTOR + NSDictionary *columnDefinition; + + if ( [[self delegate] isKindOfClass:[SPTableContent class]] ) + columnDefinition = [[(SPTableContent*)[self delegate] dataColumnDefinitions] objectAtIndex:colIndex]; + + else if ( [[self delegate] isKindOfClass:[SPCustomQuery class]] ) + columnDefinition = [[(SPCustomQuery*)[self delegate] dataColumnDefinitions] objectAtIndex:colIndex]; +#else NSDictionary *columnDefinition = [[[self delegate] dataColumnDefinitions] objectAtIndex:colIndex]; +#endif + NSString *columnType = [columnDefinition objectForKey:@"typegrouping"]; // Return YES if the multiple line editing button is enabled - triggers sheet editing on all cells. |