From c5d5b115cae8eb5f8295365ffa463a6561b9cccb Mon Sep 17 00:00:00 2001 From: stuconnolly Date: Wed, 15 Sep 2010 12:21:13 +0000 Subject: Enable column sorting in the server processes window. Implements issue #816. --- Source/SPProcessListController.m | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'Source/SPProcessListController.m') diff --git a/Source/SPProcessListController.m b/Source/SPProcessListController.m index afb13634..886e6f2b 100644 --- a/Source/SPProcessListController.m +++ b/Source/SPProcessListController.m @@ -469,6 +469,16 @@ return (![object isNSNull]) ? object : [prefs stringForKey:SPNullValue]; } +/** + * Table view delegate method. Called when the user changes the sort by column. + */ +- (void)tableView:(NSTableView *)tableView sortDescriptorsDidChange:(NSArray *)oldDescriptors +{ + [processesFiltered sortUsingDescriptors:[tableView sortDescriptors]]; + + [tableView reloadData]; +} + #pragma mark - #pragma mark Text field delegate methods @@ -537,6 +547,10 @@ [self _updateServerProcessesFilterForFilterString:[filterProcessesSearchField stringValue]]; } + // Reset sort descriptors + [processesFiltered sortUsingDescriptors:[processListTableView sortDescriptors]]; + + // Reload data [processListTableView reloadData]; // Enable controls -- cgit v1.2.3