Merge branch 'new_ui' of git://git.linphone.org/linphone-iphone

Conflicts:
	linphone.xcodeproj/project.pbxproj
This commit is contained in:
Yann Diorcet 2012-07-27 15:22:32 +02:00
commit 9387905581
26 changed files with 64 additions and 47 deletions

View file

@ -24,6 +24,7 @@
@interface ContactsTableViewController : UITableViewController {
OrderedDictionary* addressBookMap;
NSMutableDictionary* avatarMap;
ABAddressBookRef addressBook;
}

View file

@ -31,6 +31,7 @@
- (void)initContactsTableViewController {
addressBookMap = [[OrderedDictionary alloc] init];
avatarMap = [[NSMutableDictionary alloc] init];
addressBook = ABAddressBookCreate();
ABAddressBookRegisterExternalChangeCallback(addressBook, sync_address_book, self);
@ -56,6 +57,9 @@
ABAddressBookUnregisterExternalChangeCallback(addressBook, sync_address_book, self);
CFRelease(addressBook);
[addressBookMap removeAllObjects];
[addressBookMap release];
[avatarMap removeAllObjects];
[avatarMap release];
[super dealloc];
}
@ -68,6 +72,7 @@
// Reset Address book
[addressBookMap removeAllObjects];
[avatarMap removeAllObjects];
NSArray *lContacts = (NSArray *)ABAddressBookCopyArrayOfAllPeople(addressBook);
for (id lPerson in lContacts) {
@ -78,7 +83,7 @@
for(int i = 0; i < ABMultiValueGetCount(lMap); ++i) {
CFDictionaryRef lDict = ABMultiValueCopyValueAtIndex(lMap, i);
if(CFDictionaryContainsKey(lDict, @"service")) {
if(CFStringCompare((CFStringRef)@"SIP", CFDictionaryGetValue(lDict, @"service"), kCFCompareCaseInsensitive) == 0) {
if(CFStringCompare((CFStringRef)@"SIP", CFDictionaryGetValue(lDict, @"service"), kCFCompareCaseInsensitive) == 0) {
add = true;
}
} else {
@ -126,7 +131,7 @@
}
}
CFRelease(lContacts);
}
}
[self.tableView reloadData];
}
@ -136,7 +141,6 @@ static void sync_address_book (ABAddressBookRef addressBook, CFDictionaryRef inf
[controller loadData];
}
#pragma mark - ViewController Functions
- (void)viewWillDisappear:(BOOL)animated {
@ -169,6 +173,21 @@ static void sync_address_book (ABAddressBookRef addressBook, CFDictionaryRef inf
NSString *key = [[subDic allKeys] objectAtIndex:[indexPath row]];
ABRecordRef contact = [subDic objectForKey:key];
// Cached avatar
UIImage *image = nil;
id data = [avatarMap objectForKey:[NSNumber numberWithInt: ABRecordGetRecordID(contact)]];
if(data == nil) {
image = [FastAddressBook getContactImage:contact thumbnail:true];
[avatarMap setObject:image forKey:[NSNumber numberWithInt: ABRecordGetRecordID(contact)]];
} else if(data != [NSNull null]) {
image = data;
}
if(image == nil) {
image = [UIImage imageNamed:@"avatar_unknown_small.png"];
}
[[cell avatarImage] setImage:image];
[cell setContact: contact];
return cell;
}

View file

@ -101,11 +101,11 @@
CFRelease(lFirstName);
// Avatar
UIImage *image = [FastAddressBook getContactImage:contact thumbnail:true];
/*UIImage *image = [FastAddressBook getContactImage:contact thumbnail:true];
if(image == nil) {
image = [UIImage imageNamed:@"avatar_unknown_small.png"];
}
[avatarImage setImage:image];
[avatarImage setImage:image];*/
//
// Adapt size

View file

@ -215,7 +215,6 @@
D347347F1580E5F8003C7B8C /* history_selected.png in Resources */ = {isa = PBXBuildFile; fileRef = D347347D1580E5F8003C7B8C /* history_selected.png */; };
D34BD61015C136D70070C209 /* GDataXMLNode.m in Sources */ = {isa = PBXBuildFile; fileRef = D34BD60F15C136D70070C209 /* GDataXMLNode.m */; };
D34BD61115C136D70070C209 /* GDataXMLNode.m in Sources */ = {isa = PBXBuildFile; fileRef = D34BD60F15C136D70070C209 /* GDataXMLNode.m */; };
D34BD61415C13A540070C209 /* libNinePatch.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D389363215A6D3C500A3A3AA /* libNinePatch.a */; };
D34BD61515C13B7B0070C209 /* libsqlite3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = D32B6E2E15A5C0AC0033019F /* libsqlite3.dylib */; };
D34BD61815C13D0B0070C209 /* liblinphone.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2211DB911475562600DEE054 /* liblinphone.a */; };
D34BD61915C13D0B0070C209 /* libmediastreamer.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2211DB8F147555C800DEE054 /* libmediastreamer.a */; };
@ -650,7 +649,6 @@
D389362715A6D19800A3A3AA /* CPAnimationSequence.m in Sources */ = {isa = PBXBuildFile; fileRef = D389362315A6D19800A3A3AA /* CPAnimationSequence.m */; };
D389362815A6D19800A3A3AA /* CPAnimationStep.m in Sources */ = {isa = PBXBuildFile; fileRef = D389362515A6D19800A3A3AA /* CPAnimationStep.m */; };
D389362915A6D19800A3A3AA /* CPAnimationStep.m in Sources */ = {isa = PBXBuildFile; fileRef = D389362515A6D19800A3A3AA /* CPAnimationStep.m */; };
D389363515A6D40000A3A3AA /* libNinePatch.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D389363215A6D3C500A3A3AA /* libNinePatch.a */; };
D389363915A6D53200A3A3AA /* chat_bubble_incoming.9.png in Resources */ = {isa = PBXBuildFile; fileRef = D389363715A6D53200A3A3AA /* chat_bubble_incoming.9.png */; };
D389363B15A6D53200A3A3AA /* chat_bubble_outgoing.9.png in Resources */ = {isa = PBXBuildFile; fileRef = D389363815A6D53200A3A3AA /* chat_bubble_outgoing.9.png */; };
D38D14AF15A30B3D008497E8 /* cell_call_first_highlight.png in Resources */ = {isa = PBXBuildFile; fileRef = D38D14AD15A30B3D008497E8 /* cell_call_first_highlight.png */; };
@ -857,23 +855,23 @@
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
D34BD61215C139D90070C209 /* PBXContainerItemProxy */ = {
D3B90E1815C2CB5800F64F8C /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = D389362A15A6D3C500A3A3AA /* NinePatch.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = D2AAC07D0554694100DB518D;
remoteInfo = NinePatch;
};
D389363115A6D3C500A3A3AA /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = D389362A15A6D3C500A3A3AA /* NinePatch.xcodeproj */;
containerPortal = D3B90E1115C2CB5700F64F8C /* NinePatch.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = D2AAC07E0554694100DB518D;
remoteInfo = NinePatch;
};
D389363315A6D3EB00A3A3AA /* PBXContainerItemProxy */ = {
D3B90E1A15C2CBC800F64F8C /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = D389362A15A6D3C500A3A3AA /* NinePatch.xcodeproj */;
containerPortal = D3B90E1115C2CB5700F64F8C /* NinePatch.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = D2AAC07D0554694100DB518D;
remoteInfo = NinePatch;
};
D3B90E1C15C2CBCD00F64F8C /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = D3B90E1115C2CB5700F64F8C /* NinePatch.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = D2AAC07D0554694100DB518D;
remoteInfo = NinePatch;
@ -1408,7 +1406,6 @@
D389362315A6D19800A3A3AA /* CPAnimationSequence.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPAnimationSequence.m; path = Utils/CPAnimation/CPAnimationSequence.m; sourceTree = "<group>"; };
D389362415A6D19800A3A3AA /* CPAnimationStep.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPAnimationStep.h; path = Utils/CPAnimation/CPAnimationStep.h; sourceTree = "<group>"; };
D389362515A6D19800A3A3AA /* CPAnimationStep.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPAnimationStep.m; path = Utils/CPAnimation/CPAnimationStep.m; sourceTree = "<group>"; };
D389362A15A6D3C500A3A3AA /* NinePatch.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = NinePatch.xcodeproj; path = NinePatch/NinePatch.xcodeproj; sourceTree = "<group>"; };
D389363715A6D53200A3A3AA /* chat_bubble_incoming.9.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = chat_bubble_incoming.9.png; path = Resources/chat_bubble_incoming.9.png; sourceTree = "<group>"; };
D389363815A6D53200A3A3AA /* chat_bubble_outgoing.9.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = chat_bubble_outgoing.9.png; path = Resources/chat_bubble_outgoing.9.png; sourceTree = "<group>"; };
D38D14AD15A30B3D008497E8 /* cell_call_first_highlight.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = cell_call_first_highlight.png; path = Resources/cell_call_first_highlight.png; sourceTree = "<group>"; };
@ -1427,6 +1424,7 @@
D3B829FC15C148C90036C93E /* castel.xsd */ = {isa = PBXFileReference; lastKnownFileType = text; path = castel.xsd; sourceTree = "<group>"; };
D3B82A0015C18A710036C93E /* history_details_bar_background.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = history_details_bar_background.png; path = Resources/history_details_bar_background.png; sourceTree = "<group>"; };
D3B82A0115C18A710036C93E /* settings_bar_background.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = settings_bar_background.png; path = Resources/settings_bar_background.png; sourceTree = "<group>"; };
D3B90E1115C2CB5700F64F8C /* NinePatch.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = NinePatch.xcodeproj; path = Utils/NinePatch/NinePatch.xcodeproj; sourceTree = "<group>"; };
D3B9A3DA15A58C440096EA4E /* chat_field.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = chat_field.png; path = Resources/chat_field.png; sourceTree = "<group>"; };
D3B9A3DB15A58C440096EA4E /* chat_ok_default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = chat_ok_default.png; path = Resources/chat_ok_default.png; sourceTree = "<group>"; };
D3B9A3DC15A58C440096EA4E /* chat_ok_over.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = chat_ok_over.png; path = Resources/chat_ok_over.png; sourceTree = "<group>"; };
@ -1644,7 +1642,6 @@
70E542F513E147EB002BA2C0 /* QuartzCore.framework in Frameworks */,
2264B6D211200342002C2C53 /* SystemConfiguration.framework in Frameworks */,
1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */,
D389363515A6D40000A3A3AA /* libNinePatch.a in Frameworks */,
344ABDF114850AE9007420B6 /* libc++.1.dylib in Frameworks */,
D32B6E2F15A5C0AC0033019F /* libsqlite3.dylib in Frameworks */,
344ABDF214850AE9007420B6 /* libstdc++.6.dylib in Frameworks */,
@ -1700,7 +1697,6 @@
22D8F15C147548E2008C97DB /* QuartzCore.framework in Frameworks */,
22D8F173147548E2008C97DB /* SystemConfiguration.framework in Frameworks */,
22D8F166147548E2008C97DB /* UIKit.framework in Frameworks */,
D34BD61415C13A540070C209 /* libNinePatch.a in Frameworks */,
22D8F178147548E2008C97DB /* libresolv.dylib in Frameworks */,
D34BD61515C13B7B0070C209 /* libsqlite3.dylib in Frameworks */,
22D8F164147548E2008C97DB /* libcrypto.a in Frameworks */,
@ -2220,7 +2216,6 @@
22744043106F33FC006EC466 /* Security.framework */,
2264B6D111200342002C2C53 /* SystemConfiguration.framework */,
22F51EF5107FA66500F98953 /* untitled.plist */,
D389362A15A6D3C500A3A3AA /* NinePatch.xcodeproj */,
080E96DDFE201D6D7F000001 /* Classes */,
29B97323FDCFA39411CA2CEA /* Frameworks */,
220FAC77107654FC0068D98F /* include */,
@ -2543,6 +2538,7 @@
D32B9DFA15A2F131000B6DEC /* FastAddressBook.h */,
D32B9DFB15A2F131000B6DEC /* FastAddressBook.m */,
D3807FC715C2894A005BE9BC /* InAppSettingsKit */,
D3B90E1115C2CB5700F64F8C /* NinePatch.xcodeproj */,
D326483615887D5200930C67 /* OrderedDictionary.h */,
D326483715887D5200930C67 /* OrderedDictionary.m */,
D3F9A9DD15AF0FFE0045320F /* TPKeyboardAvoiding */,
@ -2660,14 +2656,6 @@
name = CPAnimation;
sourceTree = "<group>";
};
D389362B15A6D3C500A3A3AA /* Products */ = {
isa = PBXGroup;
children = (
D389363215A6D3C500A3A3AA /* libNinePatch.a */,
);
name = Products;
sourceTree = "<group>";
};
D398D3031594B0FB00FD553C /* Settings */ = {
isa = PBXGroup;
children = (
@ -2676,6 +2664,14 @@
path = Settings;
sourceTree = "<group>";
};
D3B90E1215C2CB5700F64F8C /* Products */ = {
isa = PBXGroup;
children = (
D3B90E1915C2CB5800F64F8C /* libNinePatch.a */,
);
name = Products;
sourceTree = "<group>";
};
D3F7997E15BD31EC0018C273 /* TPMultiLayoutViewController */ = {
isa = PBXGroup;
children = (
@ -2720,7 +2716,7 @@
buildRules = (
);
dependencies = (
D389363415A6D3EB00A3A3AA /* PBXTargetDependency */,
D3B90E1B15C2CBC800F64F8C /* PBXTargetDependency */,
);
name = linphone;
productName = linphone;
@ -2739,7 +2735,7 @@
buildRules = (
);
dependencies = (
D34BD61315C139D90070C209 /* PBXTargetDependency */,
D3B90E1D15C2CBCD00F64F8C /* PBXTargetDependency */,
);
name = "linphone-no-gpl-thirdparties";
productName = linphone;
@ -2769,8 +2765,8 @@
projectDirPath = "";
projectReferences = (
{
ProductGroup = D389362B15A6D3C500A3A3AA /* Products */;
ProjectRef = D389362A15A6D3C500A3A3AA /* NinePatch.xcodeproj */;
ProductGroup = D3B90E1215C2CB5700F64F8C /* Products */;
ProjectRef = D3B90E1115C2CB5700F64F8C /* NinePatch.xcodeproj */;
},
);
projectRoot = "";
@ -2782,11 +2778,11 @@
/* End PBXProject section */
/* Begin PBXReferenceProxy section */
D389363215A6D3C500A3A3AA /* libNinePatch.a */ = {
D3B90E1915C2CB5800F64F8C /* libNinePatch.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libNinePatch.a;
remoteRef = D389363115A6D3C500A3A3AA /* PBXContainerItemProxy */;
remoteRef = D3B90E1815C2CB5800F64F8C /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
/* End PBXReferenceProxy section */
@ -3586,15 +3582,15 @@
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
D34BD61315C139D90070C209 /* PBXTargetDependency */ = {
D3B90E1B15C2CBC800F64F8C /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = NinePatch;
targetProxy = D34BD61215C139D90070C209 /* PBXContainerItemProxy */;
targetProxy = D3B90E1A15C2CBC800F64F8C /* PBXContainerItemProxy */;
};
D389363415A6D3EB00A3A3AA /* PBXTargetDependency */ = {
D3B90E1D15C2CBCD00F64F8C /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = NinePatch;
targetProxy = D389363315A6D3EB00A3A3AA /* PBXContainerItemProxy */;
targetProxy = D3B90E1C15C2CBCD00F64F8C /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
@ -3641,8 +3637,8 @@
submodules/externals/osip/include,
submodules/externals/exosip/include,
submodules/externals/speex/include,
classes/Utils/NinePatch/,
/usr/include/libxml2,
NinePatch,
);
INFOPLIST_FILE = "linphone-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 4.0;
@ -3716,8 +3712,8 @@
submodules/externals/osip/include,
submodules/externals/exosip/include,
submodules/externals/speex/include,
classes/Utils/NinePatch/,
/usr/include/libxml2,
NinePatch,
);
INFOPLIST_FILE = "linphone-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 4.0;
@ -3772,8 +3768,8 @@
submodules/externals/osip/include,
submodules/externals/exosip/include,
submodules/externals/speex/include,
classes/Utils/NinePatch/,
/usr/include/libxml2,
NinePatch,
);
INFOPLIST_FILE = "linphone-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 4.0;
@ -3827,6 +3823,7 @@
submodules/externals/osip/include,
submodules/externals/exosip/include,
submodules/externals/speex/include,
classes/Utils/NinePatch/,
/usr/include/libxml2,
NinePatch,
);
@ -3883,8 +3880,8 @@
submodules/externals/osip/include,
submodules/externals/exosip/include,
submodules/externals/speex/include,
classes/Utils/NinePatch/,
/usr/include/libxml2,
NinePatch,
);
INFOPLIST_FILE = "linphone-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 4.0;
@ -3939,8 +3936,8 @@
submodules/externals/osip/include,
submodules/externals/exosip/include,
submodules/externals/speex/include,
classes/Utils/NinePatch/,
/usr/include/libxml2,
NinePatch,
);
INFOPLIST_FILE = "linphone-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 4.0;
@ -4013,8 +4010,8 @@
submodules/externals/osip/include,
submodules/externals/exosip/include,
submodules/externals/speex/include,
classes/Utils/NinePatch/,
/usr/include/libxml2,
NinePatch,
);
INFOPLIST_FILE = "linphone-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 4.0;
@ -4088,8 +4085,8 @@
submodules/externals/osip/include,
submodules/externals/exosip/include,
submodules/externals/speex/include,
classes/Utils/NinePatch/,
/usr/include/libxml2,
NinePatch,
);
INFOPLIST_FILE = "linphone-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 4.0;