Skip to content

Instantly share code, notes, and snippets.

@primalmotion
Created February 10, 2010 17:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save primalmotion/300582 to your computer and use it in GitHub Desktop.
Save primalmotion/300582 to your computer and use it in GitHub Desktop.
@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