aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/SPTableContentDelegate.m16
-rw-r--r--Source/SPTableRelations.m8
2 files changed, 15 insertions, 9 deletions
diff --git a/Source/SPTableContentDelegate.m b/Source/SPTableContentDelegate.m
index 19bbc4b3..4d7bbb04 100644
--- a/Source/SPTableContentDelegate.m
+++ b/Source/SPTableContentDelegate.m
@@ -263,7 +263,14 @@
// Retrieve the column definition
NSDictionary *columnDefinition = [cqColumnDefinition objectAtIndex:[[tableColumn identifier] integerValue]];
-
+
+ // TODO: Fix editing of "Display as Hex" columns and remove this (also see above)
+ if ([[columnDefinition objectForKey:@"typegrouping"] isEqualToString:@"binary"] && [prefs boolForKey:SPDisplayBinaryDataAsHex]) {
+ NSBeep();
+ [SPTooltip showWithObject:NSLocalizedString(@"Disable \"Display Binary Data as Hex\" in the View menu to edit this field.",@"Temporary : Tooltip shown when trying to edit a binary field in table content view while it is displayed using HEX conversion")];
+ return NO;
+ }
+
// Open the editing sheet if required
if ([tableContentView shouldUseFieldEditorForRow:rowIndex column:[[tableColumn identifier] integerValue] checkWithLock:NULL]) {
@@ -347,13 +354,6 @@
return NO;
}
- // TODO: Fix editing of "Display as Hex" columns and remove this (also see above)
- if ([[columnDefinition objectForKey:@"typegrouping"] isEqualToString:@"binary"] && [prefs boolForKey:SPDisplayBinaryDataAsHex]) {
- NSBeep();
- [SPTooltip showWithObject:NSLocalizedString(@"Disable \"Display Binary Data as Hex\" in the View menu to edit this field.",@"Temporary : Tooltip shown when trying to edit a binary field in table content view while it is displayed using HEX conversion")];
- return NO;
- }
-
return YES;
}
diff --git a/Source/SPTableRelations.m b/Source/SPTableRelations.m
index 2374ea81..5734a96d 100644
--- a/Source/SPTableRelations.m
+++ b/Source/SPTableRelations.m
@@ -376,7 +376,13 @@ static NSString *SPRelationOnDeleteKey = @"on_delete";
- (id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)rowIndex
{
- return [[relationData objectAtIndex:rowIndex] objectForKey:[tableColumn identifier]];
+ id data = [[relationData objectAtIndex:rowIndex] objectForKey:[tableColumn identifier]];
+ //dim the database name if it matches the current database
+ if([[tableColumn identifier] isEqualToString:SPRelationFKDatabaseKey] && [[tableDocumentInstance database] isEqual:data]) {
+ NSDictionary *textAttributes = @{NSForegroundColorAttributeName: [NSColor lightGrayColor]};
+ data = [[[NSAttributedString alloc] initWithString:(NSString *)data attributes:textAttributes] autorelease];
+ }
+ return data;
}
#pragma mark -