// // PLSLoginWindowController.m // Pulse // // Created by Matt Attaway on 2/19/14. // Copyright (c) 2014 Zen of the Monkey. All rights reserved. // #import "PLSLoginController.h" #import "PLSOverseer.h" @interface PLSLoginController () @end @implementation PLSLoginController - (id)initWithWindow:(NSWindow *)window { self = [super initWithWindow:window]; return self; } - (void)windowDidLoad { [super windowDidLoad]; NSString* title = [[NSString alloc] initWithFormat:@"Enter password for '%@' on %@", self.os.user, self.os.port]; [self.header setStringValue:title]; [self.password setStringValue:@""]; } - (IBAction)login:(id)sender { if(self.os) { [self.os login:[self.password stringValue]]; if(!self.os.needsLogin) { [self.os startTracking]; } } [self close]; } - (IBAction)cancel:(id)sender { [self close]; } @end