diff options
author | Bibiko <bibiko@eva.mpg.de> | 2009-06-23 13:19:19 +0000 |
---|---|---|
committer | Bibiko <bibiko@eva.mpg.de> | 2009-06-23 13:19:19 +0000 |
commit | 819434c9cda0189662128862399baaa68a2537d2 (patch) | |
tree | b89ac87f170bc1df87ec36a3a0904b753c7db7fc | |
parent | dc84b62997c3cd70f15d14f60c64d3a9fa163fb3 (diff) | |
download | sequelpro-819434c9cda0189662128862399baaa68a2537d2.tar.gz sequelpro-819434c9cda0189662128862399baaa68a2537d2.tar.bz2 sequelpro-819434c9cda0189662128862399baaa68a2537d2.zip |
• fixed issue while editing an field cell in Structure View select an other table
• fixed issue while moving a field description row in Structure View that "Extra" field content wasn't moved
• fixed issue that "Extra" field content was appended without leading space in "addRowToDB"
-rw-r--r-- | Source/TableSource.m | 64 |
1 files changed, 36 insertions, 28 deletions
diff --git a/Source/TableSource.m b/Source/TableSource.m index 2f66d1fb..648d53f6 100644 --- a/Source/TableSource.m +++ b/Source/TableSource.m @@ -717,8 +717,10 @@ fetches the result as an array with a dictionary for each row in it [queryString appendString:@" "]; } - if (![[theRow objectForKey:@"Extra"] isEqualToString:@""] && - ![[theRow objectForKey:@"Extra"] isEqualToString:@"None"] && + if (!( + [[theRow objectForKey:@"Extra"] isEqualToString:@""] || + [[theRow objectForKey:@"Extra"] isEqualToString:@"None"] + ) && [theRow objectForKey:@"Extra"] ) { [queryString appendString:[theRow objectForKey:@"Extra"]]; @@ -1118,6 +1120,10 @@ would result in a position change. if ([[originalRow objectForKey:@"Null"] isEqualToString:@"NO"] ) { [queryString appendString:@" NOT NULL"]; } + if (![[originalRow objectForKey:@"Extra"] isEqualToString:@"None"] ) { + [queryString appendString:@" "]; + [queryString appendString:[[originalRow objectForKey:@"Extra"] uppercaseString]]; + } // Add the default value if ([[originalRow objectForKey:@"Default"] isEqualToString:[prefs objectForKey:@"NullValue"]]) { @@ -1167,32 +1173,34 @@ would result in a position change. - (void)tableViewSelectionDidChange:(NSNotification *)aNotification { - //check for which table view the selection changed - if ([aNotification object] == tableSourceView) { - // If we are editing a row, attempt to save that row - if saving failed, reselect the edit row. - if ( isEditingRow && [tableSourceView selectedRow] != currentlyEditingRow ) { - [self saveRowOnDeselect]; - } - [copyFieldButton setEnabled:YES]; - - // check if there is currently a field selected - // and change button state accordingly - if ([tableSourceView numberOfSelectedRows] > 0 && [tablesListInstance tableType] == SP_TABLETYPE_TABLE) { - [removeFieldButton setEnabled:YES]; - } else { - [removeFieldButton setEnabled:NO]; - [copyFieldButton setEnabled:NO]; - } - } - else if ([aNotification object] == indexView) { - // check if there is currently an index selected - // and change button state accordingly - if ([indexView numberOfSelectedRows] > 0 && [tablesListInstance tableType] == SP_TABLETYPE_TABLE) { - [removeIndexButton setEnabled:YES]; - } else { - [removeIndexButton setEnabled:NO]; - } - } + + //check for which table view the selection changed + if ([aNotification object] == tableSourceView) { + // If we are editing a row, attempt to save that row - if saving failed, reselect the edit row. + if ( isEditingRow && [tableSourceView selectedRow] != currentlyEditingRow ) { + [self saveRowOnDeselect]; + isEditingRow = NO; + } + [copyFieldButton setEnabled:YES]; + + // check if there is currently a field selected + // and change button state accordingly + if ([tableSourceView numberOfSelectedRows] > 0 && [tablesListInstance tableType] == SP_TABLETYPE_TABLE) { + [removeFieldButton setEnabled:YES]; + } else { + [removeFieldButton setEnabled:NO]; + [copyFieldButton setEnabled:NO]; + } + } + else if ([aNotification object] == indexView) { + // check if there is currently an index selected + // and change button state accordingly + if ([indexView numberOfSelectedRows] > 0 && [tablesListInstance tableType] == SP_TABLETYPE_TABLE) { + [removeIndexButton setEnabled:YES]; + } else { + [removeIndexButton setEnabled:NO]; + } + } } /* |