From 93a8588ed4eb00327b9762e068fc4662ed0316bf Mon Sep 17 00:00:00 2001 From: Yann Diorcet Date: Thu, 9 Aug 2012 16:40:16 +0200 Subject: [PATCH] Add DEBUG symbol in debug configuration Disabled validation of contact is first & last name are empty --- Classes/ContactDetailsDelegate.h | 25 +++ Classes/ContactDetailsTableViewController.h | 7 +- Classes/ContactDetailsTableViewController.m | 37 +++- Classes/ContactDetailsViewController.h | 4 +- Classes/ContactDetailsViewController.m | 27 ++- Classes/ContactDetailsViewController.xib | 174 +++++++++++++++++- Classes/ContactsTableViewController.m | 2 +- Classes/LinphoneUI/UIContactDetailsFooter.h | 8 +- Classes/LinphoneUI/UIContactDetailsFooter.m | 35 +++- Classes/LinphoneUI/UIContactDetailsFooter.xib | 31 +++- Classes/LinphoneUI/UIContactDetailsHeader.h | 5 + Classes/LinphoneUI/UIContactDetailsHeader.m | 53 +++++- Classes/SettingsViewController.m | 4 + Resources/contact_ok_disabled.png | Bin 0 -> 2159 bytes Settings/InAppSettings.bundle/Root.plist | 8 + linphone.xcodeproj/project.pbxproj | 10 + main.m | 14 ++ 17 files changed, 410 insertions(+), 34 deletions(-) create mode 100644 Classes/ContactDetailsDelegate.h create mode 100644 Resources/contact_ok_disabled.png diff --git a/Classes/ContactDetailsDelegate.h b/Classes/ContactDetailsDelegate.h new file mode 100644 index 000000000..c251079ee --- /dev/null +++ b/Classes/ContactDetailsDelegate.h @@ -0,0 +1,25 @@ +/* ContactDetailsDelegate.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 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. + */ + +@protocol ContactDetailsDelegate + +- (void)onRemove:(id)event; +- (void)onModification:(id)event; + +@end \ No newline at end of file diff --git a/Classes/ContactDetailsTableViewController.h b/Classes/ContactDetailsTableViewController.h index 24407db95..978007841 100644 --- a/Classes/ContactDetailsTableViewController.h +++ b/Classes/ContactDetailsTableViewController.h @@ -20,6 +20,7 @@ #import #import +#import "ContactDetailsDelegate.h" #import "ContactDetailsLabelViewController.h" #import "UIContactDetailsHeader.h" #import "UIContactDetailsFooter.h" @@ -30,13 +31,17 @@ NSMutableArray *dataCache; NSMutableArray *labelArray; NSIndexPath *editingIndexPath; -@public UIContactDetailsHeader *headerController; UIContactDetailsFooter *footerController; + id contactDetailsDelegate; } @property (nonatomic, assign) ABRecordRef contact; +@property (nonatomic, retain) IBOutlet id contactDetailsDelegate; +@property (nonatomic, retain) IBOutlet UIContactDetailsHeader *headerController; +@property (nonatomic, retain) IBOutlet UIContactDetailsFooter *footerController; +- (BOOL)isValid; - (void)addSipField:(NSString*)address; @end diff --git a/Classes/ContactDetailsTableViewController.m b/Classes/ContactDetailsTableViewController.m index dd4c21b6f..b36a4bc77 100644 --- a/Classes/ContactDetailsTableViewController.m +++ b/Classes/ContactDetailsTableViewController.m @@ -63,6 +63,9 @@ enum _ContactSections { static const int contactSections[ContactSections_MAX] = {ContactSections_Number, ContactSections_Sip}; +@synthesize footerController; +@synthesize headerController; +@synthesize contactDetailsDelegate; @synthesize contact; #pragma mark - Lifecycle Functions @@ -74,8 +77,6 @@ static const int contactSections[ContactSections_MAX] = {ContactSections_Number, [NSString stringWithString:(NSString*)kABPersonPhoneMobileLabel], [NSString stringWithString:(NSString*)kABPersonPhoneIPhoneLabel], [NSString stringWithString:(NSString*)kABPersonPhoneMainLabel], nil]; - headerController = [[UIContactDetailsHeader alloc] init]; - footerController = [[UIContactDetailsFooter alloc] init]; editingIndexPath = nil; } @@ -104,8 +105,6 @@ static const int contactSections[ContactSections_MAX] = {ContactSections_Number, } [labelArray release]; [dataCache release]; - [headerController release]; - [UIContactDetailsFooter release]; [super dealloc]; } @@ -125,6 +124,15 @@ static const int contactSections[ContactSections_MAX] = {ContactSections_Number, #pragma mark - +- (BOOL)isValid { + return [headerController isValid]; +} + +- (void)updateModification { + [contactDetailsDelegate onModification:nil]; +} + + + (BOOL)findAndResignFirstResponder:(UIView*)view { if (view.isFirstResponder) { [view resignFirstResponder]; @@ -212,7 +220,10 @@ static const int contactSections[ContactSections_MAX] = {ContactSections_Number, } [dataCache addObject:subArray]; } - + + if(contactDetailsDelegate != nil) { + [contactDetailsDelegate onModification:nil]; + } [self.tableView reloadData]; } @@ -286,6 +297,9 @@ static const int contactSections[ContactSections_MAX] = {ContactSections_Number, } [tableview insertRowsAtIndexPaths:[NSArray arrayWithObject:[NSIndexPath indexPathForRow:count inSection:section]] withRowAnimation:UITableViewRowAnimationFade]; } + if(contactDetailsDelegate != nil) { + [contactDetailsDelegate onModification:nil]; + } } - (void)removeEmptyEntry:(UITableView*)tableview section:(NSInteger)section animated:(BOOL)animated { @@ -314,6 +328,9 @@ static const int contactSections[ContactSections_MAX] = {ContactSections_Number, CFRelease(lMap); } } + if(contactDetailsDelegate != nil) { + [contactDetailsDelegate onModification:nil]; + } } - (void)removeEntry:(UITableView*)tableview path:(NSIndexPath*)indexPath animated:(BOOL)animated { @@ -652,6 +669,13 @@ static const int contactSections[ContactSections_MAX] = {ContactSections_Number, #pragma mark - UITextFieldDelegate Functions +- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string { + if(contactDetailsDelegate != nil) { + [self performSelector:@selector(updateModification) withObject:nil afterDelay:0]; + } + return YES; +} + - (BOOL)textFieldShouldReturn:(UITextField *)textField { [textField resignFirstResponder]; return YES; @@ -692,6 +716,9 @@ static const int contactSections[ContactSections_MAX] = {ContactSections_Number, } else { [LinphoneLogger logc:LinphoneLoggerError format:"Not valid UIEditableTableViewCell"]; } + if(contactDetailsDelegate != nil) { + [self performSelector:@selector(updateModification) withObject:nil afterDelay:0]; + } return TRUE; } diff --git a/Classes/ContactDetailsViewController.h b/Classes/ContactDetailsViewController.h index 16e96f59e..5e1f159ed 100644 --- a/Classes/ContactDetailsViewController.h +++ b/Classes/ContactDetailsViewController.h @@ -21,10 +21,10 @@ #import #import "UICompositeViewController.h" -#import "ContactDetailsTableViewController.h" #import "UIToggleButton.h" +#import "ContactDetailsTableViewController.h" -@interface ContactDetailsViewController : UIViewController { +@interface ContactDetailsViewController : UIViewController { ContactDetailsTableViewController *tableController; ABRecordRef contact; UIToggleButton *editButton; diff --git a/Classes/ContactDetailsViewController.m b/Classes/ContactDetailsViewController.m index dbf758904..aaa216eff 100644 --- a/Classes/ContactDetailsViewController.m +++ b/Classes/ContactDetailsViewController.m @@ -198,22 +198,18 @@ static void sync_address_book (ABAddressBookRef addressBook, CFDictionaryRef inf - (void)viewDidLoad{ [super viewDidLoad]; + // Set selected+over background: IB lack ! [editButton setImage:[UIImage imageNamed:@"contact_ok_over.png"] forState:(UIControlStateHighlighted | UIControlStateSelected)]; - // Force view load - [tableController->footerController view]; - [tableController->footerController->removeButton addTarget:self - action:@selector(onRemove:) - forControlEvents:UIControlEventTouchUpInside]; + // Set selected+disabled background: IB lack ! + [editButton setImage:[UIImage imageNamed:@"contact_ok_disabled.png"] + forState:(UIControlStateDisabled | UIControlStateSelected)]; } - (void)viewDidUnload { [super viewDidUnload]; - [tableController->footerController->removeButton removeTarget:self - action:@selector(onRemove:) - forControlEvents:UIControlEventTouchUpInside]; } - (void)viewWillDisappear:(BOOL)animated { @@ -291,6 +287,7 @@ static UICompositeViewDescription *compositeDescription = nil; [backButton setHidden:FALSE]; } + #pragma mark - Action Functions - (IBAction)onCancelClick:(id)event { @@ -304,8 +301,10 @@ static UICompositeViewDescription *compositeDescription = nil; - (IBAction)onEditClick:(id)event { if([tableController isEditing]) { - [self disableEdit:TRUE]; - [self saveData]; + if([tableController isValid]) { + [self disableEdit:TRUE]; + [self saveData]; + } } else { [self enableEdit:TRUE]; } @@ -317,4 +316,12 @@ static UICompositeViewDescription *compositeDescription = nil; [[PhoneMainView instance] popCurrentView]; } +- (void)onModification:(id)event { + if(![tableController isEditing] || [tableController isValid]) { + [editButton setEnabled:TRUE]; + } else { + [editButton setEnabled:FALSE]; + } +} + @end diff --git a/Classes/ContactDetailsViewController.xib b/Classes/ContactDetailsViewController.xib index 939b1c99b..4f71c2019 100644 --- a/Classes/ContactDetailsViewController.xib +++ b/Classes/ContactDetailsViewController.xib @@ -17,6 +17,7 @@ IBUITableView IBUITableViewController IBUIView + IBUIViewController com.apple.InterfaceBuilder.IBCocoaTouchPlugin @@ -176,7 +177,6 @@ {{0, 59}, {320, 401}} - _NS:9 10 @@ -270,6 +270,26 @@ AAgACAAIAAEAAQABAAE IBCocoaTouchFramework NO + + UIContactDetailsFooter + + + 1 + 1 + + IBCocoaTouchFramework + NO + + + UIContactDetailsHeader + + + 1 + 1 + + IBCocoaTouchFramework + NO + @@ -355,6 +375,30 @@ AAgACAAIAAEAAQABAAE 26 + + + contactDetailsDelegate + + + + 53 + + + + footerController + + + + 59 + + + + headerController + + + + 60 + onCancelClick: @@ -364,6 +408,22 @@ AAgACAAIAAEAAQABAAE 49 + + + contactDetailsDelegate + + + + 61 + + + + contactDetailsDelegate + + + + 62 + @@ -442,6 +502,18 @@ AAgACAAIAAEAAQABAAE barBackground + + 57 + + + footerController + + + 58 + + + headerController + @@ -457,6 +529,10 @@ AAgACAAIAAEAAQABAAE com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin + UIContactDetailsFooter + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + UIContactDetailsHeader + com.apple.InterfaceBuilder.IBCocoaTouchPlugin UIToggleButton com.apple.InterfaceBuilder.IBCocoaTouchPlugin @@ -467,13 +543,32 @@ AAgACAAIAAEAAQABAAE - 52 + 62 ContactDetailsTableViewController UITableViewController + + id + UIContactDetailsFooter + UIContactDetailsHeader + + + + contactDetailsDelegate + id + + + footerController + UIContactDetailsFooter + + + headerController + UIContactDetailsHeader + + IBProjectSource ./Classes/ContactDetailsTableViewController.h @@ -530,6 +625,81 @@ AAgACAAIAAEAAQABAAE ./Classes/ContactDetailsViewController.h + + UIContactDetailsFooter + UIViewController + + onRemoveClick: + id + + + onRemoveClick: + + onRemoveClick: + id + + + + id + UIButton + + + + contactDetailsDelegate + id + + + removeButton + UIButton + + + + IBProjectSource + ./Classes/UIContactDetailsFooter.h + + + + UIContactDetailsHeader + UIViewController + + UILabel + UIImageView + id + UIView + UIView + UITableView + + + + addressLabel + UILabel + + + avatarImage + UIImageView + + + contactDetailsDelegate + id + + + editView + UIView + + + normalView + UIView + + + tableView + UITableView + + + + IBProjectSource + ./Classes/UIContactDetailsHeader.h + + UIToggleButton UIButton diff --git a/Classes/ContactsTableViewController.m b/Classes/ContactsTableViewController.m index 4f5cd356b..acf33fe4d 100644 --- a/Classes/ContactsTableViewController.m +++ b/Classes/ContactsTableViewController.m @@ -111,7 +111,7 @@ } else { } - if(name != nil) { + if(name != nil && [name length] > 0) { // Put in correct subDic NSString *firstChar = [[name substringToIndex:1] uppercaseString]; if([firstChar characterAtIndex:0] < 'A' || [firstChar characterAtIndex:0] > 'Z') { diff --git a/Classes/LinphoneUI/UIContactDetailsFooter.h b/Classes/LinphoneUI/UIContactDetailsFooter.h index ab808a680..08b14b850 100644 --- a/Classes/LinphoneUI/UIContactDetailsFooter.h +++ b/Classes/LinphoneUI/UIContactDetailsFooter.h @@ -19,12 +19,18 @@ #import +#import "ContactDetailsDelegate.h" + @interface UIContactDetailsFooter : UIViewController { - @public +@private UIButton *removeButton; + id contactDetailsDelegate; } @property (nonatomic, retain) IBOutlet UIButton *removeButton; +@property (nonatomic, retain) IBOutlet id contactDetailsDelegate; + +- (IBAction)onRemoveClick:(id)event; + (CGFloat)height:(BOOL)editing; diff --git a/Classes/LinphoneUI/UIContactDetailsFooter.m b/Classes/LinphoneUI/UIContactDetailsFooter.m index 5320de827..e681aac04 100644 --- a/Classes/LinphoneUI/UIContactDetailsFooter.m +++ b/Classes/LinphoneUI/UIContactDetailsFooter.m @@ -22,12 +22,36 @@ @implementation UIContactDetailsFooter @synthesize removeButton; +@synthesize contactDetailsDelegate; #pragma mark - Lifecycle Functions +- (void)initUIContactDetailsFooter { +} + - (id)init { - return self = [super initWithNibName:@"UIContactDetailsFooter" bundle:[NSBundle mainBundle]]; + 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; } - (void)dealloc { @@ -37,6 +61,15 @@ } +#pragma mark - Action Functions + +- (IBAction)onRemoveClick:(id)event { + if(contactDetailsDelegate != nil) { + [contactDetailsDelegate onRemove:event]; + } +} + + #pragma mark - + (CGFloat)height:(BOOL)editing { diff --git a/Classes/LinphoneUI/UIContactDetailsFooter.xib b/Classes/LinphoneUI/UIContactDetailsFooter.xib index b02d3ec41..78b5e58dc 100644 --- a/Classes/LinphoneUI/UIContactDetailsFooter.xib +++ b/Classes/LinphoneUI/UIContactDetailsFooter.xib @@ -3,17 +3,17 @@ 1296 11E53 - 2182 + 2549 1138.47 569.00 com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 1181 + 1498 IBProxyObject - IBUIView IBUIButton + IBUIView com.apple.InterfaceBuilder.IBCocoaTouchPlugin @@ -41,7 +41,6 @@ {{23, 25}, {275, 50}} - _NS:9 3 @@ -103,6 +102,15 @@ 7 + + + onRemoveClick: + + + 7 + + 10 + @@ -152,13 +160,24 @@ - 9 + 10 UIContactDetailsFooter UIViewController + + onRemoveClick: + id + + + onRemoveClick: + + onRemoveClick: + id + + removeButton UIButton @@ -189,6 +208,6 @@ {550, 101} {550, 101} - 1181 + 1498 diff --git a/Classes/LinphoneUI/UIContactDetailsHeader.h b/Classes/LinphoneUI/UIContactDetailsHeader.h index 86e5d69a5..7e45e9514 100644 --- a/Classes/LinphoneUI/UIContactDetailsHeader.h +++ b/Classes/LinphoneUI/UIContactDetailsHeader.h @@ -20,6 +20,8 @@ #import #import +#import "ContactDetailsDelegate.h" + @interface UIContactDetailsHeader : UIViewController { UILabel *addressLabel; UIImageView *avatarImage; @@ -30,6 +32,7 @@ NSArray *propertyList; ABRecordRef contact; BOOL editing; + id contactDetailsDelegate; } @property (nonatomic, assign) ABRecordRef contact; @@ -40,6 +43,7 @@ @property (nonatomic, retain) IBOutlet UIView *normalView; @property (nonatomic, retain) IBOutlet UIView *editView; @property (nonatomic, retain) IBOutlet UITableView *tableView; +@property (nonatomic, retain) IBOutlet id contactDetailsDelegate; @property(nonatomic,getter=isEditing) BOOL editing; @@ -48,5 +52,6 @@ - (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 index 10650d957..1d7bfa4ef 100644 --- a/Classes/LinphoneUI/UIContactDetailsHeader.m +++ b/Classes/LinphoneUI/UIContactDetailsHeader.m @@ -31,15 +31,36 @@ @synthesize normalView; @synthesize editView; @synthesize tableView; +@synthesize contactDetailsDelegate; #pragma mark - Lifecycle Functions +- (void)initUIContactDetailsHeader { + propertyList = [[NSArray alloc] initWithObjects: + [NSNumber numberWithInt:kABPersonFirstNameProperty], + [NSNumber numberWithInt:kABPersonLastNameProperty], nil]; +} + - (id)init { - self = [super initWithNibName:@"UIContactDetailsHeader" bundle:[NSBundle mainBundle]]; + self = [super init]; if(self != nil) { - self->propertyList = [[NSArray alloc] initWithObjects: - [NSNumber numberWithInt:kABPersonFirstNameProperty], - [NSNumber numberWithInt:kABPersonLastNameProperty], 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; } @@ -73,7 +94,16 @@ } -#pragma mark - +#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) { @@ -154,6 +184,9 @@ return editing; } +- (void)updateModification { + [contactDetailsDelegate onModification:nil]; +} #pragma mark - UITableViewDataSource Functions @@ -213,6 +246,13 @@ return YES; } +- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string { + if(contactDetailsDelegate != nil) { + [self performSelector:@selector(updateModification) withObject:nil afterDelay:0]; + } + return YES; +} + - (BOOL)textFieldShouldEndEditing:(UITextField *)textField { UIView *view = [textField superview]; // Find TableViewCell @@ -230,6 +270,9 @@ } else { [LinphoneLogger logc:LinphoneLoggerWarning format:"Not valid UIEditableTableViewCell"]; } + if(contactDetailsDelegate != nil) { + [self performSelector:@selector(updateModification) withObject:nil afterDelay:0]; + } return TRUE; } diff --git a/Classes/SettingsViewController.m b/Classes/SettingsViewController.m index 29b9f2460..cb1fd0dfa 100644 --- a/Classes/SettingsViewController.m +++ b/Classes/SettingsViewController.m @@ -451,6 +451,10 @@ static UICompositeViewDescription *compositeDescription = nil; } NSMutableSet *hiddenKeys = [NSMutableSet set]; +#ifndef DEBUG + [hiddenKeys addObject:@"release_button"]; +#endif + [hiddenKeys addObject:@"quit_button"]; // Hide for the moment [hiddenKeys addObject:@"about_button"]; // Hide for the moment diff --git a/Resources/contact_ok_disabled.png b/Resources/contact_ok_disabled.png new file mode 100644 index 0000000000000000000000000000000000000000..cf466e1db226b5413a7ab03230e107d640f156f3 GIT binary patch literal 2159 zcmb_eiC2=_7XMIGFf|%X8Vr1yrIu!cLpkM8VL6K!w!`%^*R&pRN1WdVj!MXPsg1b@s6K*}uKdbq}}Wn(ABB z0RYg%oN)320Ej(!Cc#v})y~5bTmjXyCyzS;E34xXr!)uTz@twD!~wvX4XYCZJSaed zOtpB7tFziL46e0PGl4!Y2003h(@~#!BheMYb_FCnJ*HB)wr4+iMSu z5z<9uHU~)y7$OfJ1g#{F5;R=3q3Gp*IluxdeErfxuzAClxb*jDn^-PK>J3aOQ-e*4 zhN*YQ!p7vGbmr6pmvvAyQQ(ZP@ST(gKYZsqLc#Q$HS@z_qXHk^vy+aF9yNmw%q=iY z(jGmz06Gr0$1zS&hT%A&b8E`^X_}aGd_ZalG!0*eU8yFF^9?QSz6+}akTh_Ot(-$&l+ZRSk!g;B z)>B9oAz>ALu?0z9=fFS)` z#Of!rg=ZqWUt3wEiIOY0C8WrTr^y~?$!&_jOU10E zMgmGvn#}`|2ACWz{*cZDTzZP;iAJ;?zKfV;JkiZQAcoN9An)`c$QecHp0Erimw1Of>Pc8 z#;UY(Y6M@w$o0YYRi9IpY3#Y$^6HR5=!b(@OlFege!1XfZpMwfMAI@rGTqpE*FZdF z1Lq>K`3&09BCkY^xFMza_-6MTk>){p6EDIxIe1{Pjxx_B(4?qt{oBX=b)NaFMKyRV*#qwv{vczv&D9K^>OQR%6oC~i@V+c0i6@3_cYpn! zs*bQTfwGu)Ux*Cvx?h!yL~sTsZ^?HGgQ29VY9MgiZWVqAU-rp+a68N%Km(9Z88+*Q5Wwgskpe(dP+4a7 zfX`2Wi=$nGwuqG)zKuK;6tXv=ftcRejxL38hTN6SFV@X|+Z8mH?P$y>sT6BB`MG!n zG!nkRwy&V@0z>}6Cfnkbu}nY-5u!umNY!m$Td@Lq3pjNbgBbdKq(gtfJBvrGOUgyPHBv6>_|$g51o4z^G2Li*-SpL*25Qr6UnFLZh@YHg9?K^Z5WH zMhPOdytXTqwfjag)*n}CGA{}ELBV3*FM)6Wy8)dY_FhBTs~Ku!MIgigMRaBcY%WRO%i_Nz%Gzb9i#nvZNqxmtGj%lP=*+ z?!CO?B`c(8f&r)j-r{>=(l31-q!#MeUMw9bPwdyqGR&w^Hcb!lw8lFg;nyO~_-qp1 zLLrn#n96(rUaMHA?`rS+lt5jF1|$^dSlahoFE4B8Xv}@r z3)jn~ppfW=DwShnLyG9dq+gmz9+5vbj;zq#{xo1Ck4Ml{_Lf9!L@~v3zpC~eeQsEd zPSyO#+7|zfyxD=7?srerpVh)i|7KT!hUT5OqQ9T8>qFQ}*C-n>S15j63~0Wcda{#5_cre*%Hg2`<1&r3&S09)1k z4sWO&zbs7#>uTmqmHyHf?n>{{Ts8^{v!~*Bek2L^{b#7I&;d4?%(XLO#WR`Vu(uNA z$Db9g0_?74rAMPkjK?_AqSz0q57-Ovf@t?uWYRo7g`r zUz%iTey%Qz-3yk#s0~Hl!R*gVt8H}0o~sahm7l$}TSfK1Xf)XectDf@ZS?Type IASKButtonSpecifier + + Key + Release_button + Title + Release + Type + IASKButtonSpecifier + StringsTable Root diff --git a/linphone.xcodeproj/project.pbxproj b/linphone.xcodeproj/project.pbxproj index 9bae23f7a..ffb6306b1 100755 --- a/linphone.xcodeproj/project.pbxproj +++ b/linphone.xcodeproj/project.pbxproj @@ -141,6 +141,8 @@ C9C8254915AE204D00D493FA /* transfer_call_over.png in Resources */ = {isa = PBXBuildFile; fileRef = C9C8254215AE204D00D493FA /* transfer_call_over.png */; }; C9C8254C15AE207B00D493FA /* options_selected.png in Resources */ = {isa = PBXBuildFile; fileRef = C9C8254B15AE207B00D493FA /* options_selected.png */; }; C9C8254F15AE256100D493FA /* transfer_call_disabled.png in Resources */ = {isa = PBXBuildFile; fileRef = C9C8254E15AE256100D493FA /* transfer_call_disabled.png */; }; + D30BBD1815D402A7000F93DD /* contact_ok_disabled.png in Resources */ = {isa = PBXBuildFile; fileRef = D30BBD1715D402A7000F93DD /* contact_ok_disabled.png */; }; + D30BBD1915D402A7000F93DD /* contact_ok_disabled.png in Resources */ = {isa = PBXBuildFile; fileRef = D30BBD1715D402A7000F93DD /* contact_ok_disabled.png */; }; D3119E7215B6A4710005D4A4 /* contacts_back_default.png in Resources */ = {isa = PBXBuildFile; fileRef = D3119E7015B6A4710005D4A4 /* contacts_back_default.png */; }; D3119E7415B6A4710005D4A4 /* contacts_back_over.png in Resources */ = {isa = PBXBuildFile; fileRef = D3119E7115B6A4710005D4A4 /* contacts_back_over.png */; }; D3128FE115AABC7E00A2147A /* ContactDetailsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D3128FDF15AABC7E00A2147A /* ContactDetailsViewController.m */; }; @@ -1480,6 +1482,8 @@ C9C8254215AE204D00D493FA /* transfer_call_over.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = transfer_call_over.png; path = Resources/transfer_call_over.png; sourceTree = ""; }; C9C8254B15AE207B00D493FA /* options_selected.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = options_selected.png; path = Resources/options_selected.png; sourceTree = ""; }; C9C8254E15AE256100D493FA /* transfer_call_disabled.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = transfer_call_disabled.png; path = Resources/transfer_call_disabled.png; sourceTree = ""; }; + D30BBD1215D3EFEB000F93DD /* ContactDetailsDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContactDetailsDelegate.h; sourceTree = ""; }; + D30BBD1715D402A7000F93DD /* contact_ok_disabled.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = contact_ok_disabled.png; path = Resources/contact_ok_disabled.png; sourceTree = ""; }; D3119E7015B6A4710005D4A4 /* contacts_back_default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = contacts_back_default.png; path = Resources/contacts_back_default.png; sourceTree = ""; }; D3119E7115B6A4710005D4A4 /* contacts_back_over.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = contacts_back_over.png; path = Resources/contacts_back_over.png; sourceTree = ""; }; D3128FDE15AABC7E00A2147A /* ContactDetailsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContactDetailsViewController.h; sourceTree = ""; }; @@ -2149,6 +2153,7 @@ 22E0A820111C44E100B04932 /* ConsoleViewController.h */, 22E0A81F111C44E100B04932 /* ConsoleViewController.m */, 22E0A81E111C44E100B04932 /* ConsoleViewController.xib */, + D30BBD1215D3EFEB000F93DD /* ContactDetailsDelegate.h */, D378906215AC373B00BD776C /* ContactDetailsLabelViewController.h */, D378906315AC373B00BD776C /* ContactDetailsLabelViewController.m */, D378906415AC373B00BD776C /* ContactDetailsLabelViewController.xib */, @@ -2751,6 +2756,7 @@ D37C638D15AAD251009D0BAC /* contact_number.png */, D37C638C15AAD251009D0BAC /* contact_number_over.png */, D3C6526915AC228A0092A874 /* contact_ok_default.png */, + D30BBD1715D402A7000F93DD /* contact_ok_disabled.png */, D3C6526A15AC228A0092A874 /* contact_ok_over.png */, D354980E15875608000081D8 /* contacts_add_default.png */, D354980F15875608000081D8 /* contacts_add_over.png */, @@ -3753,6 +3759,7 @@ D339890815C6E16F00CAF1E4 /* dialer_alt_back_over_landscape~ipad.png in Resources */, D33CF34A15D3A03400CD4B85 /* linphone_icon_57@2x.png in Resources */, D33CF34C15D3A03400CD4B85 /* linphone_icon_72@2x.png in Resources */, + D30BBD1815D402A7000F93DD /* contact_ok_disabled.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -4191,6 +4198,7 @@ D339890915C6E16F00CAF1E4 /* dialer_alt_back_over_landscape~ipad.png in Resources */, D33CF34B15D3A03400CD4B85 /* linphone_icon_57@2x.png in Resources */, D33CF34D15D3A03400CD4B85 /* linphone_icon_72@2x.png in Resources */, + D30BBD1915D402A7000F93DD /* contact_ok_disabled.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -4462,6 +4470,7 @@ VIDEO_ENABLED, HAVE_X264, HAVE_SILK, + DEBUG, ); HEADER_SEARCH_PATHS = ( submodules/linphone/coreapi, @@ -4582,6 +4591,7 @@ GCC_PREPROCESSOR_DEFINITIONS = ( IN_LINPHONE, VIDEO_ENABLED, + DEBUG, ); HEADER_SEARCH_PATHS = ( submodules/linphone/coreapi, diff --git a/main.m b/main.m index 1535f7764..878eadce7 100644 --- a/main.m +++ b/main.m @@ -19,7 +19,21 @@ #import +#ifdef DEBUG + +// Dump exception +void uncaughtExceptionHandler(NSException *exception) { + NSLog(@"Crash: %@", exception); + NSLog(@"Stack Trace: %@", [exception callStackSymbols]); + // Internal error reporting +} + +#endif + int main(int argc, char *argv[]) { +#ifdef DEBUG + NSSetUncaughtExceptionHandler(&uncaughtExceptionHandler); +#endif NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; int retVal = UIApplicationMain(argc, argv, nil, nil); [pool release];