aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPTableContent.m
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2010-08-25 15:35:33 +0000
committerBibiko <bibiko@eva.mpg.de>2010-08-25 15:35:33 +0000
commit47b27a6d2b5d3cd7fa7152d2679283e7fba3e82d (patch)
treed56cfe249672bb8df90562a2724f2310c4087e5f /Source/SPTableContent.m
parentbcf348746216a4dec98b5eb8dcff625e023d00fa (diff)
downloadsequelpro-47b27a6d2b5d3cd7fa7152d2679283e7fba3e82d.tar.gz
sequelpro-47b27a6d2b5d3cd7fa7152d2679283e7fba3e82d.tar.bz2
sequelpro-47b27a6d2b5d3cd7fa7152d2679283e7fba3e82d.zip
• added tooltip about non-editable while keyboard navigation and trying to modify a cell
• in Custom Query table after field editor sheet dismissing preserve the the edited field selection
Diffstat (limited to 'Source/SPTableContent.m')
-rw-r--r--Source/SPTableContent.m32
1 files changed, 30 insertions, 2 deletions
diff --git a/Source/SPTableContent.m b/Source/SPTableContent.m
index 777eaf7f..86a960e5 100644
--- a/Source/SPTableContent.m
+++ b/Source/SPTableContent.m
@@ -235,7 +235,10 @@
}
// Update display if necessary
- [[tableContentView onMainThread] setNeedsDisplay:YES];
+ if (!NSEqualRects(selectionViewportToRestore, NSZeroRect))
+ [[tableContentView onMainThread] setNeedsDisplayInRect:selectionViewportToRestore];
+ else
+ [[tableContentView onMainThread] setNeedsDisplay:YES];
// Post the notification that the query is finished
[[NSNotificationCenter defaultCenter] postNotificationOnMainThreadWithName:@"SMySQLQueryHasBeenPerformed" object:tableDocumentInstance];
@@ -3734,10 +3737,35 @@
row = [tableContentView editedRow];
column = [tableContentView editedColumn];
+ NSInteger numberOfPossibleUpdateRows = [self fieldEditStatusForRow:row andColumn:[NSArrayObjectAtIndex([tableContentView tableColumns], column) identifier]];
+ if([tableContentView isCellEditingMode] && numberOfPossibleUpdateRows != 1) {
+ NSPoint pos = [[tableDocumentInstance parentWindow] convertBaseToScreen:[tableContentView convertPoint:[tableContentView frameOfCellAtColumn:column row:row].origin toView:nil]];
+ pos.y -= 20;
+ switch(numberOfPossibleUpdateRows) {
+ case -1:
+ [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"];
+ break;
+ case 0:
+ [SPTooltip showWithObject:[NSString stringWithFormat:NSLocalizedString(@"Field is not editable. No matching record found.\nReload table or try to add a primary key field or more fields\nin the view declaration of '%@' to identify\nfield origin unambiguously.", @"Table Content result editing error - could not identify original row"), selectedTable]
+ atLocation:pos
+ ofType:@"text"];
+ break;
+
+ case 1:
+ break;
+
+ default:
+ [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"];
+ }
- if([tableContentView isCellEditingMode] && [self fieldEditStatusForRow:row andColumn:[NSArrayObjectAtIndex([tableContentView tableColumns], column) identifier]] != 1)
return NO;
+ }
+
NSString *fieldType;
// Check if current edited field is a blob