aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/TableContent.m33
1 files changed, 24 insertions, 9 deletions
diff --git a/Source/TableContent.m b/Source/TableContent.m
index 7f8f5ab4..594822ec 100644
--- a/Source/TableContent.m
+++ b/Source/TableContent.m
@@ -1007,9 +1007,29 @@
*/
- (IBAction)filterTable:(id)sender
{
+ NSString *taskString;
+
if ([tableDocumentInstance isWorking]) return;
[self setPaginationViewVisibility:FALSE];
- [tableDocumentInstance startTaskWithDescription:NSLocalizedString(@"Filtering table...", @"Filtering table task description")];
+
+ // Select the correct pagination value
+ if (![prefs boolForKey:SPLimitResults] || [paginationPageField integerValue] <= 0)
+ contentPage = 1;
+ else if (([paginationPageField integerValue] - 1) * [prefs integerForKey:SPLimitResultsValue] >= maxNumRows)
+ contentPage = ceil((CGFloat)maxNumRows / [prefs floatForKey:SPLimitResultsValue]);
+ else
+ contentPage = [paginationPageField integerValue];
+
+ if ([self tableFilterString]) {
+ taskString = NSLocalizedString(@"Filtering table...", @"Filtering table task description");
+ } else if (contentPage == 1) {
+ taskString = [NSString stringWithFormat:NSLocalizedString(@"Loading %@...", @"Loading table task string"), selectedTable];
+ } else {
+ taskString = [NSString stringWithFormat:NSLocalizedString(@"Loading page %lu...", @"Loading table page task string"), (unsigned long)contentPage];
+ }
+
+ [tableDocumentInstance startTaskWithDescription:taskString];
+
if ([NSThread isMainThread]) {
[NSThread detachNewThreadSelector:@selector(filterTableTask) toTarget:self withObject:nil];
} else {
@@ -1026,14 +1046,6 @@
// Update history
[spHistoryControllerInstance updateHistoryEntries];
- // Select the correct pagination value
- if (![prefs boolForKey:SPLimitResults] || [paginationPageField integerValue] <= 0)
- contentPage = 1;
- else if (([paginationPageField integerValue] - 1) * [prefs integerForKey:SPLimitResultsValue] >= maxNumRows)
- contentPage = ceil((CGFloat)maxNumRows / [prefs floatForKey:SPLimitResultsValue]);
- else
- contentPage = [paginationPageField integerValue];
-
// Reset and reload data using the new filter settings
previousTableRowsCount = 0;
[self clearTableValues];
@@ -2518,6 +2530,9 @@
maxNumRows = foundMaxRows;
maxNumRowsIsEstimate = NO;
}
+ } else if (!isInterruptedLoad && tableRowsCount < [prefs integerForKey:SPLimitResultsValue]) {
+ maxNumRows = foundMaxRows;
+ maxNumRowsIsEstimate = NO;
}
} else if (tableRowsCount > maxNumRows) {
maxNumRows = tableRowsCount;