Created
February 10, 2010 17:23
-
-
Save primalmotion/300582 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@implementation TNConnectionWindow: CPWindow { | |
@outlet CPTextField jid; | |
@outlet CPTextField password; | |
@outlet CPImageView spinning; | |
@outlet CPTextField message; | |
CPCookie cookieLogin @accessors; | |
CPCookie cookiePassword @accessors; | |
TNStropheConnection strophe @accessors; | |
} | |
// initialization | |
- (void) awakeFromCib { | |
[[self password] setSecure:YES]; | |
cookieLogin = [[CPCookie alloc] initWithName:@"login"]; | |
cookiePassword = [[CPCookie alloc] initWithName:@"password"]; | |
if ([[self cookieLogin] value]) | |
[[self jid] setStringValue:[cookieLogin value]]; | |
if ([[self cookiePassword] value]) | |
[[self password] setStringValue:[cookiePassword value]]; | |
} | |
// actions | |
- (IBAction) connect:(id)sender { | |
//[logger log:"connecting with " + [jid stringValue] + " password: " + [password stringValue]]; | |
[cookieLogin setValue:[jid stringValue] expires:[CPDate distantFuture] domain:""]; | |
[cookiePassword setValue:[password stringValue] expires:[CPDate distantFuture] domain:""]; | |
// do stuff | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment