aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2010-08-25 11:27:52 +0000
committerBibiko <bibiko@eva.mpg.de>2010-08-25 11:27:52 +0000
commitbcf348746216a4dec98b5eb8dcff625e023d00fa (patch)
tree166148a08bc4679b96875c1dfc20ba4f8817acc0 /Source
parent86f08139a21a39b9d6077a34bf6a819833ca860c (diff)
downloadsequelpro-bcf348746216a4dec98b5eb8dcff625e023d00fa.tar.gz
sequelpro-bcf348746216a4dec98b5eb8dcff625e023d00fa.tar.bz2
sequelpro-bcf348746216a4dec98b5eb8dcff625e023d00fa.zip
• after editing in Custom Query table preserve the selected line even if the actual edited line due to new data will come up in another line
Diffstat (limited to 'Source')
-rw-r--r--Source/SPCopyTable.m1
-rw-r--r--Source/SPCustomQuery.m21
2 files changed, 14 insertions, 8 deletions
diff --git a/Source/SPCopyTable.m b/Source/SPCopyTable.m
index 2634c7f5..b1b663a4 100644
--- a/Source/SPCopyTable.m
+++ b/Source/SPCopyTable.m
@@ -120,6 +120,7 @@ NSInteger MENU_EDIT_COPY_AS_SQL = 2003;
if ( [self numberOfColumns] - 1 == column) {
if([[self delegate] respondsToSelector:@selector(addRowToDB)])
[[self delegate] addRowToDB];
+ [[self onMainThread] makeFirstResponder];
} else {
// Select the next field for editing
[self editColumn:column+1 row:row withEvent:nil select:YES];
diff --git a/Source/SPCustomQuery.m b/Source/SPCustomQuery.m
index c9e1f4c5..435cb016 100644
--- a/Source/SPCustomQuery.m
+++ b/Source/SPCustomQuery.m
@@ -833,14 +833,6 @@
[customQueryView scrollRectToVisible:selectionViewportToRestore];
}
- // Restore selection indexes if appropriate
- if (selectionIndexToRestore) {
- BOOL previousTableRowsSelectable = tableRowsSelectable;
- tableRowsSelectable = YES;
- [customQueryView selectRowIndexes:selectionIndexToRestore byExtendingSelection:NO];
- tableRowsSelectable = previousTableRowsSelectable;
- }
-
//query finished
[[NSNotificationCenter defaultCenter] postNotificationOnMainThreadWithName:@"SMySQLQueryHasBeenPerformed" object:tableDocumentInstance];
@@ -857,7 +849,14 @@
}
[tableDocumentInstance endTask];
+
+ [customQueryView makeFirstResponder];
+ // Restore selection indexes if appropriate
+ if (selectionIndexToRestore)
+ [customQueryView selectRowIndexes:selectionIndexToRestore byExtendingSelection:NO];
+
[queryRunningPool release];
+
}
/*
@@ -1897,6 +1896,7 @@
[self storeCurrentResultViewForRestoration];
[self performQueries:[NSArray arrayWithObject:lastExecutedQuery] withCallback:NULL];
+
} else {
// otherwise, just update the data in the data storage
SPDataStorageReplaceObjectAtRowAndColumn(resultData, rowIndex, [[aTableColumn identifier] intValue], anObject);
@@ -2274,6 +2274,11 @@
if ( editData ) [editData release];
+ // Preserve focus and restore selection indexes if appropriate
+ [customQueryView makeFirstResponder];
+ if (selectionIndexToRestore)
+ [customQueryView selectRowIndexes:selectionIndexToRestore byExtendingSelection:NO];
+
return NO;
}