aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2010-10-29 23:56:40 +0000
committerBibiko <bibiko@eva.mpg.de>2010-10-29 23:56:40 +0000
commitf6ae8533374461cb00133d4cdaaed1c4172c0940 (patch)
tree41a185b170e5ed9ec3dccc07ff873ef17974eb18
parent8a061fc1d3903ca61ab6287ce822ab8d500ce4bb (diff)
downloadsequelpro-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
-rw-r--r--Source/SPCopyTable.m33
-rw-r--r--Source/SPCustomQuery.m3
-rw-r--r--Source/SPTableContent.m3
3 files changed, 21 insertions, 18 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];
}
diff --git a/Source/SPCustomQuery.m b/Source/SPCustomQuery.m
index 1a7eeffe..5eea9f6f 100644
--- a/Source/SPCustomQuery.m
+++ b/Source/SPCustomQuery.m
@@ -3599,9 +3599,6 @@
// 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 0ee639c8..ac76f093 100644
--- a/Source/SPTableContent.m
+++ b/Source/SPTableContent.m
@@ -4204,9 +4204,6 @@
// Call the field editor sheet
[self tableView:tableContentView shouldEditTableColumn:NSArrayObjectAtIndex([tableContentView tableColumns], column) row:row];
- // Reset the field editor
- [tableContentView editColumn:column row:row withEvent:nil select:YES];
-
return NO;
}