diff --git a/Classes/ChatRoomViewController.m b/Classes/ChatRoomViewController.m index b231298b1..d4ee8b7fe 100644 --- a/Classes/ChatRoomViewController.m +++ b/Classes/ChatRoomViewController.m @@ -69,8 +69,8 @@ static UICompositeViewDescription *compositeDescription = nil; content:@"ChatRoomViewController" stateBar:nil stateBarEnabled:false - tabBar:nil - tabBarEnabled:false + tabBar:@"UIMainBar" + tabBarEnabled:true fullscreen:false]; } return compositeDescription; @@ -255,7 +255,8 @@ static UICompositeViewDescription *compositeDescription = nil; #pragma mark - Keyboard Event Functions - (void)keyboardWillHide:(NSNotification *)notif { - CGRect beginFrame = [[[notif userInfo] objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue]; + //CGRect beginFrame = [[[notif userInfo] objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue]; + //CGRect endFrame = [[[notif userInfo] objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue]; UIViewAnimationCurve curve = [[[notif userInfo] objectForKey:UIKeyboardAnimationCurveUserInfoKey] intValue]; NSTimeInterval duration = [[[notif userInfo] objectForKey:UIKeyboardAnimationDurationUserInfoKey] doubleValue]; [UIView beginAnimations:@"resize" context:nil]; @@ -264,9 +265,8 @@ static UICompositeViewDescription *compositeDescription = nil; [UIView setAnimationBeginsFromCurrentState:TRUE]; // Move view - CGRect endFrame = [[[notif userInfo] objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue]; CGRect frame = [[self view] frame]; - frame.origin.y += endFrame.origin.y - beginFrame.origin.y; + frame.origin.y = 0; [[self view] setFrame:frame]; // Resize table view @@ -279,7 +279,8 @@ static UICompositeViewDescription *compositeDescription = nil; } - (void)keyboardWillShow:(NSNotification *)notif { - CGRect beginFrame = [[[notif userInfo] objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue]; + //CGRect beginFrame = [[[notif userInfo] objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue]; + CGRect endFrame = [[[notif userInfo] objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue]; UIViewAnimationCurve curve = [[[notif userInfo] objectForKey:UIKeyboardAnimationCurveUserInfoKey] intValue]; NSTimeInterval duration = [[[notif userInfo] objectForKey:UIKeyboardAnimationDurationUserInfoKey] doubleValue]; [UIView beginAnimations:@"resize" context:nil]; @@ -288,9 +289,8 @@ static UICompositeViewDescription *compositeDescription = nil; [UIView setAnimationBeginsFromCurrentState:TRUE]; // Move view - CGRect endFrame = [[[notif userInfo] objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue]; CGRect frame = [[self view] frame]; - frame.origin.y += endFrame.origin.y - beginFrame.origin.y; + frame.origin.y = [self.view convertPoint:endFrame.origin fromView:nil].y - frame.size.height; [[self view] setFrame:frame]; // Resize table view diff --git a/Classes/ChatRoomViewController.xib b/Classes/ChatRoomViewController.xib index 6ed84a132..c8b9c4f6b 100644 --- a/Classes/ChatRoomViewController.xib +++ b/Classes/ChatRoomViewController.xib @@ -238,7 +238,6 @@ {{250, 0}, {70, 59}} - _NS:9 NO @@ -303,6 +302,7 @@ YES 17 + 2 IBCocoaTouchFramework diff --git a/Classes/ChatViewController.m b/Classes/ChatViewController.m index ff63f4884..16dca20f8 100644 --- a/Classes/ChatViewController.m +++ b/Classes/ChatViewController.m @@ -102,6 +102,8 @@ static UICompositeViewDescription *compositeDescription = nil; - (IBAction)onAddClick:(id)event { [ContactSelection setSelectionMode:ContactSelectionModeMessage]; + [ContactSelection setAddAddress:nil]; + [ContactSelection setSipFilter:TRUE]; [[PhoneMainView instance] changeCurrentView:[ContactsViewController compositeViewDescription] push:TRUE]; } diff --git a/Classes/ContactsTableViewController.h b/Classes/ContactsTableViewController.h index 7ae506cb8..529a97d07 100644 --- a/Classes/ContactsTableViewController.h +++ b/Classes/ContactsTableViewController.h @@ -26,9 +26,8 @@ OrderedDictionary* addressBookMap; ABAddressBookRef addressBook; - BOOL sipFilter; } -@property (nonatomic, assign) BOOL sipFilter; +- (void)loadData; @end diff --git a/Classes/ContactsTableViewController.m b/Classes/ContactsTableViewController.m index bb32853fd..d0c4d935c 100644 --- a/Classes/ContactsTableViewController.m +++ b/Classes/ContactsTableViewController.m @@ -27,8 +27,6 @@ @implementation ContactsTableViewController -@synthesize sipFilter; - #pragma mark - Lifecycle Functions - (void)initContactsTableViewController { @@ -62,17 +60,9 @@ } -#pragma mark - Property Functions - -- (void)setSipFilter:(BOOL)asipFilter { - self->sipFilter = asipFilter; - [self reloadData]; -} - - #pragma mark - -- (void)reloadData { +- (void)loadData { [LinphoneLogger logc:LinphoneLoggerLog format:"Load contact list"]; @synchronized (addressBookMap) { @@ -82,7 +72,7 @@ NSArray *lContacts = (NSArray *)ABAddressBookCopyArrayOfAllPeople(addressBook); for (id lPerson in lContacts) { BOOL add = true; - if(sipFilter) { + if([ContactSelection getSipFilter]) { add = false; ABMultiValueRef lMap = ABRecordCopyValue((ABRecordRef)lPerson, kABPersonInstantMessageProperty); for(int i = 0; i < ABMultiValueGetCount(lMap); ++i) { @@ -91,6 +81,8 @@ if(CFStringCompare((CFStringRef)@"SIP", CFDictionaryGetValue(lDict, @"service"), kCFCompareCaseInsensitive) == 0) { add = true; } + } else { + add = true; } CFRelease(lDict); } @@ -141,7 +133,7 @@ static void sync_address_book (ABAddressBookRef addressBook, CFDictionaryRef info, void *context) { ContactsTableViewController* controller = (ContactsTableViewController*)context; ABAddressBookRevert(addressBook); - [controller reloadData]; + [controller loadData]; } diff --git a/Classes/ContactsViewController.h b/Classes/ContactsViewController.h index e818ccc3f..2b14e492c 100644 --- a/Classes/ContactsViewController.h +++ b/Classes/ContactsViewController.h @@ -36,6 +36,8 @@ typedef enum _ContactSelectionMode { + (ContactSelectionMode)getSelectionMode; + (void)setAddAddress:(NSString*)address; + (NSString*)getAddAddress; ++ (void)setSipFilter:(BOOL)enable; ++ (BOOL)getSipFilter; @end diff --git a/Classes/ContactsViewController.m b/Classes/ContactsViewController.m index 4d7778927..2c4ebc9b4 100644 --- a/Classes/ContactsViewController.m +++ b/Classes/ContactsViewController.m @@ -27,6 +27,7 @@ static ContactSelectionMode sSelectionMode = ContactSelectionModeNone; static NSString* sAddAddress = nil; +static BOOL sSipFilter = FALSE; + (void)setSelectionMode:(ContactSelectionMode)selectionMode { sSelectionMode = selectionMode; @@ -50,6 +51,14 @@ static NSString* sAddAddress = nil; return sAddAddress; } ++ (void)setSipFilter:(BOOL)enable { + sSipFilter = enable; +} + ++ (BOOL)getSipFilter { + return sSipFilter; +} + @end @implementation ContactsViewController @@ -120,7 +129,6 @@ static UICompositeViewDescription *compositeDescription = nil; [tableController viewWillAppear:animated]; } - [self changeView:History_All]; [self update]; } @@ -141,6 +149,8 @@ static UICompositeViewDescription *compositeDescription = nil; - (void)viewDidLoad { [super viewDidLoad]; + [self changeView:History_All]; + // Set selected+over background: IB lack ! [linphoneButton setImage:[UIImage imageNamed:@"contacts_linphone_selected.png"] forState:(UIControlStateHighlighted | UIControlStateSelected)]; @@ -155,14 +165,16 @@ static UICompositeViewDescription *compositeDescription = nil; - (void)changeView: (HistoryView) view { if(view == History_All) { - [tableController setSipFilter:FALSE]; + [ContactSelection setSipFilter:FALSE]; + [tableController loadData]; allButton.selected = TRUE; } else { allButton.selected = FALSE; } if(view == History_Linphone) { - [tableController setSipFilter:TRUE]; + [ContactSelection setSipFilter:TRUE]; + [tableController loadData]; linphoneButton.selected = TRUE; } else { linphoneButton.selected = FALSE; @@ -181,6 +193,14 @@ static UICompositeViewDescription *compositeDescription = nil; [backButton setHidden:TRUE]; break; } + if([ContactSelection getSipFilter]) { + allButton.selected = FALSE; + linphoneButton.selected = TRUE; + } else { + allButton.selected = TRUE; + linphoneButton.selected = FALSE; + } + [tableController loadData]; } diff --git a/Classes/DialerViewController.m b/Classes/DialerViewController.m index 96b3e64c8..41fba484b 100644 --- a/Classes/DialerViewController.m +++ b/Classes/DialerViewController.m @@ -229,6 +229,7 @@ static UICompositeViewDescription *compositeDescription = nil; - (IBAction)onAddContactClick: (id) event { [ContactSelection setSelectionMode:ContactSelectionModeEdit]; [ContactSelection setAddAddress:[addressField text]]; + [ContactSelection setSipFilter:FALSE]; ContactsViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:[ContactsViewController compositeViewDescription] push:TRUE], ContactsViewController); if(controller != nil) { diff --git a/Classes/HistoryDetailsViewController.m b/Classes/HistoryDetailsViewController.m index 9ceee4f95..f8f0aef89 100644 --- a/Classes/HistoryDetailsViewController.m +++ b/Classes/HistoryDetailsViewController.m @@ -264,6 +264,7 @@ static UICompositeViewDescription *compositeDescription = nil; - (IBAction)onAddContactClick:(id)event { [ContactSelection setSelectionMode:ContactSelectionModeEdit]; [ContactSelection setAddAddress:[[addressButton titleLabel] text]]; + [ContactSelection setSipFilter:FALSE]; ContactsViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:[ContactsViewController compositeViewDescription] push:TRUE], ContactsViewController); if(controller != nil) { } diff --git a/Classes/HistoryDetailsViewController.xib b/Classes/HistoryDetailsViewController.xib index 2f430fa08..58deeddcf 100644 --- a/Classes/HistoryDetailsViewController.xib +++ b/Classes/HistoryDetailsViewController.xib @@ -78,11 +78,11 @@ NSImage - history_back_over.png + history_details_back_over.png NSImage - history_back_default.png + history_details_back_default.png 2 @@ -113,11 +113,11 @@ NSImage - history_add_over.png + history_details_add_over.png NSImage - history_add_default.png + history_details_add_default.png @@ -417,6 +417,7 @@ {{33, 273}, {255, 50}} + _NS:9 NO IBCocoaTouchFramework @@ -633,7 +634,7 @@ 8 - barBackground + background 9 @@ -753,7 +754,7 @@ 50 - backButton + addButton @@ -780,11 +781,11 @@ com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin - + com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin - + @@ -896,10 +897,10 @@ {550, 101} {550, 101} {5, 117} - {320, 117} - {320, 117} - {320, 117} - {320, 117} + {320, 117} + {320, 117} + {320, 117} + {320, 117} 1181 diff --git a/Classes/LinphoneCoreSettingsStore.m b/Classes/LinphoneCoreSettingsStore.m index 7a57b6f42..a26823e82 100644 --- a/Classes/LinphoneCoreSettingsStore.m +++ b/Classes/LinphoneCoreSettingsStore.m @@ -361,9 +361,9 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args); linphone_core_enable_video(lc, enableVideo, enableVideo); NSString *menc = [self stringForKey:@"media_encryption_preference"]; - if (menc && [menc compare:@"SRTP"]) + if (menc && [menc compare:@"SRTP"] == NSOrderedSame) linphone_core_set_media_encryption(lc, LinphoneMediaEncryptionSRTP); - else if (menc && [menc compare:@"ZRTP"]) + else if (menc && [menc compare:@"ZRTP"] == NSOrderedSame) linphone_core_set_media_encryption(lc, LinphoneMediaEncryptionZRTP); else linphone_core_set_media_encryption(lc, LinphoneMediaEncryptionNone); diff --git a/Classes/LinphoneUI/UICallCell.m b/Classes/LinphoneUI/UICallCell.m index 8933e0e9b..5f364e105 100644 --- a/Classes/LinphoneUI/UICallCell.m +++ b/Classes/LinphoneUI/UICallCell.m @@ -57,6 +57,7 @@ @synthesize conferenceCell; @synthesize currentCall; + #pragma mark - Lifecycle Functions - (id)initWithIdentifier:(NSString*)identifier { @@ -97,6 +98,7 @@ data = nil; } + #pragma mark - Properties Functions - (void)setData:(UICallCellData *)adata { diff --git a/Classes/LinphoneUI/UIChatRoomCell.m b/Classes/LinphoneUI/UIChatRoomCell.m index ceb4ec040..98f355cc5 100644 --- a/Classes/LinphoneUI/UIChatRoomCell.m +++ b/Classes/LinphoneUI/UIChatRoomCell.m @@ -32,8 +32,11 @@ @synthesize dateLabel; @synthesize chat; -static const CGFloat CELL_MIN_HEIGHT = 65.0f; -static const CGFloat CELL_MESSAGE_MAX_WIDTH = 280.0f; +static const CGFloat CELL_MIN_HEIGHT = 40.0f; +static const CGFloat CELL_MIN_WIDTH = 150.0f; +static const CGFloat CELL_MAX_WIDTH = 320.0f; +static const CGFloat CELL_MESSAGE_X_MARGIN = 26.0f; +static const CGFloat CELL_MESSAGE_Y_MARGIN = 33.0f; static const CGFloat CELL_FONT_SIZE = 17.0f; static UIFont *CELL_FONT = nil; @@ -115,53 +118,52 @@ static UIFont *CELL_FONT = nil; } - (void)resizeContent { - // Resize content - { - CGRect frame = [contentView frame]; - frame.origin.x = 0.0f; - frame.origin.y = 0.0f; - frame.size = [self frame].size; - [ contentView setFrame:frame]; - } - if(chat != nil) { - CGPoint center = [contentView center]; - if(![[chat direction] intValue]) { // Inverted + // Resize Content + CGRect contentFrame = [contentView frame]; + contentFrame.size = [UIChatRoomCell viewSize:[chat message]]; + if([[chat direction] intValue]) { // Inverted + contentFrame.origin.x = 0.0f; + contentFrame.origin.y = 0.0f; + } else { + contentFrame.origin.x = CELL_MAX_WIDTH - contentFrame.size.width; + contentFrame.origin.y = 0.0f; + } + [contentView setFrame:contentFrame]; + + CGRect messageFrame = [messageView frame]; + messageFrame.origin.y = ([contentView frame].size.height - messageFrame.size.height)/2; + if([[chat direction] intValue]) { // Inverted [backgroundImage setImage:[TUNinePatchCache imageOfSize:[backgroundImage bounds].size forNinePatchNamed:@"chat_bubble_incoming"]]; - center.y += 6; + messageFrame.origin.y += 5; } else { [backgroundImage setImage:[TUNinePatchCache imageOfSize:[backgroundImage bounds].size forNinePatchNamed:@"chat_bubble_outgoing"]]; - center.y -= 6; + messageFrame.origin.y -= 5; } - [messageView setCenter:center]; - } - - // Resize messageView - { - CGRect frame = [messageView frame]; - frame.size.height = [UIChatRoomCell messageHeight:[chat message]] + 10; - [messageView setFrame:frame]; + [messageView setFrame:messageFrame]; } } -+ (CGFloat)messageHeight:(NSString*)message { ++ (CGSize)viewSize:(NSString*)message { if(CELL_FONT == nil) { CELL_FONT = [UIFont systemFontOfSize:CELL_FONT_SIZE]; } CGSize messageSize = [message sizeWithFont: CELL_FONT - constrainedToSize: CGSizeMake(CELL_MESSAGE_MAX_WIDTH, 10000.0f) + constrainedToSize: CGSizeMake(CELL_MAX_WIDTH - CELL_MESSAGE_X_MARGIN, 10000.0f) lineBreakMode: UILineBreakModeTailTruncation]; - return messageSize.height; + messageSize.height += CELL_MESSAGE_Y_MARGIN; + if(messageSize.height < CELL_MIN_HEIGHT) + messageSize.height = CELL_MIN_HEIGHT; + messageSize.width += CELL_MESSAGE_X_MARGIN; + if(messageSize.width < CELL_MIN_WIDTH) + messageSize.width = CELL_MIN_WIDTH; + return messageSize; } + (CGFloat)height:(ChatModel*)chat { - CGFloat height = [UIChatRoomCell messageHeight:[chat message]]; - height += 40; - if(height < CELL_MIN_HEIGHT) - height = CELL_MIN_HEIGHT; - return height; + return [UIChatRoomCell viewSize:[chat message]].height; } diff --git a/Classes/LinphoneUI/UIChatRoomCell.xib b/Classes/LinphoneUI/UIChatRoomCell.xib index 3939cee62..822ed6cc6 100644 --- a/Classes/LinphoneUI/UIChatRoomCell.xib +++ b/Classes/LinphoneUI/UIChatRoomCell.xib @@ -40,7 +40,7 @@ 274 - {{10, 10}, {300, 120}} + {{5, 5}, {310, 130}} @@ -59,7 +59,7 @@ 274 - {280, 90} + {294, 107} @@ -92,7 +92,7 @@ 289 - {{236, 0}, {44, 44}} + {{250, 0}, {44, 44}} @@ -131,10 +131,9 @@ 265 - {{0, 90}, {280, 10}} + {{14, 107}, {280, 7}} - _NS:9 NO YES @@ -149,16 +148,16 @@ 2 1 - 12 + 10 Helvetica - 12 + 10 16 - {{20, 20}, {280, 100}} + {{13, 13}, {294, 114}} diff --git a/Classes/LinphoneUI/UICompositeViewController.m b/Classes/LinphoneUI/UICompositeViewController.m index b12ad3052..c7e3b4030 100644 --- a/Classes/LinphoneUI/UICompositeViewController.m +++ b/Classes/LinphoneUI/UICompositeViewController.m @@ -211,9 +211,7 @@ } } - if(oldViewDescription != nil && contentViewController != nil && oldViewDescription.content != currentViewDescription.content) { - [UICompositeViewController removeSubView: contentViewController]; - } + [UICompositeViewController removeSubView: contentViewController]; if(oldViewDescription != nil && tabBarViewController != nil && oldViewDescription.tabBar != currentViewDescription.tabBar) { [UICompositeViewController removeSubView: tabBarViewController]; } @@ -311,9 +309,7 @@ // Change view if(description != nil) { - if(oldViewDescription == nil || oldViewDescription.content != currentViewDescription.content) { - [UICompositeViewController addSubView: contentViewController view:contentView]; - } + [UICompositeViewController addSubView: contentViewController view:contentView]; if(oldViewDescription == nil || oldViewDescription.tabBar != currentViewDescription.tabBar) { [UICompositeViewController addSubView: tabBarViewController view:tabBarView]; } diff --git a/Classes/LinphoneUI/UIMainBar.m b/Classes/LinphoneUI/UIMainBar.m index b1c6e1d91..ce79586f6 100644 --- a/Classes/LinphoneUI/UIMainBar.m +++ b/Classes/LinphoneUI/UIMainBar.m @@ -282,6 +282,7 @@ - (IBAction)onContactsClick: (id) event { [ContactSelection setSelectionMode:ContactSelectionModeNone]; [ContactSelection setAddAddress:nil]; + [ContactSelection setSipFilter:FALSE]; [[PhoneMainView instance] changeCurrentView:[ContactsViewController compositeViewDescription]]; } diff --git a/Classes/LinphoneUI/UIStateBar.h b/Classes/LinphoneUI/UIStateBar.h index e9033cb53..76be85a2c 100644 --- a/Classes/LinphoneUI/UIStateBar.h +++ b/Classes/LinphoneUI/UIStateBar.h @@ -23,10 +23,12 @@ UIImageView* registrationStateImage; UILabel* registrationStateLabel; UIImageView* callQualityImage; + UIImageView* callSecurityImage; } @property (nonatomic, retain) IBOutlet UIImageView* registrationStateImage; @property (nonatomic, retain) IBOutlet UILabel* registrationStateLabel; @property (nonatomic, retain) IBOutlet UIImageView* callQualityImage; +@property (nonatomic, retain) IBOutlet UIImageView* callSecurityImage; @end diff --git a/Classes/LinphoneUI/UIStateBar.m b/Classes/LinphoneUI/UIStateBar.m index 1b14f74e5..da0d611c3 100644 --- a/Classes/LinphoneUI/UIStateBar.m +++ b/Classes/LinphoneUI/UIStateBar.m @@ -27,14 +27,21 @@ @synthesize registrationStateImage; @synthesize registrationStateLabel; @synthesize callQualityImage; +@synthesize callSecurityImage; NSTimer *callQualityTimer; +NSTimer *callSecurityTimer; #pragma mark - Lifecycle Functions - (id)init { - return [super initWithNibName:@"UIStateBar" bundle:[NSBundle mainBundle]]; + self = [super initWithNibName:@"UIStateBar" bundle:[NSBundle mainBundle]]; + if(self != nil) { + self->callSecurityImage = nil; + self->callQualityImage = nil; + } + return self; } - (void) dealloc { @@ -57,6 +64,13 @@ NSTimer *callQualityTimer; userInfo:nil repeats:YES]; + // Set callQualityTimer + callSecurityTimer = [NSTimer scheduledTimerWithTimeInterval:1 + target:self + selector:@selector(callSecurityUpdate) + userInfo:nil + repeats:YES]; + // Set observer [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(registrationUpdate:) @@ -65,6 +79,7 @@ NSTimer *callQualityTimer; [callQualityImage setHidden: true]; + [callSecurityImage setHidden: true]; // Update to default state LinphoneProxyConfig* config = NULL; @@ -81,7 +96,14 @@ NSTimer *callQualityTimer; name:@"LinphoneRegistrationUpdate" object:nil]; - [callQualityTimer invalidate]; + if(callQualityTimer != nil) { + [callQualityTimer invalidate]; + callQualityTimer = nil; + } + if(callQualityTimer != nil) { + [callSecurityTimer invalidate]; + callSecurityTimer = nil; + } } @@ -157,6 +179,44 @@ NSTimer *callQualityTimer; #pragma mark - +- (void)callSecurityUpdate { + BOOL pending = false; + BOOL security = true; + + if(![LinphoneManager isLcReady]) { + [callSecurityImage setHidden: true]; + return; + } + const MSList *list = linphone_core_get_calls([LinphoneManager getLc]); + if(list == NULL) { + [callSecurityImage setHidden: true]; + return; + } + while(list != NULL) { + LinphoneCall *call = (LinphoneCall*) list->data; + LinphoneMediaEncryption enc = linphone_call_params_get_media_encryption(linphone_call_get_current_params(call)); + if(enc == LinphoneMediaEncryptionNone) + security = false; + else if(enc == LinphoneMediaEncryptionZRTP) { + if(!linphone_call_get_authentication_token_verified(call)) { + pending = true; + } + } + list = list->next; + } + + if(security) { + if(pending) { + [callSecurityImage setImage:[UIImage imageNamed:@"security_pending.png"]]; + } else { + [callSecurityImage setImage:[UIImage imageNamed:@"security_ok.png"]]; + } + } else { + [callSecurityImage setImage:[UIImage imageNamed:@"security_ko.png"]]; + } + [callSecurityImage setHidden: false]; +} + - (void)callQualityUpdate { UIImage *image = nil; if([LinphoneManager isLcReady]) { diff --git a/Classes/LinphoneUI/UIStateBar.xib b/Classes/LinphoneUI/UIStateBar.xib index ff171f256..23f0c3c49 100644 --- a/Classes/LinphoneUI/UIStateBar.xib +++ b/Classes/LinphoneUI/UIStateBar.xib @@ -103,11 +103,22 @@ {{219, 3}, {27, 17}} - + _NS:567 NO IBCocoaTouchFramework + + + 292 + {{254, 3}, {27, 17}} + + + _NS:567 + 1 + NO + IBCocoaTouchFramework + {320, 23} @@ -155,6 +166,14 @@ 16 + + + callSecurityImage + + + + 18 + @@ -183,6 +202,7 @@ + @@ -208,7 +228,13 @@ 13 - callQualityIndicatorImage + callQualityImage + + + 17 + + + callSecurityImage @@ -219,6 +245,7 @@ com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin @@ -227,7 +254,7 @@ - 16 + 18 @@ -236,6 +263,7 @@ UIViewController UIImageView + UIImageView UIImageView UILabel @@ -244,6 +272,10 @@ callQualityImage UIImageView + + callSecurityImage + UIImageView + registrationStateImage UIImageView diff --git a/Classes/PhoneMainView.m b/Classes/PhoneMainView.m index 082536914..4cff2c52d 100644 --- a/Classes/PhoneMainView.m +++ b/Classes/PhoneMainView.m @@ -341,17 +341,19 @@ static PhoneMainView* phoneMainViewInstance=nil; } - (UIViewController*)changeCurrentView:(UICompositeViewDescription*)view push:(BOOL)push { + BOOL force = push; if(!push) { + force = [viewStack count] > 1; [viewStack removeAllObjects]; } [viewStack addObject:view]; - return [self _changeCurrentView:view transition:nil]; + return [self _changeCurrentView:view transition:nil force:force]; } -- (UIViewController*)_changeCurrentView:(UICompositeViewDescription*)view transition:(CATransition*)transition { +- (UIViewController*)_changeCurrentView:(UICompositeViewDescription*)view transition:(CATransition*)transition force:(BOOL)force { [LinphoneLogger logc:LinphoneLoggerLog format:"PhoneMainView: change view %d", [view name]]; - if(![view equal: currentView]) { + if(force || ![view equal: currentView]) { if(transition == nil) transition = [PhoneMainView getTransition:currentView new:view]; [mainViewController setViewTransition:transition]; @@ -369,7 +371,7 @@ static PhoneMainView* phoneMainViewInstance=nil; while([viewStack count] > 1 && ![[viewStack lastObject] equal:view]) { [viewStack removeLastObject]; } - [self _changeCurrentView:[viewStack lastObject] transition:[PhoneMainView getBackwardTransition]]; + [self _changeCurrentView:[viewStack lastObject] transition:[PhoneMainView getBackwardTransition] force:TRUE]; } - (UICompositeViewDescription *)firstView { @@ -384,7 +386,7 @@ static PhoneMainView* phoneMainViewInstance=nil; [LinphoneLogger logc:LinphoneLoggerLog format:"PhoneMainView: Pop view"]; if([viewStack count] > 0) { [viewStack removeLastObject]; - [self _changeCurrentView:[viewStack lastObject] transition:[PhoneMainView getBackwardTransition]]; + [self _changeCurrentView:[viewStack lastObject] transition:[PhoneMainView getBackwardTransition] force:TRUE]; return [mainViewController getCurrentViewController]; } return nil; diff --git a/Resources/dialer_alt_background.png b/Resources/dialer_alt_background.png index 5a2a26716..86b6c3f02 100644 Binary files a/Resources/dialer_alt_background.png and b/Resources/dialer_alt_background.png differ diff --git a/Resources/history_add_default.png b/Resources/history_details_add_default.png similarity index 100% rename from Resources/history_add_default.png rename to Resources/history_details_add_default.png diff --git a/Resources/history_add_over.png b/Resources/history_details_add_over.png similarity index 100% rename from Resources/history_add_over.png rename to Resources/history_details_add_over.png diff --git a/Resources/history_back_default.png b/Resources/history_details_back_default.png similarity index 100% rename from Resources/history_back_default.png rename to Resources/history_details_back_default.png diff --git a/Resources/history_back_over.png b/Resources/history_details_back_over.png similarity index 100% rename from Resources/history_back_over.png rename to Resources/history_details_back_over.png diff --git a/linphone.xcodeproj/project.pbxproj b/linphone.xcodeproj/project.pbxproj index 4d2a0d322..829d23352 100755 --- a/linphone.xcodeproj/project.pbxproj +++ b/linphone.xcodeproj/project.pbxproj @@ -180,14 +180,14 @@ D3128FF415AABE4E00A2147A /* contact_edit_default.png in Resources */ = {isa = PBXBuildFile; fileRef = D3128FE915AABE4E00A2147A /* contact_edit_default.png */; }; D3128FF515AABE4E00A2147A /* contact_edit_over.png in Resources */ = {isa = PBXBuildFile; fileRef = D3128FEA15AABE4E00A2147A /* contact_edit_over.png */; }; D3128FF615AABE4E00A2147A /* contact_edit_over.png in Resources */ = {isa = PBXBuildFile; fileRef = D3128FEA15AABE4E00A2147A /* contact_edit_over.png */; }; - D3157A8A15B4466F00DD8C4C /* history_add_default.png in Resources */ = {isa = PBXBuildFile; fileRef = D3157A8815B4466F00DD8C4C /* history_add_default.png */; }; - D3157A8B15B4466F00DD8C4C /* history_add_default.png in Resources */ = {isa = PBXBuildFile; fileRef = D3157A8815B4466F00DD8C4C /* history_add_default.png */; }; - D3157A8C15B4466F00DD8C4C /* history_add_over.png in Resources */ = {isa = PBXBuildFile; fileRef = D3157A8915B4466F00DD8C4C /* history_add_over.png */; }; - D3157A8D15B4466F00DD8C4C /* history_add_over.png in Resources */ = {isa = PBXBuildFile; fileRef = D3157A8915B4466F00DD8C4C /* history_add_over.png */; }; - D3157A9015B446CB00DD8C4C /* history_back_default.png in Resources */ = {isa = PBXBuildFile; fileRef = D3157A8E15B446CB00DD8C4C /* history_back_default.png */; }; - D3157A9115B446CB00DD8C4C /* history_back_default.png in Resources */ = {isa = PBXBuildFile; fileRef = D3157A8E15B446CB00DD8C4C /* history_back_default.png */; }; - D3157A9215B446CB00DD8C4C /* history_back_over.png in Resources */ = {isa = PBXBuildFile; fileRef = D3157A8F15B446CB00DD8C4C /* history_back_over.png */; }; - D3157A9315B446CB00DD8C4C /* history_back_over.png in Resources */ = {isa = PBXBuildFile; fileRef = D3157A8F15B446CB00DD8C4C /* history_back_over.png */; }; + D3157A8A15B4466F00DD8C4C /* history_details_add_default.png in Resources */ = {isa = PBXBuildFile; fileRef = D3157A8815B4466F00DD8C4C /* history_details_add_default.png */; }; + D3157A8B15B4466F00DD8C4C /* history_details_add_default.png in Resources */ = {isa = PBXBuildFile; fileRef = D3157A8815B4466F00DD8C4C /* history_details_add_default.png */; }; + D3157A8C15B4466F00DD8C4C /* history_details_add_over.png in Resources */ = {isa = PBXBuildFile; fileRef = D3157A8915B4466F00DD8C4C /* history_details_add_over.png */; }; + D3157A8D15B4466F00DD8C4C /* history_details_add_over.png in Resources */ = {isa = PBXBuildFile; fileRef = D3157A8915B4466F00DD8C4C /* history_details_add_over.png */; }; + D3157A9015B446CB00DD8C4C /* history_details_back_default.png in Resources */ = {isa = PBXBuildFile; fileRef = D3157A8E15B446CB00DD8C4C /* history_details_back_default.png */; }; + D3157A9115B446CB00DD8C4C /* history_details_back_default.png in Resources */ = {isa = PBXBuildFile; fileRef = D3157A8E15B446CB00DD8C4C /* history_details_back_default.png */; }; + D3157A9215B446CB00DD8C4C /* history_details_back_over.png in Resources */ = {isa = PBXBuildFile; fileRef = D3157A8F15B446CB00DD8C4C /* history_details_back_over.png */; }; + D3157A9315B446CB00DD8C4C /* history_details_back_over.png in Resources */ = {isa = PBXBuildFile; fileRef = D3157A8F15B446CB00DD8C4C /* history_details_back_over.png */; }; D3196D3415A321E3007FEEBA /* options_add_default.png in Resources */ = {isa = PBXBuildFile; fileRef = D3196D3015A321E2007FEEBA /* options_add_default.png */; }; D3196D3515A321E3007FEEBA /* options_add_default.png in Resources */ = {isa = PBXBuildFile; fileRef = D3196D3015A321E2007FEEBA /* options_add_default.png */; }; D3196D3615A321E3007FEEBA /* options_add_over.png in Resources */ = {isa = PBXBuildFile; fileRef = D3196D3115A321E2007FEEBA /* options_add_over.png */; }; @@ -1090,10 +1090,10 @@ D3128FE815AABE4E00A2147A /* contact_back_over.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = contact_back_over.png; path = Resources/contact_back_over.png; sourceTree = ""; }; D3128FE915AABE4E00A2147A /* contact_edit_default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = contact_edit_default.png; path = Resources/contact_edit_default.png; sourceTree = ""; }; D3128FEA15AABE4E00A2147A /* contact_edit_over.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = contact_edit_over.png; path = Resources/contact_edit_over.png; sourceTree = ""; }; - D3157A8815B4466F00DD8C4C /* history_add_default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = history_add_default.png; path = Resources/history_add_default.png; sourceTree = ""; }; - D3157A8915B4466F00DD8C4C /* history_add_over.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = history_add_over.png; path = Resources/history_add_over.png; sourceTree = ""; }; - D3157A8E15B446CB00DD8C4C /* history_back_default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = history_back_default.png; path = Resources/history_back_default.png; sourceTree = ""; }; - D3157A8F15B446CB00DD8C4C /* history_back_over.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = history_back_over.png; path = Resources/history_back_over.png; sourceTree = ""; }; + D3157A8815B4466F00DD8C4C /* history_details_add_default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = history_details_add_default.png; path = Resources/history_details_add_default.png; sourceTree = ""; }; + D3157A8915B4466F00DD8C4C /* history_details_add_over.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = history_details_add_over.png; path = Resources/history_details_add_over.png; sourceTree = ""; }; + D3157A8E15B446CB00DD8C4C /* history_details_back_default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = history_details_back_default.png; path = Resources/history_details_back_default.png; sourceTree = ""; }; + D3157A8F15B446CB00DD8C4C /* history_details_back_over.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = history_details_back_over.png; path = Resources/history_details_back_over.png; sourceTree = ""; }; D3196D3015A321E2007FEEBA /* options_add_default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = options_add_default.png; path = Resources/options_add_default.png; sourceTree = ""; }; D3196D3115A321E2007FEEBA /* options_add_over.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = options_add_over.png; path = Resources/options_add_over.png; sourceTree = ""; }; D3196D3215A321E3007FEEBA /* options_transfer_default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = options_transfer_default.png; path = Resources/options_transfer_default.png; sourceTree = ""; }; @@ -2203,12 +2203,12 @@ D3F83EFB158205A100336684 /* hangup_over.png */, D36C43CE158F2F370048BA40 /* header_conference.png */, D3F26BFB15987083005F9CAB /* header_incoming.png */, - D3157A8815B4466F00DD8C4C /* history_add_default.png */, - D3157A8915B4466F00DD8C4C /* history_add_over.png */, + D3157A8815B4466F00DD8C4C /* history_details_add_default.png */, + D3157A8915B4466F00DD8C4C /* history_details_add_over.png */, D3ED3E9315872EF1006C0DE4 /* history_all_default.png */, D3ED3E9215872EF1006C0DE4 /* history_all_selected.png */, - D3157A8E15B446CB00DD8C4C /* history_back_default.png */, - D3157A8F15B446CB00DD8C4C /* history_back_over.png */, + D3157A8E15B446CB00DD8C4C /* history_details_back_default.png */, + D3157A8F15B446CB00DD8C4C /* history_details_back_over.png */, D347347C1580E5F8003C7B8C /* history_default.png */, D3ED3E9415872EF1006C0DE4 /* history_edit_default.png */, D3ED3E9515872EF1006C0DE4 /* history_edit_over.png */, @@ -2828,10 +2828,10 @@ D3E84F2A15B00F4100420DAC /* dialer_alt_background.png in Resources */, D3E84F3815B011AF00420DAC /* contact_cancel_default.png in Resources */, D3E84F3A15B011AF00420DAC /* contact_cancel_over.png in Resources */, - D3157A8A15B4466F00DD8C4C /* history_add_default.png in Resources */, - D3157A8C15B4466F00DD8C4C /* history_add_over.png in Resources */, - D3157A9015B446CB00DD8C4C /* history_back_default.png in Resources */, - D3157A9215B446CB00DD8C4C /* history_back_over.png in Resources */, + D3157A8A15B4466F00DD8C4C /* history_details_add_default.png in Resources */, + D3157A8C15B4466F00DD8C4C /* history_details_add_over.png in Resources */, + D3157A9015B446CB00DD8C4C /* history_details_back_default.png in Resources */, + D3157A9215B446CB00DD8C4C /* history_details_back_over.png in Resources */, D3119E7215B6A4710005D4A4 /* contacts_back_default.png in Resources */, D3119E7415B6A4710005D4A4 /* contacts_back_over.png in Resources */, ); @@ -3081,10 +3081,10 @@ D3E84F2B15B00F4100420DAC /* dialer_alt_background.png in Resources */, D3E84F3915B011AF00420DAC /* contact_cancel_default.png in Resources */, D3E84F3B15B011AF00420DAC /* contact_cancel_over.png in Resources */, - D3157A8B15B4466F00DD8C4C /* history_add_default.png in Resources */, - D3157A8D15B4466F00DD8C4C /* history_add_over.png in Resources */, - D3157A9115B446CB00DD8C4C /* history_back_default.png in Resources */, - D3157A9315B446CB00DD8C4C /* history_back_over.png in Resources */, + D3157A8B15B4466F00DD8C4C /* history_details_add_default.png in Resources */, + D3157A8D15B4466F00DD8C4C /* history_details_add_over.png in Resources */, + D3157A9115B446CB00DD8C4C /* history_details_back_default.png in Resources */, + D3157A9315B446CB00DD8C4C /* history_details_back_over.png in Resources */, D3119E7315B6A4710005D4A4 /* contacts_back_default.png in Resources */, D3119E7515B6A4710005D4A4 /* contacts_back_over.png in Resources */, );