diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/SPUserManager.m | 7 | ||||
-rw-r--r-- | Source/SPUserManagerDelegate.m | 16 |
2 files changed, 11 insertions, 12 deletions
diff --git a/Source/SPUserManager.m b/Source/SPUserManager.m index 35a97807..ac539624 100644 --- a/Source/SPUserManager.m +++ b/Source/SPUserManager.m @@ -365,8 +365,8 @@ static const NSString *SPTableViewNameColumnID = @"NameColumn"; for (NSDictionary *rowDict in queryResults) { - NSManagedObject *dbPriv = [NSEntityDescription insertNewObjectForEntityForName:@"Privileges" - inManagedObjectContext:[self managedObjectContext]]; + NSManagedObject *dbPriv = [NSEntityDescription insertNewObjectForEntityForName:@"Privileges" inManagedObjectContext:[self managedObjectContext]]; + for (NSString *key in rowDict) { if ([key hasSuffix:@"_priv"]) { @@ -440,7 +440,7 @@ static const NSString *SPTableViewNameColumnID = @"NameColumn"; if (coordinator != nil) { managedObjectContext = [[NSManagedObjectContext alloc] init]; - [managedObjectContext setPersistentStoreCoordinator: coordinator]; + [managedObjectContext setPersistentStoreCoordinator:coordinator]; } [[NSNotificationCenter defaultCenter] addObserver:self @@ -459,7 +459,6 @@ static const NSString *SPTableViewNameColumnID = @"NameColumn"; */ - (IBAction)doCancel:(id)sender { - // Change the first responder to end editing in any field [[self window] makeFirstResponder:self]; diff --git a/Source/SPUserManagerDelegate.m b/Source/SPUserManagerDelegate.m index dccfe4c9..dc409308 100644 --- a/Source/SPUserManagerDelegate.m +++ b/Source/SPUserManagerDelegate.m @@ -151,11 +151,11 @@ static NSString *SPSchemaPrivilegesTabIdentifier = @"Schema Privileges"; retVal = parent ? ([[parent children] count] > 0) : ([[selectedObject children] count] > 0); if (!retVal) { - NSAlert *alert = [NSAlert alertWithMessageText:@"User doesn't have any hosts." + NSAlert *alert = [NSAlert alertWithMessageText:NSLocalizedString(@"User has no hosts", @"user has no hosts message") defaultButton:NSLocalizedString(@"Add Host", @"Add Host") alternateButton:NSLocalizedString(@"Cancel", @"cancel button") otherButton:nil - informativeTextWithFormat:@"This user doesn't have any hosts associated with it. User will be deleted unless one is added"]; + informativeTextWithFormat:NSLocalizedString(@"This user doesn't have any hosts associated with it. It will be deleted unless one is added", @"user has no hosts informative message")]; if ([alert runModal] == NSAlertDefaultReturn) { [self addHost:nil]; @@ -276,14 +276,14 @@ static NSString *SPSchemaPrivilegesTabIdentifier = @"Schema Privileges"; NSString *name = [selectedObject valueForKey:@"user"]; NSArray *results = [self _fetchUserWithUserName:name]; - if ([results count] > 1) - { - NSAlert *alert = [NSAlert alertWithMessageText:@"Duplicate User" + if ([results count] > 1) { + NSAlert *alert = [NSAlert alertWithMessageText:NSLocalizedString(@"Duplicate User", @"duplicate user message") defaultButton:NSLocalizedString(@"OK", @"OK button") alternateButton:nil otherButton:nil - informativeTextWithFormat:@"A user with that name already exists"]; + informativeTextWithFormat:[NSString stringWithFormat:NSLocalizedString(@"A user with the name '%@' already exists", @"duplicate user informative message"), name]]; [alert runModal]; + return NO; } } @@ -296,11 +296,11 @@ static NSString *SPSchemaPrivilegesTabIdentifier = @"Schema Privileges"; { if (![selectedObject isEqual:child] && [[child valueForKey:@"host"] isEqualToString:host]) { - NSAlert *alert = [NSAlert alertWithMessageText:@"Duplicate Host" + NSAlert *alert = [NSAlert alertWithMessageText:NSLocalizedString(@"Duplicate Host", @"duplicate host message") defaultButton:NSLocalizedString(@"OK", @"OK button") alternateButton:nil otherButton:nil - informativeTextWithFormat:@"A user with that host already exists"]; + informativeTextWithFormat:[NSString stringWithFormat:NSLocalizedString(@"A user with the host '%@' already exists", @"duplicate host informative message"), host]]; [alert runModal]; |