diff --git a/Classes/Base.lproj/ContactDetailsViewController.xib b/Classes/Base.lproj/ContactDetailsViewController.xib index f0180bfc9..dfd1f70b1 100644 --- a/Classes/Base.lproj/ContactDetailsViewController.xib +++ b/Classes/Base.lproj/ContactDetailsViewController.xib @@ -70,7 +70,7 @@ - + @@ -87,23 +87,9 @@ - - - - - - - - - - - - - - diff --git a/Classes/ContactDetailsTableViewController.h b/Classes/ContactDetailsTableViewController.h index 3deaa2107..4b362e9ea 100644 --- a/Classes/ContactDetailsTableViewController.h +++ b/Classes/ContactDetailsTableViewController.h @@ -22,9 +22,6 @@ #import "ContactDetailsDelegate.h" #import "ContactDetailsLabelViewController.h" -#import "UIContactDetailsHeader.h" -#import "UIContactDetailsFooter.h" - typedef enum _ContactSections { ContactSections_None = 0, @@ -43,8 +40,6 @@ typedef enum _ContactSections { @property (nonatomic, assign, setter=setContact:) ABRecordRef contact; @property (nonatomic, strong) IBOutlet id contactDetailsDelegate; -@property (nonatomic, strong) IBOutlet UIContactDetailsHeader *headerController; -@property (nonatomic, strong) IBOutlet UIContactDetailsFooter *footerController; - (BOOL)isValid; - (void)addPhoneField:(NSString*)number; diff --git a/Classes/ContactDetailsTableViewController.m b/Classes/ContactDetailsTableViewController.m index 82f709fe6..9d158a033 100644 --- a/Classes/ContactDetailsTableViewController.m +++ b/Classes/ContactDetailsTableViewController.m @@ -53,8 +53,6 @@ static const ContactSections_e contactSections[ContactSections_MAX] = {ContactSections_None, ContactSections_Number, ContactSections_Sip, ContactSections_Email}; -@synthesize footerController; -@synthesize headerController; @synthesize contactDetailsDelegate; @synthesize contact; @@ -98,22 +96,8 @@ static const ContactSections_e contactSections[ContactSections_MAX] = {ContactSe } } -#pragma mark - ViewController Functions - -- (void)viewDidLoad { - [super viewDidLoad]; - [headerController view]; // Force view load - [footerController view]; // Force view load - - self.tableView.accessibilityIdentifier = @"Contact numbers table"; -} - #pragma mark - -- (BOOL)isValid { - return [headerController isValid]; -} - - (void)updateModification { [contactDetailsDelegate onModification:nil]; } @@ -466,7 +450,6 @@ static const ContactSections_e contactSections[ContactSections_MAX] = {ContactSe } contact = acontact; [self loadData]; - [headerController setContact:contact]; } - (void)addPhoneField:(NSString *)number { @@ -701,9 +684,6 @@ static const ContactSections_e contactSections[ContactSections_MAX] = {ContactSe [LinphoneUtils findAndResignFirstResponder:[self tableView]]; } - [headerController setEditing:editing animated:animated]; - [footerController setEditing:editing animated:animated]; - if (animated) { [self.tableView beginUpdates]; } @@ -748,23 +728,6 @@ static const ContactSections_e contactSections[ContactSections_MAX] = {ContactSe return UITableViewCellEditingStyleDelete; } -- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { - if (section == ContactSections_None) { - return [headerController view]; - } else { - return nil; - } -} - -- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section { - if (section == (ContactSections_MAX - 1)) { - if (ABRecordGetRecordID(contact) != kABRecordInvalidID) { - return [footerController view]; - } - } - return nil; -} - - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { if ([[self getSectionData:section] count] == 0) return nil; @@ -779,35 +742,6 @@ static const ContactSections_e contactSections[ContactSections_MAX] = {ContactSe return nil; } -- (NSString *)tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)section { - return nil; -} - -- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section { - if (section == ContactSections_None) { - return [UIContactDetailsHeader height:[headerController isEditing]]; - } else { - // Hide section if nothing in it - if ([[self getSectionData:section] count] > 0) - return 22; - else - return 0.000001f; // Hack UITableView = 0 - } -} - -- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section { - if (section == (ContactSections_MAX - 1)) { - if (ABRecordGetRecordID(contact) != kABRecordInvalidID) { - return [UIContactDetailsFooter height:[footerController isEditing]]; - } else { - return 0.000001f; // Hack UITableView = 0 - } - } else if (section == ContactSections_None) { - return 0.000001f; // Hack UITableView = 0 - } - return 10.0f; -} - #pragma mark - ContactDetailsLabelDelegate Functions - (void)changeContactDetailsLabel:(NSString *)value { @@ -888,4 +822,8 @@ static const ContactSections_e contactSections[ContactSections_MAX] = {ContactSe return TRUE; } +- (BOOL)isValid { + return true; +} + @end diff --git a/Classes/LinphoneUI/Base.lproj/UIContactDetailsFooter.strings b/Classes/LinphoneUI/Base.lproj/UIContactDetailsFooter.strings deleted file mode 100644 index d8404ad2e..000000000 Binary files a/Classes/LinphoneUI/Base.lproj/UIContactDetailsFooter.strings and /dev/null differ diff --git a/Classes/LinphoneUI/Base.lproj/UIContactDetailsFooter.xib b/Classes/LinphoneUI/Base.lproj/UIContactDetailsFooter.xib deleted file mode 100644 index 133dff539..000000000 --- a/Classes/LinphoneUI/Base.lproj/UIContactDetailsFooter.xib +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Classes/LinphoneUI/Base.lproj/UIContactDetailsHeader.strings b/Classes/LinphoneUI/Base.lproj/UIContactDetailsHeader.strings deleted file mode 100644 index 5f67bbc47..000000000 Binary files a/Classes/LinphoneUI/Base.lproj/UIContactDetailsHeader.strings and /dev/null differ diff --git a/Classes/LinphoneUI/Base.lproj/UIContactDetailsHeader.xib b/Classes/LinphoneUI/Base.lproj/UIContactDetailsHeader.xib deleted file mode 100644 index cb76c7954..000000000 --- a/Classes/LinphoneUI/Base.lproj/UIContactDetailsHeader.xib +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Classes/LinphoneUI/UIContactDetailsFooter.h b/Classes/LinphoneUI/UIContactDetailsFooter.h deleted file mode 100644 index 1fd974fe0..000000000 --- a/Classes/LinphoneUI/UIContactDetailsFooter.h +++ /dev/null @@ -1,34 +0,0 @@ -/* UIContactDetailsFooter.h - * - * Copyright (C) 2012 Belledonne Comunications, Grenoble, France - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#import - -#import "ContactDetailsDelegate.h" - -@interface UIContactDetailsFooter : UIViewController { -} - -@property (nonatomic, strong) IBOutlet UIButton *removeButton; -@property (nonatomic, strong) IBOutlet id contactDetailsDelegate; - -- (IBAction)onRemoveClick:(id)event; - -+ (CGFloat)height:(BOOL)editing; - -@end diff --git a/Classes/LinphoneUI/UIContactDetailsFooter.m b/Classes/LinphoneUI/UIContactDetailsFooter.m deleted file mode 100644 index 7a153c463..000000000 --- a/Classes/LinphoneUI/UIContactDetailsFooter.m +++ /dev/null @@ -1,74 +0,0 @@ -/* UIContactDetailsFooter.h - * - * Copyright (C) 2012 Belledonne Comunications, Grenoble, France - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#import "UIContactDetailsFooter.h" - -@implementation UIContactDetailsFooter - -@synthesize removeButton; -@synthesize contactDetailsDelegate; - -#pragma mark - Lifecycle Functions - -- (void)initUIContactDetailsFooter { -} - -- (id)init { - self = [super init]; - if (self != nil) { - [self initUIContactDetailsFooter]; - } - return self; -} - -- (id)initWithCoder:(NSCoder *)aDecoder { - self = [super initWithCoder:aDecoder]; - if (self != nil) { - [self initUIContactDetailsFooter]; - } - return self; -} - -- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { - self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; - if (self != nil) { - [self initUIContactDetailsFooter]; - } - return self; -} - -#pragma mark - Action Functions - -- (IBAction)onRemoveClick:(id)event { - if (contactDetailsDelegate != nil) { - [contactDetailsDelegate onRemove:event]; - } -} - -#pragma mark - - -+ (CGFloat)height:(BOOL)editing { - if (editing) { - return 80.0f; - } else { - return 0.000001f; // Hack UITableView = 0 - } -} - -@end diff --git a/Classes/LinphoneUI/UIContactDetailsHeader.h b/Classes/LinphoneUI/UIContactDetailsHeader.h deleted file mode 100644 index a6b20d296..000000000 --- a/Classes/LinphoneUI/UIContactDetailsHeader.h +++ /dev/null @@ -1,55 +0,0 @@ -/* UIContactDetailsHeader.h - * - * Copyright (C) 2012 Belledonne Comunications, Grenoble, France - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#import -#import - -#import "ImagePickerViewController.h" -#import "ContactDetailsDelegate.h" - -@interface UIContactDetailsHeader : UIViewController { - @private - NSArray *propertyList; - BOOL editing; -} - -@property (nonatomic, assign) ABRecordRef contact; - -@property (nonatomic, strong) IBOutlet UILabel *addressLabel; -@property (nonatomic, strong) IBOutlet UIImageView *avatarImage; - -@property (nonatomic, strong) IBOutlet UIView *normalView; -@property (nonatomic, strong) IBOutlet UIView *editView; -@property (nonatomic, strong) IBOutlet UITableView *tableView; -@property (nonatomic, strong) IBOutlet id contactDetailsDelegate; - -@property (strong, nonatomic) ImagePickerViewController* popoverController; - -@property(nonatomic,getter=isEditing) BOOL editing; - -- (IBAction)onAvatarClick:(id)event; - -+ (CGFloat)height:(BOOL)editing; - -- (void)setEditing:(BOOL)editing animated:(BOOL)animated; -- (void)setEditing:(BOOL)editing; -- (BOOL)isEditing; -- (BOOL)isValid; - -@end diff --git a/Classes/LinphoneUI/UIContactDetailsHeader.m b/Classes/LinphoneUI/UIContactDetailsHeader.m deleted file mode 100644 index b39a0d350..000000000 --- a/Classes/LinphoneUI/UIContactDetailsHeader.m +++ /dev/null @@ -1,373 +0,0 @@ -/* UIContactDetailsHeader.m - * - * Copyright (C) 2012 Belledonne Comunications, Grenoble, France - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#import "UIContactDetailsHeader.h" -#import "Utils.h" -#import "UIEditableTableViewCell.h" -#import "FastAddressBook.h" -#import "UILinphone.h" -#import "PhoneMainView.h" -#import "DTActionSheet.h" - -#import - -@implementation UIContactDetailsHeader - -@synthesize avatarImage; -@synthesize addressLabel; -@synthesize contact; -@synthesize normalView; -@synthesize editView; -@synthesize tableView; -@synthesize contactDetailsDelegate; -@synthesize popoverController; - -#pragma mark - Lifecycle Functions - -- (void)initUIContactDetailsHeader { - propertyList = [[NSArray alloc] initWithObjects:[NSNumber numberWithInt:kABPersonFirstNameProperty], - [NSNumber numberWithInt:kABPersonLastNameProperty], - [NSNumber numberWithInt:kABPersonOrganizationProperty], nil]; - editing = FALSE; -} - -- (id)init { - self = [super init]; - if (self != nil) { - [self initUIContactDetailsHeader]; - } - return self; -} - -- (id)initWithCoder:(NSCoder *)aDecoder { - self = [super initWithCoder:aDecoder]; - if (self != nil) { - [self initUIContactDetailsHeader]; - } - return self; -} - -- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { - self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; - if (self != nil) { - [self initUIContactDetailsHeader]; - } - return self; -} - -#pragma mark - ViewController Functions - -- (void)viewDidLoad { - [super viewDidLoad]; - [normalView setAlpha:1.0f]; - [editView setAlpha:0.0f]; - [tableView setEditing:TRUE animated:false]; - tableView.accessibilityIdentifier = @"Contact Name Table"; -} - -#pragma mark - Propery Functions - -- (void)setContact:(ABRecordRef)acontact { - contact = acontact; - [self update]; -} - -#pragma mark - - -- (BOOL)isValid { - for (int i = 0; i < [propertyList count]; ++i) { - UIEditableTableViewCell *cell = - (UIEditableTableViewCell *)[tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:i inSection:0]]; - if ([cell.detailTextField.text length] > 0) - return true; - } - return false; -} - -- (void)update { - if (contact == NULL) { - LOGW(@"Cannot update contact details header: null contact"); - return; - } - - // Avatar image - { - UIImage *image = [FastAddressBook getContactImage:contact thumbnail:false]; - if (image == nil) { - image = [UIImage imageNamed:@"avatar_unknown_small.png"]; - } - [avatarImage setImage:image]; - } - - // Contact label - { [addressLabel setText:[FastAddressBook getContactDisplayName:contact]]; } - - [tableView reloadData]; -} - -+ (CGFloat)height:(BOOL)editing { - if (editing) { - return 170.0f; - } else { - return 80.0f; - } -} - -- (void)setEditing:(BOOL)aediting animated:(BOOL)animated { - editing = aediting; - // Resign keyboard - if (!editing) { - [LinphoneUtils findAndResignFirstResponder:[self tableView]]; - [self update]; - } - if (animated) { - [UIView beginAnimations:nil context:nil]; - [UIView setAnimationDuration:0.3]; - } - if (editing) { - [editView setAlpha:1.0f]; - [normalView setAlpha:0.0f]; - } else { - [editView setAlpha:0.0f]; - [normalView setAlpha:1.0f]; - } - if (animated) { - [UIView commitAnimations]; - } -} - -- (void)setEditing:(BOOL)aediting { - [self setEditing:aediting animated:FALSE]; -} - -- (BOOL)isEditing { - return editing; -} - -- (void)updateModification { - [contactDetailsDelegate onModification:nil]; -} - -#pragma mark - UITableViewDataSource Functions - -- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { - return 1; -} - -- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { - return [propertyList count]; -} - -- (UITableViewCell *)tableView:(UITableView *)atableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - static NSString *kCellId = @"ContactDetailsHeaderCell"; - UIEditableTableViewCell *cell = [atableView dequeueReusableCellWithIdentifier:kCellId]; - if (cell == nil) { - cell = [[UIEditableTableViewCell alloc] initWithStyle:UITableViewCellStyleValue2 reuseIdentifier:kCellId]; - [cell.detailTextField setAutocapitalizationType:UITextAutocapitalizationTypeWords]; - [cell.detailTextField setAutocorrectionType:UITextAutocorrectionTypeNo]; - [cell.detailTextField setKeyboardType:UIKeyboardTypeDefault]; - [cell setBackgroundColor:[UIColor whiteColor]]; - } - - // setup placeholder - ABPropertyID property = [[propertyList objectAtIndex:[indexPath row]] intValue]; - if (property == kABPersonFirstNameProperty) { - [cell.detailTextField setPlaceholder:NSLocalizedString(@"First name", nil)]; - } else if (property == kABPersonLastNameProperty) { - [cell.detailTextField setPlaceholder:NSLocalizedString(@"Last name", nil)]; - } else if (property == kABPersonOrganizationProperty) { - [cell.detailTextField setPlaceholder:NSLocalizedString(@"Company name", nil)]; - } - - [cell.detailTextField setKeyboardType:UIKeyboardTypeDefault]; - - // setup values, if they exist - if (contact) { - NSString *lValue = CFBridgingRelease(ABRecordCopyValue(contact, property)); - if (lValue != NULL) { - [cell.detailTextLabel setText:lValue]; - [cell.detailTextField setText:lValue]; - } else { - [cell.detailTextLabel setText:@""]; - [cell.detailTextField setText:@""]; - } - } - [cell.detailTextField setDelegate:self]; - - return cell; -} - -#pragma mark - Action Functions - -- (IBAction)onAvatarClick:(id)event { - if (self.isEditing) { - void (^showAppropriateController)(UIImagePickerControllerSourceType) = - ^(UIImagePickerControllerSourceType type) { - UICompositeViewDescription *description = [ImagePickerViewController compositeViewDescription]; - ImagePickerViewController *controller; - if ([LinphoneManager runningOnIpad]) { - controller = DYNAMIC_CAST( - [[PhoneMainView instance].mainViewController getCachedController:description.content], - ImagePickerViewController); - // keep a reference to this controller so that in case of memory pressure we keep it - self.popoverController = controller; - } else { - controller = DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:description push:TRUE], - ImagePickerViewController); - } - if (controller != nil) { - controller.sourceType = type; - - // Displays a control that allows the user to choose picture or - // movie capture, if both are available: - controller.mediaTypes = [NSArray arrayWithObject:(NSString *)kUTTypeImage]; - - // Hides the controls for moving & scaling pictures, or for - // trimming movies. To instead show the controls, use YES. - controller.allowsEditing = NO; - controller.imagePickerDelegate = self; - - if ([LinphoneManager runningOnIpad]) { - [controller.popoverController presentPopoverFromRect:[avatarImage frame] - inView:self.view - permittedArrowDirections:UIPopoverArrowDirectionAny - animated:FALSE]; - } - } - }; - DTActionSheet *sheet = [[DTActionSheet alloc] initWithTitle:NSLocalizedString(@"Select picture source", nil)]; - if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) { - [sheet addButtonWithTitle:NSLocalizedString(@"Camera", nil) - block:^() { - showAppropriateController(UIImagePickerControllerSourceTypeCamera); - }]; - } - if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary]) { - [sheet addButtonWithTitle:NSLocalizedString(@"Photo library", nil) - block:^() { - showAppropriateController(UIImagePickerControllerSourceTypePhotoLibrary); - }]; - } - if ([FastAddressBook getContactImage:contact thumbnail:true] != nil) { - [sheet addDestructiveButtonWithTitle:NSLocalizedString(@"Remove", nil) - block:^() { - CFErrorRef error = NULL; - if (!ABPersonRemoveImageData(contact, (CFErrorRef *)&error)) { - LOGI(@"Can't remove entry: %@", - [(__bridge NSError *)error localizedDescription]); - } - [self update]; - }]; - } - [sheet addCancelButtonWithTitle:NSLocalizedString(@"Cancel", nil) - block:^{ - self.popoverController = nil; - }]; - - [sheet showInView:[PhoneMainView instance].view]; - } -} - -#pragma mark - ContactDetailsImagePickerDelegate Functions - -- (void)imagePickerDelegateImage:(UIImage *)image info:(NSDictionary *)info { - // Dismiss popover on iPad - if ([LinphoneManager runningOnIpad]) { - UICompositeViewDescription *description = [ImagePickerViewController compositeViewDescription]; - ImagePickerViewController *controller = - DYNAMIC_CAST([[PhoneMainView instance].mainViewController getCachedController:description.content], - ImagePickerViewController); - if (controller != nil) { - [controller.popoverController dismissPopoverAnimated:TRUE]; - self.popoverController = nil; - } - } - FastAddressBook *fab = [LinphoneManager instance].fastAddressBook; - CFErrorRef error = NULL; - if (!ABPersonRemoveImageData(contact, (CFErrorRef *)&error)) { - LOGI(@"Can't remove entry: %@", [(__bridge NSError *)error localizedDescription]); - } - NSData *dataRef = UIImageJPEGRepresentation(image, 0.9f); - CFDataRef cfdata = CFDataCreate(NULL, [dataRef bytes], [dataRef length]); - - [fab saveAddressBook]; - - if (!ABPersonSetImageData(contact, cfdata, (CFErrorRef *)&error)) { - LOGI(@"Can't add entry: %@", [(__bridge NSError *)error localizedDescription]); - } else { - [fab saveAddressBook]; - } - - CFRelease(cfdata); - - [self update]; -} - -#pragma mark - UITableViewDelegate Functions - -- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView - editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath { - return UITableViewCellEditingStyleNone; -} - -#pragma mark - UITextFieldDelegate Functions - -- (BOOL)textFieldShouldReturn:(UITextField *)textField { - [textField resignFirstResponder]; - return YES; -} - -- (BOOL)textField:(UITextField *)textField - shouldChangeCharactersInRange:(NSRange)range - replacementString:(NSString *)string { - if (contactDetailsDelegate != nil) { - // add a mini delay to have the text updated BEFORE notifying the selector - [self performSelector:@selector(updateModification) withObject:nil afterDelay:0.1]; - } - return YES; -} - -- (BOOL)textFieldShouldEndEditing:(UITextField *)textField { - UIView *view = [textField superview]; - // Find TableViewCell - while (view != nil && ![view isKindOfClass:[UIEditableTableViewCell class]]) - view = [view superview]; - - if (view != nil) { - UIEditableTableViewCell *cell = (UIEditableTableViewCell *)view; - NSIndexPath *indexPath = [self.tableView indexPathForCell:cell]; - ABPropertyID property = [[propertyList objectAtIndex:[indexPath row]] intValue]; - [cell.detailTextLabel setText:[textField text]]; - CFErrorRef error = NULL; - ABRecordSetValue(contact, property, (__bridge CFTypeRef)([textField text]), (CFErrorRef *)&error); - if (error != NULL) { - LOGE(@"Error when saving property %i in contact %p: Fail(%@)", property, contact, - [(__bridge NSError *)error localizedDescription]); - } - } else { - LOGW(@"Not valid UIEditableTableViewCell"); - } - if (contactDetailsDelegate != nil) { - // add a mini delay to have the text updated BEFORE notifying the selector - [self performSelector:@selector(updateModification) withObject:nil afterDelay:0.1]; - } - return TRUE; -} - -@end diff --git a/Classes/LinphoneUI/ar.lproj/UIContactDetailsFooter.strings b/Classes/LinphoneUI/ar.lproj/UIContactDetailsFooter.strings deleted file mode 100644 index e7f4ec919..000000000 Binary files a/Classes/LinphoneUI/ar.lproj/UIContactDetailsFooter.strings and /dev/null differ diff --git a/Classes/LinphoneUI/ar.lproj/UIContactDetailsHeader.strings b/Classes/LinphoneUI/ar.lproj/UIContactDetailsHeader.strings deleted file mode 100644 index fbb4793a2..000000000 Binary files a/Classes/LinphoneUI/ar.lproj/UIContactDetailsHeader.strings and /dev/null differ diff --git a/Classes/LinphoneUI/fr.lproj/UIContactDetailsFooter.strings b/Classes/LinphoneUI/fr.lproj/UIContactDetailsFooter.strings deleted file mode 100644 index e69c1bca3..000000000 Binary files a/Classes/LinphoneUI/fr.lproj/UIContactDetailsFooter.strings and /dev/null differ diff --git a/Classes/LinphoneUI/fr.lproj/UIContactDetailsHeader.strings b/Classes/LinphoneUI/fr.lproj/UIContactDetailsHeader.strings deleted file mode 100644 index 25edf1a57..000000000 Binary files a/Classes/LinphoneUI/fr.lproj/UIContactDetailsHeader.strings and /dev/null differ diff --git a/Classes/LinphoneUI/ru.lproj/UIContactDetailsFooter.strings b/Classes/LinphoneUI/ru.lproj/UIContactDetailsFooter.strings deleted file mode 100644 index a49afc474..000000000 Binary files a/Classes/LinphoneUI/ru.lproj/UIContactDetailsFooter.strings and /dev/null differ diff --git a/Classes/LinphoneUI/ru.lproj/UIContactDetailsHeader.strings b/Classes/LinphoneUI/ru.lproj/UIContactDetailsHeader.strings deleted file mode 100644 index 0ba585044..000000000 Binary files a/Classes/LinphoneUI/ru.lproj/UIContactDetailsHeader.strings and /dev/null differ diff --git a/linphone.xcodeproj/project.pbxproj b/linphone.xcodeproj/project.pbxproj index 118e13497..248836ba5 100755 --- a/linphone.xcodeproj/project.pbxproj +++ b/linphone.xcodeproj/project.pbxproj @@ -299,7 +299,6 @@ D36FB2D51589EF7C0036F6F2 /* UIPauseButton.m in Sources */ = {isa = PBXBuildFile; fileRef = D36FB2D41589EF7C0036F6F2 /* UIPauseButton.m */; }; D378906515AC373B00BD776C /* ContactDetailsLabelViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D378906315AC373B00BD776C /* ContactDetailsLabelViewController.m */; }; D378AB2A15DCDB4A0098505D /* ImagePickerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D378AB2915DCDB490098505D /* ImagePickerViewController.m */; }; - D37C639515AADDAF009D0BAC /* UIContactDetailsHeader.m in Sources */ = {isa = PBXBuildFile; fileRef = D37C639315AADDAE009D0BAC /* UIContactDetailsHeader.m */; }; D37C639B15AADEF6009D0BAC /* ContactDetailsTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D37C639A15AADEF5009D0BAC /* ContactDetailsTableViewController.m */; }; D37DC6C11594AE1800B2A5EB /* LinphoneCoreSettingsStore.m in Sources */ = {isa = PBXBuildFile; fileRef = D37DC6C01594AE1800B2A5EB /* LinphoneCoreSettingsStore.m */; }; D37DC7181594AF3400B2A5EB /* MessageUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D37DC7171594AF3400B2A5EB /* MessageUI.framework */; }; @@ -343,10 +342,8 @@ D38187E115FE349700C3EDCA /* UICallBar.xib in Resources */ = {isa = PBXBuildFile; fileRef = D38187E415FE349700C3EDCA /* UICallBar.xib */; }; D38187E515FE349D00C3EDCA /* UICallBar~ipad.xib in Resources */ = {isa = PBXBuildFile; fileRef = D38187E815FE349D00C3EDCA /* UICallBar~ipad.xib */; }; D38187F015FE354000C3EDCA /* UIConferenceHeader.xib in Resources */ = {isa = PBXBuildFile; fileRef = D38187F315FE354000C3EDCA /* UIConferenceHeader.xib */; }; - D38187F415FE354700C3EDCA /* UIContactDetailsFooter.xib in Resources */ = {isa = PBXBuildFile; fileRef = D38187F715FE354700C3EDCA /* UIContactDetailsFooter.xib */; }; D38187F815FE355D00C3EDCA /* UIMainBar.xib in Resources */ = {isa = PBXBuildFile; fileRef = D38187FB15FE355D00C3EDCA /* UIMainBar.xib */; }; D381881115FE3F0B00C3EDCA /* UICallCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = D381881415FE3F0B00C3EDCA /* UICallCell.xib */; }; - D381881515FE3F7F00C3EDCA /* UIContactDetailsHeader.xib in Resources */ = {isa = PBXBuildFile; fileRef = D381881815FE3F7F00C3EDCA /* UIContactDetailsHeader.xib */; }; D381881915FE3FCA00C3EDCA /* InCallViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = D381881C15FE3FCA00C3EDCA /* InCallViewController.xib */; }; D3A55FBC15877E5E003FD403 /* UIContactCell.m in Sources */ = {isa = PBXBuildFile; fileRef = D3A55FBB15877E5E003FD403 /* UIContactCell.m */; }; D3A8BB7015A6C7D500F96BE5 /* UIChatRoomCell.m in Sources */ = {isa = PBXBuildFile; fileRef = D3A8BB6F15A6C7D500F96BE5 /* UIChatRoomCell.m */; }; @@ -354,7 +351,6 @@ D3D5126C160B3A8E00946DF8 /* WizardViews.xib in Resources */ = {isa = PBXBuildFile; fileRef = D3D5126A160B3A8E00946DF8 /* WizardViews.xib */; }; D3D51270160B3AD400946DF8 /* WizardViewController~ipad.xib in Resources */ = {isa = PBXBuildFile; fileRef = D3D5126E160B3AD400946DF8 /* WizardViewController~ipad.xib */; }; D3D52A731614480700DEB00A /* IncomingCallViewController~ipad.xib in Resources */ = {isa = PBXBuildFile; fileRef = D3D52A711614480700DEB00A /* IncomingCallViewController~ipad.xib */; }; - D3E8F68615ADE05B0065A226 /* UIContactDetailsFooter.m in Sources */ = {isa = PBXBuildFile; fileRef = D3E8F68415ADE0580065A226 /* UIContactDetailsFooter.m */; }; D3EA53FD159850E80037DC6B /* LinphoneManager.m in Sources */ = {isa = PBXBuildFile; fileRef = D3EA53FC159850E80037DC6B /* LinphoneManager.m */; }; D3EA540D1598528B0037DC6B /* ChatTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D3EA540C1598528B0037DC6B /* ChatTableViewController.m */; }; D3EA5411159853750037DC6B /* UIChatCell.m in Sources */ = {isa = PBXBuildFile; fileRef = D3EA5410159853750037DC6B /* UIChatCell.m */; }; @@ -898,8 +894,6 @@ D378906315AC373B00BD776C /* ContactDetailsLabelViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ContactDetailsLabelViewController.m; sourceTree = ""; }; D378AB2815DCDB480098505D /* ImagePickerViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImagePickerViewController.h; sourceTree = ""; }; D378AB2915DCDB490098505D /* ImagePickerViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ImagePickerViewController.m; sourceTree = ""; }; - D37C639215AADDAE009D0BAC /* UIContactDetailsHeader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIContactDetailsHeader.h; sourceTree = ""; }; - D37C639315AADDAE009D0BAC /* UIContactDetailsHeader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UIContactDetailsHeader.m; sourceTree = ""; }; D37C639915AADEF4009D0BAC /* ContactDetailsTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContactDetailsTableViewController.h; sourceTree = ""; }; D37C639A15AADEF5009D0BAC /* ContactDetailsTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ContactDetailsTableViewController.m; sourceTree = ""; }; D37DC6BF1594AE1800B2A5EB /* LinphoneCoreSettingsStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LinphoneCoreSettingsStore.h; sourceTree = ""; }; @@ -957,8 +951,6 @@ D3C6526515AC1A8F0092A874 /* UIEditableTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIEditableTableViewCell.h; sourceTree = ""; }; D3C6526615AC1A8F0092A874 /* UIEditableTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UIEditableTableViewCell.m; sourceTree = ""; }; D3E84F3C15B018A600420DAC /* UILinphone.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UILinphone.h; sourceTree = ""; }; - D3E8F68315ADE0570065A226 /* UIContactDetailsFooter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIContactDetailsFooter.h; sourceTree = ""; }; - D3E8F68415ADE0580065A226 /* UIContactDetailsFooter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UIContactDetailsFooter.m; sourceTree = ""; }; D3EA53FB159850E80037DC6B /* LinphoneManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LinphoneManager.h; sourceTree = ""; }; D3EA53FC159850E80037DC6B /* LinphoneManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LinphoneManager.m; sourceTree = ""; }; D3EA540B1598528B0037DC6B /* ChatTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ChatTableViewController.h; sourceTree = ""; }; @@ -1021,8 +1013,6 @@ F09548271883F15400E8A69B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = "Base.lproj/UICallBar~ipad.xib"; sourceTree = ""; }; F09548281883F15400E8A69B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/UICallCell.xib; sourceTree = ""; }; F09548291883F15400E8A69B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/UIConferenceHeader.xib; sourceTree = ""; }; - F095482A1883F15400E8A69B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/UIContactDetailsFooter.xib; sourceTree = ""; }; - F095482B1883F15400E8A69B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/UIContactDetailsHeader.xib; sourceTree = ""; }; F095482C1883F15400E8A69B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/UIMainBar.xib; sourceTree = ""; }; F095482E1883F15500E8A69B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/WizardViewController.xib; sourceTree = ""; }; F095482F1883F15500E8A69B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = "Base.lproj/WizardViewController~ipad.xib"; sourceTree = ""; }; @@ -1059,10 +1049,6 @@ F095484E1883F5B300E8A69B /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = "ru.lproj/UICallBar~ipad.strings"; sourceTree = ""; }; F095484F1883F5D500E8A69B /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/UIConferenceHeader.strings; sourceTree = ""; }; F09548501883F5D900E8A69B /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/UIConferenceHeader.strings; sourceTree = ""; }; - F09548511883F5E300E8A69B /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/UIContactDetailsFooter.strings; sourceTree = ""; }; - F09548521883F5E600E8A69B /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/UIContactDetailsFooter.strings; sourceTree = ""; }; - F09548531883F5F400E8A69B /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/UIContactDetailsHeader.strings; sourceTree = ""; }; - F09548541883F5F700E8A69B /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/UIContactDetailsHeader.strings; sourceTree = ""; }; F09548551883F61300E8A69B /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/UIMainBar.strings; sourceTree = ""; }; F09548561883F61600E8A69B /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/UIMainBar.strings; sourceTree = ""; }; F09548591883F67800E8A69B /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/WizardViewController.strings; sourceTree = ""; }; @@ -1094,8 +1080,6 @@ F0AF07041A24BA770086C9C1 /* ar */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ar; path = ar.lproj/UICompositeViewController.strings; sourceTree = ""; }; F0AF07051A24BA770086C9C1 /* ar */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ar; path = ar.lproj/UIConferenceHeader.strings; sourceTree = ""; }; F0AF07061A24BA770086C9C1 /* ar */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ar; path = ar.lproj/UIContactCell.strings; sourceTree = ""; }; - F0AF07071A24BA770086C9C1 /* ar */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ar; path = ar.lproj/UIContactDetailsFooter.strings; sourceTree = ""; }; - F0AF07081A24BA770086C9C1 /* ar */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ar; path = ar.lproj/UIContactDetailsHeader.strings; sourceTree = ""; }; F0AF07091A24BA770086C9C1 /* ar */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ar; path = ar.lproj/UIHistoryCell.strings; sourceTree = ""; }; F0AF070A1A24BA770086C9C1 /* ar */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ar; path = ar.lproj/UIMainBar.strings; sourceTree = ""; }; F0AF070C1A24BA770086C9C1 /* ar */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ar; path = ar.lproj/UIStateBar.strings; sourceTree = ""; }; @@ -1388,12 +1372,6 @@ D3A55FBA15877E5E003FD403 /* UIContactCell.h */, D3A55FBB15877E5E003FD403 /* UIContactCell.m */, F088488D19FF8C41007FFCF3 /* UIContactCell.xib */, - D3E8F68315ADE0570065A226 /* UIContactDetailsFooter.h */, - D3E8F68415ADE0580065A226 /* UIContactDetailsFooter.m */, - D38187F715FE354700C3EDCA /* UIContactDetailsFooter.xib */, - D37C639215AADDAE009D0BAC /* UIContactDetailsHeader.h */, - D37C639315AADDAE009D0BAC /* UIContactDetailsHeader.m */, - D381881815FE3F7F00C3EDCA /* UIContactDetailsHeader.xib */, 2248E90C12F7E4CF00220D9C /* UIDigitButton.h */, 2248E90D12F7E4CF00220D9C /* UIDigitButton.m */, D3C6526515AC1A8F0092A874 /* UIEditableTableViewCell.h */, @@ -2279,10 +2257,8 @@ 639CEB061A1DF4F1004DE38F /* UIChatRoomCell.xib in Resources */, 634CEDD11B6630DB00D7A921 /* footer_dialer.png in Resources */, D38187B915FE342200C3EDCA /* ContactDetailsViewController.xib in Resources */, - D381881515FE3F7F00C3EDCA /* UIContactDetailsHeader.xib in Resources */, D38187B515FE341B00C3EDCA /* ContactDetailsLabelViewController.xib in Resources */, 634CEDF41B6630DB00D7A921 /* options_transfer_call.png in Resources */, - D38187F415FE354700C3EDCA /* UIContactDetailsFooter.xib in Resources */, 634CEDA41B6630DB00D7A921 /* call_start_body_default.png in Resources */, 634CEDCB1B6630DB00D7A921 /* dialer_alt_back.png in Resources */, 634CEE0C1B6630DB00D7A921 /* status_available_phone.png in Resources */, @@ -2520,12 +2496,10 @@ D32B6E2915A5BC440033019F /* ChatRoomTableViewController.m in Sources */, D3A8BB7015A6C7D500F96BE5 /* UIChatRoomCell.m in Sources */, D3128FE115AABC7E00A2147A /* ContactDetailsViewController.m in Sources */, - D37C639515AADDAF009D0BAC /* UIContactDetailsHeader.m in Sources */, D37C639B15AADEF6009D0BAC /* ContactDetailsTableViewController.m in Sources */, 63E59A3F1ADE70D900646FB3 /* InAppProductsManager.m in Sources */, D3C6526715AC1A8F0092A874 /* UIEditableTableViewCell.m in Sources */, D378906515AC373B00BD776C /* ContactDetailsLabelViewController.m in Sources */, - D3E8F68615ADE05B0065A226 /* UIContactDetailsFooter.m in Sources */, C90FAA7915AF54E6002091CB /* HistoryDetailsViewController.m in Sources */, 63FB30351A680E73008CA393 /* UIRoundedImageView.m in Sources */, 635775251B6673EC00C8B704 /* HistoryDetailsTableViewController.m in Sources */, @@ -2940,17 +2914,6 @@ name = UIConferenceHeader.xib; sourceTree = ""; }; - D38187F715FE354700C3EDCA /* UIContactDetailsFooter.xib */ = { - isa = PBXVariantGroup; - children = ( - F095482A1883F15400E8A69B /* Base */, - F09548511883F5E300E8A69B /* fr */, - F09548521883F5E600E8A69B /* ru */, - F0AF07071A24BA770086C9C1 /* ar */, - ); - name = UIContactDetailsFooter.xib; - sourceTree = ""; - }; D38187FB15FE355D00C3EDCA /* UIMainBar.xib */ = { isa = PBXVariantGroup; children = ( @@ -2973,17 +2936,6 @@ name = UICallCell.xib; sourceTree = ""; }; - D381881815FE3F7F00C3EDCA /* UIContactDetailsHeader.xib */ = { - isa = PBXVariantGroup; - children = ( - F095482B1883F15400E8A69B /* Base */, - F09548531883F5F400E8A69B /* fr */, - F09548541883F5F700E8A69B /* ru */, - F0AF07081A24BA770086C9C1 /* ar */, - ); - name = UIContactDetailsHeader.xib; - sourceTree = ""; - }; D381881C15FE3FCA00C3EDCA /* InCallViewController.xib */ = { isa = PBXVariantGroup; children = (