diff options
author | Bibiko <bibiko@eva.mpg.de> | 2010-10-30 08:28:46 +0000 |
---|---|---|
committer | Bibiko <bibiko@eva.mpg.de> | 2010-10-30 08:28:46 +0000 |
commit | 27122d036b690c1e3601f219a0aa69d6ce52addf (patch) | |
tree | a1a2f00f25176d2bffc3b5786b93d4dd3579e387 /Source | |
parent | 9018787f43507f525ed0aa5036d21017cc8846a2 (diff) | |
download | sequelpro-27122d036b690c1e3601f219a0aa69d6ce52addf.tar.gz sequelpro-27122d036b690c1e3601f219a0aa69d6ce52addf.tar.bz2 sequelpro-27122d036b690c1e3601f219a0aa69d6ce52addf.zip |
• after the field editor sheet was closed enter into the edit mode of the current table cell; this makes it rather convenient to navigate and edit cells via keyboard or mouse for each mode (field editor or incell); the sheet will be ordered out if user tries to modify the current cell if set or blob
Diffstat (limited to 'Source')
-rw-r--r-- | Source/SPCopyTable.m | 16 | ||||
-rw-r--r-- | Source/SPCustomQuery.m | 13 | ||||
-rw-r--r-- | Source/SPTableContent.m | 13 |
3 files changed, 23 insertions, 19 deletions
diff --git a/Source/SPCopyTable.m b/Source/SPCopyTable.m index 21a1bd7f..98dd45aa 100644 --- a/Source/SPCopyTable.m +++ b/Source/SPCopyTable.m @@ -739,21 +739,8 @@ NSInteger MENU_EDIT_COPY_AS_SQL = 2003; // RETURN or ENTER invoke editing mode for selected row // by calling tableView:shouldEditTableColumn: to validate - // TODO: find a better solution HansJB if([self numberOfSelectedRows] == 1 && ([theEvent keyCode] == 36 || [theEvent keyCode] == 76)) { - if([[self delegate] isKindOfClass:[SPCustomQuery class]] || [[self delegate] isKindOfClass:[SPTableContent class]]) { - [self editColumn:0 row:[self selectedRow] withEvent:nil select:YES];; - } else { - for(id item in [self tableColumns]) { - // Run in fieldEditorMode? - if(![[self delegate] tableView:self shouldEditTableColumn:item row:[self selectedRow]]) - ; - else { - [self editColumn:0 row:[self selectedRow] withEvent:nil select:YES]; - break; - } - } - } + [self editColumn:0 row:[self selectedRow] withEvent:nil select:YES]; return; } @@ -763,7 +750,6 @@ NSInteger MENU_EDIT_COPY_AS_SQL = 2003; if ([[self delegate] cancelRowEditing]) return; } - // TODO: find a better solution HansJB else if ([theEvent keyCode] == 48 && ([[self delegate] isKindOfClass:[SPCustomQuery class]] || [[self delegate] isKindOfClass:[SPTableContent class]])) { [self editColumn:0 row:[self selectedRow] withEvent:nil select:YES]; diff --git a/Source/SPCustomQuery.m b/Source/SPCustomQuery.m index 5eea9f6f..011cdc09 100644 --- a/Source/SPCustomQuery.m +++ b/Source/SPCustomQuery.m @@ -3408,9 +3408,15 @@ - (void)processFieldEditorResult:(id)data contextInfo:(NSDictionary*)contextInfo { + NSInteger row = -1; + NSInteger column = -1; + + if(contextInfo) { + row = [[contextInfo objectForKey:@"row"] integerValue]; + column = [[contextInfo objectForKey:@"column"] integerValue]; + } + if (data && contextInfo) { - NSUInteger row = [[contextInfo objectForKey:@"row"] integerValue]; - NSUInteger column = [[contextInfo objectForKey:@"column"] integerValue]; BOOL isFieldEditable = ([contextInfo objectForKey:@"isFieldEditable"]) ? YES : NO; if(isFieldEditable) { @@ -3428,6 +3434,9 @@ if (selectionIndexToRestore) [customQueryView selectRowIndexes:selectionIndexToRestore byExtendingSelection:NO]; + if(row > -1 && column > -1) + [customQueryView editColumn:column row:row withEvent:nil select:YES]; + } #pragma mark - diff --git a/Source/SPTableContent.m b/Source/SPTableContent.m index c71099b8..19d9a6b6 100644 --- a/Source/SPTableContent.m +++ b/Source/SPTableContent.m @@ -2884,9 +2884,15 @@ - (void)processFieldEditorResult:(id)data contextInfo:(NSDictionary*)contextInfo { + NSInteger row = -1; + NSInteger column = -1; + + if(contextInfo) { + row = [[contextInfo objectForKey:@"row"] integerValue]; + column = [[contextInfo objectForKey:@"column"] integerValue]; + } + if (data && contextInfo) { - NSUInteger row = [[contextInfo objectForKey:@"row"] integerValue]; - NSUInteger column = [[contextInfo objectForKey:@"column"] integerValue]; BOOL isFieldEditable = ([contextInfo objectForKey:@"isFieldEditable"]) ? YES : NO; if (!isEditingRow && [tablesListInstance tableType] != SPTableTypeView) { [oldRow setArray:[tableValues rowContentsAtIndex:row]]; @@ -2918,6 +2924,9 @@ } [[tableDocumentInstance parentWindow] makeFirstResponder:tableContentView]; + + if(row > -1 && column > -1) + [tableContentView editColumn:column row:row withEvent:nil select:YES]; } #pragma mark - |