aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPCustomQuery.m
diff options
context:
space:
mode:
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;
}