diff options
author | rowanbeentje <rowan@beent.je> | 2009-07-23 23:08:57 +0000 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2009-07-23 23:08:57 +0000 |
commit | e1e2fed7963d439b01d2048b8b79fed69b051d94 (patch) | |
tree | db857b12c0240b0bec0a92aa138e81e69205f72d | |
parent | cdb3bc05f56e2a7a89581f3ed42e5147323c014f (diff) | |
download | sequelpro-e1e2fed7963d439b01d2048b8b79fed69b051d94.tar.gz sequelpro-e1e2fed7963d439b01d2048b8b79fed69b051d94.tar.bz2 sequelpro-e1e2fed7963d439b01d2048b8b79fed69b051d94.zip |
- Fix editing of results including decimals
- Enable custom query result editing
-rw-r--r-- | Frameworks/MCPKit/MCPFoundationKit/MCPResult.m | 3 | ||||
-rw-r--r-- | Source/CustomQuery.m | 8 |
2 files changed, 6 insertions, 5 deletions
diff --git a/Frameworks/MCPKit/MCPFoundationKit/MCPResult.m b/Frameworks/MCPKit/MCPFoundationKit/MCPResult.m index f8158f7c..2fb15a88 100644 --- a/Frameworks/MCPKit/MCPFoundationKit/MCPResult.m +++ b/Frameworks/MCPKit/MCPFoundationKit/MCPResult.m @@ -626,6 +626,7 @@ const OUR_CHARSET our_charsets60[] = theType = @"longlong"; break; case FIELD_TYPE_DECIMAL: + case FIELD_TYPE_NEWDECIMAL: theType = @"decimal"; break; case FIELD_TYPE_FLOAT: @@ -1129,6 +1130,7 @@ const OUR_CHARSET our_charsets60[] = case FIELD_TYPE_BIT: return @"BIT"; case MYSQL_TYPE_DECIMAL: + case MYSQL_TYPE_NEWDECIMAL: //return isUnsigned ? (isZerofill? @"DECIMAL UNSIGNED ZEROFILL" : @"DECIMAL UNSIGNED"): return @"DECIMAL"; case MYSQL_TYPE_TINY: @@ -1238,6 +1240,7 @@ const OUR_CHARSET our_charsets60[] = case MYSQL_TYPE_FLOAT: case MYSQL_TYPE_DOUBLE: case MYSQL_TYPE_DECIMAL: + case MYSQL_TYPE_NEWDECIMAL: return @"float"; case MYSQL_TYPE_YEAR: case MYSQL_TYPE_DATETIME: diff --git a/Source/CustomQuery.m b/Source/CustomQuery.m index b6499431..f5742df4 100644 --- a/Source/CustomQuery.m +++ b/Source/CustomQuery.m @@ -1609,16 +1609,14 @@ BOOL isFieldEditable = (!noTableName && numberOfPossibleUpdateRows == 1) ? YES : NO; - // maybe?? - // if(!isFieldEditable) - // [errorText setStringValue:[NSString stringWithFormat:@"Field is not editable. Couldn't identify field origin unambiguously (%d match%@).", numberOfPossibleUpdateRows, (numberOfPossibleUpdateRows>1)?@"es":@""]]; + if(!isFieldEditable) + [errorText setStringValue:[NSString stringWithFormat:@"Field is not editable. Couldn't identify field origin unambiguously (%d match%@).", numberOfPossibleUpdateRows, (numberOfPossibleUpdateRows>1)?@"es":@""]]; - //to enable editing simply uncomment isEditable and delete 'NO' :) SPFieldEditorController *fieldEditor = [[SPFieldEditorController alloc] init]; id editData = [[fieldEditor editWithObject:[[fullResult objectAtIndex:rowIndex] objectAtIndex:[[aTableColumn identifier] intValue]] usingEncoding:[mySQLConnection encoding] isObjectBlob:isBlob - isEditable:/*isFieldEditable*/NO + isEditable:isFieldEditable withWindow:tableWindow] retain]; if ( editData ) |