aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPExtendedTableInfo.m
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2010-02-22 23:36:15 +0000
committerBibiko <bibiko@eva.mpg.de>2010-02-22 23:36:15 +0000
commitc11169058366ca679789bc82cf1b3ca8ed496967 (patch)
treee2f34bd6888ac59554b9c6df5532265d8b230c76 /Source/SPExtendedTableInfo.m
parent0d39a10771ae048d49d413ac1baf1d8f485190e0 (diff)
downloadsequelpro-c11169058366ca679789bc82cf1b3ca8ed496967.tar.gz
sequelpro-c11169058366ca679789bc82cf1b3ca8ed496967.tar.bz2
sequelpro-c11169058366ca679789bc82cf1b3ca8ed496967.zip
• implemented chance to reset AUTO_INCREMENT of the PRIMARY KEY field in Table Info Pane via Advanced popup button and sheet (not yet optimal GUI solution)
• SPAlertSheets - ensure that this sheet becomes the keyWindow
Diffstat (limited to 'Source/SPExtendedTableInfo.m')
-rw-r--r--Source/SPExtendedTableInfo.m18
1 files changed, 15 insertions, 3 deletions
diff --git a/Source/SPExtendedTableInfo.m b/Source/SPExtendedTableInfo.m
index 1ddcc90d..f68dca18 100644
--- a/Source/SPExtendedTableInfo.m
+++ b/Source/SPExtendedTableInfo.m
@@ -172,6 +172,11 @@
}
}
+- (IBAction)resetAutoIncrement:(id)sender
+{
+ [tableSourceInstance resetAutoIncrement:sender];
+}
+
#pragma mark -
#pragma mark Other
@@ -185,6 +190,8 @@
{
BOOL enableInteraction = ![[tableDocumentInstance selectedToolbarItemIdentifier] isEqualToString:SPMainToolbarTableInfo] || ![tableDocumentInstance isWorking];
+ [resetAutoIncrementResetButton setEnabled:NO];
+
// Store the table name away for future use
selectedTable = table;
@@ -196,7 +203,7 @@
[tableCollationPopUpButton removeAllItems];
// No table selected or view selected
- if ([table isEqualToString:@""] || (!table) || [[statusFields objectForKey:@"Engine"] isEqualToString:@"View"]) {
+ if ((!table) || [table isEqualToString:@""] || [[statusFields objectForKey:@"Engine"] isEqualToString:@"View"]) {
[tableTypePopUpButton setEnabled:NO];
[tableEncodingPopUpButton setEnabled:NO];
@@ -330,6 +337,11 @@
[tableCreateSyntaxTextView insertText:[tableDataInstance tableCreateSyntax]];
[tableCreateSyntaxTextView didChangeText];
[tableCreateSyntaxTextView setEditable:NO];
+
+ // Validate Reset AUTO_INCREMENT button
+ if([statusFields objectForKey:@"Auto_increment"] && ![[statusFields objectForKey:@"Auto_increment"] isKindOfClass:[NSNull class]])
+ [resetAutoIncrementResetButton setEnabled:YES];
+
}
/**
@@ -464,13 +476,13 @@
[dateFormatter setDateStyle:NSDateFormatterLongStyle];
[dateFormatter setTimeStyle:NSDateFormatterMediumStyle];
- value = [dateFormatter stringFromDate:[NSDate dateWithNaturalLanguageString:value]];
+ value = [dateFormatter stringFromDate:[NSDate dateWithNaturalLanguageString:value]];
}
// Format numbers
else if ([key isEqualToString:@"Rows"] ||
[key isEqualToString:@"Avg_row_length"] ||
[key isEqualToString:@"Auto_increment"]) {
- NSNumberFormatter *numberFormatter = [[[NSNumberFormatter alloc] init] autorelease];
+ NSNumberFormatter *numberFormatter = [[[NSNumberFormatter alloc] init] autorelease];
[numberFormatter setNumberStyle:NSNumberFormatterDecimalStyle];
value = [numberFormatter stringFromNumber:[NSNumber numberWithLongLong:[value longLongValue]]];