diff options
author | Bibiko <bibiko@eva.mpg.de> | 2010-08-25 15:35:33 +0000 |
---|---|---|
committer | Bibiko <bibiko@eva.mpg.de> | 2010-08-25 15:35:33 +0000 |
commit | 47b27a6d2b5d3cd7fa7152d2679283e7fba3e82d (patch) | |
tree | d56cfe249672bb8df90562a2724f2310c4087e5f /Source | |
parent | bcf348746216a4dec98b5eb8dcff625e023d00fa (diff) | |
download | sequelpro-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')
-rw-r--r-- | Source/SPCustomQuery.m | 3 | ||||
-rw-r--r-- | Source/SPTableContent.m | 32 |
2 files changed, 33 insertions, 2 deletions
diff --git a/Source/SPCustomQuery.m b/Source/SPCustomQuery.m index 435cb016..82b40465 100644 --- a/Source/SPCustomQuery.m +++ b/Source/SPCustomQuery.m @@ -3499,6 +3499,9 @@ // Call the field editor sheet [self tableView:customQueryView shouldEditTableColumn:NSArrayObjectAtIndex([customQueryView tableColumns], column) row:row]; + // Reset the field editor + [customQueryView editColumn:column row:row withEvent:nil select:YES]; + return NO; } 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 |