Updated Theme Tester for the new system. Fixed issues with MGMAdressBook. Changed to new dealloc setup. Fixed issue with MGMContacts nameForNumber. Fixed issues with calling SIP addresses. Fixed issues with images having a size of zero. Fixed possibility of error being null for placing calls. Added caf support for theme manager. Added support for setting a custom useragent for MGMSIP. Fixed issues with TCP/UDP connections and added option per an account on what type the user wants. Added choice of DTMF tone type. Fixed issues with registration of SIP accounts. Fixed issue where windows wouldn't reopen after being cloed and quit. Updated to a fixed version of PJSIP.

This commit is contained in:
GRMrGecko 2011-02-22 12:00:36 -06:00
parent f7a808f394
commit 7fdf9035a7
264 changed files with 1798 additions and 4566 deletions

View File

@ -11,7 +11,7 @@ RockStar ({\field{\*\fldinst{HYPERLINK "http://rocknthesweater.com"}}{\fldrslt r
PowerOfCheese ({\field{\*\fldinst{HYPERLINK "http://xtrememachinez.com"}}{\fldrslt xtrememachinez.com}})\
\
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural
\cf0 VoiceMac Uses {\field{\*\fldinst{HYPERLINK "http://mrgeckosmedia.com"}}{\fldrslt MGMSIP}} as a wrapper for {\field{\*\fldinst{HYPERLINK "http://www.pjsip.org/"}}{\fldrslt PJSIP}} which is a VOIP library, {\field{\*\fldinst{HYPERLINK "http://sparkle.andymatuschak.org"}}{\fldrslt Sparkle}} for software update, and Growl for notifications.\
\cf0 VoiceMac Uses {\field{\*\fldinst{HYPERLINK "http://mrgeckosmedia.com"}}{\fldrslt MGMSIP}} as a wrapper for {\field{\*\fldinst{HYPERLINK "http://www.pjsip.org/"}}{\fldrslt PJSIP}} which is a VOIP library, {\field{\*\fldinst{HYPERLINK "http://sparkle.andymatuschak.org"}}{\fldrslt Sparkle}} for software update, and {\field{\*\fldinst{HYPERLINK "http://growl.info/"}}{\fldrslt Growl}} for notifications.\
\
VoiceMac is the first Google Voice client for the Mac. Send multiple SMS Messages, send SMS Messages, receive SMS Messages, place calls, look at your call history, receive voicemail, reverse lookup a phone number, and search your contact list in one easy interface. When you receive a SMS Message or Voicemail, you get notifications view Growl and hear sounds that is customizable.\
\

View File

@ -186,7 +186,7 @@
}
NSDateFormatter *formatter = [[NSDateFormatter new] autorelease];
[formatter setDateFormat:[[themeManager variant] objectForKey:MGMTDate]];
[SMSView stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"newMessage('%@', '%@', '%@', %@, '%@', '%@', '%@', %d);", [[message objectForKey:MGMIText] escapeSMS], [[message objectForKey:MGMTPhoto] escapeSMS], [[message objectForKey:MGMITime] escapeSMS], [message objectForKey:MGMIID], [[message objectForKey:MGMTName] escapeSMS], [[[message objectForKey:MGMIPhoneNumber] readableNumber] escapeSMS], [formatter stringFromDate:[messageInfo objectForKey:MGMITime]], type]];
[SMSView stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"newMessage('%@', '%@', '%@', %@, '%@', '%@', '%@', %d);", [[message objectForKey:MGMIText] javascriptEscape], [[message objectForKey:MGMTPhoto] javascriptEscape], [[message objectForKey:MGMITime] javascriptEscape], [message objectForKey:MGMIID], [[message objectForKey:MGMTName] javascriptEscape], [[[message objectForKey:MGMIPhoneNumber] readableNumber] javascriptEscape], [formatter stringFromDate:[messageInfo objectForKey:MGMITime]], type]];
[SMSView stringByEvaluatingJavaScriptFromString:@"scrollToBottom();"];
}
- (IBAction)incoming:(id)sender {

View File

@ -20,7 +20,7 @@
@implementation MGMAddressBook
- (id)initWithDelegate:(id)theDelegate {
if (self = [super init]) {
if ((self = [super init])) {
delegate = theDelegate;
shouldStop = NO;
gettingContacts = NO;
@ -38,8 +38,7 @@
if (addressBook!=NULL)
CFRelease(addressBook);
#else
if (addressBook!=nil)
[addressBook release];
[addressBook release];
#endif
[super dealloc];
}
@ -101,10 +100,12 @@
NSMutableDictionary *contact = [NSMutableDictionary dictionary];
[contact setObject:name forKey:MGMCName];
[contact setObject:company forKey:MGMCCompany];
CFStringRef phoneNumber = ABMultiValueCopyValueAtIndex(phones, p);
if (delegate!=nil)
[contact setObject:[[(NSString *)ABMultiValueCopyValueAtIndex(phones, p) autorelease] phoneFormatWithAreaCode:[delegate areaCode]] forKey:MGMCNumber];
[contact setObject:[(NSString *)phoneNumber phoneFormatWithAreaCode:[delegate areaCode]] forKey:MGMCNumber];
else
[contact setObject:[[(NSString *)ABMultiValueCopyValueAtIndex(phones, p) autorelease] phoneFormat] forKey:MGMCNumber];
[contact setObject:[(NSString *)phoneNumber phoneFormat] forKey:MGMCNumber];
CFRelease(phoneNumber);
NSString *label = [(NSString *)ABMultiValueCopyLabelAtIndex(phones, p) autorelease];
NSRange range = [label rangeOfString:@"<"];
if (range.location!=NSNotFound) {

View File

@ -42,7 +42,7 @@ const int MGMCMaxResults = 10;
return [[[self alloc] initWithClass:theClass delegate:theDelegate] autorelease];
}
- (id)initWithClass:(Class)theClass delegate:(id)theDelegate {
if (self = [super init]) {
if ((self = [super init])) {
maxResults = MGMCMaxResults;
delegate = theDelegate;
user = [delegate user];
@ -71,22 +71,15 @@ const int MGMCMaxResults = 10;
}
- (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self];
if (updateLock!=nil) {
[updateLock lock];
[updateLock unlock];
[updateLock release];
}
if (contactsLock!=nil) {
[contactsLock lock];
[contactsLock unlock];
[contactsLock release];
}
if (contactsConnection!=nil)
[contactsConnection release];
if (updateConnection!=nil)
[updateConnection release];
if (contacts!=nil)
[contacts release];
[updateLock lock];
[updateLock unlock];
[updateLock release];
[contactsLock lock];
[contactsLock unlock];
[contactsLock release];
[contactsConnection release];
[updateConnection release];
[contacts release];
[super dealloc];
}
@ -103,10 +96,8 @@ const int MGMCMaxResults = 10;
[contacts stop];
[updateLock lock];
[updateLock unlock];
if (updateConnection!=nil) {
[updateConnection release];
updateConnection = nil;
}
[updateConnection release];
updateConnection = nil;
isUpdating = NO;
stopingUpdate = NO;
}
@ -117,7 +108,7 @@ const int MGMCMaxResults = 10;
if ([theUser isEqual:user] && (![[theUser settingForKey:MGMSContactsSourceKey] isEqual:NSStringFromClass([contacts class])] || ([contacts isKindOfClass:[MGMGoogleContacts class]] && ![[[(MGMGoogleContacts *)contacts user] settingForKey:MGMUserID] isEqual:[theUser settingForKey:MGMCGoogleContactsUser]]))) {
if (stopingUpdate) return;
[self stop];
if (contacts!=nil) [contacts release];
[contacts release];
contacts = [[NSClassFromString([theUser settingForKey:MGMSContactsSourceKey]) alloc] initWithDelegate:delegate];
[self updateContacts];
}
@ -135,7 +126,7 @@ const int MGMCMaxResults = 10;
}
- (void)setContactsConnection:(MGMLiteConnection *)theConnection {
[contactsLock lock];
if (contactsConnection!=nil) [contactsConnection release];
[contactsConnection release];
contactsConnection = [theConnection retain];
[contactsLock unlock];
}
@ -202,9 +193,8 @@ const int MGMCMaxResults = 10;
long long int groupID = [updateConnection insertId];
for (unsigned int i=0; i<[theMembers count]; i++) {
NSDictionary *result = [[updateConnection query:@"SELECT docid, * FROM contacts WHERE number = %@", [theMembers objectAtIndex:i]] nextRow];
if (result!=nil) {
if (result!=nil)
[updateConnection query:@"INSERT INTO groupMembers (groupid, contactid) VALUES (%qi, %@)", groupID, [result objectForKey:MGMCDocID]];
}
}
}
[updateLock unlock];
@ -481,7 +471,7 @@ const int MGMCMaxResults = 10;
else if (![[contact objectForKey:MGMCCompany] isEqual:@""])
return [contact objectForKey:MGMCCompany];
}
if ([theNumber isPhone])
if ([theNumber isPhoneComplete])
return [theNumber readableNumber];
return theNumber;
}
@ -533,9 +523,8 @@ const int MGMCMaxResults = 10;
NSDictionary *member = nil;
while ((member=[result nextRow])!=nil) {
NSDictionary *contact = [self contactWithID:[member objectForKey:MGMCContactID]];
if (contact!=nil) {
if (contact!=nil)
[memebersArray addObject:contact];
}
}
[contactsLock unlock];
[pool drain];

View File

@ -22,4 +22,8 @@ NSString * const MGMCContactID = @"contactid";
NSString * const MGMCGoogleContactsUser = @"MGMCGoogleContactsUser";
const float MGMABPhotoSizePX = 64.0;
#if TARGET_OS_IPHONE
const float MGMABPhotoSizePX = 120.0;
#else
const float MGMABPhotoSizePX = 64.0;
#endif

View File

