diff options
author | Bibiko <bibiko@eva.mpg.de> | 2010-10-29 23:56:40 +0000 |
---|---|---|
committer | Bibiko <bibiko@eva.mpg.de> | 2010-10-29 23:56:40 +0000 |
commit | f6ae8533374461cb00133d4cdaaed1c4172c0940 (patch) | |
tree | 41a185b170e5ed9ec3dccc07ff873ef17974eb18 /Source/SPCopyTable.m | |
parent | 8a061fc1d3903ca61ab6287ce822ab8d500ce4bb (diff) | |
download | sequelpro-f6ae8533374461cb00133d4cdaaed1c4172c0940.tar.gz sequelpro-f6ae8533374461cb00133d4cdaaed1c4172c0940.tar.bz2 sequelpro-f6ae8533374461cb00133d4cdaaed1c4172c0940.zip |
• Custom Query and Content table editing
- fixed issue for tab navigating if the table is already in the edit mode
- !! FOR SAFETY reasons disabled enter/return/tab enters the edit mode !! to avoid crashes until we found a better solution due to the non-waiting field editor sheets
Diffstat (limited to 'Source/SPCopyTable.m')
-rw-r--r-- | Source/SPCopyTable.m | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/Source/SPCopyTable.m b/Source/SPCopyTable.m index c8a32f00..513421a0 100644 --- a/Source/SPCopyTable.m +++ b/Source/SPCopyTable.m @@ -738,27 +738,36 @@ NSInteger MENU_EDIT_COPY_AS_SQL = 2003; // RETURN or ENTER invoke editing mode for selected row // by calling tableView:shouldEditTableColumn: to validate - if([self numberOfSelectedRows] == 1 && ([theEvent keyCode] == 36 || [theEvent keyCode] == 76)) { - 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; + // 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]]) { + ; + } 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; + } } } - return; } - + // Check if ESCAPE is hit and use it to cancel row editing if supported - else if ([theEvent keyCode] == 53 && [[self delegate] respondsToSelector:@selector(cancelRowEditing)]) + if ([theEvent keyCode] == 53 && [[self delegate] respondsToSelector:@selector(cancelRowEditing)]) { 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]])) { + return; + } [super keyDown:theEvent]; } |