aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPTableContent.m
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2010-08-22 12:47:39 +0000
committerBibiko <bibiko@eva.mpg.de>2010-08-22 12:47:39 +0000
commit5bc3071de5ca8a27b2be1daa007d2ba9d7896b56 (patch)
tree57d49d261a45fd55001099184ab8f45d243941eb /Source/SPTableContent.m
parentcbf4944858c866191ea5ffd5caf459a79d4d0288 (diff)
downloadsequelpro-5bc3071de5ca8a27b2be1daa007d2ba9d7896b56.tar.gz
sequelpro-5bc3071de5ca8a27b2be1daa007d2ba9d7896b56.tar.bz2
sequelpro-5bc3071de5ca8a27b2be1daa007d2ba9d7896b56.zip
• view editing
- if multipleLineEditingButton is set to on or field is a blob field allow to show the field data as non-editable fieldEditorSheet if field is not editable
Diffstat (limited to 'Source/SPTableContent.m')
-rw-r--r--Source/SPTableContent.m30
1 files changed, 19 insertions, 11 deletions
diff --git a/Source/SPTableContent.m b/Source/SPTableContent.m
index a3379f09..7b012f45 100644
--- a/Source/SPTableContent.m
+++ b/Source/SPTableContent.m
@@ -3377,6 +3377,7 @@
NSDictionary *columnDefinition;
BOOL noTableName = NO;
+ BOOL otherErrorWasDisplayed = NO;
isFieldEditable = NO;
NSInteger numberOfPossibleUpdateRows = -1;
@@ -3414,6 +3415,7 @@
if(!isFieldEditable) {
fieldIDQueryString = nil;
+ otherErrorWasDisplayed = YES;
NSPoint pos = [NSEvent mouseLocation];
pos.y -= 20;
if(numberOfPossibleUpdateRows == 0)
@@ -3424,17 +3426,21 @@
[SPTooltip showWithObject:[NSString stringWithFormat:NSLocalizedString(@"Field is not editable. Couldn't identify field origin unambiguously (%ld match%@).", @"Table Content result editing error - could not match row being edited uniquely"), (long)numberOfPossibleUpdateRows, (numberOfPossibleUpdateRows>1)?NSLocalizedString(@"es", @"Plural suffix for row count, eg 4 match*es*"):@""]
atLocation:pos
ofType:@"text"];
- return NO;
+ // Allow to display blobs even it's not editable
+ if(!isBlob && [multipleLineEditingButton state] == NSOffState)
+ return NO;
}
}
- if(!isFieldEditable) {
+ if(!isFieldEditable && !otherErrorWasDisplayed) {
NSPoint pos = [NSEvent mouseLocation];
pos.y -= 20;
[SPTooltip showWithObject:NSLocalizedString(@"Field is not editable. Field has no or multiple table or database origin(s).",@"field is not editable due to no table/database")
atLocation:pos
ofType:@"text"];
- return NO;
+ // Allow to display blobs even it's not editable
+ if(!isBlob && [multipleLineEditingButton state] == NSOffState)
+ return NO;
}
}
@@ -3453,7 +3459,7 @@
fieldName:[[aTableColumn headerCell] stringValue]
usingEncoding:[mySQLConnection encoding]
isObjectBlob:isBlob
- isEditable:YES
+ isEditable:isFieldEditable
withWindow:[tableDocumentInstance parentWindow]] retain];
if (editData) {
@@ -3470,13 +3476,15 @@
[editData release];
editData = [[NSNull null] retain];
}
- if([tablesListInstance tableType] == SPTableTypeView) {
- // since in a view we're editing a field rather than a row
- isEditingRow = NO;
- // update the field and refresh the table
- [self tableView:aTableView setObjectValue:[[editData copy] autorelease] forTableColumn:aTableColumn row:rowIndex];
- } else {
- [tableValues replaceObjectInRow:rowIndex column:[[aTableColumn identifier] integerValue] withObject:[[editData copy] autorelease]];
+ if(isFieldEditable) {
+ if([tablesListInstance tableType] == SPTableTypeView) {
+ // since in a view we're editing a field rather than a row
+ isEditingRow = NO;
+ // update the field and refresh the table
+ [self tableView:aTableView setObjectValue:[[editData copy] autorelease] forTableColumn:aTableColumn row:rowIndex];
+ } else {
+ [tableValues replaceObjectInRow:rowIndex column:[[aTableColumn identifier] integerValue] withObject:[[editData copy] autorelease]];
+ }
}
}