@ -25,7 +25,7 @@ const BOOL MGMGoogleContactsInvisible = YES;
@implementation MGMGoogleContacts
- (id)initWithDelegate:(id)theDelegate {
if (self = [super init]) {
if ((self = [super init])) {
gettingContacts = NO;
delegate = theDelegate;
user = [[MGMUser userWithID:[[delegate user] settingForKey:MGMCGoogleContactsUser]] retain];
@ -49,22 +49,14 @@ const BOOL MGMGoogleContactsInvisible = YES;
return self;
}
- (void)dealloc {
if (user!=nil)
[user release];
if (connectionManager!=nil) {
[connectionManager cancelAll];
[connectionManager release];
}
if (authenticationString!=nil)
[authenticationString release];
if (afterAuthentication!=nil)
[afterAuthentication release];
if (releaseTimer!=nil)
[releaseTimer fire];
if (contactEntries!=nil)
[contactEntries release];
if (contactPhoto!=nil)
[contactPhoto release];
[user release];
[connectionManager cancelAll];
[connectionManager release];
[authenticationString release];
[afterAuthentication release];
[releaseTimer fire];
[contactEntries release];
[contactPhoto release];
[super dealloc];
}
- (void)authentication:(NSDictionary *)theInfo didFailWithError:(NSError *)theError {
@ -88,7 +80,7 @@ const BOOL MGMGoogleContactsInvisible = YES;
}
- (void)authenticationDidFinish:(NSDictionary *)theInfo {
NSDictionary *info = [MGMGoogleContacts dictionaryWithData:[theInfo objectForKey:MGMConnectionData]];
if (authenticationString!=nil) [authenticationString release];
[authenticationString release];
authenticationString = [[NSString stringWithFormat:@"GoogleLogin auth=%@", [info objectForKey:@"Auth"]] retain];
isAuthenticating = NO;
while ([afterAuthentication count]!=0) {
@ -139,12 +131,10 @@ const BOOL MGMGoogleContactsInvisible = YES;
if ([contactsSender respondsToSelector:@selector(contactsError:)]) [contactsSender contactsError:theError];
}
- (void)contactsDidFinish:(NSDictionary *)theInfo {
if (releaseTimer!=nil) {
[releaseTimer invalidate];
[releaseTimer release];
releaseTimer = nil;
}
if (contacts!=nil) [contacts release];
[releaseTimer invalidate];
[releaseTimer release];
releaseTimer = nil;
[contacts release];
contacts = [NSMutableArray new];
MGMXMLElement *XML = [(MGMXMLDocument *)[[[MGMXMLDocument alloc] initWithData:[theInfo objectForKey:MGMConnectionData] options:MGMXMLDocumentTidyXML error:nil] autorelease] rootElement];
contactEntries = [[XML elementsForName:@"entry"] retain];
@ -254,15 +244,11 @@ const BOOL MGMGoogleContactsInvisible = YES;
}
}
- (void)releaseContacts {
if (releaseTimer!=nil) {
[releaseTimer invalidate];
[releaseTimer release];
releaseTimer = nil;
}
if (contacts!=nil) {
[contacts release];
contacts = nil;
}
[releaseTimer invalidate];
[releaseTimer release];
releaseTimer = nil;
[contacts release];
contacts = nil;
}
- (void)getGroups:(id)sender {

View File

@ -144,12 +144,16 @@
return number;
}
- (BOOL)isPhone {
if ([self rangeOfString:@"@"].location!=NSNotFound)
return YES;
NSString *number = [self removePhoneWhiteSpace];
if ([number length]<1)
return NO;
return [[NSCharacterSet decimalDigitCharacterSet] characterIsMember:[number characterAtIndex:0]];
}
- (BOOL)isPhoneComplete {
if ([self rangeOfString:@"@"].location!=NSNotFound)
return YES;
NSString *number = [self removePhoneWhiteSpace];
if ([number length]<1 || ![[NSCharacterSet decimalDigitCharacterSet] characterIsMember:[number characterAtIndex:0]])
return NO;
@ -162,6 +166,8 @@
return NO;
}
- (NSString *)phoneFormatWithAreaCode:(NSString *)theAreaCode {
if ([self rangeOfString:@"@"].location!=NSNotFound)
return self;
NSString *number = [[self removePhoneWhiteSpace] littersToNumbers];
if (![number hasPrefix:@"011"]) {
int length = [number length];
@ -175,6 +181,8 @@
return number;
}
- (NSString *)phoneFormatAreaCode:(NSString *)theAreaCode {
if ([self rangeOfString:@"@"].location!=NSNotFound)
return self;
NSString *number = [[self removePhoneWhiteSpace] littersToNumbers];
if (![number hasPrefix:@"011"]) {
int length = [number length];
@ -186,6 +194,8 @@
return number;
}
- (NSString *)phoneFormat {
if ([self rangeOfString:@"@"].location!=NSNotFound)
return self;
NSString *number = [[self removePhoneWhiteSpace] littersToNumbers];
if (![number hasPrefix:@"011"]) {
if ([number hasPrefix:@"1"])
@ -1371,6 +1381,8 @@ NSComparisonResult dateSort(NSDictionary *info1, NSDictionary *info2, void *cont
#else
NSImage *image = [[NSImage alloc] initWithData:self];
#endif
if (image==nil)
return self;
if (image!=nil) {
#if TARGET_OS_IPHONE
CGSize size = [image size];
@ -1416,6 +1428,8 @@ NSComparisonResult dateSort(NSDictionary *info1, NSDictionary *info2, void *cont
NSSize newSize = NSMakeSize(scaledWidth, scaledHeight);
if (!NSEqualSizes(newSize, NSZeroSize)) {
NSImage *newImage = [[NSImage alloc] initWithSize:newSize];
if (newImage==nil || NSEqualSizes([newImage size], NSZeroSize))
return self;
[newImage lockFocus];
NSGraphicsContext *graphicsContext = [NSGraphicsContext currentContext];
[graphicsContext setImageInterpolation:NSImageInterpolationHigh];

View File

@ -73,17 +73,15 @@ const BOOL MGMInboxInvisible = YES;
return [[[self alloc] initWithInstance:theInstance] autorelease];
}
- (id)initWithInstance:(MGMInstance *)theInstance {
if (self = [super init]) {
if ((self = [super init])) {
instance = theInstance;
connectionManager = [[MGMURLConnectionManager managerWithCookieStorage:[theInstance cookieStorage]] retain];
}
return self;
}
- (void)dealloc {
if (connectionManager!=nil) {
[connectionManager cancelAll];
[connectionManager release];
}
[connectionManager cancelAll];
[connectionManager release];
[super dealloc];
}

View File

@ -58,7 +58,7 @@ const BOOL MGMInstanceInvisible = YES;
return [[[self alloc] initWithUser:theUser delegate:theDelegate isCheck:isCheck] autorelease];
}
- (id)initWithUser:(MGMUser *)theUser delegate:(id)theDelegate isCheck:(BOOL)isCheck {
if (self = [super init]) {
if ((self = [super init])) {
checkingAccount = isCheck;
loggedIn = NO;
webLoginTries = 0;
@ -75,44 +75,26 @@ const BOOL MGMInstanceInvisible = YES;
return self;
}
- (void)dealloc {
if (connectionManager!=nil) {
[connectionManager cancelAll];
[connectionManager release];
}
if (user!=nil)
[user release];
if (cookeStorage!=nil)
[cookeStorage release];
if (inbox!=nil)
[inbox release];
if (contacts!=nil)
[contacts release];
if (XPCURL!=nil)
[XPCURL release];
if (XPCCD!=nil)
[XPCCD release];
if (rnr_se!=nil)
[rnr_se release];
if (userName!=nil)
[userName release];
if (userNumber!=nil)
[userNumber release];
if (userAreacode!=nil)
[userAreacode release];
if (userPhoneNumbers!=nil)
[userPhoneNumbers release];
if (checkTimer!=nil) {
[checkTimer invalidate];
[checkTimer release];
checkTimer = nil;
}
if (unreadCounts!=nil)
[unreadCounts release];
if (creditTimer!=nil) {
[creditTimer invalidate];
[creditTimer release];
creditTimer = nil;
}
[connectionManager cancelAll];
[connectionManager release];
[user release];
[cookeStorage release];
[inbox release];
[contacts release];
[XPCURL release];
[XPCCD release];
[rnr_se release];
[userName release];
[userNumber release];
[userAreacode release];
[userPhoneNumbers release];
[checkTimer invalidate];
[checkTimer release];
checkTimer = nil;
[unreadCounts release];
[creditTimer invalidate];
[creditTimer release];
creditTimer = nil;
[super dealloc];
}
@ -125,16 +107,12 @@ const BOOL MGMInstanceInvisible = YES;
[contacts stop];
[inbox stop];
[connectionManager cancelAll];
if (checkTimer!=nil) {
[checkTimer invalidate];
[checkTimer release];
checkTimer = nil;
}
if (creditTimer!=nil) {
[creditTimer invalidate];
[creditTimer release];
creditTimer = nil;
}
[checkTimer invalidate];
[checkTimer release];
checkTimer = nil;
[creditTimer invalidate];
[creditTimer release];
creditTimer = nil;
}
- (void)registerSettings {
@ -323,7 +301,7 @@ const BOOL MGMInstanceInvisible = YES;
if (range.location==NSNotFound) {
NSLog(@"failed 0001");
} else {
if (rnr_se!=nil) [rnr_se release];
[rnr_se release];
rnr_se = [[[string substringWithRange:NSMakeRange(0, range.location)] addPercentEscapes] copy];
}
}
@ -364,7 +342,7 @@ const BOOL MGMInstanceInvisible = YES;
if (range.location==NSNotFound) {
NSLog(@"failed 0003.1");
} else {
if (userName!=nil) [userName release];
[userName release];
userName = [[string substringWithRange:NSMakeRange(0, range.location)] copy];
}
}
@ -406,7 +384,7 @@ const BOOL MGMInstanceInvisible = YES;
if (range.location==NSNotFound) {
NSLog(@"failed 0004.1");
} else {
if (userNumber!=nil) [userNumber release];
[userNumber release];
userNumber = [[[string substringWithRange:NSMakeRange(0, range.location)] phoneFormat] copy];
}
}
@ -420,7 +398,7 @@ const BOOL MGMInstanceInvisible = YES;
}
return;
}
if (userAreacode!=nil) [userAreacode release];
[userAreacode release];
userAreacode = [[userNumber areaCode] copy];
#if MGMInstanceDebug
NSLog(@"Google Number = %@", userNumber);
@ -441,7 +419,7 @@ const BOOL MGMInstanceInvisible = YES;
NSDictionary *phones = [phonesInfo parseJSON];
//NSLog(@"%@", phones);
NSArray *phoneKeys = [phones allKeys];
if (userPhoneNumbers!=nil) [userPhoneNumbers release];
[userPhoneNumbers release];
userPhoneNumbers = [NSMutableArray new];
for (int i=0; i<[phoneKeys count]; i++) {
NSDictionary *phoneInfo = [phones objectForKey:[phoneKeys objectAtIndex:i]];
@ -465,7 +443,7 @@ const BOOL MGMInstanceInvisible = YES;
if (range.location==NSNotFound) {
NSLog(@"failed 0008");
} else {
if (XPCURL!=nil) [XPCURL release];
[XPCURL release];
XPCURL = [[string substringWithRange:NSMakeRange(0, range.location)] copy];
}
}
@ -476,16 +454,12 @@ const BOOL MGMInstanceInvisible = YES;
if (delegate!=nil && [delegate respondsToSelector:@selector(loginSuccessful)]) [delegate loginSuccessful];
if (!checkingAccount) {
[contacts updateContacts];
if (checkTimer!=nil) {
[checkTimer invalidate];
[checkTimer release];
}
[checkTimer invalidate];
[checkTimer release];
checkTimer = [[NSTimer scheduledTimerWithTimeInterval:15.0 target:self selector:@selector(checkTimer) userInfo:nil repeats:YES] retain];
[checkTimer fire];
if (creditTimer!=nil) {
[creditTimer invalidate];
[creditTimer release];
}
[creditTimer invalidate];
[creditTimer release];
creditTimer = [[NSTimer scheduledTimerWithTimeInterval:60.0 target:self selector:@selector(creditTimer) userInfo:nil repeats:YES] retain];
[creditTimer fire];
}
@ -503,7 +477,7 @@ const BOOL MGMInstanceInvisible = YES;
range = [string rangeOfString:@"'"];
if (range.location==NSNotFound) NSLog(@"failed 0009");
if (XPCCD!=nil) [XPCCD release];
[XPCCD release];
XPCCD = [[[string substringWithRange:NSMakeRange(0, range.location)] addPercentEscapes] copy];
}
#if MGMInstanceDebug
@ -535,7 +509,7 @@ const BOOL MGMInstanceInvisible = YES;
if (delegate!=nil && [delegate respondsToSelector:@selector(updateVoicemail)]) [delegate updateVoicemail];
if (smsCount>0)
if (delegate!=nil && [delegate respondsToSelector:@selector(updateSMS)]) [delegate updateSMS];
if (unreadCounts!=nil) [unreadCounts release];
[unreadCounts release];
unreadCounts = [currentUnreadCounts copy];
}
}
@ -640,7 +614,9 @@ const BOOL MGMInstanceInvisible = YES;
}
}
} else {
NSDictionary *info = [NSDictionary dictionaryWithObject:[infoDic objectForKey:@"error"] forKey:NSLocalizedDescriptionKey];
NSDictionary *info = nil;
if ([infoDic objectForKey:@"error"]!=nil)
info = [NSDictionary dictionaryWithObject:[infoDic objectForKey:@"error"] forKey:NSLocalizedDescriptionKey];
NSError *error = [NSError errorWithDomain:@"com.MrGeckosMedia.VoiceBase.Call" code:1 userInfo:info];
NSDictionary *thisInfo = [theInfo objectForKey:MGMConnectionObject];
if ([thisInfo objectForKey:MGMIDidFailWithError]!=nil) {

View File

@ -22,6 +22,8 @@
@interface MGMSound : NSObject
#if TARGET_OS_IPHONE
<AVAudioPlayerDelegate>
#else
<NSSoundDelegate>
#endif
{
#if TARGET_OS_IPHONE

View File

@ -10,7 +10,7 @@
@implementation MGMSound
- (id)init {
if (self = [super init]) {
if ((self = [super init])) {
loops = NO;
}
return self;
@ -19,7 +19,7 @@
return [self initWithContentsOfURL:[NSURL fileURLWithPath:theFile]];
}
- (id)initWithContentsOfURL:(NSURL *)theURL {
if (self = [self init]) {
if ((self = [self init])) {
#if TARGET_OS_IPHONE
sound = [[AVAudioPlayer alloc] initWithContentsOfURL:theURL error:nil];
#else
@ -30,7 +30,7 @@
return self;
}
- (id)initWithData:(NSData *)theData {
if (self = [self init]) {
if ((self = [self init])) {
#if TARGET_OS_IPHONE
sound = [[AVAudioPlayer alloc] initWithData:theData error:nil];
#else
@ -41,11 +41,9 @@
return self;
}
- (void)dealloc {
if (sound!=nil) {
[sound setDelegate:nil];
[sound stop];
[sound release];
}
[sound setDelegate:nil];
[sound stop];
[sound release];
[super dealloc];
}

View File

@ -76,6 +76,7 @@ extern NSString * const MGMMP3Ext;
extern NSString * const MGMWavExt;
extern NSString * const MGMAuExt;
extern NSString * const MGMM4AExt;
extern NSString * const MGMCAFExt;
@interface MGMThemeManager : NSObject {
NSMutableDictionary *currentTheme;

View File

@ -108,10 +108,11 @@ NSString * const MGMMP3Ext = @"mp3";
NSString * const MGMWavExt = @"wav";
NSString * const MGMAuExt = @"au";
NSString * const MGMM4AExt = @"m4a";
NSString * const MGMCAFExt = @"caf";
@implementation MGMThemeManager
- (id)init {
if (self = [super init]) {
if ((self = [super init])) {
shouldPostNotification = NO;
[self registerDefaults];
if (![self setupCurrentTheme]) {
@ -128,8 +129,7 @@ NSString * const MGMM4AExt = @"m4a";
}
- (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self];
if (currentTheme!=nil)
[currentTheme release];
[currentTheme release];
[super dealloc];
}
@ -172,17 +172,25 @@ NSString * const MGMM4AExt = @"m4a";
- (NSDictionary *)sounds {
NSFileManager *manager = [NSFileManager defaultManager];
NSMutableDictionary *sounds = [NSMutableDictionary dictionary];
#if TARGET_IPHONE_SIMULATOR || TARGET_OS_MAC
NSMutableArray *systemSounds = [NSMutableArray array];
NSMutableArray *userSounds = [NSMutableArray array];
#endif
NSMutableArray *unknownSounds = [NSMutableArray array];
#if TARGET_IPHONE_SIMULATOR || TARGET_OS_MAC
NSString *systemSoundsPath = @"/System/Library/Sounds/";
NSString *userSoundsPath = [@"~/Library/Sounds/" stringByExpandingTildeInPath];
NSArray *allowedExtensions = [NSArray arrayWithObjects:MGMAiffExt, MGMAifExt, MGMMP3Ext, MGMWavExt, MGMAuExt, MGMM4AExt, nil];
NSArray *checkPaths = [NSArray arrayWithObjects:[self soundsFolderPath], [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:MGMTSoundsFolder], systemSoundsPath, userSoundsPath, nil];
#endif
NSArray *allowedExtensions = [NSArray arrayWithObjects:MGMAiffExt, MGMAifExt, MGMMP3Ext, MGMWavExt, MGMAuExt, MGMM4AExt, MGMCAFExt, nil];
NSArray *checkPaths = [NSArray arrayWithObjects:[self soundsFolderPath], [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:MGMTSoundsFolder]
#if TARGET_IPHONE_SIMULATOR || TARGET_OS_MAC
, systemSoundsPath, userSoundsPath
#endif
, nil];
for (int i=0; i<[checkPaths count]; i++) {
NSDirectoryEnumerator *soundFolders = [manager enumeratorAtPath:[checkPaths objectAtIndex:i]];
NSString *soundName = nil;
while (soundName = [soundFolders nextObject]) {
while ((soundName = [soundFolders nextObject])) {
NSString *path = [[[checkPaths objectAtIndex:i] stringByAppendingPathComponent:soundName] stringByResolvingSymlinksInPath];
if ([[[soundName pathExtension] lowercaseString] isEqual:MGMTSoundExt]) {
if (![manager fileExistsAtPath:[path stringByAppendingPathComponent:MGMTInfoPlist]])
@ -212,20 +220,27 @@ NSString * const MGMM4AExt = @"m4a";
NSMutableDictionary *sound = [NSMutableDictionary dictionary];
[sound setObject:[soundName stringByDeletingPathExtension] forKey:MGMTSName];
[sound setObject:path forKey:MGMTSPath];
if ([[checkPaths objectAtIndex:i] isEqual:systemSoundsPath])
#if TARGET_IPHONE_SIMULATOR || TARGET_OS_MAC
if ([[checkPaths objectAtIndex:i] isEqual:systemSoundsPath] && ![systemSounds containsObject:sound])
[systemSounds addObject:sound];
else if ([[checkPaths objectAtIndex:i] isEqual:userSoundsPath])
else if ([[checkPaths objectAtIndex:i] isEqual:userSoundsPath] && ![userSounds containsObject:sound])
[userSounds addObject:sound];
else
else if (![[checkPaths objectAtIndex:i] isEqual:systemSoundsPath] && ![[checkPaths objectAtIndex:i] isEqual:userSoundsPath] && ![unknownSounds containsObject:sound])
[unknownSounds addObject:sound];
#else
if (![unknownSounds containsObject:sound])
[unknownSounds addObject:sound];
#endif
}
}
}
#if TARGET_IPHONE_SIMULATOR || TARGET_OS_MAC
if ([systemSounds count]>0)
[sounds setObject:systemSounds forKey:@"System Sounds"];
if ([userSounds count]>0)
[sounds setObject:userSounds forKey:@"User Sounds"];
if ([unknownSounds count]>1)
#endif
[sounds setObject:unknownSounds forKey:@"Unknown"];
return sounds;
}
@ -255,7 +270,12 @@ NSString * const MGMM4AExt = @"m4a";
return path;
path = [path replace:MGMTPResource with:[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:MGMTSoundsFolder]];
path = [path replace:MGMTPSounds with:[self soundsFolderPath]];
return [path stringByAppendingPathComponent:[defaults objectForKey:[MGMTSName stringByAppendingString:theSoundName]]];
path = [path stringByAppendingPathComponent:[defaults objectForKey:[MGMTSName stringByAppendingString:theSoundName]]];
if (![[NSFileManager defaultManager] fileExistsAtPath:path]) {
[defaults setObject:MGMTNoSound forKey:[MGMTSPath stringByAppendingString:theSoundName]];
path = MGMTNoSound;
}
return path;
}
- (BOOL)setSound:(NSString *)theSoundName withPath:(NSString *)thePath {
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
@ -374,7 +394,7 @@ NSString * const MGMM4AExt = @"m4a";
for (int i=0; i<[checkPaths count]; i++) {
NSDirectoryEnumerator *themeFolders = [manager enumeratorAtPath:[checkPaths objectAtIndex:i]];
NSString *themeFolder = nil;
while (themeFolder = [themeFolders nextObject]) {
while ((themeFolder = [themeFolders nextObject])) {
if ([[[themeFolder pathExtension] lowercaseString] isEqual:MGMTThemeExt]) {
NSString *folder = [[[checkPaths objectAtIndex:i] stringByAppendingPathComponent:themeFolder] stringByResolvingSymlinksInPath];
if (![manager fileExistsAtPath:[folder stringByAppendingPathComponent:MGMTInfoPlist]])
@ -394,7 +414,7 @@ NSString * const MGMM4AExt = @"m4a";
}
- (BOOL)setTheme:(NSDictionary *)theTheme {
BOOL isNew = ![[theTheme objectForKey:MGMTThemePath] isEqual:[self currentThemePath]];
if (currentTheme!=nil) [currentTheme release];
[currentTheme release];
currentTheme = [theTheme mutableCopy];
NSFileManager<NSFileManagerProtocol> *manager = [NSFileManager defaultManager];
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];

View File

@ -30,6 +30,7 @@ extern NSString * const MGMSIPNameServersEnabled;
extern NSString * const MGMSIPEchoCacnellationEnabled;
extern NSString * const MGMSIPPort;
extern NSString * const MGMSIPPublicAddress;
extern NSString * const MGMSIPUserAgent;
extern NSString * const MGMNetworkConnectedNotification;
extern NSString * const MGMNetworkDisconnectedNotification;

View File

@ -38,6 +38,7 @@ NSString * const MGMSIPNameServersEnabled = @"MGMSIPNameServersEnabled";
NSString * const MGMSIPEchoCacnellationEnabled = @"MGMSIPEchoCacnellationEnabled";
NSString * const MGMSIPPort = @"MGMSIPPort";
NSString * const MGMSIPPublicAddress = @"MGMSIPPublicAddress";
NSString * const MGMSIPUserAgent = @"MGMSIPUserAgent";
NSString * const MGMNetworkConnectedNotification = @"MGMNetworkConnectedNotification";
NSString * const MGMNetworkDisconnectedNotification = @"MGMNetworkDisconnectedNotification";
@ -206,7 +207,8 @@ static void MGMSIPCallTransferStatusChanged(pjsua_call_id callIdentifier, int st
static void MGMSIPAccountRegistrationStateChanged(pjsua_acc_id accountIdentifier) {
NSAutoreleasePool *pool = [NSAutoreleasePool new];
MGMSIPAccount *account = [[MGMSIP sharedSIP] accountWithIdentifier:accountIdentifier];
if ([account delegate]!=nil && [[account delegate] respondsToSelector:@selector(registrationChanged)]) [(NSObject *)[account delegate] performSelectorOnMainThread:@selector(registrationChanged) withObject:nil waitUntilDone:NO];
[account registrationStateChanged];
if ([account delegate]!=nil && [[account delegate] respondsToSelector:@selector(registrationChanged)]) [(NSObject *)[account delegate] performSelectorOnMainThread:@selector(registrationChanged) withObject:nil waitUntilDone:YES];
[pool drain];
}
@ -265,7 +267,7 @@ static OSStatus MGMAudioDevicesChanged(AudioHardwarePropertyID propertyID, void
return MGMSIPSingleton;
}
- (id)init {
if (self = [super init]) {
if ((self = [super init])) {
[self registerDefaults];
port = [[NSUserDefaults standardUserDefaults] integerForKey:MGMSIPPort];
lock = [NSLock new];
@ -310,10 +312,8 @@ static OSStatus MGMAudioDevicesChanged(AudioHardwarePropertyID propertyID, void
if (store!=NULL)
CFRelease(store);
#endif
if (lock!=nil)
[lock release];
if (accounts!=nil)
[accounts release];
[lock release];
[accounts release];
[super dealloc];
}
@ -387,11 +387,9 @@ static OSStatus MGMAudioDevicesChanged(AudioHardwarePropertyID propertyID, void
if (state>MGMSIPStoppedState)
return;
if (restartTimer!=nil) {
[restartTimer invalidate];
[restartTimer release];
restartTimer = nil;
}
[restartTimer invalidate];
[restartTimer release];
restartTimer = nil;
[NSThread detachNewThreadSelector:@selector(startBackground) toTarget:self withObject:nil];
}
@ -431,7 +429,10 @@ static OSStatus MGMAudioDevicesChanged(AudioHardwarePropertyID propertyID, void
pjsua_config sipConfig;
pjsua_config_default(&sipConfig);
sipConfig.user_agent = [[NSString stringWithFormat:@"%@ %@", [[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString *)kCFBundleNameKey], [[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString *)kCFBundleVersionKey]] PJString];
if ([defaults objectForKey:MGMSIPUserAgent]==nil || [[defaults objectForKey:MGMSIPUserAgent] isEqual:@""])
sipConfig.user_agent = [[NSString stringWithFormat:@"%@ %@", [[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString *)kCFBundleNameKey], [[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString *)kCFBundleVersionKey]] PJString];
else
sipConfig.user_agent = [[defaults objectForKey:MGMSIPUserAgent] PJString];
sipConfig.cb.on_incoming_call = &MGMSIPIncomingCallReceived;
sipConfig.cb.on_call_media_state = &MGMSIPCallMediaStateChanged;
@ -454,7 +455,7 @@ static OSStatus MGMAudioDevicesChanged(AudioHardwarePropertyID propertyID, void
}
CFRelease(dynamicStore);
if ([nameServers count]>=0) {
if ([nameServers count]>0) {
sipConfig.nameserver_count = ([nameServers count]>4 ? 4 : [nameServers count]);
for (int i=0; i<[nameServers count] && i<4; i++)
sipConfig.nameserver[i] = [[nameServers objectAtIndex:i] PJString];
@ -541,7 +542,7 @@ static OSStatus MGMAudioDevicesChanged(AudioHardwarePropertyID propertyID, void
status = pjsua_transport_create(PJSIP_TRANSPORT_TCP, &transportConfig, &TCPTransport);
if (status!=PJ_SUCCESS) {
NSLog(@"Error creating TCP transport");
NSLog(@"Error creating tcp transport");
} else {
pjsua_acc_add_local(TCPTransport, PJ_TRUE, &TCPAccount);
pjsua_acc_set_online_status(pjsua_acc_get_default(), PJ_TRUE);
@ -646,11 +647,9 @@ static OSStatus MGMAudioDevicesChanged(AudioHardwarePropertyID propertyID, void
[pool drain];
}
- (void)startRestartTimer {
if (restartTimer!=nil) {
[restartTimer invalidate];
[restartTimer release];
restartTimer = nil;
}
[restartTimer invalidate];
[restartTimer release];
restartTimer = nil;
restartTimer = [[NSTimer scheduledTimerWithTimeInterval:5.0 target:self selector:@selector(start) userInfo:nil repeats:NO] retain];
}
- (void)restart {
@ -672,11 +671,9 @@ static OSStatus MGMAudioDevicesChanged(AudioHardwarePropertyID propertyID, void
#if !TARGET_OS_IPHONE
[self updateAudioDevices];
#endif
if (restartAccounts!=nil) {
[restartAccounts makeObjectsPerformSelector:@selector(login)];
[restartAccounts release];
restartAccounts = nil;
}
[restartAccounts makeObjectsPerformSelector:@selector(login)];
[restartAccounts release];
restartAccounts = nil;
}
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_4_0
@ -744,7 +741,12 @@ static OSStatus MGMAudioDevicesChanged(AudioHardwarePropertyID propertyID, void
else
accountConfig.id = [[NSString stringWithFormat:@"<sip:%@>", [theAccount SIPAddress]] PJString];
NSString *registerURI = [NSString stringWithFormat:@"sip:%@", [theAccount registrar]];
accountConfig.reg_uri = [[registerURI stringByAppendingString:@";transport=tcp"] PJString];
NSString *transport = @"";
if ([theAccount transport]==1)
transport = @";transport=tcp";
else if ([theAccount transport]==2)
transport = @";transport=udp";
accountConfig.reg_uri = [[registerURI stringByAppendingString:transport] PJString];
if ([theAccount proxy]!=nil && ![[theAccount proxy] isEqual:@""]) {
accountConfig.proxy_cnt = 1;
@ -762,17 +764,13 @@ static OSStatus MGMAudioDevicesChanged(AudioHardwarePropertyID propertyID, void
pjsua_acc_id identifier;
pj_status_t status = pjsua_acc_add(&accountConfig, PJ_FALSE, &identifier);
if (status!=PJ_SUCCESS) {
accountConfig.reg_uri = [registerURI PJString];
pj_status_t status = pjsua_acc_add(&accountConfig, PJ_FALSE, &identifier);
if (status!=PJ_SUCCESS) {
[theAccount setLastError:[NSString stringWithFormat:@"Unable to login with status %d.", status]];
[theAccount loginErrored];
NSLog(@"Error With Account %@: %@", theAccount, [theAccount lastError]);
[accounts removeObject:theAccount];
bzero(&PJThreadDesc, sizeof(pj_thread_desc));
[pool drain];
return;
}
[theAccount setLastError:[NSString stringWithFormat:@"Unable to login with status %d.", status]];
[theAccount loginErrored];
NSLog(@"Error With Account %@: %@", theAccount, [theAccount lastError]);
[accounts removeObject:theAccount];
bzero(&PJThreadDesc, sizeof(pj_thread_desc));
[pool drain];
return;
}
[theAccount setIdentifier:identifier];
[theAccount setOnline:YES];
@ -837,7 +835,7 @@ static OSStatus MGMAudioDevicesChanged(AudioHardwarePropertyID propertyID, void
}
}
if ([accounts count]<=1)
return [[accounts objectAtIndex:0] identifier];
return [(MGMSIPAccount *)[accounts objectAtIndex:0] identifier];
return PJSUA_INVALID_ID;
}
- (MGMSIPAccount *)accountWithIdentifier:(pjsua_acc_id)theIdentifier {
@ -1073,7 +1071,7 @@ static OSStatus MGMAudioDevicesChanged(AudioHardwarePropertyID propertyID, void
}
free(devices);
if (audioDevices!=nil) [audioDevices release];
[audioDevices release];
audioDevices = [devicesArray copy];
//if ((currentInput==-1 ? defaultInputIndex!=lastInputDevice : currentInput!=lastInputDevice) && (currentOutput==-1 ? defaultOutputIndex!=lastOutputDevice : currentOutput!=lastOutputDevice)) {

View File

@ -22,6 +22,8 @@ extern NSString * const MGMSIPAccountSIPAddress;
extern NSString * const MGMSIPAccountProxy;
extern NSString * const MGMSIPAccountProxyPort;
extern NSString * const MGMSIPAccountRegisterTimeout;
extern NSString * const MGMSIPAccountTransport;
extern NSString * const MGMSIPAccountDTMFToneType;
extern const int MGMSIPAccountDefaultProxyPort;
@class MGMSIPCall, MGMSIPURL;
@ -49,8 +51,11 @@ extern const int MGMSIPAccountDefaultProxyPort;
int proxyPort;
int reregisterTimeout;
NSTimer *reregisterTimer;
int transport;
int dtmfToneType;
pjsua_acc_id identifier;
BOOL registered;
NSMutableArray *calls;
@ -79,6 +84,10 @@ extern const int MGMSIPAccountDefaultProxyPort;
- (void)setProxyPort:(int)theProxyPort;
- (int)reregisterTimeout;
- (void)setReregisterTimeout:(int)theReregisterTimeout;
- (int)transport;
- (void)setTransport:(int)theTransport;
- (int)dtmfToneType;
- (void)setDTMFToneType:(int)theType;
- (pjsua_acc_id)identifier;
- (void)setIdentifier:(pjsua_acc_id)theIdentifier;
- (NSString *)password;
@ -93,6 +102,7 @@ extern const int MGMSIPAccountDefaultProxyPort;
- (void)logout;
- (void)logoutErrored;
- (void)registrationStateChanged;
- (BOOL)isRegistered;
- (void)reregister;
- (void)setRegistered:(BOOL)isRegistered;

View File

@ -21,6 +21,9 @@ NSString * const MGMSIPAccountSIPAddress = @"MGMSIPAccountSIPAddress";
NSString * const MGMSIPAccountProxy = @"MGMSIPAccountProxy";
NSString * const MGMSIPAccountProxyPort = @"MGMSIPAccountProxyPort";
NSString * const MGMSIPAccountRegisterTimeout = @"MGMSIPAccountRegisterTimeout";
NSString * const MGMSIPAccountTransport = @"MGMSIPAccountTransport";
NSString * const MGMSIPAccountDTMFToneType = @"MGMSIPAccountDTMFToneType";
const int MGMSIPAccountDefaultProxyPort = 5060;
const int MGMSIPAccountReregisterTimeoutMin = 60;
@ -29,7 +32,7 @@ const int MGMSIPAccountReregisterTimeoutDefault = 300;
@implementation MGMSIPAccount
- (id)initWithSettings:(NSDictionary *)theSettings {
if (self = [self init]) {
if ((self = [self init])) {
if ([theSettings objectForKey:MGMSIPAccountUserName]==nil || [[theSettings objectForKey:MGMSIPAccountUserName] isEqual:@""] || [theSettings objectForKey:MGMSIPAccountDomain]==nil || [[theSettings objectForKey:MGMSIPAccountDomain] isEqual:@""]) {
[self release];
self = nil;
@ -50,6 +53,14 @@ const int MGMSIPAccountReregisterTimeoutDefault = 300;
proxyPort = 0;
if ([theSettings objectForKey:MGMSIPAccountRegisterTimeout]!=nil && [[theSettings objectForKey:MGMSIPAccountRegisterTimeout] intValue]!=0)
reregisterTimeout = [[theSettings objectForKey:MGMSIPAccountRegisterTimeout] intValue];
if ([theSettings objectForKey:MGMSIPAccountTransport]!=nil)
transport = [[theSettings objectForKey:MGMSIPAccountTransport] intValue];
#if TARGET_OS_IPHONE
else
transport = 1;
#endif
if ([theSettings objectForKey:MGMSIPAccountDTMFToneType]!=nil)
dtmfToneType = [[theSettings objectForKey:MGMSIPAccountDTMFToneType] intValue];
}
}
return self;
@ -74,31 +85,24 @@ const int MGMSIPAccountReregisterTimeoutDefault = 300;
return [self initWithSettings:settings];
}
- (id)init {
if (self = [super init]) {
if ((self = [super init])) {
reregisterTimeout = MGMSIPAccountReregisterTimeoutDefault;
identifier = PJSUA_INVALID_ID;
registered = NO;
calls = [NSMutableArray new];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(networkConnected:) name:MGMNetworkConnectedNotification object:nil];
}
return self;
}
- (void)dealloc {
NSLog(@"Releasing SIP Account");
[[NSNotificationCenter defaultCenter] removeObserver:self];
if (calls!=nil)
[calls release];
if (fullName!=nil)
[fullName release];
if (userName!=nil)
[userName release];
if (domain!=nil)
[domain release];
if (registrar!=nil)
[registrar release];
if (SIPAddress!=nil)
[SIPAddress release];
if (proxy!=nil)
[proxy release];
[calls release];
[fullName release];
[userName release];
[domain release];
[registrar release];
[SIPAddress release];
[proxy release];
[super dealloc];
}
@ -118,7 +122,7 @@ const int MGMSIPAccountReregisterTimeoutDefault = 300;
return fullName;
}
- (void)setFullName:(NSString *)theFullName {
if (fullName!=nil) [fullName release];
[fullName release];
fullName = [theFullName copy];
}
- (NSString *)userName {
@ -126,14 +130,14 @@ const int MGMSIPAccountReregisterTimeoutDefault = 300;
}
- (void)setUserName:(NSString *)theUserName {
if (theUserName==nil || [theUserName isEqual:@""]) return;
if (userName!=nil) [userName release];
[userName release];
userName = [theUserName copy];
}
- (NSString *)domain {
return domain;
}
- (void)setDomain:(NSString *)theDomain {
if (domain!=nil) [domain release];
[domain release];
domain = [theDomain copy];
}
- (NSString *)registrar {
@ -141,7 +145,7 @@ const int MGMSIPAccountReregisterTimeoutDefault = 300;
return registrar;
}
- (void)setRegistrar:(NSString *)theRegistrar {
if (registrar!=nil) [registrar release];
[registrar release];
registrar = [theRegistrar copy];
}
- (NSString *)SIPAddress {
@ -150,14 +154,14 @@ const int MGMSIPAccountReregisterTimeoutDefault = 300;
return SIPAddress;
}
- (void)setSIPAddress:(NSString *)theSIPAddress {
if (SIPAddress!=nil) [SIPAddress release];
[SIPAddress release];
SIPAddress = [theSIPAddress copy];
}
- (NSString *)proxy {
return proxy;
}
- (void)setProxy:(NSString *)theProxy {
if (proxy!=nil) [proxy release];
[proxy release];
proxy = [theProxy copy];
}
- (int)proxyPort {
@ -180,6 +184,18 @@ const int MGMSIPAccountReregisterTimeoutDefault = 300;
else
reregisterTimeout = theReregisterTimeout;
}
- (int)transport {
return transport;
}
- (void)setTransport:(int)theTransport {
transport = theTransport;
}
- (int)dtmfToneType {
return dtmfToneType;
}
- (void)setDTMFToneType:(int)theType {
dtmfToneType = theType;
}
- (pjsua_acc_id)identifier {
return identifier;
}
@ -210,11 +226,13 @@ const int MGMSIPAccountReregisterTimeoutDefault = 300;
[settings setObject:[NSNumber numberWithInt:proxyPort] forKey:MGMSIPAccountProxyPort];
if (reregisterTimeout!=0)
[settings setObject:[NSNumber numberWithInt:reregisterTimeout] forKey:MGMSIPAccountRegisterTimeout];
[settings setObject:[NSNumber numberWithInt:transport] forKey:MGMSIPAccountTransport];
[settings setObject:[NSNumber numberWithInt:dtmfToneType] forKey:MGMSIPAccountDTMFToneType];
return settings;
}
- (void)setLastError:(NSString *)theError {
if (lastError!=nil) [lastError release];
[lastError release];
lastError = [theError copy];
}
- (NSString *)lastError {
@ -237,8 +255,11 @@ const int MGMSIPAccountReregisterTimeoutDefault = 300;
if (delegate!=nil && [delegate respondsToSelector:@selector(logoutErrored)]) [delegate logoutErrored];
}
- (void)registrationStateChanged {
registered = (([self registrationStatus]/100)==2 && [self registrationExpireTime]>0);
}
- (BOOL)isRegistered {
return (([self registrationStatus]/100)==2 && [self registrationExpireTime]>0);
return registered;
}
- (void)reregister {
[self setRegistered:YES];
@ -324,11 +345,9 @@ const int MGMSIPAccountReregisterTimeoutDefault = 300;
pj_status_t status = pjsua_acc_set_online_status(identifier, (isOnline ? PJ_TRUE : PJ_FALSE));
if (status==PJ_SUCCESS) {
if (reregisterTimer!=nil) {
[reregisterTimer invalidate];
[reregisterTimer release];
reregisterTimer = nil;
}
[reregisterTimer invalidate];
[reregisterTimer release];
reregisterTimer = nil;
if (isOnline)
reregisterTimer = [[NSTimer scheduledTimerWithTimeInterval:(float)reregisterTimeout target:self selector:@selector(reregister) userInfo:nil repeats:YES] retain];
}

View File

@ -16,7 +16,7 @@
@implementation MGMSIPCall
- (id)initWithIdentifier:(pjsua_call_id)theIdentifier account:(MGMSIPAccount *)theAccount {
if (self = [super init]) {
if ((self = [super init])) {
account = theAccount;
identifier = theIdentifier;
@ -52,18 +52,12 @@
if (isRingbackOn)
[self stopRingback];
[self hangUp];
if (remoteURL!=nil)
[remoteURL release];
if (localURL!=nil)
[localURL release];
if (stateText!=nil)
[stateText release];
if (lastStatusText!=nil)
[lastStatusText release];
if (transferStatusText!=nil)
[transferStatusText release];
if (holdMusicPath!=nil)
[holdMusicPath release];
[remoteURL release];
[localURL release];
[stateText release];
[lastStatusText release];
[transferStatusText release];
[holdMusicPath release];
if (toneGenSlot!=PJSUA_INVALID_ID) {
pjsua_conf_remove_port(toneGenSlot);
pjmedia_port_destroy(toneGenPort);
@ -110,9 +104,9 @@
if (isRingbackOn)
[self stopRingback];
if (holdMusicPlayer!=PJSUA_INVALID_ID)
[self performSelectorOnMainThread:@selector(stopHoldMusic) withObject:nil waitUntilDone:NO];
[self performSelectorOnMainThread:@selector(stopHoldMusic) withObject:nil waitUntilDone:YES];
if (recorderID!=PJSUA_INVALID_ID)
[self performSelectorOnMainThread:@selector(stopRecordingMain) withObject:nil waitUntilDone:NO];
[self performSelectorOnMainThread:@selector(stopRecordingMain) withObject:nil waitUntilDone:YES];
}
state = theState;
}
@ -120,7 +114,7 @@
return stateText;
}
- (void)setStateText:(NSString *)theStateText {
if (stateText!=nil) [stateText release];
[stateText release];
stateText = [theStateText copy];
}
- (int)lastStatus {
@ -133,7 +127,7 @@
return lastStatusText;
}
- (void)setLastStatusText:(NSString *)theLastStatusText {
if (lastStatusText!=nil) [lastStatusText release];
[lastStatusText release];
lastStatusText = [theLastStatusText copy];
}
- (int)transferStatus {
@ -146,7 +140,7 @@
return transferStatusText;
}
- (void)setTransferStatusText:(NSString *)theTransferStatusText {
if (transferStatusText!=nil) [transferStatusText release];
[transferStatusText release];
transferStatusText = [theTransferStatusText copy];
}
- (BOOL)isIncoming {
@ -207,7 +201,7 @@
return (callInfo.media_status==PJSUA_CALL_MEDIA_REMOTE_HOLD);
}
- (void)setHoldMusicPath:(NSString *)thePath {
if (holdMusicPath!=nil) [holdMusicPath release];
[holdMusicPath release];
holdMusicPath = [thePath copy];
}
- (void)hold {
@ -220,12 +214,12 @@
onHold = YES;
pjsua_conf_disconnect(0, conf_port);
pjsua_conf_adjust_rx_level(conf_port, 0);
[self performSelectorOnMainThread:@selector(startHoldMusic) withObject:nil waitUntilDone:NO];
[self performSelectorOnMainThread:@selector(startHoldMusic) withObject:nil waitUntilDone:YES];
} else {
onHold = NO;
pjsua_conf_connect(0, conf_port);
pjsua_conf_adjust_rx_level(conf_port, [[MGMSIP sharedSIP] micVolume]);
[self performSelectorOnMainThread:@selector(stopHoldMusic) withObject:nil waitUntilDone:NO];
[self performSelectorOnMainThread:@selector(stopHoldMusic) withObject:nil waitUntilDone:YES];
}
}
bzero(&PJThreadDesc, sizeof(pj_thread_desc));
@ -331,15 +325,17 @@
if (identifier==PJSUA_INVALID_ID || state!=MGMSIPCallConfirmedState)
return;
BOOL sendSuccessful = NO;
pj_thread_desc PJThreadDesc;
[[MGMSIP sharedSIP] registerThread:&PJThreadDesc];
pj_str_t digits = [theDigits PJString];
pj_status_t status = pjsua_call_dial_dtmf(identifier, &digits);
sendSuccessful = (status==PJ_SUCCESS);
if (!sendSuccessful) {
NSLog(@"%@", theDigits);
if ([account dtmfToneType]==0) {
pj_str_t digits = [theDigits PJString];
pj_status_t status = pjsua_call_dial_dtmf(identifier, &digits);
if (status!=PJ_SUCCESS)
NSLog(@"Unable to send DTMF tone.");
} else if ([account dtmfToneType]==1) {
const pj_str_t INFO = pj_str("INFO");
for (unsigned int i=0; i<[theDigits length]; i++) {
pjsua_msg_data messageData;
@ -347,8 +343,9 @@
messageData.content_type = pj_str("application/dtmf-relay");
messageData.msg_body = [[NSString stringWithFormat:@"Signal=%C\r\nDuration=300", [theDigits characterAtIndex:i]] PJString];
status = pjsua_call_send_request(identifier, &INFO, &messageData);
sendSuccessful = (status==PJ_SUCCESS);
pj_status_t status = pjsua_call_send_request(identifier, &INFO, &messageData);
if (status!=PJ_SUCCESS)
NSLog(@"Unable to send DTMF tone.");
}
}
@ -366,22 +363,22 @@
pjsua_conf_connect(toneGenSlot, 0);
}
}
if (!sendSuccessful)
if ([account dtmfToneType]==2) {
NSLog(@"Using Tone Generator.");
pjsua_conf_connect(toneGenSlot, pjsua_call_get_conf_port(identifier));
}
for (unsigned int i=0; i<[theDigits length]; i++) {
pjmedia_tonegen_stop(toneGenPort);
pjmedia_tone_digit digit[1];
digit[0].digit = [theDigits characterAtIndex:i];
digit[0].on_msec = 100;
digit[0].off_msec = 100;
digit[0].on_msec = 300;
digit[0].off_msec = 300;
digit[0].volume = 16383;
pjmedia_tonegen_play_digits(toneGenPort, 1, digit, 0);
if ([theDigits length]!=1 && (i+1)<[theDigits length]) [NSThread sleepUntilDate:[NSDate dateWithTimeIntervalSinceNow:1]];
}
if (!sendSuccessful)
pjsua_conf_disconnect(toneGenSlot, pjsua_call_get_conf_port(identifier));
bzero(&PJThreadDesc, sizeof(pj_thread_desc));
}
- (void)receivedDTMFDigit:(int)theDigit {
@ -393,7 +390,23 @@
pj_thread_desc PJThreadDesc;
[[MGMSIP sharedSIP] registerThread:&PJThreadDesc];
if (toneGenSlot==PJSUA_INVALID_ID) {
pjsua_media_config mediaConfig = [[MGMSIP sharedSIP] mediaConfig];
unsigned int samplesPerFrame = mediaConfig.audio_frame_ptime * mediaConfig.clock_rate * mediaConfig.channel_count / 1000;
pj_status_t status = pjmedia_tonegen_create([[MGMSIP sharedSIP] PJPool], mediaConfig.clock_rate, mediaConfig.channel_count, samplesPerFrame, 16, 0, &toneGenPort);
if (status!=PJ_SUCCESS) {
NSLog(@"Error creating tone generator");
} else {
status = pjsua_conf_add_port([[MGMSIP sharedSIP] PJPool], toneGenPort, &toneGenSlot);
if (status!=PJ_SUCCESS)
NSLog(@"Error adding tone generator");
else
pjsua_conf_connect(toneGenSlot, 0);
}
}
pjmedia_tonegen_stop(toneGenPort);
pjsua_conf_disconnect(toneGenSlot, pjsua_call_get_conf_port(identifier));
pjmedia_tone_digit digit[1];
digit[0].digit = theDigit;

View File

@ -14,7 +14,7 @@
return [[[self alloc] initWithFullName:theFullName userName:theUserName host:theHost] autorelease];
}
- (id)initWithFullName:(NSString *)theFullName userName:(NSString *)theUserName host:(NSString *)theHost {
if (self = [super init]) {
if ((self = [super init])) {
if (theHost==nil || [theHost isEqual:@""]) {
[self release];
self = nil;
@ -37,7 +37,7 @@
return [[[self alloc] initWithSIPID:theSIPID] autorelease];
}
- (id)initWithSIPID:(NSString *)theSIPID {
if (self = [super init]) {
if ((self = [super init])) {
NSString *fullNameString, *addressString;
NSRange range = [theSIPID rangeOfString:@"<sip:"];
if (range.location==NSNotFound) {
@ -72,12 +72,9 @@
return self;
}
- (void)dealloc {
if (fullName!=nil)
[fullName release];
if (userName!=nil)
[userName release];
if (host!=nil)
[host release];
[fullName release];
[userName release];
[host release];
[super dealloc];
}

View File

@ -21,7 +21,7 @@
return [self initWithData:data options:mask error:error];
}
- (id)initWithData:(NSData *)data options:(NSUInteger)mask error:(NSError **)error {
if (self = [super init]) {
if ((self = [super init])) {
if (data==nil || [data length]<=0) {
if (error!=nil) *error = [NSError errorWithDomain:MGMXMLErrorDomain code:0 userInfo:[NSDictionary dictionaryWithObject:@"Data has no length." forKey:NSLocalizedDescriptionKey]];
[self release];

View File

@ -39,7 +39,7 @@ static void MGMXMLErrorHandler(void *userData, xmlErrorPtr error) {
}
- (id)init {
if (self = [super init]) {
if ((self = [super init])) {
commonXML = NULL;
namespaceXML = NULL;
parentNode = NULL;
@ -51,7 +51,7 @@ static void MGMXMLErrorHandler(void *userData, xmlErrorPtr error) {
return [[[self alloc] initWithTypeXMLPtr:theXMLPtr] autorelease];
}
- (id)initWithTypeXMLPtr:(xmlTypPtr)theXMLPtr {
if (self = [self init]) {
if ((self = [self init])) {
if (theXMLPtr->type==MGMXMLNamespaceKind) {
xmlNsPtr xmlPtr = (xmlNsPtr)theXMLPtr;
if (xmlPtr->_private!=NULL) {
@ -229,10 +229,8 @@ static void MGMXMLErrorHandler(void *userData, xmlErrorPtr error) {
}
}
- (void)releaseDocument {
if (documentNode!=nil) {
[documentNode release];
documentNode = nil;
}
[documentNode release];
documentNode = nil;
}
+ (BOOL)isNode:(MGMXMLNodeKind)theType {
switch (theType) {

View File

@ -10,7 +10,7 @@
@class MGMInstance, MGMURLConnectionManager, QTMovieView;
@interface MGMInboxPlayWindow : NSWindow {
@interface MGMInboxPlayWindow : NSWindow <NSWindowDelegate> {
MGMInstance *instance;
MGMURLConnectionManager *connectionManager;
IBOutlet NSView *view;

View File

@ -14,7 +14,7 @@
@implementation MGMInboxPlayWindow
- (id)initWithNibNamed:(NSString *)theNib data:(NSDictionary *)theData instance:(MGMInstance *)theInstance {
if (self = [super initWithContentRect:NSMakeRect(34, 34, 0, 0) styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:YES]) {
if ((self = [super initWithContentRect:NSMakeRect(34, 34, 0, 0) styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:YES])) {
if (![NSBundle loadNibNamed:theNib owner:self]) {
NSLog(@"Unable to load nib for the Play Window");
[self release];
@ -63,8 +63,7 @@
}
- (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self];
if (connectionManager!=nil)
[connectionManager release];
[connectionManager release];
[super dealloc];
}
@ -118,10 +117,8 @@
return [NSColor colorWithPatternImage:[bg autorelease]];
}
- (void)windowDidResignKey:(NSNotification *)notification {
if (connectionManager!=nil)
[connectionManager cancelAll];
if (audioPlayer!=nil)
[audioPlayer setMovie:nil];
[connectionManager cancelAll];
[audioPlayer setMovie:nil];
[self setContentView:nil];
[view release];
[self close];

View File

@ -43,6 +43,8 @@
- (void)checkVoicemail;
- (BOOL)outlineView:(NSOutlineView *)outlineView shouldSelectItem:(id)item;
- (IBAction)next:(id)sender;
- (IBAction)previous:(id)sender;

View File

@ -27,7 +27,7 @@ NSString * const MGMSID = @"id";
return [[[self alloc] initWithInstance:theInstance] autorelease];
}
- (id)initWithInstance:(MGMInstance *)theInstance {
if (self = [super init]) {
if ((self = [super init])) {
if (sideItems==nil) {
sideItems = [NSMutableArray new];
[sideItems addObject:[NSDictionary dictionaryWithObjectsAndKeys:@"Inbox", MGMSName, [NSNumber numberWithBool:YES], MGMSSelectable, [NSNumber numberWithInt:0], MGMSID, nil]];
@ -62,10 +62,8 @@ NSString * const MGMSID = @"id";
[sidebarView setAutosaveExpandedItems:YES];
}
- (void)dealloc {
if (inboxWindow!=nil)
[inboxWindow close];
if (currentData!=nil)
[currentData release];
[inboxWindow close];
[currentData release];
[super dealloc];
}
@ -125,22 +123,17 @@ NSString * const MGMSID = @"id";
[inboxWindow makeKeyAndOrderFront:self];
}
- (void)closeWindow {
if (inboxWindow!=nil)
[inboxWindow close];
[inboxWindow close];
}
- (void)startProgress {
if (progress!=nil) {
if (progressStartCount==0)
[progress startAnimation:self];
}
if (progressStartCount==0)
[progress startAnimation:self];
progressStartCount++;
}
- (void)stopProgress {
if (progress!=nil) {
if (progressStartCount==1)
[progress stopAnimation:self];
}
if (progressStartCount==1)
[progress stopAnimation:self];
progressStartCount--;
}
@ -162,7 +155,7 @@ NSString * const MGMSID = @"id";
}
}
if (newMessage) {
if (lastDate!=nil) [lastDate release];
[lastDate release];
lastDate = [newestDate copy];
[self setCurrentData:theMessages];
[self showWindow:self];
@ -266,7 +259,7 @@ NSString * const MGMSID = @"id";
return currentInbox;
}
- (void)setCurrentData:(NSArray *)theData {
if (currentData!=nil) [currentData release];
[currentData release];
currentData = [theData mutableCopy];
resultsCount = [currentData count];

View File

@ -32,7 +32,7 @@ NSString * const MGMSIPDefaultDomain = @"proxy01.sipphone.com";
@implementation MGMAccountSetup
- (id)init {
if (self = [super init]) {
if ((self = [super init])) {
if (![NSBundle loadNibNamed:@"AccountSetup" owner:self]) {
NSLog(@"Unable to load Account Set Up!");
[self release];
@ -49,22 +49,15 @@ NSString * const MGMSIPDefaultDomain = @"proxy01.sipphone.com";
return self;
}
- (void)dealloc {
if (setupWindow!=nil)
[setupWindow release];
if (accountsCreated!=nil)
[accountsCreated release];
if (S7CheckUser!=nil)
[S7CheckUser release];
if (S7CheckInstance!=nil)
[S7CheckInstance release];
if (S7ConnectionManager!=nil)
[S7ConnectionManager release];
[setupWindow release];
[accountsCreated release];
[S7CheckUser release];
[S7CheckInstance release];
[S7ConnectionManager release];
#if MGMSIPENABLED
if (S7CheckSIPAccount!=nil)
[S7CheckSIPAccount release];
[S7CheckSIPAccount release];
#endif
if (S8Message!=nil)
[S8Message release];
[S8Message release];
[super dealloc];
}
@ -155,10 +148,8 @@ NSString * const MGMSIPDefaultDomain = @"proxy01.sipphone.com";
[continueButton setTitle:MGMSContinue];
[continueButton setEnabled:NO];
[S8MessageField setStringValue:[NSString stringWithFormat:@"Unable to set up your %@ account, the error we receviced was \"%@\" Please go back and correct the problem.", type, S8Message]];
if (S8Message!=nil) {
[S8Message release];
S8Message = nil;
}
[S8Message release];
S8Message = nil;
NSBeep();
break;
}
@ -324,15 +315,11 @@ NSString * const MGMSIPDefaultDomain = @"proxy01.sipphone.com";
S7CheckInstance = [[MGMInstance instanceWithUser:S7CheckUser delegate:self isCheck:YES] retain];
}
- (void)loginError:(NSError *)theError {
if (S7CheckUser!=nil) {
[S7CheckUser remove];
[S7CheckUser release];
S7CheckUser = nil;
}
if (S7CheckInstance!=nil) {
[S7CheckInstance release];
S7CheckInstance = nil;
}
[S7CheckUser remove];
[S7CheckUser release];
S7CheckUser = nil;
[S7CheckInstance release];
S7CheckInstance = nil;
NSLog(@"Login Failed %@", theError);
S8Message = [[theError localizedDescription] copy];
step = 8;
@ -347,10 +334,8 @@ NSString * const MGMSIPDefaultDomain = @"proxy01.sipphone.com";
[S7CheckUser release];
S7CheckUser = nil;
}
if (S7CheckInstance!=nil) {
[S7CheckInstance release];
S7CheckInstance = nil;
}
[S7CheckInstance release];
S7CheckInstance = nil;
[self S4Reset];
step = 9;
[self displayStep];
@ -373,13 +358,10 @@ NSString * const MGMSIPDefaultDomain = @"proxy01.sipphone.com";
[S7ConnectionManager connectionWithRequest:request delegate:self didFailWithError:@selector(authentication:didFailWithError:) didFinish:@selector(authenticationDidFinish:) invisible:NO object:nil];
}
- (void)authentication:(NSDictionary *)theInfo didFailWithError:(NSError *)theError {
if (S7CheckUser!=nil) {
[S7CheckUser remove];
[S7CheckUser release];
S7CheckUser = nil;
}
if (S7ConnectionManager!=nil)
[S7ConnectionManager setCookieStorage:nil];
[S7CheckUser remove];
[S7CheckUser release];
S7CheckUser = nil;
[S7ConnectionManager setCookieStorage:nil];
NSLog(@"Login Failed %@", theError);
S8Message = [[theError localizedDescription] copy];
step = 8;
@ -387,22 +369,19 @@ NSString * const MGMSIPDefaultDomain = @"proxy01.sipphone.com";
}
- (void)authenticationDidFinish:(NSDictionary *)theInfo {
NSDictionary *info = [MGMGoogleContacts dictionaryWithData:[theInfo objectForKey:MGMConnectionData]];
if (S7ConnectionManager!=nil)
[S7ConnectionManager setCookieStorage:nil];
if (S7CheckUser!=nil) {
if ([info objectForKey:@"Error"]!=nil) {
[S7CheckUser remove];
[S7CheckUser release];
S7CheckUser = nil;
S8Message = [@"Unable to login. Please check your Credentials." retain];
step = 8;
[self displayStep];
return;
}
[S7CheckUser done];
[S7ConnectionManager setCookieStorage:nil];
if ([info objectForKey:@"Error"]!=nil) {
[S7CheckUser remove];
[S7CheckUser release];
S7CheckUser = nil;
S8Message = [@"Unable to login. Please check your Credentials." retain];
step = 8;
[self displayStep];
return;
}
[S7CheckUser done];
[S7CheckUser release];
S7CheckUser = nil;
[self S5Reset];
step = 9;
@ -441,22 +420,18 @@ NSString * const MGMSIPDefaultDomain = @"proxy01.sipphone.com";
}
- (void)S7RegistrationChanged {
#if MGMSIPENABLED
if (S7SIPRegistrationTimeout!=nil) {
[S7SIPRegistrationTimeout invalidate];
[S7SIPRegistrationTimeout release];
S7SIPRegistrationTimeout = nil;
}
if (S7CheckSIPAccount!=nil) {
if (![S7CheckSIPAccount isRegistered]) {
[S7CheckSIPAccount setLastError:@"Unable to Register with Server. Please check your credentials."];
[self loginErrored];
return;
}
[S7CheckSIPAccount setDelegate:nil];
[S7CheckSIPAccount logout];
[S7CheckSIPAccount release];
S7CheckSIPAccount = nil;
[S7SIPRegistrationTimeout invalidate];
[S7SIPRegistrationTimeout release];
S7SIPRegistrationTimeout = nil;
if (![S7CheckSIPAccount isRegistered]) {
[S7CheckSIPAccount setLastError:@"Unable to Register with Server. Please check your credentials."];
[self loginErrored];
return;
}
[S7CheckSIPAccount setDelegate:nil];
[S7CheckSIPAccount logout];
[S7CheckSIPAccount release];
S7CheckSIPAccount = nil;
if (S7CheckUser!=nil) {
[accountsCreated addObject:S7CheckUser];
[S7CheckUser release];
@ -470,11 +445,9 @@ NSString * const MGMSIPDefaultDomain = @"proxy01.sipphone.com";
}
#if MGMSIPENABLED
- (void)S7SIPTimeout {
if (S7SIPRegistrationTimeout!=nil) {
[S7SIPRegistrationTimeout invalidate];
[S7SIPRegistrationTimeout release];
S7SIPRegistrationTimeout = nil;
}
[S7SIPRegistrationTimeout invalidate];
[S7SIPRegistrationTimeout release];
S7SIPRegistrationTimeout = nil;
[S7CheckSIPAccount setLastError:@"Registration Timeout."];
[self loginErrored];
}
@ -487,19 +460,15 @@ NSString * const MGMSIPDefaultDomain = @"proxy01.sipphone.com";
S7SIPRegistrationTimeout = [[NSTimer scheduledTimerWithTimeInterval:10.0 target:self selector:@selector(S7SIPTimeout) userInfo:nil repeats:NO] retain];
}
- (void)loginErrored {
if (S7CheckUser!=nil) {
[S7CheckUser remove];
[S7CheckUser release];
S7CheckUser = nil;
}
if (S7CheckSIPAccount!=nil) {
NSLog(@"Login Failed %@", [S7CheckSIPAccount lastError]);
S8Message = [[S7CheckSIPAccount lastError] copy];
[S7CheckSIPAccount setDelegate:nil];
[S7CheckSIPAccount logout];
[S7CheckSIPAccount release];
S7CheckSIPAccount = nil;
}
[S7CheckUser remove];
[S7CheckUser release];
S7CheckUser = nil;
NSLog(@"Login Failed %@", [S7CheckSIPAccount lastError]);
S8Message = [[S7CheckSIPAccount lastError] copy];
[S7CheckSIPAccount setDelegate:nil];
[S7CheckSIPAccount logout];
[S7CheckSIPAccount release];
S7CheckSIPAccount = nil;
step = 8;
[self displayStep];
}

View File

@ -10,17 +10,15 @@
@implementation MGMBadge
- (id)init {
if (self = [super init]) {
if ((self = [super init])) {
applicationIcon = [[[NSApplication sharedApplication] applicationIconImage] copy];
visable = NO;
}
return self;
}
- (void)dealloc {
if (label!=nil)
[label release];
if (applicationIcon!=nil)
[applicationIcon release];
[label release];
[applicationIcon release];
[super dealloc];
}
@ -55,7 +53,7 @@
}
- (void)setLabel:(NSString *)badgeLabel {
if (label!=nil) [label release];
[label release];
label = [badgeLabel copy];
if (label==nil || [label isEqual:@""])
[self setVisable:NO];

View File

@ -12,7 +12,7 @@
extern NSString *MGMContactsWindowOpen;
@interface MGMContactsController : NSObject {
@interface MGMContactsController : NSObject <NSTextFieldDelegate> {
MGMController *controller;
IBOutlet NSWindow *contactsWindow;
BOOL closingWindow;
@ -63,6 +63,7 @@ extern NSString *MGMContactsWindowOpen;
- (IBAction)runAction:(id)sender;
- (IBAction)call:(id)sender;
- (void)windowDidBecomeKey:(NSNotification *)notification;
- (void)windowWillClose:(NSNotification *)notification;
@end

View File

@ -17,7 +17,7 @@ NSString *MGMContactsWindowOpen = @"MGMContactsWindowOpen";
@implementation MGMContactsController
- (id)initWithController:(MGMController *)theController {
if (self = [super init]) {
if ((self = [super init])) {
controller = theController;
filterLock = [NSLock new];
filterWaiting = 0;
@ -43,15 +43,11 @@ NSString *MGMContactsWindowOpen = @"MGMContactsWindowOpen";
}
- (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self];
if (contactsWindow!=nil)
[contactsWindow close];
if (filterLock!=nil) {
[filterLock lock];
[filterLock unlock];
[filterLock release];
}
if (contactViews!=nil)
[contactViews release];
[contactsWindow close];
[filterLock lock];
[filterLock unlock];
[filterLock release];
[contactViews release];
[super dealloc];
}
@ -113,12 +109,8 @@ NSString *MGMContactsWindowOpen = @"MGMContactsWindowOpen";
if (row>=contactsCount) return;
[self checkContactRow:row];
[filterLock lock];
@try {
if ((row-contactsVisible.location)<[contactViews count])
[(MGMViewCell *)cell addSubview:[contactViews objectAtIndex:row-contactsVisible.location]];
}
@catch (NSException *e) {
NSLog(@"Contact error, ignoring. %@", e);
}
[filterLock unlock];
}
- (BOOL)tableView:(NSTableView *)tableView shouldSelectRow:(int)row {
@ -158,7 +150,7 @@ NSString *MGMContactsWindowOpen = @"MGMContactsWindowOpen";
filterWaiting--;
contactsCount = 0;
[contactViews removeAllObjects];
if (contactsMatchString!=nil) [contactsMatchString release];
[contactsMatchString release];
contactsMatchString = [[self filterString] copy];
int count = [[[self contacts] countContactsMatching:contactsMatchString] intValue];
[contactsTable scrollRowToVisible:0];
@ -256,16 +248,12 @@ NSString *MGMContactsWindowOpen = @"MGMContactsWindowOpen";
[controller contactsControllerBecameCurrent:self];
}
- (void)windowWillClose:(NSNotification *)notification {
[contactViews removeAllObjects];
contactsCount = 0;
[self reloadData];
[contactsWindow setDelegate:nil];
contactsWindow = nil;
[contactViews removeAllObjects];
contactsCount = 0;
contactsTable = nil;
if (phoneFieldView!=nil) {
[phoneFieldView release];
phoneFieldView = nil;
}
phoneFieldView = nil;
phoneField = nil;
}
@end

View File

@ -138,6 +138,14 @@ NSString * const MGMLoading = @"Loading...";
[[MGMAccountSetup new] showSetupWindow:self]; // This is not a leak, it'll auto release it self when done.
else
[self preferences:self];
} else {
BOOL windows = NO;
for (int i=0; i<[contactsControllers count]; i++) {
if ([[(MGMUser *)[[contactsControllers objectAtIndex:i] user] settingForKey:MGMContactsWindowOpen] boolValue])
windows = YES;
}
if (!windows)
[contactsControllers makeObjectsPerformSelector:@selector(showContactsWindow)];
}
[[RLMap mainFrame] loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"map" ofType:@"html"]]]];
@ -150,24 +158,17 @@ NSString * const MGMLoading = @"Loading...";
}
- (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self];
if (contactsControllers!=nil)
[contactsControllers release];
if (multipleSMS!=nil)
[multipleSMS release];
if (preferences!=nil)
[preferences release];
if (taskManager!=nil)
[taskManager release];
if (whitePages!=nil)
[whitePages release];
if (themeManager!=nil)
[themeManager release];
if (SMSManager!=nil)
[SMSManager release];
if (badge!=nil)
[badge release];
if (badgeValues!=nil)
[badgeValues release];
[contactsControllers release];
[multipleSMS release];
[preferences release];
[taskManager release];
[whitePages release];
[themeManager release];
[SMSManager release];
[badge release];
[badgeValues release];
[aboutWindow release];
[RLWindow release];
[super dealloc];
}
@ -323,9 +324,9 @@ NSString * const MGMLoading = @"Loading...";
[[contactsController phoneField] setStringValue:[phoneNumber readableNumber]];
[self sms:self];
} else if ([scheme isEqualToString:@"vmtheme"]) {
[taskManager addTask:nil withURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://%@", data]]];
[taskManager addTask:nil withURL:[NSURL URLWithString:[@"http://" stringByAppendingString:data]]];
} else if ([scheme isEqualToString:@"vmsound"]) {
[taskManager addTask:nil withURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://%@", data]]];
[taskManager addTask:nil withURL:[NSURL URLWithString:[@"http://" stringByAppendingString:data]]];
}
}
- (void)application:(NSApplication *)sender openFiles:(NSArray *)filenames {

View File

@ -15,7 +15,7 @@
@implementation MGMNumberOptions
- (id)initWithContactsController:(MGMContactsController *)theContactsController controller:(MGMController *)theController number:(NSString *)theNumber {
if (self = [super init]) {
if ((self = [super init])) {
if (![NSBundle loadNibNamed:@"NumberOptions" owner:self]) {
NSLog(@"Unable to load the Number Options Window");
[self release];
@ -45,8 +45,7 @@
}
- (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self];
if (whitePages!=nil)
[whitePages release];
[whitePages release];
[super dealloc];
}
@ -100,8 +99,7 @@
}
}
- (IBAction)cancel:(id)sender {
if (whitePages!=nil)
[whitePages cancelAll];
[whitePages cancelAll];
[optionsWindow close];
[self release];
}

View File

@ -13,7 +13,7 @@ extern NSString *MGMLastUserPhoneKey;
@class MGMController, MGMUser, MGMInstance, MGMInboxWindow, MGMProgressView, MGMPhoneField, MGMPhoneFieldView, MGMContactsTableView;
@interface MGMVoiceUser : MGMContactsController {
@interface MGMVoiceUser : MGMContactsController <NSAnimationDelegate> {
MGMInstance *instance;
MGMUser *user;
MGMInboxWindow *inboxWindow;

View File

@ -26,7 +26,7 @@ NSString *MGMLastUserPhoneKey = @"MGMLastUserPhone";
return [[[self alloc] initUser:theUser controller:theController instance:theInstance] autorelease];
}
- (id)initUser:(MGMUser *)theUser controller:(MGMController *)theController instance:(MGMInstance *)theInstance {
if (self = [super initWithController:theController]) {
if ((self = [super initWithController:theController])) {
user = [theUser retain];
[self registerSettings];
if (theInstance==nil) {
@ -60,31 +60,20 @@ NSString *MGMLastUserPhoneKey = @"MGMLastUserPhone";
}
}
- (void)dealloc {
if (progressFadeAnimation!=nil) {
[progressFadeAnimation stopAnimation];
[progressFadeAnimation release];
progressFadeAnimation = nil;
}
[progressFadeAnimation stopAnimation];
[progressFadeAnimation release];
progressFadeAnimation = nil;
[super dealloc];
if (inboxWindow!=nil) {
[inboxWindow closeWindow];
[inboxWindow release];
}
if (instance!=nil) {
[instance setDelegate:nil];
[instance stop];
[instance release];
}
if (progressView!=nil) {
[progressView removeFromSuperview];
[progressView release];
}
if (callTimer!=nil) {
[callTimer invalidate];
[callTimer release];
}
if (user!=nil)
[user release];
[inboxWindow closeWindow];
[inboxWindow release];
[instance setDelegate:nil];
[instance stop];
[instance release];
[progressView removeFromSuperview];
[progressView release];
[callTimer invalidate];
[callTimer release];
[user release];
}
- (void)registerSettings {
@ -123,18 +112,14 @@ NSString *MGMLastUserPhoneKey = @"MGMLastUserPhone";
[theAlert setInformativeText:[theError localizedDescription]];
[theAlert runModal];
if (progressView!=nil) {
[progressView stopProgess];
[progressView removeFromSuperview];
[progressView release];
progressView = nil;
}
[progressView stopProgess];
[progressView removeFromSuperview];
[progressView release];
progressView = nil;
}
- (void)loginSuccessful {
if (progressView!=nil) {
[progressView stopProgess];
[progressView display];
}
[progressView stopProgess];
[progressView display];
[self setInstanceInfo];
@ -163,15 +148,11 @@ NSString *MGMLastUserPhoneKey = @"MGMLastUserPhone";
}
}
- (void)animationDidEnd:(NSAnimation *)animation {
if (progressFadeAnimation!=nil) {
[progressFadeAnimation release];
progressFadeAnimation = nil;
}
if (progressView!=nil) {
[progressView removeFromSuperview];
[progressView release];
progressView = nil;
}
[progressFadeAnimation release];
progressFadeAnimation = nil;
[progressView removeFromSuperview];
[progressView release];
progressView = nil;
}
- (MGMContacts *)contacts {
@ -180,7 +161,7 @@ NSString *MGMLastUserPhoneKey = @"MGMLastUserPhone";
- (void)reloadData {
[super reloadData];
if (progressView!=nil) [progressView display];
[progressView display];
}
- (NSString *)areaCode {
@ -246,8 +227,7 @@ NSString *MGMLastUserPhoneKey = @"MGMLastUserPhone";
[alert setInformativeText:[theError localizedDescription]];
[alert runModal];
placingCall = NO;
if (callTimer!=nil)
[callTimer fire];
[callTimer fire];
}
- (void)callDidFinish:(NSDictionary *)theInfo {
placingCall = NO;
@ -260,11 +240,9 @@ NSString *MGMLastUserPhoneKey = @"MGMLastUserPhone";
[alert runModal];
}
- (void)callTimer {
if (callTimer!=nil) {
[callTimer invalidate];
[callTimer release];
callTimer = nil;
}
[callTimer invalidate];
[callTimer release];
callTimer = nil;
[callButton setImage:[NSImage imageNamed:@"placeCall"]];
}
@ -298,16 +276,14 @@ NSString *MGMLastUserPhoneKey = @"MGMLastUserPhone";
- (void)windowWillClose:(NSNotification *)notification {
if (![controller isQuitting])
[user setSetting:[NSNumber numberWithBool:NO] forKey:MGMContactsWindowOpen];
[super windowWillClose:notification];
if (progressFadeAnimation!=nil) {
[progressFadeAnimation stopAnimation];
[progressFadeAnimation release];
progressFadeAnimation = nil;
}
[progressFadeAnimation stopAnimation];
[progressFadeAnimation release];
progressFadeAnimation = nil;
creditField = nil;
userNumberButton = nil;
userPhonesButton = nil;
callButton = nil;
smsButton = nil;
[super windowWillClose:notification];
}
@end

View File

@ -44,6 +44,8 @@
IBOutlet NSTextField *SIPProxyPortField;
IBOutlet NSTextField *SIPSIPAddressField;
IBOutlet NSTextField *SIPRegistrarTimeoutField;
IBOutlet NSPopUpButton *SIPTransportPopUp;
IBOutlet NSPopUpButton *SIPToneTypePopUp;
IBOutlet NSMatrix *SIPContactsMatrix;
IBOutlet NSPopUpButton *SIPGoogleContactsPopUp;
}
@ -55,6 +57,7 @@
- (IBAction)loginout:(id)sender;
- (IBAction)add:(id)sender;
- (IBAction)remove:(id)sender;
- (void)tableViewSelectionDidChange:(NSNotification *)aNotification;
- (IBAction)saveGV:(id)sender;
- (IBAction)saveGC:(id)sender;

View File

@ -18,7 +18,7 @@ NSString * const MGMLogout = @"Logout";
@implementation MGMAccountsPane
- (id)initWithPreferences:(MGMPreferences *)thePreferences {
if (self = [super initWithPreferences:thePreferences]) {
if ((self = [super initWithPreferences:thePreferences])) {
if (![NSBundle loadNibNamed:@"AccountsPane" owner:self]) {
NSLog(@"Unable to load Nib for Account Preferences");
[self release];
@ -48,6 +48,8 @@ NSString * const MGMLogout = @"Logout";
[SIPProxyPortField setEnabled:NO];
[SIPSIPAddressField setEnabled:NO];
[SIPRegistrarTimeoutField setEnabled:NO];
[SIPTransportPopUp setEnabled:NO];
[SIPToneTypePopUp setEnabled:NO];
[SIPContactsMatrix setEnabled:NO];
[SIPGoogleContactsPopUp setEnabled:NO];
[settingsTab selectTabViewItemAtIndex:0];
@ -58,10 +60,8 @@ NSString * const MGMLogout = @"Logout";
- (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self];
[[NSNotificationCenter defaultCenter] removeObserver:usersTable];
if (checkInstance!=nil)
[checkInstance release];
if (mainView!=nil)
[mainView release];
[checkInstance release];
[mainView release];
[super dealloc];
}
+ (void)setUpToolbarItem:(NSToolbarItem *)theItem {
@ -153,6 +153,8 @@ NSString * const MGMLogout = @"Logout";
[SIPProxyPortField setEnabled:NO];
[SIPSIPAddressField setEnabled:NO];
[SIPRegistrarTimeoutField setEnabled:NO];
[SIPTransportPopUp setEnabled:NO];
[SIPToneTypePopUp setEnabled:NO];
[SIPContactsMatrix setEnabled:NO];
[SIPGoogleContactsPopUp setEnabled:NO];
if (selected==-1)
@ -240,6 +242,8 @@ NSString * const MGMLogout = @"Logout";
[SIPProxyPortField setEnabled:YES];
[SIPSIPAddressField setEnabled:YES];
[SIPRegistrarTimeoutField setEnabled:YES];
[SIPTransportPopUp setEnabled:YES];
[SIPToneTypePopUp setEnabled:YES];
}
if ([user settingForKey:MGMSIPAccountFullName]!=nil)
[SIPFullNameField setStringValue:[user settingForKey:MGMSIPAccountFullName]];
@ -282,6 +286,10 @@ NSString * const MGMLogout = @"Logout";
[SIPRegistrarTimeoutField setIntValue:[[user settingForKey:MGMSIPAccountRegisterTimeout] intValue]];
else
[SIPRegistrarTimeoutField setStringValue:@""];
int transport = [[user settingForKey:MGMSIPAccountTransport] intValue];
[SIPTransportPopUp selectItemAtIndex:transport];
int dtmfToneType = [[user settingForKey:MGMSIPAccountDTMFToneType] intValue];
[SIPToneTypePopUp selectItemAtIndex:dtmfToneType];
NSArray *users = [MGMUser users];
NSMenu *menu = [[NSMenu new] autorelease];
@ -376,6 +384,8 @@ NSString * const MGMLogout = @"Logout";
[user setSetting:[SIPSIPAddressField stringValue] forKey:MGMSIPAccountSIPAddress];
[[SIPSIPAddressField cell] setPlaceholderString:[NSString stringWithFormat:@"%@@%@", [user settingForKey:MGMSIPAccountUserName], [user settingForKey:MGMSIPAccountDomain]]];
[user setSetting:[NSNumber numberWithInt:[SIPRegistrarTimeoutField intValue]] forKey:MGMSIPAccountRegisterTimeout];
[user setSetting:[NSNumber numberWithInt:[SIPTransportPopUp indexOfSelectedItem]] forKey:MGMSIPAccountTransport];
[user setSetting:[NSNumber numberWithInt:[SIPToneTypePopUp indexOfSelectedItem]] forKey:MGMSIPAccountDTMFToneType];
#endif
}

View File

@ -37,6 +37,7 @@
IBOutlet NSTextField *logFileLevelField;
IBOutlet NSTextField *consoleLogLevelField;
IBOutlet NSTextField *publicAddressField;
IBOutlet NSTextField *userAgentField;
}
- (id)initWithPreferences:(MGMPreferences *)thePreferences;
+ (void)setUpToolbarItem:(NSToolbarItem *)theItem;
@ -66,5 +67,6 @@
- (IBAction)logFileLevel:(id)sender;
- (IBAction)consoleLogLevel:(id)sender;
- (IBAction)publicAddress:(id)sender;
- (IBAction)userAgent:(id)sender;
@end
#endif

View File

@ -12,7 +12,7 @@
@implementation MGMSIPPane
- (id)initWithPreferences:(MGMPreferences *)thePreferences {
if (self = [super initWithPreferences:thePreferences]) {
if ((self = [super initWithPreferences:thePreferences])) {
if (![NSBundle loadNibNamed:@"SIPPane" owner:self]) {
NSLog(@"Unable to load Nib for SIP Preferences");
[self release];
@ -49,6 +49,8 @@
[consoleLogLevelField setIntValue:[defaults integerForKey:MGMSIPConsoleLogLevel]];
if ([defaults objectForKey:MGMSIPPublicAddress]!=nil && ![[defaults objectForKey:MGMSIPPublicAddress] isEqual:@""])
[publicAddressField setStringValue:[defaults objectForKey:MGMSIPPublicAddress]];
if ([defaults objectForKey:MGMSIPUserAgent]!=nil)
[userAgentField setStringValue:[defaults objectForKey:MGMSIPUserAgent]];
NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
[notificationCenter addObserver:self selector:@selector(volumeChanged:) name:MGMSIPVolumeChangedNotification object:nil];
@ -76,8 +78,7 @@
}
//[[MGMSIP sharedSIP] restart];
}
if (mainView!=nil)
[mainView release];
[mainView release];
[super dealloc];
}
+ (void)setUpToolbarItem:(NSToolbarItem *)theItem {
@ -228,5 +229,9 @@
[[NSUserDefaults standardUserDefaults] setObject:[publicAddressField stringValue] forKey:MGMSIPPublicAddress];
shouldRestart = YES;
}
- (IBAction)userAgent:(id)sender {
[[NSUserDefaults standardUserDefaults] setObject:[userAgentField stringValue] forKey:MGMSIPUserAgent];
shouldRestart = YES;
}
@end
#endif

View File

@ -15,7 +15,7 @@ NSString * const MGMTestTTPhoto = @"tPhoto";
@implementation MGMSMSThemesPane
- (id)initWithPreferences:(MGMPreferences *)thePreferences {
if (self = [super initWithPreferences:thePreferences]) {
if ((self = [super initWithPreferences:thePreferences])) {
if (![NSBundle loadNibNamed:@"SMSThemesPane" owner:self]) {
NSLog(@"Unable to load Nib for SMS Themes Preferences");
[self release];
@ -50,16 +50,11 @@ NSString * const MGMTestTTPhoto = @"tPhoto";
return self;
}
- (void)dealloc {
if (themeManager!=nil)
[themeManager release];
if (testMessages!=nil)
[testMessages release];
if (testMessageInfo!=nil)
[testMessageInfo release];
if (mainView!=nil)
[mainView release];
if (browserWindow!=nil)
[browserWindow release];
[themeManager release];
[testMessages release];
[testMessageInfo release];
[mainView release];
[browserWindow release];
[super dealloc];
}
+ (void)setUpToolbarItem:(NSToolbarItem *)theItem {

View File

@ -15,7 +15,7 @@ NSString * const MGMNoAuthor = @"No Author Found";
@implementation MGMSoundsPane
- (id)initWithPreferences:(MGMPreferences *)thePreferences {
if (self = [super initWithPreferences:thePreferences]) {
if ((self = [super initWithPreferences:thePreferences])) {
if (![NSBundle loadNibNamed:@"SoundsPane" owner:self]) {
NSLog(@"Unable to load Nib for Sounds Preferences");
[self release];
@ -30,14 +30,10 @@ NSString * const MGMNoAuthor = @"No Author Found";
}
- (void)dealloc {
[self stopSound:self];
if (themeManager!=nil)
[themeManager release];
if (mainView!=nil)
[mainView release];
if (sounds!=nil)
[sounds release];
if (browserWindow!=nil)
[browserWindow release];
[themeManager release];
[mainView release];
[sounds release];
[browserWindow release];
[super dealloc];
}
+ (void)setUpToolbarItem:(NSToolbarItem *)theItem {
@ -190,11 +186,9 @@ NSString * const MGMNoAuthor = @"No Author Found";
if (![themeManager setSound:soundName withPath:[sound objectForKey:MGMTSPath]]) {
NSBeep();
} else {
if (soundPlayer!=nil) {
[soundPlayer stop];
[soundPlayer release];
soundPlayer = nil;
}
[soundPlayer stop];
[soundPlayer release];
soundPlayer = nil;
soundPlayer = [themeManager playSound:soundName];
[soundPlayer setDelegate:self];
}
@ -205,17 +199,13 @@ NSString * const MGMNoAuthor = @"No Author Found";
[self reload:soundName];
}
- (void)soundDidFinishPlaying:(MGMSound *)theSound {
if (soundPlayer!=nil) {
[soundPlayer release];
soundPlayer = nil;
}
[soundPlayer release];
soundPlayer = nil;
}
- (IBAction)stopSound:(id)sender {
if (soundPlayer!=nil) {
[soundPlayer stop];
[soundPlayer release];
soundPlayer = nil;
}
[soundPlayer stop];
[soundPlayer release];
soundPlayer = nil;
}
- (IBAction)authorSite:(id)sender {

View File

@ -22,7 +22,7 @@ NSString * const MGMSCTitleNoNameFormat = @"Call With %@";
return [[[self alloc] initWithCall:theCall SIPUser:theSIPUser] autorelease];
}
- (id)initWithCall:(MGMSIPCall *)theCall SIPUser:(MGMSIPUser *)theSIPUser {
if (self = [super init]) {
if ((self = [super init])) {
if (![NSBundle loadNibNamed:@"SIPCallWindow" owner:self]) {
NSLog(@"Unable to load SIP Call Window!");
[self release];
@ -104,11 +104,9 @@ NSString * const MGMSCTitleNoNameFormat = @"Call With %@";
}
if ([call state]==MGMSIPCallDisconnectedState) {
if (ringtone!=nil) {
[ringtone stop];
[ringtone release];
ringtone = nil;
}
[ringtone stop];
[ringtone release];
ringtone = nil;
}
NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
@ -122,49 +120,31 @@ NSString * const MGMSCTitleNoNameFormat = @"Call With %@";
- (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self];
[self hidePad];
if (call!=nil) {
[call setDelegate:nil];
[call release];
}
if (whitePages!=nil)
[whitePages release];
if (incomingWindow!=nil)
[incomingWindow release];
if (callWindow!=nil)
[callWindow release];
if (fullName!=nil)
[fullName release];
if (phoneNumber!=nil)
[phoneNumber release];
if (ringtone!=nil) {
[ringtone stop];
[ringtone release];
}
if (startTime!=nil)
[startTime release];
if (durationUpdater!=nil) {
[durationUpdater invalidate];
[durationUpdater release];
}
[call setDelegate:nil];
[call release];
[whitePages release];
[incomingWindow release];
[callWindow release];
[fullName release];
[phoneNumber release];
[ringtone stop];
[ringtone release];
[durationUpdater invalidate];
[durationUpdater release];
[startTime release];
[super dealloc];
}
- (void)disconnected:(MGMSIPCall *)theCall {
if (ringtone!=nil) {
[ringtone stop];
[ringtone release];
ringtone = nil;
}
[ringtone stop];
[ringtone release];
ringtone = nil;
if ([callWindow isVisible]) {
if (durationUpdater!=nil) {
[durationUpdater invalidate];
[durationUpdater release];
durationUpdater = nil;
}
if (startTime!=nil) {
[startTime release];
startTime = nil;
}
[durationUpdater invalidate];
[durationUpdater release];
durationUpdater = nil;
[startTime release];
startTime = nil;
[statusField setStringValue:@"Disconnected"];
[[[SIPUser controller] themeManager] playSound:MGMTSSIPDisconnected];
} else {
@ -176,7 +156,7 @@ NSString * const MGMSCTitleNoNameFormat = @"Call With %@";
- (void)confirmed:(MGMSIPCall *)theCall {
[statusField setStringValue:@"Connected"];
[[[SIPUser controller] themeManager] playSound:MGMTSSIPConnected];
[self performSelectorOnMainThread:@selector(startDurationTimer) withObject:nil waitUntilDone:NO];
[self performSelectorOnMainThread:@selector(startDurationTimer) withObject:nil waitUntilDone:YES];
}
- (void)startDurationTimer {
startTime = [NSDate new];
@ -216,22 +196,18 @@ NSString * const MGMSCTitleNoNameFormat = @"Call With %@";
[sound5Button setTitle:[[[SIPUser controller] themeManager] nameOfSound:MGMTSSIPSound5]];
}
- (IBAction)answer:(id)sender {
if (ringtone!=nil) {
[ringtone stop];
[ringtone release];
ringtone = nil;
}
[ringtone stop];
[ringtone release];
ringtone = nil;
[incomingWindow close];
[call answer];
[self fillCallWindow];
[callWindow makeKeyAndOrderFront:self];
}
- (IBAction)ignore:(id)sender {
if (ringtone!=nil) {
[ringtone stop];
[ringtone release];
ringtone = nil;
}
[ringtone stop];
[ringtone release];
ringtone = nil;
[incomingWindow close];
[SIPUser callDone:self];
}
@ -286,15 +262,11 @@ NSString * const MGMSCTitleNoNameFormat = @"Call With %@";
}
- (IBAction)hangUp:(id)sender {
[callWindow close];
if (durationUpdater!=nil) {
[durationUpdater invalidate];
[durationUpdater release];
durationUpdater = nil;
}
if (startTime!=nil) {
[startTime release];
startTime = nil;
}
[durationUpdater invalidate];
[durationUpdater release];
durationUpdater = nil;
[startTime release];
startTime = nil;
[call hangUp];
[SIPUser callDone:self];
}

View File

@ -14,7 +14,7 @@
extern NSString * const MGMSIPUserAreaCode;
@interface MGMSIPUser : MGMContactsController {
@interface MGMSIPUser : MGMContactsController <NSAnimationDelegate> {
MGMUser *user;
MGMSIPAccount *account;
NSMutableArray *calls;

View File

@ -23,7 +23,7 @@ NSString * const MGMSIPUserAreaCode = @"MGMVSIPUserAreaCode";
return [[[self alloc] initUser:theUser controller:theController] autorelease];
}
- (id)initUser:(MGMUser *)theUser controller:(MGMController *)theController {
if (self = [super initWithController:theController]) {
if ((self = [super initWithController:theController])) {
user = [theUser retain];
[user setDelegate:self];
[self registerSettings];
@ -52,7 +52,7 @@ NSString * const MGMSIPUserAreaCode = @"MGMVSIPUserAreaCode";
userName = [user settingForKey:MGMSIPAccountFullName];
[userNameField setStringValue:userName];
if (![account isLoggedIn]) {
if (![account isRegistered]) {
NSSize contentSize = [[contactsWindow contentView] frame].size;
progressView = [[MGMProgressView alloc] initWithFrame:NSMakeRect(0, 0, contentSize.width, contentSize.height)];
[progressView setProgressTitle:@"Logging In"];
@ -62,36 +62,23 @@ NSString * const MGMSIPUserAreaCode = @"MGMVSIPUserAreaCode";
}
}
- (void)dealloc {
if (progressFadeAnimation!=nil) {
[progressFadeAnimation stopAnimation];
[progressFadeAnimation release];
progressFadeAnimation = nil;
}
if (progressView!=nil) {
[progressView stopProgess];
[progressView release];
}
if (SIPRegistrationTimeout!=nil) {
[SIPRegistrationTimeout invalidate];
[SIPRegistrationTimeout release];
}
[account setDelegate:nil];
[contacts setDelegate:nil];
[progressFadeAnimation stopAnimation];
[progressFadeAnimation release];
progressFadeAnimation = nil;
[progressView stopProgess];
[progressView release];
[SIPRegistrationTimeout invalidate];
[SIPRegistrationTimeout release];
[super dealloc];
if (calls!=nil) {
[calls removeAllObjects];
[calls release];
}
if (account!=nil) {
[account setDelegate:nil];
[account logout];
[account release];
}
if (contacts!=nil) {
[contacts stop];
[contacts setDelegate:nil];
[contacts release];
}
if (user!=nil)
[user release];
[calls removeAllObjects];
[calls release];
[account logout];
[account release];
[contacts stop];
[contacts release];
[user release];
}
- (void)registerSettings {
@ -131,11 +118,9 @@ NSString * const MGMSIPUserAreaCode = @"MGMVSIPUserAreaCode";
}
- (void)registrationChanged {
if (SIPRegistrationTimeout!=nil) {
[SIPRegistrationTimeout invalidate];
[SIPRegistrationTimeout release];
SIPRegistrationTimeout = nil;
}
[SIPRegistrationTimeout invalidate];
[SIPRegistrationTimeout release];
SIPRegistrationTimeout = nil;
if (!acountRegistered) {
if (![account isRegistered]) {
NSAlert *theAlert = [[NSAlert new] autorelease];
@ -144,23 +129,21 @@ NSString * const MGMSIPUserAreaCode = @"MGMVSIPUserAreaCode";
[theAlert runModal];
}
acountRegistered = YES;
[self performSelectorOnMainThread:@selector(removeLoginProgress) withObject:nil waitUntilDone:NO];
[self performSelectorOnMainThread:@selector(removeLoginProgress) withObject:nil waitUntilDone:YES];
}
}
- (void)loggedIn {
loggingIn = NO;
[self performSelectorOnMainThread:@selector(startRegistrationTimeoutTimer) withObject:nil waitUntilDone:NO];
[self performSelectorOnMainThread:@selector(startRegistrationTimeoutTimer) withObject:nil waitUntilDone:YES];
}
- (void)startRegistrationTimeoutTimer {
if (!acountRegistered)
SIPRegistrationTimeout = [[NSTimer scheduledTimerWithTimeInterval:10.0 target:self selector:@selector(SIPTimeout) userInfo:nil repeats:NO] retain];
}
- (void)SIPTimeout {
if (SIPRegistrationTimeout!=nil) {
[SIPRegistrationTimeout invalidate];
[SIPRegistrationTimeout release];
SIPRegistrationTimeout = nil;
}
[SIPRegistrationTimeout invalidate];
[SIPRegistrationTimeout release];
SIPRegistrationTimeout = nil;
[account setLastError:@"Registration Timeout."];
[self loginErrored];
}
@ -185,13 +168,11 @@ NSString * const MGMSIPUserAreaCode = @"MGMVSIPUserAreaCode";
[theAlert setInformativeText:[account lastError]];
[theAlert runModal];
if (progressView!=nil) {
[progressView stopProgess];
[progressView removeFromSuperview];
[progressView release];
progressView = nil;
}
[self performSelectorOnMainThread:@selector(removeLoginProgress) withObject:nil waitUntilDone:NO];
[progressView stopProgess];
[progressView removeFromSuperview];
[progressView release];
progressView = nil;
[self performSelectorOnMainThread:@selector(removeLoginProgress) withObject:nil waitUntilDone:YES];
}
- (void)logoutErrored {
NSAlert *theAlert = [[NSAlert new] autorelease];
@ -200,15 +181,11 @@ NSString * const MGMSIPUserAreaCode = @"MGMVSIPUserAreaCode";
[theAlert runModal];
}
- (void)animationDidEnd:(NSAnimation *)animation {
if (progressFadeAnimation!=nil) {
[progressFadeAnimation release];
progressFadeAnimation = nil;
}
if (progressView!=nil) {
[progressView removeFromSuperview];
[progressView release];
progressView = nil;
}
[progressFadeAnimation release];
progressFadeAnimation = nil;
[progressView removeFromSuperview];
[progressView release];
progressView = nil;
}
- (MGMContacts *)contacts {
@ -217,7 +194,7 @@ NSString * const MGMSIPUserAreaCode = @"MGMVSIPUserAreaCode";
- (void)reloadData {
[super reloadData];
if (progressView!=nil) [progressView display];
[progressView display];
}
- (NSString *)areaCode {
@ -274,11 +251,9 @@ NSString * const MGMSIPUserAreaCode = @"MGMVSIPUserAreaCode";
if (![controller isQuitting])
[user setSetting:[NSNumber numberWithBool:NO] forKey:MGMContactsWindowOpen];
[super windowWillClose:notification];
if (progressFadeAnimation!=nil) {
[progressFadeAnimation stopAnimation];
[progressFadeAnimation release];
progressFadeAnimation = nil;
}
[progressFadeAnimation stopAnimation];
[progressFadeAnimation release];
progressFadeAnimation = nil;
}
@end
#endif

View File

@ -13,7 +13,7 @@
@implementation MGMSIPWavConverter
- (id)initWithSoundName:(NSString *)theSoundname fileConverting:(NSString *)theFile {
if (self = [super init]) {
if ((self = [super init])) {
fileConverting = [theFile copy];
soundName = [theSoundname copy];
cancel = NO;
@ -34,15 +34,11 @@
}
- (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self];
if (fileConverting!=nil)
[fileConverting release];
if (soundName!=nil)
[soundName release];
if (movie!=nil)
[movie release];
if (backgroundThread!=nil) {
[fileConverting release];
[soundName release];
[movie release];
if (backgroundThread!=nil)
while (backgroundThread!=nil) [NSThread sleepUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.2]];
}
[super dealloc];
}
@ -71,7 +67,7 @@
finalPath = [finalPath stringByAppendingPathComponent:soundName];
NSString *convertFinalPath = [[finalPath stringByAppendingPathExtension:@".tmp"] stringByAppendingPathExtension:MGMWavExt];
finalPath = [finalPath stringByAppendingPathExtension:MGMWavExt];
NSDictionary *dictionary = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:YES], QTMovieExport, [NSNumber numberWithLong:kQTFileTypeWave], QTMovieExportType, [NSNumber numberWithLong:SoundMediaType], QTMovieExportManufacturer, nil];
NSDictionary *dictionary = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:YES], QTMovieExport, [NSNumber numberWithLong:kQTFileTypeWave], QTMovieExportType, [NSNumber numberWithLong:'soun'], QTMovieExportManufacturer, nil];
if (!cancel) {
if (![movie writeToFile:convertFinalPath withAttributes:dictionary])
NSLog(@"Could not convert audio %@", fileConverting);

View File

@ -17,7 +17,7 @@
return [[[self alloc] initWithInstance:theInstance controller:theController] autorelease];
}
- (id)initWithInstance:(MGMInstance *)theInstance controller:(MGMController *)theController {
if (self = [super init]) {
if ((self = [super init])) {
if (![NSBundle loadNibNamed:@"MultiSMS" owner:self]) {
NSLog(@"Unable to load Multiple SMS Window.");
[self release];

View File

@ -40,4 +40,5 @@
- (void)messageWithNumber:(NSString *)theNumber instance:(MGMInstance *)theInstance;
- (void)messageWithData:(NSDictionary *)theData instance:(MGMInstance *)theInstance;
- (NSString *)currentPhoneNumber;
- (void)windowDidBecomeKey:(NSNotification *)notification;
@end

View File

@ -23,7 +23,7 @@ const float updateTimeInterval = 300.0;
return [[[self alloc] initWithController:theController] autorelease];
}
- (id)initWithController:(MGMController *)theController {
if (self = [super init]) {
if ((self = [super init])) {
controller = theController;
SMSMessages = [NSMutableArray new];
lastDates = [NSMutableDictionary new];
@ -35,16 +35,11 @@ const float updateTimeInterval = 300.0;
[[[messagesTable tableColumns] objectAtIndex:0] setDataCell:[[[MGMViewCell alloc] initGradientCell] autorelease]];
}
- (void)dealloc {
if (SMSWindow!=nil)
[SMSWindow close];
if (updateTimer!=nil) {
[updateTimer invalidate];
[updateTimer release];
}
if (SMSMessages!=nil)
[SMSMessages release];
if (lastDates!=nil)
[lastDates release];
[SMSWindow close];
[updateTimer invalidate];
[updateTimer release];
[SMSMessages release];
[lastDates release];
[super dealloc];
}

View File

@ -20,7 +20,7 @@
return [[[self alloc] initWithManager:theManager messages:theMessages messageInfo:theMessageInfo instance:theInstance] autorelease];
}
- (id)initWithManager:(MGMSMSManager *)theManager messages:(NSArray *)theMessages messageInfo:(NSDictionary *)theMessageInfo instance:(MGMInstance *)theInstance {
if (self = [super init]) {
if ((self = [super init])) {
if (![NSBundle loadNibNamed:@"SMSMessageView" owner:self]) {
NSLog(@"Error: Unable to load SMS Message View.");
[self release];
@ -48,12 +48,9 @@
}
- (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self];
if (SMSSplitView!=nil)
[SMSSplitView release];
if (messages!=nil)
[messages release];
if (messageInfo!=nil)
[messageInfo release];
[SMSSplitView release];
[messages release];
[messageInfo release];
[super dealloc];
}
@ -100,7 +97,7 @@
- (BOOL)updateWithMessages:(NSArray *)theMessages messageInfo:(NSDictionary *)theMessageInfo {
BOOL newIncomingMessages = NO;
if (![[theMessageInfo objectForKey:MGMITime] isEqual:[messageInfo objectForKey:MGMITime]]) {
if (messageInfo!=nil) [messageInfo release];
[messageInfo release];
messageInfo = [theMessageInfo mutableCopy];
[self setRead:[[messageInfo objectForKey:MGMIRead] boolValue]];

View File

@ -17,7 +17,7 @@
return [[[self alloc] initWithMessageView:theMessageView] autorelease];
}
- (id)initWithMessageView:(MGMSMSMessageView *)theMessageView {
if (self = [super initWithFrame:NSMakeRect(0, 0, 100, 40)]) {
if ((self = [super initWithFrame:NSMakeRect(0, 0, 100, 40)])) {
messageView = theMessageView;
[self setToolTip:[[messageView messageInfo] objectForKey:MGMTInName]];
NSRect frameRect = [self frame];
@ -57,12 +57,9 @@
return self;
}
- (void)dealloc {
if (photoView!=nil)
[photoView release];
if (nameField!=nil)
[nameField release];
if (closeButton!=nil)
[closeButton release];
[photoView release];
[nameField release];
[closeButton release];
[super dealloc];
}

View File

@ -11,7 +11,7 @@
@implementation MGMBlackWindow
- (id)initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)windowStyle backing:(NSBackingStoreType)bufferingType defer:(BOOL)deferCreation {
if (self = [super initWithContentRect:contentRect styleMask:NSBorderlessWindowMask backing:bufferingType defer:deferCreation]) {
if ((self = [super initWithContentRect:contentRect styleMask:NSBorderlessWindowMask backing:bufferingType defer:deferCreation])) {
forceDisplay = NO;
[self setLevel:NSStatusWindowLevel];
[self setBackgroundColor:[NSColor clearColor]];

View File

@ -15,7 +15,7 @@
}
- (id)initWithFrame:(NSRect)frameRect themeManager:(MGMThemeManager *)theThemeManager {
themeManager = theThemeManager;
if (self = [super initWithFrame:frameRect]) {
if ((self = [super initWithFrame:frameRect])) {
photoView = [[NSImageView alloc] initWithFrame:NSMakeRect(0, 0, frameRect.size.height, frameRect.size.height)];
[photoView setRefusesFirstResponder:YES];
[self addSubview:photoView];
@ -39,14 +39,10 @@
return self;
}
- (void)dealloc {
if (photoView!=nil)
[photoView release];
if (nameField!=nil)
[nameField release];
if (phoneField!=nil)
[phoneField release];
if (contact!=nil)
[contact release];
[photoView release];
[nameField release];
[phoneField release];
[contact release];
[super dealloc];
}
- (void)resizeSubviewsWithOldSize:(NSSize)oldBoundsSize {
@ -61,7 +57,7 @@
return contact;
}
- (void)setContact:(NSDictionary *)theContact {
if (contact!=nil) [contact release];
[contact release];
contact = [theContact mutableCopy];
if ([contact objectForKey:MGMCPhoto]==nil || [[contact objectForKey:MGMCPhoto] isKindOfClass:[NSNull class]])
[photoView setImage:[[[NSImage alloc] initWithContentsOfFile:[themeManager incomingIconPath]] autorelease]];

View File

@ -10,7 +10,7 @@
@implementation MGMPhoneField
- (id)initWithCoder:(NSCoder*)coder {
if (self = [super initWithCoder:coder]) {
if ((self = [super initWithCoder:coder])) {
NSTextFieldCell *cell = [self cell];
MGMPhoneFieldCell *phoneCell = [[MGMPhoneFieldCell alloc] initTextCell:[cell stringValue]];
//NSTextFieldCell

View File

@ -10,7 +10,7 @@
@implementation MGMProgressView
- (id)initWithFrame:(NSRect)frameRect {
if (self = [super initWithFrame:frameRect]) {
if ((self = [super initWithFrame:frameRect])) {
progress = [[NSProgressIndicator alloc] initWithFrame:NSMakeRect((frameRect.size.width-32)/2, (frameRect.size.height-32)/2, 32, 32)];
[progress setStyle:NSProgressIndicatorSpinningStyle];
[progress setControlSize:NSRegularControlSize];
@ -39,12 +39,9 @@
return self;
}
- (void)dealloc {
if (progress)
[progress release];
if (pleaseWaitField!=nil)
[pleaseWaitField release];
if (progressField!=nil)
[progressField release];
[progress release];
[pleaseWaitField release];
[progressField release];
[super dealloc];
}
- (void)resizeSubviewsWithOldSize:(NSSize)oldBoundsSize {

View File

@ -9,13 +9,6 @@
#import "MGMTranslucentTabView.h"
@implementation MGMTranslucentTabView
- (id)initWithFrame:(NSRect)frameRect {
if (self = [super initWithFrame:frameRect]) {
}
return self;
}
- (void)awakeFromNib {
[self setTabViewType:NSNoTabsNoBorder];
[self setDrawsBackground:NO];

View File

@ -11,7 +11,7 @@
@implementation MGMViewCell
- (id)initGradientCell {
if (self = [super init]) {
if ((self = [super init])) {
gradient = YES;
}
return self;

View File

@ -3,7 +3,7 @@
// VoiceMac
//
// Created by Mr. Gecko on 7/24/09.
// Copyright Mr. Gecko's Media 2009. All rights reserved.
// Copyright (c) 2010 Mr. Gecko's Media (James Coleman). All rights reserved. http://mrgeckosmedia.com/
//
#import <Cocoa/Cocoa.h>

View File

@ -4,4 +4,4 @@ Contributing to MGMSIP and MGMXML is exactly the same as VoiceMac. However there
Terms for adding:
1. The patch must not disrupt up the functionality of VoiceMac. 2. The patch must provide useful changes.
3. Anything that you add to the source code of VoiceMac will be under the terms of my licenses.
4. If you add changes to VoiceMac's main source code, you may not have them removed, but you will get credit for the changes in the history of the application. To contribute: 1. Create a patch file using this command “diff -crB VoiceMacOriginal VoiceMac > VoiceMac.patch”. 2. Send the patch to voicemac@mrgeckosmedia.com with your name, email/website (if you want that information), and what you changed so I can add it to the about and change.
4. If you add changes to VoiceMac's source code, you may not have them removed, but you will get credit for the changes in the history of the application. To contribute: 1. Create a patch file using this command “diff -crB VoiceMacOriginal VoiceMac > VoiceMac.patch”. 2. Send the patch to voicemac@mrgeckosmedia.com with your name, email/website (if you want that information), and what you changed so I can add it to the about and change.

View File

@ -3,7 +3,7 @@
// GeckoReporter
//
// Created by Mr. Gecko on 12/27/09.
// Copyright (c) 2010 Mr. Gecko's Media (James Coleman). All rights reserved. http://mrgeckosmedia.com/
// Copyright (c) 2011 Mr. Gecko's Media (James Coleman). All rights reserved. http://mrgeckosmedia.com/
//
#import "MGMReporter.h"

View File

@ -3,7 +3,7 @@
// GeckoReporter
//
// Created by Mr. Gecko on 1/2/10.
// Copyright (c) 2010 Mr. Gecko's Media (James Coleman). All rights reserved. http://mrgeckosmedia.com/
// Copyright (c) 2011 Mr. Gecko's Media (James Coleman). All rights reserved. http://mrgeckosmedia.com/
//
#import <Cocoa/Cocoa.h>

View File

@ -3,7 +3,7 @@
// GeckoReporter
//
// Created by Mr. Gecko on 1/1/10.
// Copyright (c) 2010 Mr. Gecko's Media (James Coleman). All rights reserved. http://mrgeckosmedia.com/
// Copyright (c) 2011 Mr. Gecko's Media (James Coleman). All rights reserved. http://mrgeckosmedia.com/
//
#import <Cocoa/Cocoa.h>

View File

@ -3,7 +3,7 @@
// GeckoReporter
//
// Created by Mr. Gecko on 12/27/09.
// Copyright (c) 2010 Mr. Gecko's Media (James Coleman). All rights reserved. http://mrgeckosmedia.com/
// Copyright (c) 2011 Mr. Gecko's Media (James Coleman). All rights reserved. http://mrgeckosmedia.com/
//
#import <Cocoa/Cocoa.h>

View File

@ -3,7 +3,7 @@
// GeckoReporter
//
// Created by Mr. Gecko on 12/28/09.
// Copyright (c) 2010 Mr. Gecko's Media (James Coleman). All rights reserved. http://mrgeckosmedia.com/
// Copyright (c) 2011 Mr. Gecko's Media (James Coleman). All rights reserved. http://mrgeckosmedia.com/
//
#import <Cocoa/Cocoa.h>

View File

@ -3,7 +3,7 @@
// GeckoReporter
//
// Created by Mr. Gecko on 1/2/10.
// Copyright (c) 2010 Mr. Gecko's Media (James Coleman). All rights reserved. http://mrgeckosmedia.com/
// Copyright (c) 2011 Mr. Gecko's Media (James Coleman). All rights reserved. http://mrgeckosmedia.com/
//
#import <Cocoa/Cocoa.h>

View File

@ -3,7 +3,7 @@
// GeckoReporter
//
// Created by Mr. Gecko on 12/31/09.
// Copyright (c) 2010 Mr. Gecko's Media (James Coleman). All rights reserved. http://mrgeckosmedia.com/
// Copyright (c) 2011 Mr. Gecko's Media (James Coleman). All rights reserved. http://mrgeckosmedia.com/
//
#import <Cocoa/Cocoa.h>

View File

@ -2,6 +2,8 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BuildMachineOSBuild</key>
<string>10J567</string>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
@ -15,12 +17,26 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>0.1</string>
<string>0.2</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>0.1</string>
<string>0.2</string>
<key>DTCompiler</key>
<string>4.2</string>
<key>DTPlatformBuild</key>
<string>4A278b</string>
<key>DTPlatformVersion</key>
<string>GM</string>
<key>DTSDKBuild</key>
<string>4A278b</string>
<key>DTSDKName</key>
<string>macosx10.6</string>
<key>DTXcode</key>
<string>0400</string>
<key>DTXcodeBuild</key>
<string>4A278b</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright (c) 2010 Mr. Gecko's Media (James Coleman). All rights reserved. http://mrgeckosmedia.com/</string>
<string>Copyright (c) 2011 Mr. Gecko's Media (James Coleman). All rights reserved. http://mrgeckosmedia.com/</string>
</dict>
</plist>

View File

@ -51,4 +51,4 @@ extern NSString * const MGMVMSExt;
- (void)application:(NSApplication *)sender openFiles:(NSArray *)files;
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender;
@end
@end

View File

@ -17,6 +17,7 @@ extern NSString * const MGMUserDoneNotification;
extern NSString * const MGMUserUpdatedNotification;
extern NSString * const MGMUserID;
extern NSString * const MGMUserName;
extern NSString * const MGMUserPassword;
@class MGMUser, MGMKeychainItem, MGMHTTPCookieStorage;

View File

@ -1,59 +0,0 @@
//
// NSBundle+SUAdditions.h
// Sparkle
//
// Created by Andy Matuschak on 12/21/07.
// Copyright 2007 Andy Matuschak. All rights reserved.
//
#ifndef NSBUNDLE_PLUS_ADDITIONS_H
#define NSBUNDLE_PLUS_ADDITIONS_H
#import <Cocoa/Cocoa.h>
@interface NSBundle (SUAdditions)
/*!
@method
@abstract Returns a name for the bundle suitable for display to the user.
@discussion This is performed by asking NSFileManager for the display name of the bundle.
*/
- (NSString *)name;
/*!
@method
@abstract Returns the current internal version of the bundle.
@discussion This uses the CFBundleVersion info value. This string is not appropriate for display to users: use -displayVersion instead.
*/
- (NSString *)version;
/*!
@method
@abstract Returns the bundle's version, suitable for display to the user.
@discussion If the CFBundleShortVersionString is available and different from the CFBundleVersion, this looks like CFBundleShortVersionString (CFBundleVersion). If the version strings are the same or CFBundleShortVersionString is not defined, this is equivalent to -version.
*/
- (NSString *)displayVersion;
/*!
@method
@abstract Returns a suitable icon for this bundle.
@discussion Uses the CFBundleIconFile icon if defined; otherwise, uses the default application icon.
*/
- (NSImage *)icon;
/*!
@method
@abstract Returns whether the application is running from a disk image.
*/
- (BOOL)isRunningFromDiskImage;
/*!
@method
@abstract Returns a profile of the users system useful for statistical purposes.
@discussion Returns an array of dictionaries; each dictionary represents a piece of data and has keys "key", "visibleKey", "value", and "visibleValue".
*/
- (NSArray *)systemProfile;
- (NSString *)publicDSAKey;
@end
#endif

View File

@ -1,18 +0,0 @@
//
// NSFileManager+Aliases.h
// Sparkle
//
// Created by Andy Matuschak on 2/4/08.
// Copyright 2008 Andy Matuschak. All rights reserved.
//
#ifndef NSFILEMANAGER_PLUS_ALIASES_H
#define NSFILEMANAGER_PLUS_ALIASES_H
#import <Cocoa/Cocoa.h>
@interface NSFileManager (SUAliases)
- (BOOL)isAliasFolderAtPath:(NSString *)path;
@end
#endif

View File

@ -1,16 +0,0 @@
//
// NSFileManager+Authentication.m
// Sparkle
//
// Created by Andy Matuschak on 3/9/06.
// Copyright 2006 Andy Matuschak. All rights reserved.
//
#ifndef NSFILEMANAGER_PLUS_AUTHENTICATION_H
#define NSFILEMANAGER_PLUS_AUTHENTICATION_H
@interface NSFileManager (SUAuthenticationAdditions)
- (BOOL)copyPathWithAuthentication:(NSString *)src overPath:(NSString *)dst error:(NSError **)error;
@end
#endif

View File

@ -1,53 +0,0 @@
//
// NSFileManager+ExtendedAttributes.h
// Sparkle
//
// Created by Mark Mentovai on 2008-01-22.
// Copyright 2008 Mark Mentovai. All rights reserved.
//
#ifndef NSFILEMANAGER_PLUS_EXTENDEDATTRIBUTES
#define NSFILEMANAGER_PLUS_EXTENDEDATTRIBUTES
#import <Cocoa/Cocoa.h>
@interface NSFileManager (MMExtendedAttributes)
// Wraps the removexattr system call, allowing an AppKit-style NSString* to
// be used for the pathname argument. Note that the order of the arguments
// has changed from what removexattr accepts, so that code reads more
// naturally.
//
// removexattr is only available on Mac OS X 10.4 ("Tiger") and later. If
// built with an SDK that includes removexattr, this method will link against
// removexattr directly. When using earlier SDKs, this method will dynamically
// look up the removexattr symbol at runtime. If the symbol is not present,
// as will be the case when running on 10.3, this method returns -1 and sets
// errno to ENOSYS.
- (int)removeXAttr:(const char*)name
fromFile:(NSString*)file
options:(int)options;
// Removes the directory tree rooted at |root| from the file quarantine.
// The quarantine was introduced on Mac OS X 10.5 and is described at:
//
// http://developer.apple.com/releasenotes/Carbon/RN-LaunchServices/index.html
//#apple_ref/doc/uid/TP40001369-DontLinkElementID_2
//
// If |root| is not a directory, then it alone is removed from the quarantine.
// Symbolic links, including |root| if it is a symbolic link, will not be
// traversed.
//
// Ordinarily, the quarantine is managed by calling LSSetItemAttribute
// to set the kLSItemQuarantineProperties attribute to a dictionary specifying
// the quarantine properties to be applied. However, it does not appear to be
// possible to remove an item from the quarantine directly through any public
// Launch Services calls. Instead, this method takes advantage of the fact
// that the quarantine is implemented in part by setting an extended attribute,
// "com.apple.quarantine", on affected files. Removing this attribute is
// sufficient to remove files from the quarantine.
- (void)releaseFromQuarantine:(NSString*)root;
@end
#endif

View File

@ -1,17 +0,0 @@
//
// NSFileManager+Verification.h
// Sparkle
//
// Created by Andy Matuschak on 3/16/06.
// Copyright 2006 Andy Matuschak. All rights reserved.
//
#ifndef NSFILEMANAGER_PLUS_VERIFICATION_H
#define NSFILEMANAGER_PLUS_VERIFICATION_H
// For the paranoid folks!
@interface NSFileManager (SUVerification)
- (BOOL)validatePath:(NSString *)path withEncodedDSASignature:(NSString *)encodedSignature withPublicDSAKey:(NSString *)pkeyString;
@end
#endif

Some files were not shown because too many files have changed in this diff Show More