-
Notifications
You must be signed in to change notification settings - Fork 3
/
AccountWindowController.m
49 lines (45 loc) · 1.27 KB
/
AccountWindowController.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//
// AccountWindowController.m
// Jabber
//
// Created by David Chisnall on 22/09/2004.
// Copyright 2004 __MyCompanyName__. All rights reserved.
//
#import "AccountWindowController.h"
#import <XMPPKit/XMPPAccount.h>
@implementation AccountWindowController
- (IBAction) yes:(id)sender
{
JID *myJID = [JID jidWithString:[jidBox stringValue]];
NSString * myServer = [serverBox stringValue];
SCAccountInfoManager *manager;
if(myServer != nil && ![myServer isEqualToString:@""])
{
[XMPPAccount setDefaultJID:myJID withServer:myServer];
manager = [[SCAccountInfoManager alloc] init];
[manager writeJIDToFile:myJID atPath:[manager filePath]];
}
else
{
if ([[myJID domain] isEqualToString:@"gmail.com"])
{
myServer = @"talk.google.com";
[XMPPAccount setDefaultJID:myJID withServer:myServer];
}
else
{
[XMPPAccount setDefaultJID:myJID];
}
manager = [[SCAccountInfoManager alloc] init];
[manager writeJIDToFile:myJID atPath:[manager filePath]];
}
[[self window] close];
[NSApp stopModalWithCode:0];
}
- (IBAction) no:(id)sender
{
[[self window] close];
[NSApp stopModalWithCode:-1];
exit(0); //Slex: with NSAPP -terminate the App did close but did stay still in memory
}
@end