2010-09-30 12:27:22 -05:00
|
|
|
//
|
|
|
|
// MGMVoiceContacts.m
|
|
|
|
// VoiceMob
|
|
|
|
//
|
|
|
|
// Created by Mr. Gecko on 9/29/10.
|
2013-07-20 06:56:17 -05:00
|
|
|
// Copyright (c) 2011 Mr. Gecko's Media (James Coleman). http://mrgeckosmedia.com/
|
2010-09-30 12:27:22 -05:00
|
|
|
//
|
|
|
|
|
|
|
|
#import "MGMVoiceContacts.h"
|
|
|
|
#import "MGMVoiceUser.h"
|
2013-07-20 06:56:17 -05:00
|
|
|
#import "MGMAccountController.h"
|
|
|
|
#import "MGMController.h"
|
2010-10-02 22:00:01 -05:00
|
|
|
#import "MGMVoiceSMS.h"
|
2010-09-30 12:27:22 -05:00
|
|
|
#import "MGMVMAddons.h"
|
2010-10-01 22:03:15 -05:00
|
|
|
#import <VoiceBase/VoiceBase.h>
|
2010-09-30 12:27:22 -05:00
|
|
|
|
|
|
|
@implementation MGMVoiceContacts
|
|
|
|
+ (id)tabWithVoiceUser:(MGMVoiceUser *)theVoiceUser {
|
|
|
|
return [[[self alloc] initWithVoiceUser:theVoiceUser] autorelease];
|
|
|
|
}
|
|
|
|
- (id)initWithVoiceUser:(MGMVoiceUser *)theVoiceUser {
|
2013-07-20 06:56:17 -05:00
|
|
|
if ((self = [super initWithAccountController:[theVoiceUser accountController]])) {
|
2010-09-30 12:27:22 -05:00
|
|
|
voiceUser = theVoiceUser;
|
|
|
|
}
|
|
|
|
return self;
|
|
|
|
}
|
2013-07-20 06:56:17 -05:00
|
|
|
- (void)dealloc {
|
|
|
|
#if releaseDebug
|
|
|
|
NSLog(@"%s Releasing", __PRETTY_FUNCTION__);
|
|
|
|
#endif
|
|
|
|
[self releaseView];
|
|
|
|
[super dealloc];
|
|
|
|
}
|
2010-09-30 12:27:22 -05:00
|
|
|
|
|
|
|
- (MGMVoiceUser *)voiceUser {
|
|
|
|
return voiceUser;
|
|
|
|
}
|
|
|
|
- (MGMContacts *)contacts {
|
|
|
|
return [[voiceUser instance] contacts];
|
|
|
|
}
|
|
|
|
|
|
|
|
- (UIView *)view {
|
2010-09-30 22:52:12 -05:00
|
|
|
if (view==nil) {
|
|
|
|
if (![[NSBundle mainBundle] loadNibNamed:[[UIDevice currentDevice] appendDeviceSuffixToString:@"VoiceContacts"] owner:self options:nil]) {
|
|
|
|
NSLog(@"Unable to load Voice Contacts");
|
|
|
|
} else {
|
|
|
|
[super awakeFromNib];
|
|
|
|
}
|
2010-09-30 12:27:22 -05:00
|
|
|
}
|
|
|
|
return view;
|
|
|
|
}
|
|
|
|
- (void)releaseView {
|
2013-07-20 06:56:17 -05:00
|
|
|
#if releaseDebug
|
|
|
|
NSLog(@"%s Releasing", __PRETTY_FUNCTION__);
|
|
|
|
#endif
|
|
|
|
[view release];
|
|
|
|
view = nil;
|
2010-09-30 12:27:22 -05:00
|
|
|
[super releaseView];
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void)selectedContact:(NSDictionary *)theContact {
|
2013-07-20 06:56:17 -05:00
|
|
|
[voiceUser showOptionsForNumber:[theContact objectForKey:MGMCNumber]];
|
2010-09-30 12:27:22 -05:00
|
|
|
[contactsTable deselectRowAtIndexPath:[contactsTable indexPathForSelectedRow] animated:YES];
|
|
|
|
}
|
|
|
|
@end
|