From 43882565dbb5342c44ac0301a0393d922680be6b Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Mon, 17 Jan 2011 23:52:53 +0000 Subject: - Add a double-click action for transferring user schema privs between available & granted --- Source/SPUserManager.m | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/Source/SPUserManager.m b/Source/SPUserManager.m index 9a9b916f..87b01cdc 100644 --- a/Source/SPUserManager.m +++ b/Source/SPUserManager.m @@ -112,7 +112,11 @@ static const NSString *SPTableViewNameColumnID = @"NameColumn"; // Set the button delegate [splitViewButtonBar setSplitViewDelegate:self]; - + + // Set schema table double-click actions + [grantedTableView setDoubleAction:@selector(doubleClickSchemaPriv:)]; + [availableTableView setDoubleAction:@selector(doubleClickSchemaPriv:)]; + [self _initializeUsers]; [self _initializeSchemaPrivs]; @@ -778,6 +782,23 @@ static const NSString *SPTableViewNameColumnID = @"NameColumn"; [self _setSchemaPrivValues:selectedObjects enabled:NO]; } +/** + * Move double-clicked rows across to the other table, using the + * appropriate methods. + */ +- (IBAction)doubleClickSchemaPriv:(id)sender +{ + + // Ignore double-clicked header cells + if ([sender clickedRow] == -1) return; + + if (sender == availableTableView) { + [self addSchemaPriv:sender]; + } else { + [self removeSchemaPriv:sender]; + } +} + /** * Refreshes the current list of users. */ -- cgit v1.2.3