aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjakob <jakob@eggerapps.at>2010-07-01 10:28:50 +0000
committerjakob <jakob@eggerapps.at>2010-07-01 10:28:50 +0000
commitc427a2b0ce515226750a50335aac04dc1161b385 (patch)
tree14f51fd04ccecdd67c9c794ffbc1ae0c687301da
parent51881a8ae93b14ac7a3007bcd66bad670e91ba49 (diff)
downloadsequelpro-c427a2b0ce515226750a50335aac04dc1161b385.tar.gz
sequelpro-c427a2b0ce515226750a50335aac04dc1161b385.tar.bz2
sequelpro-c427a2b0ce515226750a50335aac04dc1161b385.zip
When editing the results from a custom query, reloading will only be performed when the "Reload after editing"-preference is selected (addresses #735)
-rw-r--r--Source/CustomQuery.m16
1 files changed, 10 insertions, 6 deletions
diff --git a/Source/CustomQuery.m b/Source/CustomQuery.m
index b5ba5306..fdc7c5d3 100644
--- a/Source/CustomQuery.m
+++ b/Source/CustomQuery.m
@@ -1694,13 +1694,17 @@
}
return;
}
-
- // On success reload table data by executing the last query
- reloadingExistingResult = YES;
- [self storeCurrentResultViewForRestoration];
-
- [self performQueries:[NSArray arrayWithObject:lastExecutedQuery] withCallback:NULL];
+ // On success reload table data by executing the last query if reloading is enabled
+ if ([prefs boolForKey:SPReloadAfterEditingRow]) {
+ reloadingExistingResult = YES;
+ [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);
+ }
} else {
SPBeginAlertSheet(NSLocalizedString(@"Error", @"error"), NSLocalizedString(@"OK", @"OK button"), nil, nil, [tableDocumentInstance parentWindow], self, nil, nil,
[NSString stringWithFormat:NSLocalizedString(@"Updating field content failed. Couldn't identify field origin unambiguously (%ld match%@). It's very likely that while editing this field the table `%@` was changed by an other user.", @"message of panel when error while updating field to db after enabling it"),