diff --git a/Classes/ChatRoomViewController.h b/Classes/ChatRoomViewController.h index d716f582e..9d63ea797 100644 --- a/Classes/ChatRoomViewController.h +++ b/Classes/ChatRoomViewController.h @@ -35,6 +35,8 @@ LinphoneChatRoom *chatRoom; UILabel *addressLabel; UIImageView *avatarImage; + UIView *headerView; + UIView *footerView; } @@ -44,6 +46,8 @@ @property (nonatomic, retain) IBOutlet UIButton* sendButton; @property (nonatomic, retain) IBOutlet UILabel *addressLabel; @property (nonatomic, retain) IBOutlet UIImageView *avatarImage; +@property (nonatomic, retain) IBOutlet UIView *headerView; +@property (nonatomic, retain) IBOutlet UIView *footerView; @property (nonatomic, copy) NSString *remoteAddress; - (IBAction)onBackClick:(id)event; diff --git a/Classes/ChatRoomViewController.m b/Classes/ChatRoomViewController.m index ade4c61e6..86d8c915c 100644 --- a/Classes/ChatRoomViewController.m +++ b/Classes/ChatRoomViewController.m @@ -31,6 +31,8 @@ @synthesize remoteAddress; @synthesize addressLabel; @synthesize avatarImage; +@synthesize headerView; +@synthesize footerView; #pragma mark - Lifecycle Functions @@ -51,21 +53,27 @@ [remoteAddress release]; [addressLabel release]; [avatarImage release]; + [headerView release]; + [footerView release]; [super dealloc]; } #pragma mark - UICompositeViewDelegate Functions -+ (UICompositeViewDescription*) compositeViewDescription { - UICompositeViewDescription *description = [UICompositeViewDescription alloc]; - description->content = @"ChatRoomViewController"; - description->tabBar = nil; - description->tabBarEnabled = false; - description->stateBar = nil; - description->stateBarEnabled = false; - description->fullscreen = false; - return description; +static UICompositeViewDescription *compositeDescription = nil; + ++ (UICompositeViewDescription *)compositeViewDescription { + if(compositeDescription == nil) { + compositeDescription = [[UICompositeViewDescription alloc] init:@"ChatRoom" + content:@"ChatRoomViewController" + stateBar:nil + stateBarEnabled:false + tabBar:nil + tabBarEnabled:false + fullscreen:false]; + } + return compositeDescription; } @@ -131,7 +139,10 @@ } remoteAddress = [aRemoteAddress copy]; [tableController setRemoteAddress: remoteAddress]; - + [self update]; +} + +- (void)update { if(remoteAddress == NULL) { [LinphoneLogger logc:LinphoneLoggerWarning format:"Cannot update chat room header: null contact"]; return; @@ -140,7 +151,7 @@ NSString *displayName = nil; UIImage *image = nil; NSString *normalizedSipAddress = [FastAddressBook normalizeSipURI:remoteAddress]; - ABRecordRef acontact =[[[LinphoneManager instance] fastAddressBook] getContact:normalizedSipAddress]; + ABRecordRef acontact = [[[LinphoneManager instance] fastAddressBook] getContact:normalizedSipAddress]; if(acontact != nil) { displayName = [FastAddressBook getContactDisplayName:acontact]; image = [FastAddressBook getContactImage:acontact thumbnail:true]; @@ -220,7 +231,7 @@ #pragma mark - Action Functions - (IBAction)onBackClick:(id)event { - [[PhoneMainView instance] popView]; + [[PhoneMainView instance] popCurrentView]; } - (IBAction)onEditClick:(id)event { @@ -251,15 +262,19 @@ [UIView setAnimationDuration:duration]; [UIView setAnimationCurve:curve]; [UIView setAnimationBeginsFromCurrentState:TRUE]; + + // Move view CGRect endFrame = [[[notif userInfo] objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue]; CGRect frame = [[self view] frame]; - /* - CGPoint pos = {0, 0}; - CGPoint gPos = [[self view] convertPoint:pos toView:nil]; - frame.size.height = endFrame.origin.y - gPos.y; - */ frame.origin.y += endFrame.origin.y - beginFrame.origin.y; [[self view] setFrame:frame]; + + // Resize table view + CGRect tableFrame = [tableController.view frame]; + tableFrame.origin.y = [headerView frame].origin.y + [headerView frame].size.height; + tableFrame.size.height = [footerView frame].origin.y - tableFrame.origin.y; + [tableController.view setFrame:tableFrame]; + [UIView commitAnimations]; } @@ -271,13 +286,27 @@ [UIView setAnimationDuration:duration]; [UIView setAnimationCurve:curve]; [UIView setAnimationBeginsFromCurrentState:TRUE]; + + // Move view CGRect endFrame = [[[notif userInfo] objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue]; CGRect frame = [[self view] frame]; - /*CGPoint pos = {0, 0}; - CGPoint gPos = [[self view] convertPoint:pos toView:nil]; - frame.size.height = endFrame.origin.y - gPos.y;*/ frame.origin.y += endFrame.origin.y - beginFrame.origin.y; [[self view] setFrame:frame]; + + // Resize table view + CGPoint pos = {0, 0}; + CGPoint gPos = [[self.view superview] convertPoint:pos toView:self.view]; + CGRect tableFrame = [tableController.view frame]; + tableFrame.origin.y = gPos.y; + tableFrame.size.height = [footerView frame].origin.y - tableFrame.origin.y; + [tableController.view setFrame:tableFrame]; + + // Scroll + int lastSection = [tableController.tableView numberOfSections] -1; + int lastRow = [tableController.tableView numberOfRowsInSection:lastSection] - 1; + [tableController.tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:lastRow inSection:lastSection] + atScrollPosition:UITableViewScrollPositionBottom + animated:TRUE]; [UIView commitAnimations]; } diff --git a/Classes/ChatRoomViewController.xib b/Classes/ChatRoomViewController.xib index 2d19178d5..cbb6a5959 100644 --- a/Classes/ChatRoomViewController.xib +++ b/Classes/ChatRoomViewController.xib @@ -131,7 +131,7 @@ - 292 + 290 @@ -234,10 +234,11 @@ - 292 + 257 {{250, 0}, {70, 59}} + _NS:9 NO @@ -267,7 +268,7 @@ - 292 + 260 {250, 59} @@ -282,7 +283,7 @@ - 292 + 260 {{10, 10}, {230, 39}} @@ -405,6 +406,22 @@ 44 + + + headerView + + + + 45 + + + + footerView + + + + 46 + dataSource @@ -542,7 +559,7 @@ - footer + footerView 15 @@ -629,7 +646,7 @@ - 44 + 46 @@ -672,6 +689,8 @@ UILabel UIImageView UIToggleButton + UIView + UIView UITextField UIButton ChatRoomTableViewController @@ -689,6 +708,14 @@ editButton UIToggleButton + + footerView + UIView + + + headerView + UIView + messageField UITextField diff --git a/Classes/ChatTableViewController.m b/Classes/ChatTableViewController.m index 3e5431f17..91b6287bc 100644 --- a/Classes/ChatTableViewController.m +++ b/Classes/ChatTableViewController.m @@ -91,7 +91,7 @@ ChatModel *chat = [data objectAtIndex:[indexPath row]]; // Go to ChatRoom view - ChatRoomViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeView:PhoneView_ChatRoom push:TRUE], ChatRoomViewController); + ChatRoomViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:[ChatRoomViewController compositeViewDescription] push:TRUE], ChatRoomViewController); if(controller != nil) { [controller setRemoteAddress:[chat remoteContact]]; } @@ -101,10 +101,11 @@ if(editingStyle == UITableViewCellEditingStyleDelete) { [tableView beginUpdates]; ChatModel *chat = [data objectAtIndex:[indexPath row]]; - [data removeObjectAtIndex:[indexPath row]]; [ChatModel removeConversation:[chat remoteContact]]; + [data removeObjectAtIndex:[indexPath row]]; [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade]; [tableView endUpdates]; + [[NSNotificationCenter defaultCenter] postNotificationName:@"LinphoneTextReceived" object:self]; } } diff --git a/Classes/ChatViewController.m b/Classes/ChatViewController.m index d35917c48..ff63f4884 100644 --- a/Classes/ChatViewController.m +++ b/Classes/ChatViewController.m @@ -82,22 +82,27 @@ #pragma mark - UICompositeViewDelegate Functions -+ (UICompositeViewDescription*) compositeViewDescription { - UICompositeViewDescription *description = [UICompositeViewDescription alloc]; - description->content = @"ChatViewController"; - description->tabBar = @"UIMainBar"; - description->tabBarEnabled = true; - description->stateBar = nil; - description->stateBarEnabled = false; - description->fullscreen = false; - return description; +static UICompositeViewDescription *compositeDescription = nil; + ++ (UICompositeViewDescription *)compositeViewDescription { + if(compositeDescription == nil) { + compositeDescription = [[UICompositeViewDescription alloc] init:@"Chat" + content:@"ChatViewController" + stateBar:nil + stateBarEnabled:false + tabBar: @"UIMainBar" + tabBarEnabled:true + fullscreen:false]; + } + return compositeDescription; } #pragma mark - Action Functions - (IBAction)onAddClick:(id)event { - [[PhoneMainView instance] changeView:PhoneView_ChatRoom push:TRUE]; + [ContactSelection setSelectionMode:ContactSelectionModeMessage]; + [[PhoneMainView instance] changeCurrentView:[ContactsViewController compositeViewDescription] push:TRUE]; } - (IBAction)onEditClick:(id)event { diff --git a/Classes/ContactDetailsLabelViewController.xib b/Classes/ContactDetailsLabelViewController.xib index c3e832ab4..324f0e974 100644 --- a/Classes/ContactDetailsLabelViewController.xib +++ b/Classes/ContactDetailsLabelViewController.xib @@ -59,6 +59,21 @@ 290 + + + 292 + {320, 58} + + + + _NS:9 + NO + IBCocoaTouchFramework + + NSImage + contact_bar_background.png + + 292 @@ -97,21 +112,6 @@ 16 - - - 292 - {{160, 0}, {160, 58}} - - - - _NS:9 - NO - IBCocoaTouchFramework - - NSImage - contact_bar_background.png - - {320, 58} diff --git a/Classes/ContactDetailsTableViewController.m b/Classes/ContactDetailsTableViewController.m index 65282e6e9..7b3e36aa1 100644 --- a/Classes/ContactDetailsTableViewController.m +++ b/Classes/ContactDetailsTableViewController.m @@ -447,17 +447,25 @@ int index = ABMultiValueGetIndexForIdentifier(lMap, [entry identifier]); CFDictionaryRef lDict = ABMultiValueCopyValueAtIndex(lMap, index); CFStringRef valueRef = CFDictionaryGetValue(lDict, kABPersonInstantMessageUsernameKey); - dest = [NSString stringWithString:(NSString*) valueRef]; + dest = [FastAddressBook normalizeSipURI:[NSString stringWithString:(NSString*) valueRef]]; CFRelease(lDict); CFRelease(lMap); } if(dest != nil) { NSString *displayName = [FastAddressBook getContactDisplayName:contact]; - - // Go to dialer view - DialerViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeView:PhoneView_Dialer], DialerViewController); - if(controller != nil) { - [controller call:dest displayName:displayName]; + if([ContactSelection getSelectionMode] != ContactSelectionModeMessage) { + // Go to dialer view + DialerViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:[DialerViewController compositeViewDescription]], DialerViewController); + if(controller != nil) { + [controller call:dest displayName:displayName]; + } + } else { + // Go to Chat room view + [[PhoneMainView instance] popToView:[ChatViewController compositeViewDescription]]; + ChatRoomViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:[ChatRoomViewController compositeViewDescription] push:TRUE], ChatRoomViewController); + if(controller != nil) { + [controller setRemoteAddress:dest]; + } } } } else { diff --git a/Classes/ContactDetailsViewController.m b/Classes/ContactDetailsViewController.m index 3ce5cf20d..ca7d9f787 100644 --- a/Classes/ContactDetailsViewController.m +++ b/Classes/ContactDetailsViewController.m @@ -67,7 +67,7 @@ ABAddressBookRevert(addressBook); contact = ABAddressBookGetPersonWithRecordID(addressBook, recordID); if(contact == NULL) { - [[PhoneMainView instance] popView]; + [[PhoneMainView instance] popCurrentView]; return; } [tableController setContact:contact]; @@ -82,7 +82,7 @@ static void sync_address_book (ABAddressBookRef addressBook, CFDictionaryRef inf - (void)removeContact { if(contact == NULL) { - [[PhoneMainView instance] popView]; + [[PhoneMainView instance] popCurrentView]; return; } @@ -112,7 +112,7 @@ static void sync_address_book (ABAddressBookRef addressBook, CFDictionaryRef inf - (void)saveData { if(contact == NULL) { - [[PhoneMainView instance] popView]; + [[PhoneMainView instance] popCurrentView]; return; } @@ -218,6 +218,12 @@ static void sync_address_book (ABAddressBookRef addressBook, CFDictionaryRef inf - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; + if([ContactSelection getSelectionMode] == ContactSelectionModeEdit || + [ContactSelection getSelectionMode] == ContactSelectionModeNone) { + [editButton setHidden:FALSE]; + } else { + [editButton setHidden:TRUE]; + } if ([[UIDevice currentDevice].systemVersion doubleValue] < 5.0) { [tableController viewWillAppear:animated]; } @@ -240,18 +246,24 @@ static void sync_address_book (ABAddressBookRef addressBook, CFDictionaryRef inf #pragma mark - UICompositeViewDelegate Functions -+ (UICompositeViewDescription*) compositeViewDescription { - UICompositeViewDescription *description = [UICompositeViewDescription alloc]; - description->content = @"ContactDetailsViewController"; - description->tabBar = @"UIMainBar"; - description->tabBarEnabled = true; - description->stateBar = nil; - description->stateBarEnabled = false; - description->fullscreen = false; - return description; +static UICompositeViewDescription *compositeDescription = nil; + ++ (UICompositeViewDescription *)compositeViewDescription { + if(compositeDescription == nil) { + compositeDescription = [[UICompositeViewDescription alloc] init:@"ContactDetails" + content:@"ContactDetailsViewController" + stateBar:nil + stateBarEnabled:false + tabBar:@"UIMainBar" + tabBarEnabled:true + fullscreen:false]; + } + return compositeDescription; } +#pragma mark - + - (void)enableEdit:(BOOL)animated { if(![tableController isEditing]) { [tableController setEditing:TRUE animated:animated]; @@ -278,7 +290,7 @@ static void sync_address_book (ABAddressBookRef addressBook, CFDictionaryRef inf } - (IBAction)onBackClick:(id)event { - [[PhoneMainView instance] popView]; + [[PhoneMainView instance] popCurrentView]; } - (IBAction)onEditClick:(id)event { @@ -293,7 +305,7 @@ static void sync_address_book (ABAddressBookRef addressBook, CFDictionaryRef inf - (void)onRemove:(id)event { [self disableEdit:FALSE]; [self removeContact]; - [[PhoneMainView instance] popView]; + [[PhoneMainView instance] popCurrentView]; } @end diff --git a/Classes/ContactDetailsViewController.xib b/Classes/ContactDetailsViewController.xib index aa51f1437..42e2901cc 100644 --- a/Classes/ContactDetailsViewController.xib +++ b/Classes/ContactDetailsViewController.xib @@ -11,6 +11,7 @@ 1181 + IBUIImageView IBUIButton IBUITableView IBUIView @@ -41,6 +42,20 @@ 290 + + + 292 + {320, 58} + + + _NS:9 + NO + IBCocoaTouchFramework + + NSImage + contact_bar_background.png + + 292 @@ -160,7 +175,6 @@ {{0, 59}, {320, 401}} - _NS:9 10 @@ -385,6 +399,7 @@ AAgACAAIAAEAAQABAAE + toolBar @@ -420,6 +435,12 @@ AAgACAAIAAEAAQABAAE cancelButton + + 52 + + + barBackground + @@ -435,6 +456,7 @@ AAgACAAIAAEAAQABAAE com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin UIToggleButton com.apple.InterfaceBuilder.IBCocoaTouchPlugin @@ -445,7 +467,7 @@ AAgACAAIAAEAAQABAAE - 51 + 52 @@ -537,6 +559,7 @@ AAgACAAIAAEAAQABAAE {320, 117} {320, 117} + {5, 117} {320, 117} {320, 117} {320, 117} diff --git a/Classes/ContactsTableViewController.h b/Classes/ContactsTableViewController.h index 5ab544424..7ae506cb8 100644 --- a/Classes/ContactsTableViewController.h +++ b/Classes/ContactsTableViewController.h @@ -27,10 +27,8 @@ ABAddressBookRef addressBook; BOOL sipFilter; - NSString *tempAddress; } -@property (nonatomic, retain) NSString* tempAddress; @property (nonatomic, assign) BOOL sipFilter; @end diff --git a/Classes/ContactsTableViewController.m b/Classes/ContactsTableViewController.m index 76b9b9c4c..bb32853fd 100644 --- a/Classes/ContactsTableViewController.m +++ b/Classes/ContactsTableViewController.m @@ -28,8 +28,6 @@ @implementation ContactsTableViewController @synthesize sipFilter; -@synthesize tempAddress; - #pragma mark - Lifecycle Functions @@ -60,7 +58,6 @@ ABAddressBookUnregisterExternalChangeCallback(addressBook, sync_address_book, self); CFRelease(addressBook); [addressBookMap removeAllObjects]; - [tempAddress release]; [super dealloc]; } @@ -152,7 +149,6 @@ static void sync_address_book (ABAddressBookRef addressBook, CFDictionaryRef inf - (void)viewWillDisappear:(BOOL)animated { [super viewWillDisappear:animated]; - [self setTempAddress:nil]; } @@ -194,13 +190,12 @@ static void sync_address_book (ABAddressBookRef addressBook, CFDictionaryRef inf ABRecordRef lPerson = [subDic objectForKey: [subDic keyAtIndex:[indexPath row]]]; // Go to Contact details view - ContactDetailsViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeView:PhoneView_ContactDetails push:TRUE], ContactDetailsViewController); + ContactDetailsViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:[ContactDetailsViewController compositeViewDescription] push:TRUE], ContactDetailsViewController); if(controller != nil) { - if(tempAddress == nil) { + if([ContactSelection getAddAddress] == nil) { [controller setContact:lPerson]; } else { - [controller editContact:lPerson address:tempAddress]; - [self setTempAddress:nil]; + [controller editContact:lPerson address:[ContactSelection getAddAddress]]; } } } diff --git a/Classes/ContactsViewController.h b/Classes/ContactsViewController.h index 3c7a81d01..e818ccc3f 100644 --- a/Classes/ContactsViewController.h +++ b/Classes/ContactsViewController.h @@ -20,26 +20,45 @@ #import #import "UICompositeViewController.h" - #import "ContactsTableViewController.h" +typedef enum _ContactSelectionMode { + ContactSelectionModeNone, + ContactSelectionModeEdit, + ContactSelectionModePhone, + ContactSelectionModeMessage +} ContactSelectionMode; + +@interface ContactSelection : NSObject { +} + ++ (void)setSelectionMode:(ContactSelectionMode)selectionMode; ++ (ContactSelectionMode)getSelectionMode; ++ (void)setAddAddress:(NSString*)address; ++ (NSString*)getAddAddress; + +@end + @interface ContactsViewController : UIViewController { ContactsTableViewController *tableController; UITableView *tableView; UIButton *allButton; UIButton *linphoneButton; + UIButton *backButton; + UIButton *addButton; } @property (nonatomic, retain) IBOutlet ContactsTableViewController* tableController; @property (nonatomic, retain) IBOutlet UITableView *tableView; @property (nonatomic, retain) IBOutlet UIButton* allButton; @property (nonatomic, retain) IBOutlet UIButton* linphoneButton; +@property (nonatomic, retain) IBOutlet UIButton *backButton; +@property (nonatomic, retain) IBOutlet UIButton *addButton; - (IBAction)onAllClick:(id)event; - (IBAction)onLinphoneClick:(id)event; - (IBAction)onAddContactClick:(id)event; - -- (void)setAddress:(NSString*)address; +- (IBAction)onBackClick:(id)event; @end diff --git a/Classes/ContactsViewController.m b/Classes/ContactsViewController.m index fc00098f1..4d7778927 100644 --- a/Classes/ContactsViewController.m +++ b/Classes/ContactsViewController.m @@ -23,6 +23,35 @@ #import +@implementation ContactSelection + +static ContactSelectionMode sSelectionMode = ContactSelectionModeNone; +static NSString* sAddAddress = nil; + ++ (void)setSelectionMode:(ContactSelectionMode)selectionMode { + sSelectionMode = selectionMode; +} + ++ (ContactSelectionMode)getSelectionMode { + return sSelectionMode; +} + ++ (void)setAddAddress:(NSString*)address { + if(sAddAddress != nil) { + [sAddAddress release]; + sAddAddress= nil; + } + if(address != nil) { + sAddAddress = [address retain]; + } +} + ++ (NSString*)getAddAddress { + return sAddAddress; +} + +@end + @implementation ContactsViewController @synthesize tableController; @@ -30,6 +59,8 @@ @synthesize allButton; @synthesize linphoneButton; +@synthesize backButton; +@synthesize addButton; typedef enum _HistoryView { History_All, @@ -50,22 +81,27 @@ typedef enum _HistoryView { [allButton release]; [linphoneButton release]; + [backButton release]; + [addButton release]; [super dealloc]; } - #pragma mark - UICompositeViewDelegate Functions -+ (UICompositeViewDescription*) compositeViewDescription { - UICompositeViewDescription *description = [UICompositeViewDescription alloc]; - description->content = @"ContactsViewController"; - description->tabBar = @"UIMainBar"; - description->tabBarEnabled = true; - description->stateBar = nil; - description->stateBarEnabled = false; - description->fullscreen = false; - return description; +static UICompositeViewDescription *compositeDescription = nil; + ++ (UICompositeViewDescription *)compositeViewDescription { + if(compositeDescription == nil) { + compositeDescription = [[UICompositeViewDescription alloc] init:@"Contacts" + content:@"ContactsViewController" + stateBar:nil + stateBarEnabled:false + tabBar:@"UIMainBar" + tabBarEnabled:true + fullscreen:false]; + } + return compositeDescription; } @@ -85,6 +121,7 @@ typedef enum _HistoryView { } [self changeView:History_All]; + [self update]; } - (void)viewDidAppear:(BOOL)animated { @@ -116,10 +153,6 @@ typedef enum _HistoryView { #pragma mark - -- (void)setAddress:(NSString*)address { - [tableController setTempAddress:address]; -} - - (void)changeView: (HistoryView) view { if(view == History_All) { [tableController setSipFilter:FALSE]; @@ -136,6 +169,20 @@ typedef enum _HistoryView { } } +- (void)update { + switch ([ContactSelection getSelectionMode]) { + case ContactSelectionModePhone: + case ContactSelectionModeMessage: + [addButton setHidden:TRUE]; + [backButton setHidden:FALSE]; + break; + default: + [addButton setHidden:FALSE]; + [backButton setHidden:TRUE]; + break; + } +} + #pragma mark - Action Functions @@ -149,15 +196,18 @@ typedef enum _HistoryView { - (IBAction)onAddContactClick:(id)event { // Go to Contact details view - ContactDetailsViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeView:PhoneView_ContactDetails push:TRUE], ContactDetailsViewController); + ContactDetailsViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:[ContactDetailsViewController compositeViewDescription] push:TRUE], ContactDetailsViewController); if(controller != nil) { - if([tableController tempAddress] == nil) { + if([ContactSelection getAddAddress] == nil) { [controller newContact]; } else { - [controller newContact:[tableController tempAddress]]; - [tableController setTempAddress:nil]; + [controller newContact:[ContactSelection getAddAddress]]; } } } +- (IBAction)onBackClick:(id)event { + [[PhoneMainView instance] popCurrentView]; +} + @end diff --git a/Classes/ContactsViewController.xib b/Classes/ContactsViewController.xib index 0a3edf504..91add1d9e 100644 --- a/Classes/ContactsViewController.xib +++ b/Classes/ContactsViewController.xib @@ -44,7 +44,7 @@ 292 - {106, 58} + {{108, 0}, {106, 58}} @@ -83,7 +83,7 @@ 292 - {{106, 0}, {106, 58}} + {{214, 0}, {106, 58}} @@ -112,10 +112,10 @@ 292 - {{212, 0}, {108, 58}} + {108, 58} - + _NS:9 NO @@ -137,6 +137,34 @@ + + + -2147483356 + {108, 58} + + + + _NS:9 + NO + + Add contact + + IBCocoaTouchFramework + 0 + 0 + NO + + + NSImage + contacts_back_over.png + + + NSImage + contacts_back_default.png + + + + {320, 58} @@ -246,6 +274,22 @@ 84 + + + backButton + + + + 90 + + + + addButton + + + + 91 + onAllClick: @@ -297,6 +341,15 @@ 80 + + + onBackClick: + + + 7 + + 89 + @@ -330,9 +383,10 @@ 3 + + - toolBar @@ -368,6 +422,12 @@ tableController + + 87 + + + backButton + @@ -386,12 +446,14 @@ com.apple.InterfaceBuilder.IBCocoaTouchPlugin ContactsTableViewController com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + - 86 + 91 @@ -409,6 +471,7 @@ id id + id id @@ -420,22 +483,36 @@ onAllClick: id + + onBackClick: + id + onLinphoneClick: id + UIButton UIButton + UIButton UIButton ContactsTableViewController UITableView + + addButton + UIButton + allButton UIButton + + backButton + UIButton + linphoneButton UIButton @@ -469,6 +546,8 @@ {213, 117} {213, 117} {213, 117} + {213, 117} + {213, 117} {213, 117} {213, 117} diff --git a/Classes/DialerViewController.m b/Classes/DialerViewController.m index 64fc25db7..96b3e64c8 100644 --- a/Classes/DialerViewController.m +++ b/Classes/DialerViewController.m @@ -96,15 +96,19 @@ #pragma mark - UICompositeViewDelegate Functions +static UICompositeViewDescription *compositeDescription = nil; + + (UICompositeViewDescription *)compositeViewDescription { - UICompositeViewDescription *description = [UICompositeViewDescription alloc]; - description->content = @"DialerViewController"; - description->tabBar = @"UIMainBar"; - description->tabBarEnabled = true; - description->stateBar = @"UIStateBar"; - description->stateBarEnabled = true; - description->fullscreen = false; - return description; + if(compositeDescription == nil) { + compositeDescription = [[UICompositeViewDescription alloc] init:@"Dialer" + content:@"DialerViewController" + stateBar:@"UIStateBar" + stateBarEnabled:true + tabBar:@"UIMainBar" + tabBarEnabled:true + fullscreen:false]; + } + return compositeDescription; } @@ -223,14 +227,16 @@ #pragma mark - Action Functions - (IBAction)onAddContactClick: (id) event { - ContactsViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeView:PhoneView_Contacts push:TRUE], ContactsViewController); + [ContactSelection setSelectionMode:ContactSelectionModeEdit]; + [ContactSelection setAddAddress:[addressField text]]; + ContactsViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:[ContactsViewController compositeViewDescription] push:TRUE], ContactsViewController); if(controller != nil) { - [controller setAddress:[addressField text]]; + } } - (IBAction)onBackClick: (id) event { - [[PhoneMainView instance] changeView:PhoneView_InCall]; + [[PhoneMainView instance] changeCurrentView:[InCallViewController compositeViewDescription]]; } - (IBAction)onAddressChange: (id)sender { diff --git a/Classes/FirstLoginViewController.m b/Classes/FirstLoginViewController.m index 554c5fdd8..2e88af89f 100644 --- a/Classes/FirstLoginViewController.m +++ b/Classes/FirstLoginViewController.m @@ -52,17 +52,20 @@ #pragma mark - UICompositeViewDelegate Functions -+ (UICompositeViewDescription *)compositeViewDescription { - UICompositeViewDescription *description = [UICompositeViewDescription alloc]; - description->content = @"FirstLoginViewController"; - description->tabBar = nil; - description->tabBarEnabled = false; - description->stateBar = nil; - description->stateBarEnabled = false; - description->fullscreen = false; - return description; -} +static UICompositeViewDescription *compositeDescription = nil; ++ (UICompositeViewDescription *)compositeViewDescription { + if(compositeDescription == nil) { + compositeDescription = [[UICompositeViewDescription alloc] init:@"FirstLogin" + content:@"FirstLoginViewController" + stateBar:nil + stateBarEnabled:false + tabBar:nil + tabBarEnabled:false + fullscreen:false]; + } + return compositeDescription; +} #pragma mark - ViewController Functions @@ -121,7 +124,7 @@ { [[LinphoneManager instance].settingsStore setBool:false forKey:@"enable_first_login_view_preference"]; [self.waitView setHidden:true]; - [[PhoneMainView instance] changeView:PhoneView_Dialer]; + [[PhoneMainView instance] changeCurrentView:[DialerViewController compositeViewDescription]]; break; } case LinphoneRegistrationNone: diff --git a/Classes/HistoryDetailsViewController.m b/Classes/HistoryDetailsViewController.m index 5822e5cc7..9ceee4f95 100644 --- a/Classes/HistoryDetailsViewController.m +++ b/Classes/HistoryDetailsViewController.m @@ -58,15 +58,19 @@ #pragma mark - UICompositeViewDelegate Functions -+ (UICompositeViewDescription*) compositeViewDescription { - UICompositeViewDescription *description = [UICompositeViewDescription alloc]; - description->content = @"HistoryDetailsViewController"; - description->tabBar = @"UIMainBar"; - description->tabBarEnabled = true; - description->stateBar = nil; - description->stateBarEnabled = false; - description->fullscreen = false; - return description; +static UICompositeViewDescription *compositeDescription = nil; + ++ (UICompositeViewDescription *)compositeViewDescription { + if(compositeDescription == nil) { + compositeDescription = [[UICompositeViewDescription alloc] init:@"HistoryDetails" + content:@"HistoryDetailsViewController" + stateBar:nil + stateBarEnabled:false + tabBar:@"UIMainBar" + tabBarEnabled:true + fullscreen:false]; + } + return compositeDescription; } @@ -245,12 +249,12 @@ #pragma mark - Action Functions - (IBAction)onBackClick:(id)event { - [[PhoneMainView instance] popView]; + [[PhoneMainView instance] popCurrentView]; } - (IBAction)onContactClick:(id)event { if(contact) { - ContactDetailsViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeView:PhoneView_ContactDetails push:TRUE], ContactDetailsViewController); + ContactDetailsViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:[ContactDetailsViewController compositeViewDescription] push:TRUE], ContactDetailsViewController); if(controller != nil) { [controller setContact:contact]; } @@ -258,9 +262,10 @@ } - (IBAction)onAddContactClick:(id)event { - ContactsViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeView:PhoneView_Contacts push:TRUE], ContactsViewController); + [ContactSelection setSelectionMode:ContactSelectionModeEdit]; + [ContactSelection setAddAddress:[[addressButton titleLabel] text]]; + ContactsViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:[ContactsViewController compositeViewDescription] push:TRUE], ContactsViewController); if(controller != nil) { - [controller setAddress:[[addressButton titleLabel] text]]; } } @@ -287,7 +292,7 @@ } - DialerViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeView:PhoneView_Dialer], DialerViewController); + DialerViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:[DialerViewController compositeViewDescription]], DialerViewController); if(controller != nil) { if(displayName != nil) { [controller call:[NSString stringWithUTF8String:lAddress] displayName:displayName]; diff --git a/Classes/HistoryTableViewController.m b/Classes/HistoryTableViewController.m index eb4dea67b..28d85ccc2 100644 --- a/Classes/HistoryTableViewController.m +++ b/Classes/HistoryTableViewController.m @@ -159,7 +159,7 @@ if(address != nil) { // Go to dialer view - DialerViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeView:PhoneView_Dialer], DialerViewController); + DialerViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:[DialerViewController compositeViewDescription]], DialerViewController); if(controller != nil) { [controller call:address displayName:displayName]; } @@ -170,8 +170,8 @@ if(editingStyle == UITableViewCellEditingStyleDelete) { [tableView beginUpdates]; LinphoneCallLog *callLog = [[callLogs objectAtIndex:[indexPath row]] pointerValue]; - [callLogs removeObjectAtIndex:[indexPath row]]; linphone_core_remove_call_log([LinphoneManager getLc], callLog); + [callLogs removeObjectAtIndex:[indexPath row]]; [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade]; [tableView endUpdates]; } diff --git a/Classes/HistoryViewController.m b/Classes/HistoryViewController.m index f1491fc4b..0cdae5baf 100644 --- a/Classes/HistoryViewController.m +++ b/Classes/HistoryViewController.m @@ -55,15 +55,19 @@ typedef enum _HistoryView { #pragma mark - UICompositeViewDelegate Functions -+ (UICompositeViewDescription*) compositeViewDescription { - UICompositeViewDescription *description = [UICompositeViewDescription alloc]; - description->content = @"HistoryViewController"; - description->tabBar = @"UIMainBar"; - description->tabBarEnabled = true; - description->stateBar = nil; - description->stateBarEnabled = false; - description->fullscreen = false; - return description; +static UICompositeViewDescription *compositeDescription = nil; + ++ (UICompositeViewDescription *)compositeViewDescription { + if(compositeDescription == nil) { + compositeDescription = [[UICompositeViewDescription alloc] init:@"History" + content:@"HistoryViewController" + stateBar:nil + stateBarEnabled:false + tabBar:@"UIMainBar" + tabBarEnabled:true + fullscreen:false]; + } + return compositeDescription; } diff --git a/Classes/InCallViewController.m b/Classes/InCallViewController.m index e6c0f4080..13cb6895a 100644 --- a/Classes/InCallViewController.m +++ b/Classes/InCallViewController.m @@ -81,15 +81,19 @@ const NSInteger SECURE_BUTTON_TAG=5; #pragma mark - UICompositeViewDelegate Functions -+ (UICompositeViewDescription*) compositeViewDescription { - UICompositeViewDescription *description = [UICompositeViewDescription alloc]; - description->content = @"InCallViewController"; - description->tabBar = @"UICallBar"; - description->tabBarEnabled = true; - description->stateBar = @"UIStateBar"; - description->stateBarEnabled = true; - description->fullscreen = false; - return description; +static UICompositeViewDescription *compositeDescription = nil; + ++ (UICompositeViewDescription *)compositeViewDescription { + if(compositeDescription == nil) { + compositeDescription = [[UICompositeViewDescription alloc] init:@"InCall" + content:@"InCallViewController" + stateBar:@"UIStateBar" + stateBarEnabled:true + tabBar:@"UICallBar" + tabBarEnabled:true + fullscreen:false]; + } + return compositeDescription; } @@ -280,7 +284,7 @@ const NSInteger SECURE_BUTTON_TAG=5; [videoCameraSwitch setAlpha:0.0]; [UIView commitAnimations]; - if([[PhoneMainView instance] currentView] == PhoneView_InCall && videoShown) + if([[[PhoneMainView instance] currentView] equal:[InCallViewController compositeViewDescription]] && videoShown) [[PhoneMainView instance] showTabBar: false]; if (hideControlsTimer) { diff --git a/Classes/LinphoneAppDelegate.m b/Classes/LinphoneAppDelegate.m index e0146a9de..a14d4c1da 100644 --- a/Classes/LinphoneAppDelegate.m +++ b/Classes/LinphoneAppDelegate.m @@ -143,14 +143,14 @@ int __aeabi_idiv(int a, int b) { - (void)setupUI { if ([[LinphoneManager instance].settingsStore boolForKey:@"enable_first_login_view_preference"] == true) { // Change to fist login view - [[PhoneMainView instance] changeView: PhoneView_FirstLogin]; + [[PhoneMainView instance] changeCurrentView: [FirstLoginViewController compositeViewDescription]]; } else { // Change to default view const MSList *list = linphone_core_get_proxy_config_list([LinphoneManager getLc]); if(list != NULL) { - [[PhoneMainView instance] changeView: PhoneView_Dialer]; + [[PhoneMainView instance] changeCurrentView: [DialerViewController compositeViewDescription]]; } else { - [[PhoneMainView instance] changeView: PhoneView_Wizard]; + [[PhoneMainView instance] changeCurrentView: [WizardViewController compositeViewDescription]]; } } @@ -220,7 +220,7 @@ int __aeabi_idiv(int a, int b) { } else if([notification.userInfo objectForKey:@"chat"] != nil) { NSString *remoteContact = (NSString*)[notification.userInfo objectForKey:@"chat"]; // Go to ChatRoom view - ChatRoomViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeView:PhoneView_ChatRoom push:TRUE], ChatRoomViewController); + ChatRoomViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:[ChatRoomViewController compositeViewDescription] push:TRUE], ChatRoomViewController); if(controller != nil) { [controller setRemoteAddress:remoteContact]; } diff --git a/Classes/LinphoneUI/UICallBar.m b/Classes/LinphoneUI/UICallBar.m index 5ced60b3d..06d1e4148 100644 --- a/Classes/LinphoneUI/UICallBar.m +++ b/Classes/LinphoneUI/UICallBar.m @@ -371,7 +371,7 @@ - (IBAction)onOptionsTransferClick:(id)sender { [self hideOptions]; // Go to dialer view - DialerViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeView:PhoneView_Dialer], DialerViewController); + DialerViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:[DialerViewController compositeViewDescription]], DialerViewController); if(controller != nil) { [controller setAddress:@""]; [controller setTransferMode:TRUE]; @@ -381,7 +381,7 @@ - (IBAction)onOptionsAddClick:(id)sender { [self hideOptions]; // Go to dialer view - DialerViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeView:PhoneView_Dialer], DialerViewController); + DialerViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:[DialerViewController compositeViewDescription]], DialerViewController); if(controller != nil) { [controller setAddress:@""]; [controller setTransferMode:FALSE]; diff --git a/Classes/LinphoneUI/UIChatCell.m b/Classes/LinphoneUI/UIChatCell.m index 522aabd62..aadba1a95 100644 --- a/Classes/LinphoneUI/UIChatCell.m +++ b/Classes/LinphoneUI/UIChatCell.m @@ -148,7 +148,7 @@ - (IBAction)onDetailsClick: (id) event { // Go to Chat room view - ChatRoomViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeView:PhoneView_ChatRoom push:TRUE], ChatRoomViewController); + ChatRoomViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:[ChatRoomViewController compositeViewDescription] push:TRUE], ChatRoomViewController); if(controller !=nil) { [controller setRemoteAddress:[chat remoteContact]]; } diff --git a/Classes/LinphoneUI/UIChatRoomCell.m b/Classes/LinphoneUI/UIChatRoomCell.m index 4ce7739f2..ceb4ec040 100644 --- a/Classes/LinphoneUI/UIChatRoomCell.m +++ b/Classes/LinphoneUI/UIChatRoomCell.m @@ -69,7 +69,7 @@ static UIFont *CELL_FONT = nil; if(chat != nil) { [chat release]; } - chat = achat; + chat = [achat retain]; [self update]; } diff --git a/Classes/LinphoneUI/UICompositeViewController.h b/Classes/LinphoneUI/UICompositeViewController.h index 0a7c4b46a..ee472f99b 100644 --- a/Classes/LinphoneUI/UICompositeViewController.h +++ b/Classes/LinphoneUI/UICompositeViewController.h @@ -23,7 +23,7 @@ #import "LinphoneManager.h" @interface UICompositeViewDescription: NSObject{ -@public + NSString *name; NSString *content; NSString *stateBar; BOOL stateBarEnabled; @@ -31,8 +31,18 @@ BOOL tabBarEnabled; BOOL fullscreen; } + +@property (retain) NSString *name; +@property (retain) NSString *content; +@property (retain) NSString *stateBar; +@property (assign) BOOL stateBarEnabled; +@property (retain) NSString *tabBar; +@property (assign) BOOL tabBarEnabled; +@property (assign) BOOL fullscreen; + - (id)copy; -- (id)init:(NSString *)content stateBar:(NSString*)stateBar +- (BOOL)equal:(UICompositeViewDescription*) description; +- (id)init:(NSString *)name content:(NSString *)content stateBar:(NSString*)stateBar stateBarEnabled:(BOOL) stateBarEnabled tabBar:(NSString*)tabBar tabBarEnabled:(BOOL) tabBarEnabled diff --git a/Classes/LinphoneUI/UICompositeViewController.m b/Classes/LinphoneUI/UICompositeViewController.m index 5875cc115..b12ad3052 100644 --- a/Classes/LinphoneUI/UICompositeViewController.m +++ b/Classes/LinphoneUI/UICompositeViewController.m @@ -21,32 +21,53 @@ @implementation UICompositeViewDescription +@synthesize name; +@synthesize content; +@synthesize stateBar; +@synthesize stateBarEnabled; +@synthesize tabBar; +@synthesize tabBarEnabled; +@synthesize fullscreen; + - (id)copy { UICompositeViewDescription *copy = [UICompositeViewDescription alloc]; - copy->content = self->content; - copy->stateBar = self->stateBar; - copy->stateBarEnabled = self->stateBarEnabled; - copy->tabBar = self->tabBar; - copy->tabBarEnabled = self->tabBarEnabled; - copy->fullscreen = self->fullscreen; + copy.content = self.content; + copy.stateBar = self.stateBar; + copy.stateBarEnabled = self.stateBarEnabled; + copy.tabBar = self.tabBar; + copy.tabBarEnabled = self.tabBarEnabled; + copy.fullscreen = self.fullscreen; return copy; } -- (id)init:(NSString *)acontent stateBar:(NSString*)astateBar +- (BOOL)equal:(UICompositeViewDescription*) description { + return [self.name compare:description.name] == NSOrderedSame; +} + +- (id)init:(NSString *)aname content:(NSString *)acontent stateBar:(NSString*)astateBar stateBarEnabled:(BOOL) astateBarEnabled tabBar:(NSString*)atabBar tabBarEnabled:(BOOL) atabBarEnabled fullscreen:(BOOL) afullscreen { - self->content = acontent; - self->stateBar = astateBar; - self->stateBarEnabled = astateBarEnabled; - self->tabBar = atabBar; - self->tabBarEnabled = atabBarEnabled; - self->fullscreen = afullscreen; + self.name = aname; + self.content = acontent; + self.stateBar = astateBar; + self.stateBarEnabled = astateBarEnabled; + self.tabBar = atabBar; + self.tabBarEnabled = atabBarEnabled; + self.fullscreen = afullscreen; return self; } +- (void)dealloc { + [name release]; + [content release]; + [stateBar release]; + [tabBar release]; + [super dealloc]; +} + @end @implementation UICompositeViewController @@ -181,28 +202,28 @@ // Animate only with a previous screen if(oldViewDescription != nil && viewTransition != nil) { [contentView.layer addAnimation:viewTransition forKey:@"Transition"]; - if((oldViewDescription->stateBarEnabled == true && currentViewDescription->stateBarEnabled == false) || - (oldViewDescription->stateBarEnabled == false && currentViewDescription->stateBarEnabled == true)) { + if((oldViewDescription.stateBarEnabled == true && currentViewDescription.stateBarEnabled == false) || + (oldViewDescription.stateBarEnabled == false && currentViewDescription.stateBarEnabled == true)) { [stateBarView.layer addAnimation:viewTransition forKey:@"Transition"]; } - if(oldViewDescription->tabBar != currentViewDescription->tabBar) { + if(oldViewDescription.tabBar != currentViewDescription.tabBar) { [tabBarView.layer addAnimation:viewTransition forKey:@"Transition"]; } } - if(oldViewDescription != nil && contentViewController != nil && oldViewDescription->content != currentViewDescription->content) { + if(oldViewDescription != nil && contentViewController != nil && oldViewDescription.content != currentViewDescription.content) { [UICompositeViewController removeSubView: contentViewController]; } - if(oldViewDescription != nil && tabBarViewController != nil && oldViewDescription->tabBar != currentViewDescription->tabBar) { + if(oldViewDescription != nil && tabBarViewController != nil && oldViewDescription.tabBar != currentViewDescription.tabBar) { [UICompositeViewController removeSubView: tabBarViewController]; } - if(oldViewDescription != nil && stateBarViewController != nil && oldViewDescription->stateBar != currentViewDescription->stateBar) { + if(oldViewDescription != nil && stateBarViewController != nil && oldViewDescription.stateBar != currentViewDescription.stateBar) { [UICompositeViewController removeSubView: stateBarViewController]; } - stateBarViewController = [self getCachedController:description->stateBar]; - contentViewController = [self getCachedController:description->content]; - tabBarViewController = [self getCachedController:description->tabBar]; + stateBarViewController = [self getCachedController:description.stateBar]; + contentViewController = [self getCachedController:description.content]; + tabBarViewController = [self getCachedController:description.tabBar]; } if(currentViewDescription == nil) { @@ -210,14 +231,14 @@ } if(tabBar != nil) { - currentViewDescription->tabBarEnabled = [tabBar boolValue]; + currentViewDescription.tabBarEnabled = [tabBar boolValue]; } if(fullscreen != nil) { - currentViewDescription->fullscreen = [fullscreen boolValue]; - [[UIApplication sharedApplication] setStatusBarHidden:currentViewDescription->fullscreen withAnimation:UIStatusBarAnimationSlide ]; + currentViewDescription.fullscreen = [fullscreen boolValue]; + [[UIApplication sharedApplication] setStatusBarHidden:currentViewDescription.fullscreen withAnimation:UIStatusBarAnimationSlide ]; } else { - [[UIApplication sharedApplication] setStatusBarHidden:currentViewDescription->fullscreen withAnimation:UIStatusBarAnimationNone]; + [[UIApplication sharedApplication] setStatusBarHidden:currentViewDescription.fullscreen withAnimation:UIStatusBarAnimationNone]; } // Start animation @@ -235,10 +256,10 @@ // Resize StateBar CGRect stateBarFrame = stateBarView.frame; int origin = IPHONE_STATUSBAR_HEIGHT; - if(currentViewDescription->fullscreen) + if(currentViewDescription.fullscreen) origin = 0; - if(stateBarViewController != nil && currentViewDescription->stateBarEnabled) { + if(stateBarViewController != nil && currentViewDescription.stateBarEnabled) { contentFrame.origin.y = origin + stateBarFrame.size.height; stateBarFrame.origin.y = origin; } else { @@ -248,7 +269,7 @@ // Resize TabBar CGRect tabFrame = tabBarView.frame; - if(tabBarViewController != nil && currentViewDescription->tabBarEnabled) { + if(tabBarViewController != nil && currentViewDescription.tabBarEnabled) { tabFrame.origin.y = viewFrame.size.height; tabFrame.origin.x = viewFrame.size.width; tabFrame.size.height = tabBarViewController.view.frame.size.height; @@ -263,17 +284,19 @@ } } } else { - contentFrame.size.height = tabFrame.origin.y + tabFrame.size.height; + contentFrame.size.height = viewFrame.size.height - contentFrame.origin.y; tabFrame.origin.y = viewFrame.size.height; } - if(currentViewDescription->fullscreen) + if(currentViewDescription.fullscreen) contentFrame.size.height = viewFrame.size.height - contentFrame.origin.y; // Resize innerView CGRect innerContentFrame = innerView.frame; - innerContentFrame.size = contentFrame.size; - + innerContentFrame.origin.x = 0; + innerContentFrame.origin.y = 0; + innerContentFrame.size.width = contentFrame.size.width; + innerContentFrame.size.height = contentFrame.size.height; // Set frames [contentView setFrame: contentFrame]; @@ -288,13 +311,13 @@ // Change view if(description != nil) { - if(oldViewDescription == nil || oldViewDescription->content != currentViewDescription->content) { + if(oldViewDescription == nil || oldViewDescription.content != currentViewDescription.content) { [UICompositeViewController addSubView: contentViewController view:contentView]; } - if(oldViewDescription == nil || oldViewDescription->tabBar != currentViewDescription->tabBar) { + if(oldViewDescription == nil || oldViewDescription.tabBar != currentViewDescription.tabBar) { [UICompositeViewController addSubView: tabBarViewController view:tabBarView]; } - if(oldViewDescription == nil || oldViewDescription->stateBar != currentViewDescription->stateBar) { + if(oldViewDescription == nil || oldViewDescription.stateBar != currentViewDescription.stateBar) { [UICompositeViewController addSubView: stateBarViewController view:stateBarView]; } } diff --git a/Classes/LinphoneUI/UICompositeViewController.xib b/Classes/LinphoneUI/UICompositeViewController.xib index 181faee01..9ee7c0b65 100644 --- a/Classes/LinphoneUI/UICompositeViewController.xib +++ b/Classes/LinphoneUI/UICompositeViewController.xib @@ -2,10 +2,10 @@ 1296 - 11D50 + 11E53 2182 - 1138.32 - 568.00 + 1138.47 + 569.00 com.apple.InterfaceBuilder.IBCocoaTouchPlugin 1181 @@ -57,10 +57,7 @@ _NS:9 - - 3 - MQA - + YES IBCocoaTouchFramework diff --git a/Classes/LinphoneUI/UIHistoryCell.m b/Classes/LinphoneUI/UIHistoryCell.m index 631013361..0c95d3f48 100644 --- a/Classes/LinphoneUI/UIHistoryCell.m +++ b/Classes/LinphoneUI/UIHistoryCell.m @@ -70,7 +70,7 @@ - (IBAction)onDetails:(id) event { if(callLog != NULL) { // Go to History details view - HistoryDetailsViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeView:PhoneView_HistoryDetails push:TRUE], HistoryDetailsViewController); + HistoryDetailsViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:[HistoryDetailsViewController compositeViewDescription] push:TRUE], HistoryDetailsViewController); if(controller != nil) { [controller setCallLog:callLog]; } diff --git a/Classes/LinphoneUI/UIMainBar.m b/Classes/LinphoneUI/UIMainBar.m index 49b24542b..db5742e92 100644 --- a/Classes/LinphoneUI/UIMainBar.m +++ b/Classes/LinphoneUI/UIMainBar.m @@ -125,9 +125,9 @@ } - (void)changeViewEvent:(NSNotification*)notif { - NSNumber *viewNumber = [notif.userInfo objectForKey: @"view"]; - if(viewNumber != nil) - [self updateView:[viewNumber intValue]]; + //UICompositeViewDescription *view = [notif.userInfo objectForKey: @"view"]; + //if(view != nil) + [self updateView:[[PhoneMainView instance] firstView]]; } - (void)textReceived:(NSNotification*)notif { @@ -138,7 +138,7 @@ #pragma mark - - (void)update { - [self updateView:[[PhoneMainView instance] currentView]]; + [self updateView:[[PhoneMainView instance] firstView]]; if([LinphoneManager isLcReady]) { [self updateMissedCall:linphone_core_get_missed_calls_count([LinphoneManager getLc])]; } else { @@ -228,35 +228,35 @@ [target.layer removeAnimationForKey:animationID]; } -- (void)updateView:(PhoneView) view { +- (void)updateView:(UICompositeViewDescription*) view { // Reset missed call - if(view == PhoneView_History) { + if([view equal:[HistoryViewController compositeViewDescription]]) { linphone_core_reset_missed_calls_count([LinphoneManager getLc]); [self updateMissedCall:0]; } // Update buttons - if(view == PhoneView_History || view == PhoneView_HistoryDetails) { + if([view equal:[HistoryViewController compositeViewDescription]]) { historyButton.selected = TRUE; } else { historyButton.selected = FALSE; } - if(view == PhoneView_Contacts || view == PhoneView_ContactDetails) { + if([view equal:[ContactsViewController compositeViewDescription]]) { contactsButton.selected = TRUE; } else { contactsButton.selected = FALSE; } - if(view == PhoneView_Dialer) { + if([view equal:[DialerViewController compositeViewDescription]]) { dialerButton.selected = TRUE; } else { dialerButton.selected = FALSE; } - if(view == PhoneView_Settings) { + if([view equal:[SettingsViewController compositeViewDescription]]) { settingsButton.selected = TRUE; } else { settingsButton.selected = FALSE; } - if(view == PhoneView_Chat || view == PhoneView_ChatRoom) { + if([view equal:[ChatViewController compositeViewDescription]]) { chatButton.selected = TRUE; } else { chatButton.selected = FALSE; @@ -267,24 +267,25 @@ #pragma mark - Action Functions - (IBAction)onHistoryClick: (id) sender { - [[PhoneMainView instance] changeView:PhoneView_History]; + [[PhoneMainView instance] changeCurrentView:[HistoryViewController compositeViewDescription]]; } - (IBAction)onContactsClick: (id) event { - [[PhoneMainView instance] changeView:PhoneView_Contacts]; + [ContactSelection setSelectionMode:ContactSelectionModeNone]; + [ContactSelection setAddAddress:nil]; + [[PhoneMainView instance] changeCurrentView:[ContactsViewController compositeViewDescription]]; } - (IBAction)onDialerClick: (id) event { - [[PhoneMainView instance] changeView:PhoneView_Dialer]; + [[PhoneMainView instance] changeCurrentView:[DialerViewController compositeViewDescription]]; } - (IBAction)onSettingsClick: (id) event { - [[PhoneMainView instance] changeView:PhoneView_Settings]; + [[PhoneMainView instance] changeCurrentView:[SettingsViewController compositeViewDescription]]; } - (IBAction)onChatClick: (id) event { - [[PhoneMainView instance] changeView:PhoneView_Chat]; + [[PhoneMainView instance] changeCurrentView:[ChatViewController compositeViewDescription]]; } - @end diff --git a/Classes/Model/ChatModel.m b/Classes/Model/ChatModel.m index e09d131e9..c538d8028 100644 --- a/Classes/Model/ChatModel.m +++ b/Classes/Model/ChatModel.m @@ -106,7 +106,7 @@ ChatModel* line = nil; int err = sqlite3_step(sqlStatement); if (err == SQLITE_ROW) { - line = [[ChatModel alloc] initWithData:sqlStatement]; + line = [[[ChatModel alloc] initWithData:sqlStatement] autorelease]; } else if (err != SQLITE_DONE) { [LinphoneLogger logc:LinphoneLoggerError format:"Error during execution of query: %s (%s)", sql, sqlite3_errmsg(database)]; sqlite3_finalize(sqlStatement); @@ -187,6 +187,7 @@ while ((err = sqlite3_step(sqlStatement)) == SQLITE_ROW) { ChatModel *line = [[ChatModel alloc] initWithData:sqlStatement]; [array addObject:line]; + [line release]; } if (err != SQLITE_DONE) { @@ -219,6 +220,7 @@ while ((err = sqlite3_step(sqlStatement)) == SQLITE_ROW) { ChatModel *line = [[ChatModel alloc] initWithData:sqlStatement]; [array addObject:line]; + [line release]; } if (err != SQLITE_DONE) { diff --git a/Classes/PhoneMainView.h b/Classes/PhoneMainView.h index 61234cdbe..7cc50ca26 100644 --- a/Classes/PhoneMainView.h +++ b/Classes/PhoneMainView.h @@ -37,45 +37,28 @@ #import "FirstLoginViewController.h" #import "WizardViewController.h" -typedef enum _PhoneView { - PhoneView_Wizard, - PhoneView_FirstLogin, - PhoneView_Dialer, - PhoneView_History, - PhoneView_HistoryDetails, - PhoneView_Settings, - PhoneView_Chat, - PhoneView_ChatRoom, - PhoneView_Contacts, - PhoneView_ContactDetails, - PhoneView_InCall, - PhoneView_IncomingCall, - PhoneView_END -} PhoneView; - @interface PhoneMainView : UIViewController { @private UICompositeViewController *mainViewController; - - NSMutableDictionary *viewDescriptions; UIActionSheet *incomingCallActionSheet; UIActionSheet *batteryActionSheet; int loadCount; - PhoneView currentView; - NSMutableArray* viewStack; + UICompositeViewDescription *currentView; + NSMutableArray *viewStack; } @property (nonatomic, retain) IBOutlet UICompositeViewController *mainViewController; - -- (UIViewController*)changeView:(PhoneView)view; -- (UIViewController*)changeView:(PhoneView)view push:(BOOL)push; -- (UIViewController*)popView; +@property (readonly) UICompositeViewDescription *currentView; +- (UIViewController*)changeCurrentView:(UICompositeViewDescription *)currentView; +- (UIViewController*)changeCurrentView:(UICompositeViewDescription *)currentView push:(BOOL)push; +- (UIViewController*)popCurrentView; +- (void)popToView:(UICompositeViewDescription *)currentView; +- (UICompositeViewDescription *)firstView; - (void)showTabBar:(BOOL)show; - (void)fullScreen:(BOOL)enabled; -- (PhoneView)currentView; + (PhoneMainView*) instance; diff --git a/Classes/PhoneMainView.m b/Classes/PhoneMainView.m index 863da3dd8..5c14d68b2 100644 --- a/Classes/PhoneMainView.m +++ b/Classes/PhoneMainView.m @@ -29,19 +29,16 @@ static PhoneMainView* phoneMainViewInstance=nil; @implementation PhoneMainView @synthesize mainViewController; - +@synthesize currentView; #pragma mark - Lifecycle Functions - (void)initPhoneMainView { assert (!phoneMainViewInstance); phoneMainViewInstance = self; - currentView = -1; + currentView = nil; viewStack = [[NSMutableArray alloc] init]; loadCount = 0; // For avoiding IOS 4 bug - - // Init view descriptions - viewDescriptions = [[NSMutableDictionary alloc] init]; } - (id)init { @@ -73,11 +70,8 @@ static PhoneMainView* phoneMainViewInstance=nil; [mainViewController release]; - [viewDescriptions removeAllObjects]; - [viewDescriptions release]; - [viewStack release]; - + [super dealloc]; } @@ -93,19 +87,6 @@ static PhoneMainView* phoneMainViewInstance=nil; [self.view addSubview: mainViewController.view]; [mainViewController.view setFrame:[self.view frame]]; - - // Init descriptions - [viewDescriptions setObject:[ChatRoomViewController compositeViewDescription] forKey:[NSNumber numberWithInt: PhoneView_ChatRoom]]; - [viewDescriptions setObject:[ChatViewController compositeViewDescription] forKey:[NSNumber numberWithInt: PhoneView_Chat]]; - [viewDescriptions setObject:[DialerViewController compositeViewDescription] forKey:[NSNumber numberWithInt: PhoneView_Dialer]]; - [viewDescriptions setObject:[ContactsViewController compositeViewDescription] forKey:[NSNumber numberWithInt: PhoneView_Contacts]]; - [viewDescriptions setObject:[ContactDetailsViewController compositeViewDescription] forKey:[NSNumber numberWithInt:PhoneView_ContactDetails]]; - [viewDescriptions setObject:[HistoryViewController compositeViewDescription] forKey:[NSNumber numberWithInt: PhoneView_History]]; - [viewDescriptions setObject:[HistoryDetailsViewController compositeViewDescription] forKey:[NSNumber numberWithInt:PhoneView_HistoryDetails]]; - [viewDescriptions setObject:[InCallViewController compositeViewDescription] forKey:[NSNumber numberWithInt: PhoneView_InCall]]; - [viewDescriptions setObject:[SettingsViewController compositeViewDescription] forKey:[NSNumber numberWithInt: PhoneView_Settings]]; - [viewDescriptions setObject:[FirstLoginViewController compositeViewDescription] forKey:[NSNumber numberWithInt: PhoneView_FirstLogin]]; - [viewDescriptions setObject:[WizardViewController compositeViewDescription] forKey:[NSNumber numberWithInt: PhoneView_Wizard]]; } - (void)viewWillAppear:(BOOL)animated { @@ -237,7 +218,7 @@ static PhoneMainView* phoneMainViewInstance=nil; case LinphoneCallConnected: case LinphoneCallUpdated: { - [self changeView:PhoneView_InCall]; + [self changeCurrentView:[InCallViewController compositeViewDescription]]; break; } case LinphoneCallUpdatedByRemote: @@ -246,7 +227,7 @@ static PhoneMainView* phoneMainViewInstance=nil; const LinphoneCallParams* remote = linphone_call_get_remote_params(call); if (linphone_call_params_video_enabled(current) && !linphone_call_params_video_enabled(remote)) { - [self changeView:PhoneView_InCall]; + [self changeCurrentView:[InCallViewController compositeViewDescription]]; } break; } @@ -259,19 +240,19 @@ static PhoneMainView* phoneMainViewInstance=nil; [self dismissIncomingCall:call]; if (canHideInCallView) { // Go to dialer view - DialerViewController *controller = DYNAMIC_CAST([self changeView:PhoneView_Dialer], DialerViewController); + DialerViewController *controller = DYNAMIC_CAST([self changeCurrentView:[DialerViewController compositeViewDescription]], DialerViewController); if(controller != nil) { [controller setAddress:@""]; [controller setTransferMode:FALSE]; } } else { - [self changeView:PhoneView_InCall]; + [self changeCurrentView:[InCallViewController compositeViewDescription]]; } break; } case LinphoneCallStreamsRunning: { - [self changeView:PhoneView_InCall]; + [self changeCurrentView:[InCallViewController compositeViewDescription]]; break; } default: @@ -302,29 +283,29 @@ static PhoneMainView* phoneMainViewInstance=nil; return trans; } -+ (CATransition*)getTransition:(PhoneView)old new:(PhoneView)new { ++ (CATransition*)getTransition:(UICompositeViewDescription *)old new:(UICompositeViewDescription *)new { bool left = false; - if(old == PhoneView_Chat || old == PhoneView_ChatRoom) { - if(new == PhoneView_Contacts || - new == PhoneView_Dialer || - new == PhoneView_Settings || - new == PhoneView_History) { + if([old equal:[ChatViewController compositeViewDescription]]) { + if([new equal:[ContactsViewController compositeViewDescription]] || + [new equal:[DialerViewController compositeViewDescription]] || + [new equal:[SettingsViewController compositeViewDescription]] || + [new equal:[HistoryViewController compositeViewDescription]]) { left = true; } - } else if(old == PhoneView_Settings) { - if(new == PhoneView_Dialer || - new == PhoneView_Contacts || - new == PhoneView_History) { + } else if([old equal:[SettingsViewController compositeViewDescription]]) { + if([new equal:[DialerViewController compositeViewDescription]] || + [new equal:[ContactsViewController compositeViewDescription]] || + [new equal:[HistoryViewController compositeViewDescription]]) { left = true; } - } else if(old == PhoneView_Dialer) { - if(new == PhoneView_Contacts || - new == PhoneView_History) { + } else if([old equal:[DialerViewController compositeViewDescription]]) { + if([new equal:[ContactsViewController compositeViewDescription]] || + [new equal:[HistoryViewController compositeViewDescription]]) { left = true; } - } else if(old == PhoneView_Contacts || old == PhoneView_ContactDetails) { - if(new == PhoneView_History) { + } else if([old equal:[ContactsViewController compositeViewDescription]]) { + if([new equal:[HistoryViewController compositeViewDescription]]) { left = true; } } @@ -348,59 +329,60 @@ static PhoneMainView* phoneMainViewInstance=nil; [mainViewController setFullScreen:enabled]; } -- (UIViewController*)changeView:(PhoneView)view { - return [self changeView:view push:FALSE]; +- (UIViewController*)changeCurrentView:(UICompositeViewDescription *)view { + return [self changeCurrentView:view push:FALSE]; } -- (UIViewController*)changeView:(PhoneView)view push:(BOOL)push { - if(push && currentView != -1) { - [viewStack addObject:[NSNumber numberWithInt: currentView]]; - } else { +- (UIViewController*)changeCurrentView:(UICompositeViewDescription*)view push:(BOOL)push { + if(!push) { [viewStack removeAllObjects]; } - return [self _changeView:view transition:nil]; + [viewStack addObject:view]; + return [self _changeCurrentView:view transition:nil]; } -- (UIViewController*)_changeView:(PhoneView)view transition:(CATransition*)transition { - [LinphoneLogger logc:LinphoneLoggerLog format:"PhoneMainView: change view %d", view]; - UICompositeViewDescription* description = [viewDescriptions objectForKey:[NSNumber numberWithInt: view]]; - if(description == nil) - return nil; +- (UIViewController*)_changeCurrentView:(UICompositeViewDescription*)view transition:(CATransition*)transition { + [LinphoneLogger logc:LinphoneLoggerLog format:"PhoneMainView: change view %d", [view name]]; - if(view != currentView) { + if(![view equal: currentView]) { if(transition == nil) transition = [PhoneMainView getTransition:currentView new:view]; [mainViewController setViewTransition:transition]; - [mainViewController changeView:description]; + [mainViewController changeView:view]; currentView = view; } - NSDictionary* mdict = [NSMutableDictionary dictionaryWithObject: [NSNumber numberWithInt:currentView] forKey:@"view"]; + NSDictionary* mdict = [NSMutableDictionary dictionaryWithObject:currentView forKey:@"view"]; [[NSNotificationCenter defaultCenter] postNotificationName:@"LinphoneMainViewChange" object:self userInfo:mdict]; return [mainViewController getCurrentViewController]; } -- (UIViewController*)popView { - return [self popView:nil]; +- (void)popToView:(UICompositeViewDescription*)view { + while([viewStack count] > 1 && ![[viewStack lastObject] equal:view]) { + [viewStack removeLastObject]; + } + [self _changeCurrentView:[viewStack lastObject] transition:[PhoneMainView getBackwardTransition]]; } -- (UIViewController*)popView:(NSArray *)calls { +- (UICompositeViewDescription *)firstView { + UICompositeViewDescription *view = nil; + if([viewStack count]) { + view = [viewStack objectAtIndex:0]; + } + return view; +} + +- (UIViewController*)popCurrentView { [LinphoneLogger logc:LinphoneLoggerLog format:"PhoneMainView: Pop view"]; if([viewStack count] > 0) { - PhoneView view = [[viewStack lastObject] intValue]; [viewStack removeLastObject]; - [self _changeView:view transition:[PhoneMainView getBackwardTransition]]; - + [self _changeCurrentView:[viewStack lastObject] transition:[PhoneMainView getBackwardTransition]]; return [mainViewController getCurrentViewController]; } return nil; } -- (PhoneView)currentView { - return currentView; -} - - (void)displayCallError:(LinphoneCall*) call message:(NSString*) message { const char* lUserNameChars=linphone_address_get_username(linphone_call_get_remote_address(call)); NSString* lUserName = lUserNameChars?[[[NSString alloc] initWithUTF8String:lUserNameChars] autorelease]:NSLocalizedString(@"Unknown",nil); diff --git a/Classes/PhoneMainView.xib b/Classes/PhoneMainView.xib index 968ca8a57..801b7f18d 100644 --- a/Classes/PhoneMainView.xib +++ b/Classes/PhoneMainView.xib @@ -2,10 +2,10 @@ 784 - 11D50 + 11E53 2182 - 1138.32 - 568.00 + 1138.47 + 569.00 com.apple.InterfaceBuilder.IBCocoaTouchPlugin 1181 diff --git a/Classes/SettingsViewController.m b/Classes/SettingsViewController.m index 352ee8aee..29690c4e4 100644 --- a/Classes/SettingsViewController.m +++ b/Classes/SettingsViewController.m @@ -34,15 +34,19 @@ #pragma mark - UICompositeViewDelegate Functions -+ (UICompositeViewDescription*) compositeViewDescription { - UICompositeViewDescription *description = [UICompositeViewDescription alloc]; - description->content = @"SettingsViewController"; - description->tabBar = @"UIMainBar"; - description->tabBarEnabled = true; - description->stateBar = nil; - description->stateBarEnabled = false; - description->fullscreen = false; - return description; +static UICompositeViewDescription *compositeDescription = nil; + ++ (UICompositeViewDescription *)compositeViewDescription { + if(compositeDescription == nil) { + compositeDescription = [[UICompositeViewDescription alloc] init:@"Settings" + content:@"SettingsViewController" + stateBar:nil + stateBarEnabled:false + tabBar: @"UIMainBar" + tabBarEnabled:true + fullscreen:false]; + } + return compositeDescription; } diff --git a/Classes/Utils/FastAddressBook.h b/Classes/Utils/FastAddressBook.h index fa737ae52..5550b373b 100644 --- a/Classes/Utils/FastAddressBook.h +++ b/Classes/Utils/FastAddressBook.h @@ -26,6 +26,7 @@ ABAddressBookRef addressBook; } ++ (BOOL)isSipURI:(NSString*)address; + (NSString*)getContactDisplayName:(ABRecordRef)contact; + (UIImage*)getContactImage:(ABRecordRef)contact thumbnail:(BOOL)thumbnail; - (ABRecordRef)getContact:(NSString*)address; diff --git a/Classes/Utils/FastAddressBook.m b/Classes/Utils/FastAddressBook.m index 3ec6488a7..c25c0e9d7 100644 --- a/Classes/Utils/FastAddressBook.m +++ b/Classes/Utils/FastAddressBook.m @@ -39,7 +39,7 @@ if (contact && ABPersonHasImageData(contact)) { CFDataRef imgData = ABPersonCopyImageDataWithFormat(contact, thumbnail? kABPersonImageFormatThumbnail: kABPersonImageFormatOriginalSize); - retImage = [[[UIImage alloc] initWithData:(NSData *)imgData] autorelease]; + retImage = [UIImage imageWithData:(NSData *)imgData]; CFRelease(imgData); } return retImage; @@ -51,6 +51,10 @@ } } ++ (BOOL)isSipURI:(NSString*)address { + return [address hasPrefix:@"sip:"]; +} + + (NSString*)appendCountryCodeIfPossible:(NSString*)number { if (![number hasPrefix:@"+"] && ![number hasPrefix:@"00"]) { NSString* lCountryCode = [[LinphoneManager instance].settingsStore objectForKey:@"countrycode_preference"]; @@ -63,7 +67,11 @@ } + (NSString*)normalizeSipURI:(NSString*)address { - return address; + NSString* ret = address; + if(![address hasPrefix:@"sip:"]) { + ret = [@"sip:" stringByAppendingString:ret]; + } + return ret; } + (NSString*)normalizePhoneNumber:(NSString*)address { diff --git a/Classes/WizardViewController.m b/Classes/WizardViewController.m index c32db0ad4..348e2022f 100644 --- a/Classes/WizardViewController.m +++ b/Classes/WizardViewController.m @@ -78,15 +78,19 @@ typedef enum _ViewElement { #pragma mark - UICompositeViewDelegate Functions -+ (UICompositeViewDescription*) compositeViewDescription { -UICompositeViewDescription *description = [UICompositeViewDescription alloc]; - description->content = @"WizardViewController"; - description->tabBar = nil; - description->tabBarEnabled = false; - description->stateBar = nil; - description->stateBarEnabled = false; - description->fullscreen = false; - return description; +static UICompositeViewDescription *compositeDescription = nil; + ++ (UICompositeViewDescription *)compositeViewDescription { + if(compositeDescription == nil) { + compositeDescription = [[UICompositeViewDescription alloc] init:@"Wizard" + content:@"WizardViewController" + stateBar:nil + stateBarEnabled:false + tabBar:nil + tabBarEnabled:false + fullscreen:false]; + } + return compositeDescription; } @@ -185,7 +189,7 @@ UICompositeViewDescription *description = [UICompositeViewDescription alloc]; } - (IBAction)onCancelClick:(id)sender { - [[PhoneMainView instance] changeView:PhoneView_Dialer]; + [[PhoneMainView instance] changeCurrentView:[DialerViewController compositeViewDescription]]; } - (IBAction)onCreateAccountClick:(id)sender { diff --git a/Resources/contacts_back_default.png b/Resources/contacts_back_default.png new file mode 100644 index 000000000..416ecfa4b Binary files /dev/null and b/Resources/contacts_back_default.png differ diff --git a/Resources/contacts_back_over.png b/Resources/contacts_back_over.png new file mode 100644 index 000000000..dc9baad61 Binary files /dev/null and b/Resources/contacts_back_over.png differ diff --git a/linphone.xcodeproj/project.pbxproj b/linphone.xcodeproj/project.pbxproj index 6e90abf59..603f1d2a0 100755 --- a/linphone.xcodeproj/project.pbxproj +++ b/linphone.xcodeproj/project.pbxproj @@ -169,6 +169,10 @@ C9C8254D15AE207B00D493FA /* 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 */; }; C9C8255015AE256100D493FA /* transfer_call_disabled.png in Resources */ = {isa = PBXBuildFile; fileRef = C9C8254E15AE256100D493FA /* transfer_call_disabled.png */; }; + D3119E7215B6A4710005D4A4 /* contacts_back_default.png in Resources */ = {isa = PBXBuildFile; fileRef = D3119E7015B6A4710005D4A4 /* contacts_back_default.png */; }; + D3119E7315B6A4710005D4A4 /* 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 */; }; + D3119E7515B6A4710005D4A4 /* 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 */; }; D3128FE215AABC7E00A2147A /* ContactDetailsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D3128FDF15AABC7E00A2147A /* ContactDetailsViewController.m */; }; D3128FE315AABC7E00A2147A /* ContactDetailsViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = D3128FE015AABC7E00A2147A /* ContactDetailsViewController.xib */; }; @@ -1091,6 +1095,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 = ""; }; + 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 = ""; }; D3128FDF15AABC7E00A2147A /* ContactDetailsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ContactDetailsViewController.m; sourceTree = ""; }; D3128FE015AABC7E00A2147A /* ContactDetailsViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ContactDetailsViewController.xib; sourceTree = ""; }; @@ -2172,6 +2178,8 @@ D354980F15875608000081D8 /* contacts_add_over.png */, D354980315875534000081D8 /* contacts_all_default.png */, D354980215875534000081D8 /* contacts_all_selected.png */, + D3119E7015B6A4710005D4A4 /* contacts_back_default.png */, + D3119E7115B6A4710005D4A4 /* contacts_back_over.png */, D38327EB1580FE3A00FA0D23 /* contacts_default.png */, D354980515875534000081D8 /* contacts_linphone_default.png */, D354980415875534000081D8 /* contacts_linphone_selected.png */, @@ -2823,6 +2831,8 @@ D3157A8C15B4466F00DD8C4C /* history_add_over.png in Resources */, D3157A9015B446CB00DD8C4C /* history_back_default.png in Resources */, D3157A9215B446CB00DD8C4C /* history_back_over.png in Resources */, + D3119E7215B6A4710005D4A4 /* contacts_back_default.png in Resources */, + D3119E7415B6A4710005D4A4 /* contacts_back_over.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -3073,6 +3083,8 @@ D3157A8D15B4466F00DD8C4C /* history_add_over.png in Resources */, D3157A9115B446CB00DD8C4C /* history_back_default.png in Resources */, D3157A9315B446CB00DD8C4C /* history_back_over.png in Resources */, + D3119E7315B6A4710005D4A4 /* contacts_back_default.png in Resources */, + D3119E7515B6A4710005D4A4 /* contacts_back_over.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; };