aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPTableStructureDelegate.m
diff options
context:
space:
mode:
authorsqlprodev <sqlprodev@northofthree.com>2011-04-11 20:29:49 +0000
committersqlprodev <sqlprodev@northofthree.com>2011-04-11 20:29:49 +0000
commit0ce916eb0583ec6b062786f91bee0133906671ce (patch)
tree68a5767ded966f4eadf53ba9ce85bcaf6d31b951 /Source/SPTableStructureDelegate.m
parent2621e79c75a0119a54c669b263caa82183bd19c8 (diff)
downloadsequelpro-0ce916eb0583ec6b062786f91bee0133906671ce.tar.gz
sequelpro-0ce916eb0583ec6b062786f91bee0133906671ce.tar.bz2
sequelpro-0ce916eb0583ec6b062786f91bee0133906671ce.zip
initial commit of SP_REFACTOR ifdefs, the start of a long quest to separate UI code from functional code
Diffstat (limited to 'Source/SPTableStructureDelegate.m')
-rw-r--r--Source/SPTableStructureDelegate.m16
1 files changed, 13 insertions, 3 deletions
diff --git a/Source/SPTableStructureDelegate.m b/Source/SPTableStructureDelegate.m
index 0cabda4c..9c8f341c 100644
--- a/Source/SPTableStructureDelegate.m
+++ b/Source/SPTableStructureDelegate.m
@@ -129,7 +129,7 @@
[chooseKeyButton selectItemWithTag:SPPrimaryKeyMenuTag];
[NSApp beginSheet:keySheet
- modalForWindow:[tableDocumentInstance parentWindow] modalDelegate:self
+ modalForWindow:[NSApp keyWindow] modalDelegate:self
didEndSelector:@selector(sheetDidEnd:returnCode:contextInfo:)
contextInfo:@"autoincrementindex" ];
}
@@ -150,7 +150,11 @@
else if([[aTableColumn identifier] isEqualToString:@"null"]) {
if([[currentRow objectForKey:@"null"] integerValue] != [anObject integerValue]) {
if([anObject integerValue] == 0) {
+#ifndef SP_REFACTOR /* patch */
if([[currentRow objectForKey:@"default"] isEqualToString:[prefs objectForKey:SPNullValue]])
+#else
+ if([[currentRow objectForKey:@"default"] isEqualToString:@"NULL"])
+#endif
[currentRow setObject:@"" forKey:@"default"];
}
[tableSourceView reloadData];
@@ -309,7 +313,11 @@
// Add the default value, skip it for auto_increment
if([originalRow objectForKey:@"Extra"] && ![[originalRow objectForKey:@"Extra"] isEqualToString:@"auto_increment"]) {
+#ifndef SP_REFACTOR /* patch */
if ([[originalRow objectForKey:@"default"] isEqualToString:[prefs objectForKey:SPNullValue]]) {
+#else
+ if ([[originalRow objectForKey:@"default"] isEqualToString:@"NULL"]) {
+#endif
if ([[originalRow objectForKey:@"null"] integerValue] == 1) {
[queryString appendString:(isTimestampType) ? @" NULL DEFAULT NULL" : @" DEFAULT NULL"];
}
@@ -344,7 +352,7 @@
[mySQLConnection queryString:queryString];
if ([mySQLConnection queryErrored]) {
- SPBeginAlertSheet(NSLocalizedString(@"Error moving field", @"error moving field message"), NSLocalizedString(@"OK", @"OK button"), nil, nil, [tableDocumentInstance parentWindow], self, nil, nil,
+ SPBeginAlertSheet(NSLocalizedString(@"Error moving field", @"error moving field message"), NSLocalizedString(@"OK", @"OK button"), nil, nil, [NSApp keyWindow], self, nil, nil,
[NSString stringWithFormat:NSLocalizedString(@"An error occurred while trying to move the field.\n\nMySQL said: %@", @"error moving field informative message"), [mySQLConnection getLastErrorMessage]]);
}
else {
@@ -467,7 +475,7 @@
[[control window] makeFirstResponder:control];
[self addRowToDB];
[tableSourceView selectRowIndexes:[NSIndexSet indexSetWithIndex:row] byExtendingSelection:NO];
- [[tableDocumentInstance parentWindow] makeFirstResponder:tableSourceView];
+ [[NSApp keyWindow] makeFirstResponder:tableSourceView];
return YES;
}
@@ -541,6 +549,7 @@
#pragma mark -
#pragma mark Split view delegate methods
+#ifndef SP_REFACTOR /* Split view delegate methods */
- (BOOL)splitView:(NSSplitView *)sender canCollapseSubview:(NSView *)subview
{
@@ -576,6 +585,7 @@
}
}
}
+#endif
#pragma mark -
#pragma mark Combo box delegate methods