aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPExtendedTableInfo.m
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2010-02-23 11:34:58 +0000
committerBibiko <bibiko@eva.mpg.de>2010-02-23 11:34:58 +0000
commitb1d29fac626ddbdcfda3bc034861c3b22e39b548 (patch)
tree97af06ea1957c982cdc1ab942dd027407ad5d6a3 /Source/SPExtendedTableInfo.m
parenta24e9c697049bacb587835153e2ebb4764fff008 (diff)
downloadsequelpro-b1d29fac626ddbdcfda3bc034861c3b22e39b548.tar.gz
sequelpro-b1d29fac626ddbdcfda3bc034861c3b22e39b548.tar.bz2
sequelpro-b1d29fac626ddbdcfda3bc034861c3b22e39b548.zip
• Reset AUTO_INCREMENT in Table Info Pane uses inline entering of the new value (no sheet)
• "Delete all records" confirmation sheet shows a checkbox "Reset AUTO_INCREMENT after deletion" if PRI key is given for that table • minimized table data querying for auto_inc • optimized auto_inc change notification • if user changes tabVIew to Table Info Pane update data in beforehand • TRUNCATE query updates auto_inc value as well in TABLE INFORMATION
Diffstat (limited to 'Source/SPExtendedTableInfo.m')
-rw-r--r--Source/SPExtendedTableInfo.m35
1 files changed, 31 insertions, 4 deletions
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