diff options
author | Max <post@wickenrode.com> | 2015-03-24 21:15:03 +0100 |
---|---|---|
committer | Max <post@wickenrode.com> | 2015-03-24 21:15:03 +0100 |
commit | 9fd78af55a55a8a5a976a6b6f31839439cc28241 (patch) | |
tree | 4f99d3adc5b2ebab7164e06034d7f38c2700ad55 /Source | |
parent | ea39be538d4726b583e67748d6e3e7ffb0ce9026 (diff) | |
download | sequelpro-9fd78af55a55a8a5a976a6b6f31839439cc28241.tar.gz sequelpro-9fd78af55a55a8a5a976a6b6f31839439cc28241.tar.bz2 sequelpro-9fd78af55a55a8a5a976a6b6f31839439cc28241.zip |
Disable editing columns in "Display in Hex" mode
This is a workaround for a potential data loss/corruption bug until we really fix this (see #1876)
Diffstat (limited to 'Source')
-rw-r--r-- | Source/SPTableContentDelegate.m | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/Source/SPTableContentDelegate.m b/Source/SPTableContentDelegate.m index b73282ec..19bbc4b3 100644 --- a/Source/SPTableContentDelegate.m +++ b/Source/SPTableContentDelegate.m @@ -261,11 +261,12 @@ [tableContentView reloadData]; } + // Retrieve the column definition + NSDictionary *columnDefinition = [cqColumnDefinition objectAtIndex:[[tableColumn identifier] integerValue]]; + // Open the editing sheet if required if ([tableContentView shouldUseFieldEditorForRow:rowIndex column:[[tableColumn identifier] integerValue] checkWithLock:NULL]) { - // Retrieve the column definition - NSDictionary *columnDefinition = [cqColumnDefinition objectAtIndex:[[tableColumn identifier] integerValue]]; BOOL isBlob = [tableDataInstance columnIsBlobOrText:[[tableColumn headerCell] stringValue]]; // A table is per definition editable @@ -318,6 +319,7 @@ if ([[columnDefinition objectForKey:@"typegrouping"] isEqualToString:@"binary"] && [prefs boolForKey:SPDisplayBinaryDataAsHex]) { [fieldEditor setTextMaxLength:[[self tableView:tableContentView objectValueForTableColumn:tableColumn row:rowIndex] length]]; + isFieldEditable = NO; } NSInteger editedColumn = 0; @@ -345,6 +347,13 @@ 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; } |