diff options
author | rowanbeentje <rowan@beent.je> | 2012-08-23 22:49:31 +0000 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2012-08-23 22:49:31 +0000 |
commit | e6d2ca221746bac11abcc43f80983ae9e5f2c0d6 (patch) | |
tree | 9972f62903745a439b545b132bc4c66ed7f0da12 /Source | |
parent | 9ea88c6caefec56a0823ffe4a44a44204b0a51d2 (diff) | |
download | sequelpro-e6d2ca221746bac11abcc43f80983ae9e5f2c0d6.tar.gz sequelpro-e6d2ca221746bac11abcc43f80983ae9e5f2c0d6.tar.bz2 sequelpro-e6d2ca221746bac11abcc43f80983ae9e5f2c0d6.zip |
- Improve filter clearing logic, addressing Issue #1438 (pagination controls no longer functioning correctly)
Diffstat (limited to 'Source')
-rw-r--r-- | Source/SPTableContent.m | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/Source/SPTableContent.m b/Source/SPTableContent.m index 0c9f1d96..8296ca75 100644 --- a/Source/SPTableContent.m +++ b/Source/SPTableContent.m @@ -1507,6 +1507,12 @@ static NSString *SPTableFilterSetDefaultOperator = @"SPTableFilterSetDefaultOper // Check whether a save of the current row is required if (![self saveRowOnDeselect]) return; + // If the filter field is being cleared by deleting the contents, and there's no current filter, + // don't trigger a reload. keycode 51 is backspace, 117 is delete. + if ([sender isKindOfClass:[NSSearchField class]] && !isFiltered && ![self tableFilterString] && ([[[sender window] currentEvent] keyCode] == 51 || [[[sender window] currentEvent] keyCode] == 117)) { + return; + } + #ifndef SP_REFACTOR [self setPaginationViewVisibility:FALSE]; #endif @@ -1526,18 +1532,10 @@ static NSString *SPTableFilterSetDefaultOperator = @"SPTableFilterSetDefaultOper 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 { - - // If the table isn't currently filtered, no action required. - if (!isFiltered) { - return; - } - - 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]; - } + taskString = [NSString stringWithFormat:NSLocalizedString(@"Loading page %lu...", @"Loading table page task string"), (unsigned long)contentPage]; } [tableDocumentInstance startTaskWithDescription:taskString]; |