aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPProcessListController.m
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2010-09-15 12:21:13 +0000
committerstuconnolly <stuart02@gmail.com>2010-09-15 12:21:13 +0000
commitc5d5b115cae8eb5f8295365ffa463a6561b9cccb (patch)
treed0a227e75b4b58de9604f4b2bf191112ab8efa7f /Source/SPProcessListController.m
parent99b6e552125002d1d49440908f2228c3eafc53a9 (diff)
downloadsequelpro-c5d5b115cae8eb5f8295365ffa463a6561b9cccb.tar.gz
sequelpro-c5d5b115cae8eb5f8295365ffa463a6561b9cccb.tar.bz2
sequelpro-c5d5b115cae8eb5f8295365ffa463a6561b9cccb.zip
Enable column sorting in the server processes window. Implements issue #816.
Diffstat (limited to 'Source/SPProcessListController.m')
-rw-r--r--Source/SPProcessListController.m14
1 files changed, 14 insertions, 0 deletions
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