aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/SPUserManager.m9
-rw-r--r--Source/SPUserManagerDelegate.m6
2 files changed, 14 insertions, 1 deletions
diff --git a/Source/SPUserManager.m b/Source/SPUserManager.m
index 8b7a3f33..eb69203a 100644
--- a/Source/SPUserManager.m
+++ b/Source/SPUserManager.m
@@ -464,6 +464,9 @@ static const NSString *SPTableViewNameColumnID = @"NameColumn";
*/
- (IBAction)doCancel:(id)sender
{
+ // Discard any pending changes
+ [treeController discardEditing];
+
// Change the first responder to end editing in any field
[[self window] makeFirstResponder:self];
@@ -479,6 +482,12 @@ static const NSString *SPTableViewNameColumnID = @"NameColumn";
*/
- (IBAction)doApply:(id)sender
{
+
+ // If editing can't be committed, cancel the apply
+ if (![treeController commitEditing]) {
+ return;
+ }
+
errorsString = [[NSMutableString alloc] init];
// Change the first responder to end editing in any field
diff --git a/Source/SPUserManagerDelegate.m b/Source/SPUserManagerDelegate.m
index c1a96ba9..8fa2b980 100644
--- a/Source/SPUserManagerDelegate.m
+++ b/Source/SPUserManagerDelegate.m
@@ -124,7 +124,11 @@ static NSString *SPSchemaPrivilegesTabIdentifier = @"Schema Privileges";
BOOL retVal = YES;
if ([[treeController selectedObjects] count] == 0) return NO;
-
+
+ if (![treeController commitEditing]) {
+ return NO;
+ }
+
// Currently selected object in tree
id selectedObject = [[treeController selectedObjects] objectAtIndex:0];