From bcf348746216a4dec98b5eb8dcff625e023d00fa Mon Sep 17 00:00:00 2001 From: Bibiko Date: Wed, 25 Aug 2010 11:27:52 +0000 Subject: =?UTF-8?q?=E2=80=A2=20after=20editing=20in=20Custom=20Query=20tab?= =?UTF-8?q?le=20preserve=20the=20selected=20line=20even=20if=20the=20actua?= =?UTF-8?q?l=20edited=20line=20due=20to=20new=20data=20will=20come=20up=20?= =?UTF-8?q?in=20another=20line?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/SPCustomQuery.m | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'Source/SPCustomQuery.m') 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; } -- cgit v1.2.3