aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPCustomQuery.m
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/SPCustomQuery.m
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/SPCustomQuery.m')
-rw-r--r--Source/SPCustomQuery.m21
1 files changed, 13 insertions, 8 deletions
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;
}