2
0

Activate before no-user alert.

[FIXED]     Also activate app before no-user alert.
This commit is contained in:
Maarten Billemont 2013-06-04 21:31:02 -04:00
parent b4dbb15853
commit c400868026
2 changed files with 5 additions and 7 deletions

@ -1 +1 @@
Subproject commit eb8b21e117bfa5747d67394f06df400ac4c94279 Subproject commit fa01dea4ec70d12a8b2db48e26b50271451a16e1

View File

@ -385,16 +385,14 @@ static OSStatus MPHotKeyHander(EventHandlerCallRef nextHandler, EventRef theEven
- (IBAction)showPasswordWindow:(id)sender { - (IBAction)showPasswordWindow:(id)sender {
[NSApp activateIgnoringOtherApps:YES];
// If no user, can't activate. // If no user, can't activate.
if (YES || ![self activeUserForThread]) { if (![self activeUserForThread]) {
[[NSAlert alertWithMessageText:@"No User Selected" defaultButton:[PearlStrings get].commonButtonOkay alternateButton:nil otherButton:nil informativeTextWithFormat:@"Begin by selecting or creating your user from the status menu (●●●|) next to the clock.", nil] runModal]; [[NSAlert alertWithMessageText:@"No User Selected" defaultButton:[PearlStrings get].commonButtonOkay alternateButton:nil otherButton:nil informativeTextWithFormat:@"Begin by selecting or creating your user from the status menu (●●●|) next to the clock.", nil] runModal];
return; return;
} }
// Activate the app if not active.
if (![[NSApplication sharedApplication] isActive])
[[NSApplication sharedApplication] activateIgnoringOtherApps:YES];
// Don't show window if we weren't already running (ie. if we haven't been activated before). // Don't show window if we weren't already running (ie. if we haven't been activated before).
if (!self.passwordWindow) if (!self.passwordWindow)
self.passwordWindow = [[MPPasswordWindowController alloc] initWithWindowNibName:@"MPPasswordWindowController"]; self.passwordWindow = [[MPPasswordWindowController alloc] initWithWindowNibName:@"MPPasswordWindowController"];