From b1d29fac626ddbdcfda3bc034861c3b22e39b548 Mon Sep 17 00:00:00 2001 From: Bibiko Date: Tue, 23 Feb 2010 11:34:58 +0000 Subject: =?UTF-8?q?=E2=80=A2=20Reset=20AUTO=5FINCREMENT=20in=20Table=20Inf?= =?UTF-8?q?o=20Pane=20uses=20inline=20entering=20of=20the=20new=20value=20?= =?UTF-8?q?(no=20sheet)=20=E2=80=A2=20"Delete=20all=20records"=20confirmat?= =?UTF-8?q?ion=20sheet=20shows=20a=20checkbox=20"Reset=20AUTO=5FINCREMENT?= =?UTF-8?q?=20after=20deletion"=20if=20PRI=20key=20is=20given=20for=20that?= =?UTF-8?q?=20table=20=E2=80=A2=20minimized=20table=20data=20querying=20fo?= =?UTF-8?q?r=20auto=5Finc=20=E2=80=A2=20optimized=20auto=5Finc=20change=20?= =?UTF-8?q?notification=20=E2=80=A2=20if=20user=20changes=20tabVIew=20to?= =?UTF-8?q?=20Table=20Info=20Pane=20update=20data=20in=20beforehand=20?= =?UTF-8?q?=E2=80=A2=20TRUNCATE=20query=20updates=20auto=5Finc=20value=20a?= =?UTF-8?q?s=20well=20in=20TABLE=20INFORMATION?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/SPExtendedTableInfo.m | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) (limited to 'Source/SPExtendedTableInfo.m') diff --git a/Source/SPExtendedTableInfo.m b/Source/SPExtendedTableInfo.m index f68dca18..00f1fc37 100644 --- a/Source/SPExtendedTableInfo.m +++ b/Source/SPExtendedTableInfo.m @@ -32,6 +32,7 @@ #import "TableDocument.h" #import "TablesList.h" #import "SPAlertSheets.h" +#import "TableSource.h" @interface SPExtendedTableInfo (PrivateAPI) @@ -174,7 +175,31 @@ - (IBAction)resetAutoIncrement:(id)sender { - [tableSourceInstance resetAutoIncrement:sender]; + + if([sender tag] == 1) { + [tableRowAutoIncrement setEditable:YES]; + [tableRowAutoIncrement selectText:nil]; + } else { + [tableRowAutoIncrement setEditable:NO]; + [tableSourceInstance resetAutoIncrement:sender]; + } +} + +- (IBAction)resetAutoIncrementValueWasEdited:(id)sender +{ + [tableRowAutoIncrement setEditable:NO]; + [tableSourceInstance setAutoIncrementTo:[[tableRowAutoIncrement stringValue] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]]; +} + +- (BOOL)control:(NSControl *)control textView:(NSTextView *)textView doCommandBySelector:(SEL)command +{ + + // Listen to ESC to abort editing of auto increment input field + if (command == @selector(cancelOperation:) && control == tableRowAutoIncrement) { + [tableRowAutoIncrement abortEditing]; + return YES; + } + return NO; } #pragma mark - @@ -235,7 +260,7 @@ [tableRowNumber setStringValue:@"Number of rows: "]; [tableRowFormat setStringValue:@"Row format: "]; [tableRowAvgLength setStringValue:@"Avg. row length: "]; - [tableRowAutoIncrement setStringValue:@"Auto increment: "]; + [tableRowAutoIncrement setStringValue:@""]; // Set size values [tableDataSize setStringValue:@"Data size: "]; @@ -493,8 +518,10 @@ } } } - - return [NSString stringWithFormat:@"%@: %@", label, ([value length] > 0) ? value : @"Not available"]; + if([key isEqualToString:@"Auto_increment"]) + return ([value length] > 0) ? value : @"Not available"; + else + return [NSString stringWithFormat:@"%@: %@", label, ([value length] > 0) ? value : @"Not available"]; } @end -- cgit v1.2.3