From 6d4c6c6ffaf4087a9d032bf9f1c5febc3d797c4a Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Thu, 13 Sep 2012 17:54:48 +0200 Subject: [PATCH 01/16] add file sharing --- Classes/ChatRoomTableViewController.m | 6 +- Classes/ChatRoomViewController.h | 13 +- Classes/ChatRoomViewController.m | 379 +++++++++++++++++- Classes/ChatRoomViewController.xib | 262 ++++++------ Classes/ContactDetailsViewController.xib | 11 +- Classes/ImageViewerViewController.h | 34 ++ Classes/ImageViewerViewController.m | 62 +++ Classes/ImageViewerViewController.xib | 233 +++++++++++ Classes/LinphoneAppDelegate.h | 4 +- Classes/LinphoneAppDelegate.m | 4 +- Classes/LinphoneCoreSettingsStore.m | 13 +- Classes/LinphoneManager.m | 36 +- Resources/linphonerc | 2 +- Settings/InAppSettings.bundle/Advanced.plist | 14 + linphone.xcodeproj/project.pbxproj | 36 +- .../liblinphone.xcodeproj/project.pbxproj | 32 +- submodules/linphone | 2 +- submodules/mssilk | 2 +- 18 files changed, 958 insertions(+), 187 deletions(-) create mode 100644 Classes/ImageViewerViewController.h create mode 100644 Classes/ImageViewerViewController.m create mode 100644 Classes/ImageViewerViewController.xib diff --git a/Classes/ChatRoomTableViewController.m b/Classes/ChatRoomTableViewController.m index d06ade197..8182eca56 100644 --- a/Classes/ChatRoomTableViewController.m +++ b/Classes/ChatRoomTableViewController.m @@ -45,7 +45,9 @@ data = nil; } } - +- (void)viewWillAppear:(BOOL)animated { + [self loadData]; +} #pragma mark - @@ -81,7 +83,7 @@ [LinphoneLogger logc:LinphoneLoggerWarning format:"chat entries diesn not exixt"]; return; } - [[self tableView] reloadData]; //just reload + [self.tableView reloadRowsAtIndexPaths:[NSArray arrayWithObject:[NSIndexPath indexPathForRow:index inSection:0]] withRowAnimation:FALSE];; //just reload return; } - (void)scrollToLastUnread:(BOOL)animated { diff --git a/Classes/ChatRoomViewController.h b/Classes/ChatRoomViewController.h index 82a8a2a75..edbdcd390 100644 --- a/Classes/ChatRoomViewController.h +++ b/Classes/ChatRoomViewController.h @@ -26,10 +26,16 @@ #include "linphonecore.h" -@interface ChatRoomViewController : UIViewController { +@interface ChatRoomViewController : UIViewController { @private LinphoneChatRoom *chatRoom; NSString *_remoteAddress; + UIActionSheet* photoSourceSelector; + NSURLConnection* uploadCnx; + NSURLConnection* downloadCnx; + NSString* pendingFileUrl; /*Url received from the remote party to be downloaded*/ + NSMutableData* downloadedData; + NSInteger totalBytesExpectedToRead; } @@ -44,10 +50,15 @@ @property (nonatomic, retain) IBOutlet UIView *chatView; @property (nonatomic, retain) IBOutlet UIImageView *fieldBackgroundImage; @property (nonatomic, copy) NSString *remoteAddress; +@property (nonatomic, retain) IBOutlet UIButton* pictButton; +@property (nonatomic, retain) IBOutlet UIButton* cancelTransfertButton; +@property (nonatomic, retain) IBOutlet UIProgressView* imageTransferProgressBar; - (IBAction)onBackClick:(id)event; - (IBAction)onEditClick:(id)event; - (IBAction)onMessageChange:(id)sender; - (IBAction)onSendClick:(id)event; +- (IBAction)onPictClick:(id)event; +- (IBAction)onTransferCancelClick:(id)event; @end diff --git a/Classes/ChatRoomViewController.m b/Classes/ChatRoomViewController.m index a144d846c..4733fca09 100644 --- a/Classes/ChatRoomViewController.m +++ b/Classes/ChatRoomViewController.m @@ -19,8 +19,13 @@ #import "ChatRoomViewController.h" #import "PhoneMainView.h" - +#import #import +#import +#import "ImageViewerViewController.h" + +#define FILE_DOWNLOAD_ACTION_SHEET 1 +#define FILE_CHOOSER_ACTION_SHEET 2 @implementation ChatRoomViewController @@ -35,7 +40,9 @@ @synthesize footerView; @synthesize chatView; @synthesize fieldBackgroundImage; - +@synthesize pictButton; +@synthesize imageTransferProgressBar; +@synthesize cancelTransfertButton; #pragma mark - Lifecycle Functions @@ -63,6 +70,7 @@ } + #pragma mark - UICompositeViewDelegate Functions static UICompositeViewDescription *compositeDescription = nil; @@ -92,6 +100,7 @@ static UICompositeViewDescription *compositeDescription = nil; // Set selected+over background: IB lack ! [editButton setImage:[UIImage imageNamed:@"chat_ok_over.png"] forState:(UIControlStateHighlighted | UIControlStateSelected)]; + [self enableTransfertView:FALSE]; } @@ -120,6 +129,19 @@ static UICompositeViewDescription *compositeDescription = nil; [fieldBackgroundImage setImage:[TUNinePatchCache imageOfSize:[fieldBackgroundImage bounds].size forNinePatchNamed:@"chat_field"]]; + BOOL fileSharingEnabled = [[LinphoneManager instance] lpConfigStringForKey:@"file_upload_url_preference"] != NULL + && [[[LinphoneManager instance] lpConfigStringForKey:@"file_upload_url_preference"] length]>0 ; + [pictButton setHidden:!fileSharingEnabled]; + +/* CGRect frame = messageField.frame; + if (fileSharingEnabled) { + frame.origin.x=61; + frame.size.width=175; + } else { + frame.origin.x=0; + frame.size.width=175+61; + } + [messageField setFrame:frame];*/ } - (void)viewWillDisappear:(BOOL)animated { @@ -199,13 +221,13 @@ static void message_status(LinphoneChatMessage* msg,LinphoneChatMessageState sta ChatRoomViewController* thiz=(ChatRoomViewController*)ud; ChatModel *chat = (ChatModel *)linphone_chat_message_get_user_data(msg); [LinphoneLogger log:LinphoneLoggerLog - format:@"Delivery status for [%@] is [%s]",chat.message,linphone_chat_message_state_to_string(state)]; + format:@"Delivery status for [%@] is [%s]",(chat.message?chat.message:@""),linphone_chat_message_state_to_string(state)]; [chat setState:[NSNumber numberWithInt:state]]; [chat update]; [thiz.tableController updateChatEntry:chat]; } -- (BOOL)sendMessage:(NSString *)message { +- (BOOL)sendMessage:(NSString *)message withExterlBodyUrl:(NSString*) url{ if(![LinphoneManager isLcReady]) { [LinphoneLogger logc:LinphoneLoggerWarning format:"Cannot send message: Linphone core not ready"]; return FALSE; @@ -215,10 +237,7 @@ static void message_status(LinphoneChatMessage* msg,LinphoneChatMessageState sta return FALSE; } if(chatRoom == NULL) { - - chatRoom = linphone_core_create_chat_room([LinphoneManager getLc], [_remoteAddress UTF8String]); - } // Save message in database @@ -232,10 +251,13 @@ static void message_status(LinphoneChatMessage* msg,LinphoneChatMessageState sta [chat setState:[NSNumber numberWithInt:1]]; //INPROGRESS [chat create]; [tableController addChatEntry:chat]; - [chat release]; + // [chat release]; commenting this line avoid a crash on first message sent, specially when picture LinphoneChatMessage* msg = linphone_chat_room_create_message(chatRoom,[message UTF8String]); linphone_chat_message_set_user_data(msg,chat); - linphone_chat_room_send_message2(chatRoom, msg,message_status,self); + if (url) { + linphone_chat_message_set_external_body_url(msg, [url UTF8String]); + } + linphone_chat_room_send_message2(chatRoom, msg,message_status,self); return TRUE; } @@ -246,7 +268,8 @@ static void message_status(LinphoneChatMessage* msg,LinphoneChatMessageState sta //LinphoneChatRoom *room = [[[notif userInfo] objectForKey:@"room"] pointerValue]; //NSString *message = [[notif userInfo] objectForKey:@"message"]; LinphoneAddress *from = [[[notif userInfo] objectForKey:@"from"] pointerValue]; - ChatModel *chat = [[notif userInfo] objectForKey:@"chat"]; + + ChatModel *chat = [[notif userInfo] objectForKey:@"chat"]; if(from != NULL && chat != NULL) { char *fromStr = linphone_address_as_string_uri_only(from); if(fromStr != NULL) { @@ -259,7 +282,18 @@ static void message_status(LinphoneChatMessage* msg,LinphoneChatMessageState sta } ms_free(fromStr); } - } else { + if ([[notif userInfo] objectForKey:@"external_body_url"]) { + pendingFileUrl=[[[notif userInfo] objectForKey:@"external_body_url"] retain]; + UIActionSheet* new_incoming_file = [[UIActionSheet alloc] initWithTitle:NSLocalizedString(@"Incoming file stored to your photo library",nil) + delegate:self + cancelButtonTitle:NSLocalizedString(@"Ignore",nil) + destructiveButtonTitle:nil + otherButtonTitles:NSLocalizedString(@"Accept",nil),nil]; + [new_incoming_file setTag:FILE_DOWNLOAD_ACTION_SHEET]; + [new_incoming_file showInView:self.view]; + [new_incoming_file release]; + } + } else { [LinphoneLogger logc:LinphoneLoggerWarning format:"Invalid textReceivedEvent"]; } } @@ -284,7 +318,7 @@ static void message_status(LinphoneChatMessage* msg,LinphoneChatMessageState sta } - (IBAction)onSendClick:(id)event { - if([self sendMessage:[messageField text]]) { + if([self sendMessage:[messageField text] withExterlBodyUrl:nil]) { [messageField setText:@""]; } } @@ -297,7 +331,328 @@ static void message_status(LinphoneChatMessage* msg,LinphoneChatMessageState sta } } +- (IBAction)onPictClick:(id)event { + + photoSourceSelector = [[UIActionSheet alloc] initWithTitle:NSLocalizedString(@"Select picture source",nil) + delegate:self + cancelButtonTitle:NSLocalizedString(@"Cancel",nil) + destructiveButtonTitle:nil + otherButtonTitles:NSLocalizedString(@"Camera",nil),NSLocalizedString(@"Photo library",nil), nil]; + + photoSourceSelector.actionSheetStyle = UIActionSheetStyleDefault; + [photoSourceSelector setTag:FILE_CHOOSER_ACTION_SHEET]; + [photoSourceSelector showInView:self.view]; + [photoSourceSelector release]; + +} +- (IBAction)onTransferCancelClick:(id)event { + [uploadCnx cancel]; + [downloadCnx cancel]; + [self stopUpload]; + [self stopDownload]; + [LinphoneLogger log:LinphoneLoggerLog format:@"File transfert interrupted by user "]; +} + +-(void) enableTransfertView:(BOOL) isTranfer { + if (isTranfer) { + [imageTransferProgressBar setProgress:0.0]; + } else { + //[uploadCnx cancel]; + + } + [imageTransferProgressBar setHidden:!isTranfer]; + [cancelTransfertButton setHidden:!isTranfer]; + [pictButton setEnabled:!isTranfer]; + [sendButton setEnabled:!isTranfer]; +} + +-(void) startUpload { + [self enableTransfertView:TRUE]; +} +-(void) stopUpload { + [self enableTransfertView:FALSE]; +} +-(void) startDownload { + [self enableTransfertView:TRUE]; +} +-(void) stopDownload { + [self enableTransfertView:FALSE]; +} + +-(void) actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex { + + switch (actionSheet.tag) { + case FILE_CHOOSER_ACTION_SHEET: { + UIImagePickerController *mediaUI = [[UIImagePickerController alloc] init]; + switch (buttonIndex) { + case 0: { + if ([UIImagePickerController isSourceTypeAvailable: + UIImagePickerControllerSourceTypeCamera] == NO) { + [LinphoneLogger log:LinphoneLoggerLog format:@"no camera found, using image library"]; + } else { + mediaUI.sourceType = UIImagePickerControllerSourceTypeCamera; + + // Displays a control that allows the user to choose picture or + // movie capture, if both are available: + mediaUI.mediaTypes = + [UIImagePickerController availableMediaTypesForSourceType: + UIImagePickerControllerSourceTypeCamera]; + + // Hides the controls for moving & scaling pictures, or for + // trimming movies. To instead show the controls, use YES. + mediaUI.allowsEditing = NO; + break; + } + } + case 1: { + + mediaUI.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; + + // Displays saved pictures and movies, if both are available, from the + // Camera Roll album. + mediaUI.mediaTypes = + [UIImagePickerController availableMediaTypesForSourceType: + UIImagePickerControllerSourceTypePhotoLibrary]; + + // Hides the controls for moving & scaling pictures, or for + // trimming movies. To instead show the controls, use YES. + mediaUI.allowsEditing = NO; + + break; + } + default: + [mediaUI release]; + return ;break; + + } + mediaUI.delegate = self; + [self presentModalViewController: mediaUI animated: YES]; + break; + } + case FILE_DOWNLOAD_ACTION_SHEET: { + switch (buttonIndex) { + case 0: + [downloadCnx release]; + downloadCnx= [self downloadImageFrom:pendingFileUrl]; + [self startDownload]; + break; + case 1: + default: { + //nop + } + break; + } + break; + } + default: + [LinphoneLogger log:LinphoneLoggerError format:@"Unexpected action sheet result for tag [%i]",actionSheet.tag]; + + } + +} +#pragma mark - NSURLConnectionDelegate +- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error { + UIAlertView* errorAlert = [UIAlertView alloc]; + if (connection == uploadCnx) { + [self stopUpload]; + [LinphoneLogger log:LinphoneLoggerError format:@"Cannot upload file to server [%@] because [%@]",[[LinphoneManager instance] lpConfigStringForKey:@"file_upload_url"],[error localizedDescription]]; + [errorAlert initWithTitle:NSLocalizedString(@"Tranfer error",nil) + message:NSLocalizedString(@"Cannot transfert file to remote pary",nil) + delegate:nil + cancelButtonTitle:NSLocalizedString(@"Ok",nil) + otherButtonTitles:nil ,nil]; + [errorAlert show]; + }else if (connection == downloadCnx) { + [LinphoneLogger log:LinphoneLoggerError format:@"Cannot dowanlod file from [%@] because [%@]",pendingFileUrl,[error localizedDescription]]; + [errorAlert initWithTitle:NSLocalizedString(@"Tranfer error",nil) + message:NSLocalizedString(@"Cannot transfert file from remote pary",nil) + delegate:nil + cancelButtonTitle:NSLocalizedString(@"Continue",nil) + otherButtonTitles:nil ,nil]; + [errorAlert show]; + } else { + [LinphoneLogger log:LinphoneLoggerError format:@"Unknown connection error [%@]",[error localizedDescription]]; + } + [errorAlert release]; + +} + +-(void)connection:(NSURLConnection *)connection didSendBodyData:(NSInteger)bytesWritten totalBytesWritten:(NSInteger)totalBytesWritten totalBytesExpectedToWrite:(NSInteger)totalBytesExpectedToWrite { + [imageTransferProgressBar setProgress:(float)((float)totalBytesWritten/(float)totalBytesExpectedToWrite) animated:FALSE]; + +} +- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data { + if (connection == uploadCnx) { + NSString* imageRemoteUrl=[[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; + [LinphoneLogger log:LinphoneLoggerLog format:@"File can be downloaded from [%@]",imageRemoteUrl]; + [self sendMessage:NSLocalizedString(@"Image sent",nil) withExterlBodyUrl:imageRemoteUrl]; + } else if (connection == downloadCnx) { + if (downloadedData == nil) downloadedData = [[NSMutableData alloc] initWithCapacity:4096]; + [downloadedData appendData:data]; + [imageTransferProgressBar setProgress:(float)((float)downloadedData.length/(float)totalBytesExpectedToRead) animated:FALSE]; + } else { + [LinphoneLogger log:LinphoneLoggerError format:@"Unknown received value error"]; + } +} +- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response { + NSHTTPURLResponse * httpResponse = (NSHTTPURLResponse *) response; + int statusCode = httpResponse.statusCode;; + [LinphoneLogger log:LinphoneLoggerLog format:@"File transfert status code [%i]",statusCode]; + UIAlertView* errorAlert = [UIAlertView alloc]; + if (connection == uploadCnx) { + if (statusCode == 200) { + //nop + } else if (statusCode >= 400) { + + [errorAlert initWithTitle:NSLocalizedString(@"Transfer error",nil) + message:NSLocalizedString(@"Cannot transfert file to remote pary",nil) + delegate:nil + cancelButtonTitle:NSLocalizedString(@"Continue",nil) + otherButtonTitles:nil ,nil]; + [errorAlert show]; + + } + + } else if (connection == downloadCnx) { + if (statusCode == 200) { + totalBytesExpectedToRead=[response expectedContentLength]; + } else if (statusCode >= 400) { + [errorAlert initWithTitle:NSLocalizedString(@"Transfer error",nil) + message:NSLocalizedString(@"Cannot transfert file from remote pary",nil) + delegate:nil + cancelButtonTitle:NSLocalizedString(@"Continue",nil) + otherButtonTitles:nil ,nil]; + [errorAlert show]; + } else { + //TODO + } + + } else { + //FIXE + } + + [errorAlert release]; + + +} + +- (void)connectionDidFinishLoading:(NSURLConnection *)connection { + if (connection == uploadCnx) { + //nothing to do [self enableTransfert:FALSE]; + [self stopUpload]; + //[uploadCnx release]; + uploadCnx=nil; + } else if (connection == downloadCnx) { + ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init]; + [library writeImageDataToSavedPhotosAlbum:downloadedData + metadata:nil + completionBlock:^(NSURL *assetURL, NSError *error){ + if (error) { + [LinphoneLogger log:LinphoneLoggerError format:@"Cannot save image data downloaded because [%@]",[error localizedDescription]]; + } else { + [LinphoneLogger log:LinphoneLoggerLog format:@"Image saved to [%@]",[assetURL absoluteString]]; + } + + ImageViewerViewController* imageView = [[ImageViewerViewController alloc ]initWithNibName:@"ImageViewerViewController" bundle:[NSBundle mainBundle]]; + [imageView setImageToDisplay:[UIImage imageWithData:downloadedData]]; + [self presentModalViewController: imageView animated: YES]; + [downloadedData release]; + downloadedData=nil; + }]; + + + [library release]; + [self stopDownload]; + //[downloadCnx release]; + downloadCnx=nil; + } +} +-(NSURLConnection*) downloadImageFrom:(NSString*) address { + [LinphoneLogger log:LinphoneLoggerLog format:@"downloading [%@]",address]; + NSURL* url = [NSURL URLWithString: address ]; + NSURLRequest* request = [NSURLRequest requestWithURL:url + cachePolicy:NSURLRequestUseProtocolCachePolicy + timeoutInterval:60.0]; + + return [[NSURLConnection alloc] initWithRequest:request delegate: self]; +} + + +-(NSURLConnection*) uploadImage:(UIImage*) image Named:(NSString*) name { + /* + turning the image into a NSData object + getting the image back out of the UIImageView + setting the quality to 90 + */ + NSData *imageData = UIImageJPEGRepresentation(image, 80); + // setting up the URL to post to + NSString *urlString = [[LinphoneManager instance] lpConfigStringForKey:@"file_upload_url_preference"]; + + // setting up the request object now + NSMutableURLRequest *request = [[[NSMutableURLRequest alloc] init] autorelease]; + [request setURL:[NSURL URLWithString:urlString]]; + [request setHTTPMethod:@"POST"]; + + /* + add some header info now + we always need a boundary when we post a file + also we need to set the content type + + You might want to generate a random boundary.. this is just the same + as my output from wireshark on a valid html post + */ + NSString *boundary = [NSString stringWithString:@"---------------------------14737809831466499882746641449"]; + NSString *contentType = [NSString stringWithFormat:@"multipart/form-data; boundary=%@",boundary]; + [request addValue:contentType forHTTPHeaderField: @"Content-Type"]; + + /* + now lets create the body of the post + */ + NSMutableData *body = [NSMutableData data]; + [body appendData:[[NSString stringWithFormat:@"\r\n--%@\r\n",boundary] dataUsingEncoding:NSUTF8StringEncoding]]; + [body appendData:[[NSString stringWithFormat:@"Content-Disposition: form-data; name=\"userfile\"; filename=\"%@\"\r\n",name] dataUsingEncoding:NSUTF8StringEncoding]]; + [body appendData:[[NSString stringWithString:@"Content-Type: application/octet-stream\r\n\r\n"] dataUsingEncoding:NSUTF8StringEncoding]]; + [body appendData:[NSData dataWithData:imageData]]; + [body appendData:[[NSString stringWithFormat:@"\r\n--%@--\r\n",boundary] dataUsingEncoding:NSUTF8StringEncoding]]; + // setting the body of the post to the reqeust + [request setHTTPBody:body]; + + return [NSURLConnection connectionWithRequest:(NSURLRequest *)request + delegate:self]; +} + +#pragma mark UIImagePickerControllerDelegate +// For responding to the user tapping Cancel. +- (void) imagePickerControllerDidCancel: (UIImagePickerController *) picker { + [self dismissModalViewControllerAnimated: YES]; + [picker release]; +} + +- (void) imagePickerController: (UIImagePickerController *) picker + didFinishPickingMediaWithInfo: (NSDictionary *) info { + + NSURL *imageURL = [info valueForKey: UIImagePickerControllerReferenceURL]; + UIImage* imageToUse = (UIImage *) [info objectForKey: UIImagePickerControllerOriginalImage]; + NSString* imageName; + if (imageURL) { + // extract id from asset-url ex: assets-library://asset/asset.JPG?id=1645156-6151-1513&ext=JPG + NSArray *parameters = [[imageURL query] componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"=&"]]; + for (int i = 0; i < [parameters count]; i=i+2) { + if ([(NSString*)[parameters objectAtIndex:i] isEqualToString:@"id"]) { + imageName=[NSString stringWithFormat:@"%@.jpg",(NSString*)[parameters objectAtIndex:i+1]]; + } + } + } else { + // must be "unique" + imageName=[NSString stringWithFormat:@"%i.jpg",[imageToUse hash]]; + } + uploadCnx =[self uploadImage:imageToUse Named: imageName]; + [self startUpload]; + + [picker.presentingViewController dismissModalViewControllerAnimated: YES]; + [picker release]; +} #pragma mark - Keyboard Event Functions - (void)keyboardWillHide:(NSNotification *)notif { diff --git a/Classes/ChatRoomViewController.xib b/Classes/ChatRoomViewController.xib index fa18a7f31..8bfc3abc7 100644 --- a/Classes/ChatRoomViewController.xib +++ b/Classes/ChatRoomViewController.xib @@ -15,6 +15,7 @@ IBUIImageView IBUILabel IBProxyObject + IBUIProgressView IBUITextField IBUITableViewController IBUITableView @@ -54,7 +55,6 @@ 292 {{-13, -5}, {131, 107}} - _NS:9 NO @@ -69,7 +69,6 @@ 292 {{20, 6}, {65, 65}} - _NS:9 NO @@ -84,7 +83,6 @@ 290 {{101, 37}, {199, 43}} - _NS:9 NO @@ -113,7 +111,6 @@ {320, 80} - _NS:9 @@ -128,10 +125,9 @@ 274 {{0, 80}, {320, 277}} - _NS:9 - + 3 MQA @@ -153,8 +149,7 @@ 257 {{250, 0}, {70, 59}} - - + _NS:9 NO @@ -195,9 +190,8 @@ 258 - {250, 59} + {{56, 0}, {194, 59}} - _NS:9 NO @@ -210,9 +204,8 @@ -2147483390 - {{10, 10}, {230, 39}} + {{61, 10}, {189, 39}} - _NS:9 NO @@ -247,10 +240,9 @@ 292 - {{10, 10}, {230, 39}} + {{61, 10}, {175, 39}} - - + _NS:9 YES YES @@ -267,11 +259,68 @@ + + + 292 + {{2, 12}, {53, 37}} + + + _NS:9 + NO + IBCocoaTouchFramework + 0 + 0 + Pict + + + 1 + MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + + + + NSImage + background.png + + + + + + + -2147483356 + {{72, 25}, {163, 9}} + + + _NS:9 + NO + IBCocoaTouchFramework + + + + 292 + {{258, 11}, {59, 37}} + + + _NS:9 + NO + IBCocoaTouchFramework + 0 + 0 + 1 + Cancel + + + 1 + MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + + + + + + {{0, 357}, {320, 59}} - - + _NS:9 3 @@ -283,7 +332,6 @@ {{0, 44}, {320, 416}} - _NS:9 @@ -302,7 +350,6 @@ 290 {320, 44} - _NS:9 NO @@ -317,7 +364,6 @@ 292 {160, 44} - _NS:9 NO @@ -345,7 +391,6 @@ 289 {{160, 0}, {160, 44}} - _NS:9 NO @@ -375,7 +420,6 @@ {320, 44} - _NS:9 @@ -388,7 +432,6 @@ {320, 460} - _NS:9 @@ -495,6 +538,30 @@ 57 + + + pictButton + + + + 59 + + + + cancelTransfertButton + + + + 66 + + + + imageTransferProgressBar + + + + 68 + dataSource @@ -546,6 +613,24 @@ 33 + + + onPictClick: + + + 7 + + 60 + + + + onTransferCancelClick: + + + 7 + + 69 + @@ -664,6 +749,9 @@ + + + footerView @@ -692,6 +780,21 @@ messageFieldOld + + 58 + + + + + 62 + + + + + 64 + + + @@ -716,7 +819,10 @@ 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 com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin @@ -726,114 +832,9 @@ - 57 - - - - - ChatRoomTableViewController - UITableViewController - - IBProjectSource - ./Classes/ChatRoomTableViewController.h - - - - ChatRoomViewController - UIViewController - - id - id - id - id - - - - onBackClick: - id - - - onEditClick: - id - - - onMessageChange: - id - - - onSendClick: - id - - - - UILabel - UIImageView - UIView - UIToggleButton - UIImageView - UIView - UIView - UITextView - UIButton - ChatRoomTableViewController - - - - addressLabel - UILabel - - - avatarImage - UIImageView - - - chatView - UIView - - - editButton - UIToggleButton - - - fieldBackgroundImage - UIImageView - - - footerView - UIView - - - headerView - UIView - - - messageField - UITextView - - - sendButton - UIButton - - - tableController - ChatRoomTableViewController - - - - IBProjectSource - ./Classes/ChatRoomViewController.h - - - - UIToggleButton - UIButton - - IBProjectSource - ./Classes/UIToggleButton.h - - - + 69 + 0 IBCocoaTouchFramework @@ -845,6 +846,7 @@ {262, 214} {131, 131} + {640, 523} {320, 88} {320, 88} {320, 88} diff --git a/Classes/ContactDetailsViewController.xib b/Classes/ContactDetailsViewController.xib index 6bb560020..56649427c 100644 --- a/Classes/ContactDetailsViewController.xib +++ b/Classes/ContactDetailsViewController.xib @@ -36,7 +36,7 @@ IBCocoaTouchFramework - + 274 @@ -48,7 +48,6 @@ 290 {320, 44} - _NS:9 NO @@ -63,7 +62,6 @@ 292 {160, 44} - _NS:9 NO @@ -101,7 +99,6 @@ -2147483356 {160, 44} - _NS:9 NO @@ -129,7 +126,6 @@ 289 {{160, 0}, {160, 44}} - _NS:9 NO @@ -159,7 +155,6 @@ {320, 44} - _NS:9 @@ -176,8 +171,6 @@ 306 {{0, 44}, {320, 416}} - - _NS:9 10 @@ -260,8 +253,6 @@ AAgACAAIAAEAAQABAAE {320, 460} - - IBCocoaTouchFramework diff --git a/Classes/ImageViewerViewController.h b/Classes/ImageViewerViewController.h new file mode 100644 index 000000000..24d29ac0e --- /dev/null +++ b/Classes/ImageViewerViewController.h @@ -0,0 +1,34 @@ +/* ImageViewerViewController.h + * + * Copyright (C) 2012 Belledonne Comunications, Grenoble, France + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#import + +@interface ImageViewerViewController : UIViewController { + +} + + + +@property (nonatomic, retain) IBOutlet UIImageView *imageView; +@property (nonatomic, retain) UIImage *imageToDisplay; +@property (nonatomic, retain) IBOutlet UIButton *backButton; + + +- (IBAction)onBackClick:(id)sender; +@end \ No newline at end of file diff --git a/Classes/ImageViewerViewController.m b/Classes/ImageViewerViewController.m new file mode 100644 index 000000000..eb3bcd0ce --- /dev/null +++ b/Classes/ImageViewerViewController.m @@ -0,0 +1,62 @@ +/* ImageViewerViewController.h + * + * Copyright (C) 2012 Belledonne Comunications, Grenoble, France + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + + +#import "ImageViewerViewController.h" + +@interface ImageViewerViewController () + +@end + +@implementation ImageViewerViewController +@synthesize imageView; +@synthesize backButton; +@synthesize imageToDisplay; + +- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil +{ + self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; + if (self) { + // Custom initialization + } + return self; +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; + [imageView setImage:imageToDisplay]; +} + +- (void)viewDidUnload +{ + [super viewDidUnload]; + // Release any retained subviews of the main view. + // e.g. self.myOutlet = nil; +} + +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation +{ + return (interfaceOrientation == UIInterfaceOrientationPortrait); +} + +- (IBAction)onBackClick:(id)sender { + [self.presentingViewController dismissModalViewControllerAnimated: YES]; +} +@end diff --git a/Classes/ImageViewerViewController.xib b/Classes/ImageViewerViewController.xib new file mode 100644 index 000000000..488929954 --- /dev/null +++ b/Classes/ImageViewerViewController.xib @@ -0,0 +1,233 @@ + + + + 1296 + 11E53 + 2182 + 1138.47 + 569.00 + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + 1181 + + + IBUIButton + IBUIImageView + IBUIView + IBProxyObject + + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + PluginDependencyRecalculationVersion + + + + + IBFilesOwner + IBCocoaTouchFramework + + + IBFirstResponder + IBCocoaTouchFramework + + + + 274 + + + + 274 + {{0, 44}, {320, 416}} + + _NS:9 + 4 + NO + IBCocoaTouchFramework + + + + 292 + {320, 44} + + + _NS:9 + NO + IBCocoaTouchFramework + + NSImage + background.png + + + + + 292 + {{235, 0}, {80, 44}} + + + _NS:9 + NO + IBCocoaTouchFramework + 0 + 0 + + 3 + MQA + + + 1 + MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + + + 3 + MC41AA + + + NSImage + chat_back_default.png + + + NSImage + chat_back_over.png + + + 2 + 15 + + + Helvetica-Bold + 15 + 16 + + + + {{0, 20}, {320, 460}} + + + + 3 + MQA + + 2 + + + + IBCocoaTouchFramework + + + + + + + view + + + + 3 + + + + backButton + + + + 8 + + + + imageView + + + + 9 + + + + onBackClick: + + + 7 + + 10 + + + + + + 0 + + + + + + 1 + + + + + + + + + + -1 + + + File's Owner + + + -2 + + + + + 4 + + + + + 6 + + + + + 7 + + + + + + + ImageViewerViewController + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + UIResponder + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + + + + 10 + + + 0 + IBCocoaTouchFramework + + com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS + + + YES + 3 + + {640, 523} + {320, 88} + {320, 88} + + 1181 + + diff --git a/Classes/LinphoneAppDelegate.h b/Classes/LinphoneAppDelegate.h index 2983bccb0..6ab450445 100644 --- a/Classes/LinphoneAppDelegate.h +++ b/Classes/LinphoneAppDelegate.h @@ -28,9 +28,11 @@ @end @interface LinphoneAppDelegate : NSObject { - UIWindow *window; + @private + UIWindow *window; CTCallCenter* callCenter; BOOL started; + int savedMaxCall; } @property (assign) BOOL started; diff --git a/Classes/LinphoneAppDelegate.m b/Classes/LinphoneAppDelegate.m index 5f75c7652..3e8cc1758 100644 --- a/Classes/LinphoneAppDelegate.m +++ b/Classes/LinphoneAppDelegate.m @@ -248,12 +248,12 @@ #pragma mark - PushNotification Functions - (void)application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken { - [LinphoneLogger log:LinphoneLoggerDebug format:@"PushNotification: Token %@", deviceToken]; + [LinphoneLogger log:LinphoneLoggerLog format:@"PushNotification: Token %@", deviceToken]; [[LinphoneManager instance] setPushNotificationToken:deviceToken]; } - (void)application:(UIApplication*)application didFailToRegisterForRemoteNotificationsWithError:(NSError*)error { - [LinphoneLogger log:LinphoneLoggerDebug format:@"PushNotification: Error %@", error]; + [LinphoneLogger log:LinphoneLoggerError format:@"PushNotification: Error %@", [error localizedDescription]]; [[LinphoneManager instance] setPushNotificationToken:nil]; } diff --git a/Classes/LinphoneCoreSettingsStore.m b/Classes/LinphoneCoreSettingsStore.m index 655f6859e..6a820991e 100644 --- a/Classes/LinphoneCoreSettingsStore.m +++ b/Classes/LinphoneCoreSettingsStore.m @@ -102,7 +102,7 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args); [self setString: linphone_address_get_username(addr) forKey:@"username_preference"]; [self setString: linphone_address_get_domain(addr) forKey:@"domain_preference"]; - [self setInteger: lp_config_get_int(linphone_core_get_config(lc),"default_values","reg_expires",600) forKey:@"expire_preference"]; + [self setInteger: linphone_proxy_config_get_expires(cfg) forKey:@"expire_preference"]; [self setString:linphone_proxy_config_get_dial_prefix(cfg) forKey:@"prefix_preference"]; if (strcmp(linphone_address_get_domain(addr),linphone_address_get_domain(proxy_addr))!=0 || port!=NULL){ @@ -119,6 +119,8 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args); [self setBool:linphone_proxy_config_get_dial_escape_plus(cfg) forKey:@"substitute_+_by_00_preference"]; } + } else { + [self setInteger: lp_config_get_int(linphone_core_get_config(lc),"default_values","reg_expires",600) forKey:@"expire_preference"]; } { LinphoneAddress *parsed = linphone_core_get_primary_contact_parsed(lc); @@ -191,7 +193,8 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args); [self setBool: lp_config_get_int(linphone_core_get_config(lc),"app","animations_preference", 1) forKey:@"animations_preference"]; [self setBool: lp_config_get_int(linphone_core_get_config(lc),"app","check_config_disable_preference", 0) forKey:@"check_config_disable_preference"]; [self setBool: lp_config_get_int(linphone_core_get_config(lc),"app","wifi_only_preference", 0) forKey:@"wifi_only_preference"]; - + [self setString: lp_config_get_string(linphone_core_get_config(lc),"app","file_upload_url_preference",NULL) forKey:@"file_upload_url_preference"]; + /*keep this one also in the standardUserDefaults so that it can be read before starting liblinphone*/ BOOL start_at_boot = TRUE; if ([[NSUserDefaults standardUserDefaults] objectForKey:@"start_at_boot_preference"]!=Nil) @@ -355,7 +358,7 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args); int expire = [self integerForKey:@"expire_preference"]; - lp_config_set_int(linphone_core_get_config(lc),"default_values","reg_expires",expire); + linphone_proxy_config_expires(proxyCfg,expire); BOOL isWifiOnly = [self boolForKey:@"wifi_only_preference"]; @@ -505,6 +508,10 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args); BOOL animations = [self boolForKey:@"animations_preference"]; lp_config_set_int(linphone_core_get_config(lc),"app","animations_preference", animations); + NSString* file_upload_url= [self stringForKey:@"file_upload_url_preference"]; + [[LinphoneManager instance] lpConfigSetString:file_upload_url forKey:@"file_upload_url_preference"]; + + /*keep this one also in the standardUserDefaults so that it can be read before starting liblinphone*/ BOOL start_at_boot = [self boolForKey:@"start_at_boot_preference"]; diff --git a/Classes/LinphoneManager.m b/Classes/LinphoneManager.m index a2140d4ad..37782fdcc 100644 --- a/Classes/LinphoneManager.m +++ b/Classes/LinphoneManager.m @@ -403,9 +403,9 @@ static void linphone_iphone_registration_state(LinphoneCore *lc, LinphoneProxyCo #pragma mark - Text Received Functions -- (void)onTextReceived:(LinphoneCore *)lc room:(LinphoneChatRoom *)room from:(const LinphoneAddress *)from message:(const char *)message { +- (void)onMessageReceived:(LinphoneCore *)lc room:(LinphoneChatRoom *)room message:(LinphoneChatMessage*)msg { - char *fromStr = linphone_address_as_string_uri_only(from); + char *fromStr = linphone_address_as_string_uri_only(linphone_chat_message_get_from(msg)); if(fromStr == NULL) return; @@ -413,27 +413,35 @@ static void linphone_iphone_registration_state(LinphoneCore *lc, LinphoneProxyCo ChatModel *chat = [[ChatModel alloc] init]; [chat setLocalContact:@""]; [chat setRemoteContact:[NSString stringWithUTF8String:fromStr]]; - [chat setMessage:[NSString stringWithUTF8String:message]]; - [chat setDirection:[NSNumber numberWithInt:1]]; + if (linphone_chat_message_get_external_body_url(msg)) { + [chat setMessage:NSLocalizedString(@"Incoming file",nil)]; + } else { + [chat setMessage:[NSString stringWithUTF8String:linphone_chat_message_get_text(msg)]]; + } + [chat setDirection:[NSNumber numberWithInt:1]]; [chat setTime:[NSDate date]]; [chat setRead:[NSNumber numberWithInt:0]]; [chat create]; ms_free(fromStr); - + NSString* ext_body_url=nil; + if (linphone_chat_message_get_external_body_url(msg)) { + ext_body_url=[NSString stringWithUTF8String:linphone_chat_message_get_external_body_url(msg)]; + } // Post event NSDictionary* dict = [NSDictionary dictionaryWithObjectsAndKeys: - [NSValue valueWithPointer:room], @"room", - [NSValue valueWithPointer:from], @"from", - [NSString stringWithUTF8String:message], @"message", - chat, @"chat", + [NSValue valueWithPointer:room], @"room", + [NSValue valueWithPointer:linphone_chat_message_get_from(msg)], @"from", + chat.message, @"message", + chat, @"chat", + ext_body_url,@"external_body_url", nil]; [[NSNotificationCenter defaultCenter] postNotificationName:kLinphoneTextReceived object:self userInfo:dict]; [chat release]; } -static void linphone_iphone_text_received(LinphoneCore *lc, LinphoneChatRoom *room, const LinphoneAddress *from, const char *message) { - [(LinphoneManager*)linphone_core_get_user_data(lc) onTextReceived:lc room:room from:from message:message]; +static void linphone_iphone_message_received(LinphoneCore *lc, LinphoneChatRoom *room, LinphoneChatMessage *message) { + [(LinphoneManager*)linphone_core_get_user_data(lc) onMessageReceived:lc room:room message:message]; } @@ -570,7 +578,8 @@ static LinphoneCoreVTable linphonec_vtable = { .display_message=linphone_iphone_log, .display_warning=linphone_iphone_log, .display_url=NULL, - .text_received=linphone_iphone_text_received, + .text_received=NULL, + .message_received=linphone_iphone_message_received, .dtmf_received=NULL, .transfer_state_changed=linphone_iphone_transfer_state_changed }; @@ -1066,7 +1075,8 @@ static LinphoneCoreVTable linphonec_vtable = { -(void)lpConfigSetString:(NSString*) value forKey:(NSString*) key { - lp_config_set_string(linphone_core_get_config(theLinphoneCore),"app",value?[key UTF8String]:NULL, [value UTF8String]); + if (!key) return; + lp_config_set_string(linphone_core_get_config(theLinphoneCore),"app",[key UTF8String], value?[value UTF8String]:NULL); } -(NSString*)lpConfigStringForKey:(NSString*) key { if (!theLinphoneCore) { diff --git a/Resources/linphonerc b/Resources/linphonerc index 5057f2f02..26241fa72 100644 --- a/Resources/linphonerc +++ b/Resources/linphonerc @@ -21,4 +21,4 @@ display_filter_auto_rotate=1 [default_values] -reg_expires=600 \ No newline at end of file +reg_expires=610 \ No newline at end of file diff --git a/Settings/InAppSettings.bundle/Advanced.plist b/Settings/InAppSettings.bundle/Advanced.plist index 5daa482cb..fbab84642 100644 --- a/Settings/InAppSettings.bundle/Advanced.plist +++ b/Settings/InAppSettings.bundle/Advanced.plist @@ -156,6 +156,20 @@ Type PSTextFieldSpecifier + + Type + PSGroupSpecifier + Title + + + + Type + PSTextFieldSpecifier + Title + sharing server + Key + file_upload_url_preference + diff --git a/linphone.xcodeproj/project.pbxproj b/linphone.xcodeproj/project.pbxproj index 6a3eca7ba..376690237 100755 --- a/linphone.xcodeproj/project.pbxproj +++ b/linphone.xcodeproj/project.pbxproj @@ -42,6 +42,13 @@ 2234C8EE15EE744200E18E83 /* chat_message_inprogress.png in Resources */ = {isa = PBXBuildFile; fileRef = 2234C8ED15EE744200E18E83 /* chat_message_inprogress.png */; }; 2234C8EF15EE744200E18E83 /* chat_message_inprogress.png in Resources */ = {isa = PBXBuildFile; fileRef = 2234C8ED15EE744200E18E83 /* chat_message_inprogress.png */; }; 2237D4091084D7A9001383EE /* ring.wav in Resources */ = {isa = PBXBuildFile; fileRef = 2237D4081084D7A9001383EE /* ring.wav */; }; + 22405EEB16006F0800B92522 /* libmediastreamer_base.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 22405EE916006F0700B92522 /* libmediastreamer_base.a */; }; + 22405EEC16006F0800B92522 /* libmediastreamer_voip.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 22405EEA16006F0700B92522 /* libmediastreamer_voip.a */; }; + 22405EEE1600B4E400B92522 /* AssetsLibrary.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 22405EED1600B4E400B92522 /* AssetsLibrary.framework */; }; + 22405F001601C19200B92522 /* ImageViewerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 22405EFE1601C19100B92522 /* ImageViewerViewController.m */; }; + 22405F011601C19200B92522 /* ImageViewerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 22405EFE1601C19100B92522 /* ImageViewerViewController.m */; }; + 22405F021601C19200B92522 /* ImageViewerViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 22405EFF1601C19100B92522 /* ImageViewerViewController.xib */; }; + 22405F031601C19200B92522 /* ImageViewerViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 22405EFF1601C19100B92522 /* ImageViewerViewController.xib */; }; 2242E313125235120061DDCE /* ring.caf in Resources */ = {isa = PBXBuildFile; fileRef = 2242E312125235120061DDCE /* ring.caf */; }; 224567C2107B968500F10948 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 224567C1107B968500F10948 /* AVFoundation.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; 2245F78A1201D38000C4179D /* MoreViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 22E0A81B111C44E100B04932 /* MoreViewController.xib */; }; @@ -53,6 +60,7 @@ 2264B6D211200342002C2C53 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2264B6D111200342002C2C53 /* SystemConfiguration.framework */; }; 226CDADF14E2D0B800513B67 /* libbcg729.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 226CDADD14E2D0B800513B67 /* libbcg729.a */; }; 226CDAE014E2D0B800513B67 /* libmsbcg729.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 226CDADE14E2D0B800513B67 /* libmsbcg729.a */; }; + 226EF06C15FA256B005865C7 /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 226EF06B15FA256B005865C7 /* MobileCoreServices.framework */; }; 226F2ED61344B0EF00F6EF27 /* libopencore-amrwb.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 226F2ED31344B0EF00F6EF27 /* libopencore-amrwb.a */; }; 226F2ED71344B0EF00F6EF27 /* libopencore-amrnb.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 226F2ED41344B0EF00F6EF27 /* libopencore-amrnb.a */; }; 226F2ED81344B0EF00F6EF27 /* libmsamr.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 226F2ED51344B0EF00F6EF27 /* libmsamr.a */; }; @@ -1133,7 +1141,6 @@ D3F9A9EE15AF277E0045320F /* UACellBackgroundView.m in Sources */ = {isa = PBXBuildFile; fileRef = D3F9A9ED15AF277D0045320F /* UACellBackgroundView.m */; }; D3F9A9EF15AF277E0045320F /* UACellBackgroundView.m in Sources */ = {isa = PBXBuildFile; fileRef = D3F9A9ED15AF277D0045320F /* UACellBackgroundView.m */; }; F476004B147AAF2800FFF19B /* liblinphone.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2211DB911475562600DEE054 /* liblinphone.a */; }; - F476004C147AAF4600FFF19B /* libmediastreamer.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2211DB8F147555C800DEE054 /* libmediastreamer.a */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -1348,6 +1355,12 @@ 2234C8E815EE2F7F00E18E83 /* chat_message_not_delivered.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = chat_message_not_delivered.png; path = Resources/chat_message_not_delivered.png; sourceTree = ""; }; 2234C8ED15EE744200E18E83 /* chat_message_inprogress.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = chat_message_inprogress.png; path = Resources/chat_message_inprogress.png; sourceTree = ""; }; 2237D4081084D7A9001383EE /* ring.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; name = ring.wav; path = Resources/ring.wav; sourceTree = ""; }; + 22405EE916006F0700B92522 /* libmediastreamer_base.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libmediastreamer_base.a; path = "liblinphone-sdk/apple-darwin/lib/libmediastreamer_base.a"; sourceTree = ""; }; + 22405EEA16006F0700B92522 /* libmediastreamer_voip.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libmediastreamer_voip.a; path = "liblinphone-sdk/apple-darwin/lib/libmediastreamer_voip.a"; sourceTree = ""; }; + 22405EED1600B4E400B92522 /* AssetsLibrary.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AssetsLibrary.framework; path = System/Library/Frameworks/AssetsLibrary.framework; sourceTree = SDKROOT; }; + 22405EFD1601C19000B92522 /* ImageViewerViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageViewerViewController.h; sourceTree = ""; }; + 22405EFE1601C19100B92522 /* ImageViewerViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ImageViewerViewController.m; sourceTree = ""; }; + 22405EFF1601C19100B92522 /* ImageViewerViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ImageViewerViewController.xib; sourceTree = ""; }; 2242E312125235120061DDCE /* ring.caf */ = {isa = PBXFileReference; lastKnownFileType = file; name = ring.caf; path = Resources/ring.caf; sourceTree = ""; }; 224567C1107B968500F10948 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; 2248E90C12F7E4CF00220D9C /* UIDigitButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIDigitButton.h; sourceTree = ""; }; @@ -1360,6 +1373,7 @@ 2264B6D111200342002C2C53 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; }; 226CDADD14E2D0B800513B67 /* libbcg729.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libbcg729.a; path = "liblinphone-sdk/apple-darwin/lib/libbcg729.a"; sourceTree = ""; }; 226CDADE14E2D0B800513B67 /* libmsbcg729.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libmsbcg729.a; path = "liblinphone-sdk/apple-darwin/lib/mediastreamer/plugins/libmsbcg729.a"; sourceTree = ""; }; + 226EF06B15FA256B005865C7 /* MobileCoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MobileCoreServices.framework; path = System/Library/Frameworks/MobileCoreServices.framework; sourceTree = SDKROOT; }; 226F2ED31344B0EF00F6EF27 /* libopencore-amrwb.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libopencore-amrwb.a"; path = "liblinphone-sdk/apple-darwin/lib/libopencore-amrwb.a"; sourceTree = ""; }; 226F2ED41344B0EF00F6EF27 /* libopencore-amrnb.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libopencore-amrnb.a"; path = "liblinphone-sdk/apple-darwin/lib/libopencore-amrnb.a"; sourceTree = ""; }; 226F2ED51344B0EF00F6EF27 /* libmsamr.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libmsamr.a; path = "liblinphone-sdk/apple-darwin/lib/mediastreamer/plugins/libmsamr.a"; sourceTree = ""; }; @@ -2050,6 +2064,10 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 22405EEE1600B4E400B92522 /* AssetsLibrary.framework in Frameworks */, + 22405EEB16006F0800B92522 /* libmediastreamer_base.a in Frameworks */, + 22405EEC16006F0800B92522 /* libmediastreamer_voip.a in Frameworks */, + 226EF06C15FA256B005865C7 /* MobileCoreServices.framework in Frameworks */, 22B5F03510CE6B2F00777D97 /* AddressBook.framework in Frameworks */, 22B5EFA310CE50BD00777D97 /* AddressBookUI.framework in Frameworks */, 2274402F106F335E006EC466 /* AudioToolbox.framework in Frameworks */, @@ -2078,7 +2096,6 @@ 220FAD3210765B400068D98F /* libgsm.a in Frameworks */, 223148E41178A08200637D6A /* libilbc.a in Frameworks */, F476004B147AAF2800FFF19B /* liblinphone.a in Frameworks */, - F476004C147AAF4600FFF19B /* libmediastreamer.a in Frameworks */, 226F2ED81344B0EF00F6EF27 /* libmsamr.a in Frameworks */, 223148E61178A09900637D6A /* libmsilbc.a in Frameworks */, 226183B0147259670037138E /* libmssilk.a in Frameworks */, @@ -2229,6 +2246,9 @@ D350F20B15A43BB100149E54 /* WizardViewController.h */, D350F20C15A43BB100149E54 /* WizardViewController.m */, D350F20D15A43BB100149E54 /* WizardViewController.xib */, + 22405EFD1601C19000B92522 /* ImageViewerViewController.h */, + 22405EFE1601C19100B92522 /* ImageViewerViewController.m */, + 22405EFF1601C19100B92522 /* ImageViewerViewController.xib */, ); path = Classes; sourceTree = ""; @@ -2590,6 +2610,10 @@ 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = { isa = PBXGroup; children = ( + 22405EED1600B4E400B92522 /* AssetsLibrary.framework */, + 22405EE916006F0700B92522 /* libmediastreamer_base.a */, + 22405EEA16006F0700B92522 /* libmediastreamer_voip.a */, + 226EF06B15FA256B005865C7 /* MobileCoreServices.framework */, 2258633C11410BAC00C5A737 /* README */, 22276E8013C73D3100210156 /* libavcodec.a */, 22276E8113C73D3100210156 /* libavutil.a */, @@ -3775,6 +3799,7 @@ 2234C8E915EE2F7F00E18E83 /* chat_message_delivered.png in Resources */, 2234C8EB15EE2F7F00E18E83 /* chat_message_not_delivered.png in Resources */, 2234C8EE15EE744200E18E83 /* chat_message_inprogress.png in Resources */, + 22405F021601C19200B92522 /* ImageViewerViewController.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -4220,6 +4245,7 @@ 2234C8EA15EE2F7F00E18E83 /* chat_message_delivered.png in Resources */, 2234C8EC15EE2F7F00E18E83 /* chat_message_not_delivered.png in Resources */, 2234C8EF15EE744200E18E83 /* chat_message_inprogress.png in Resources */, + 22405F031601C19200B92522 /* ImageViewerViewController.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -4342,6 +4368,7 @@ D380800515C28A7A005BE9BC /* UILinphone.m in Sources */, D380801315C299D0005BE9BC /* ColorSpaceUtilites.m in Sources */, D378AB2A15DCDB4A0098505D /* ContactDetailsImagePickerController.m in Sources */, + 22405F001601C19200B92522 /* ImageViewerViewController.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -4432,6 +4459,7 @@ D380800615C28A7A005BE9BC /* UILinphone.m in Sources */, D380801415C299D0005BE9BC /* ColorSpaceUtilites.m in Sources */, D378AB2B15DCDB4A0098505D /* ContactDetailsImagePickerController.m in Sources */, + 22405F011601C19200B92522 /* ImageViewerViewController.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -4491,6 +4519,7 @@ HAVE_SILK, DEBUG, ); + GCC_TREAT_WARNINGS_AS_ERRORS = YES; HEADER_SEARCH_PATHS = ( submodules/linphone/coreapi, submodules/linphone/mediastreamer2/include, @@ -4564,6 +4593,7 @@ HAVE_X264, HAVE_SILK, ); + GCC_TREAT_WARNINGS_AS_ERRORS = YES; HEADER_SEARCH_PATHS = ( submodules/linphone/coreapi, submodules/linphone/mediastreamer2/include, @@ -4831,6 +4861,7 @@ HAVE_X264, HAVE_SILK, ); + GCC_TREAT_WARNINGS_AS_ERRORS = YES; HEADER_SEARCH_PATHS = ( submodules/linphone/coreapi, submodules/linphone/mediastreamer2/include, @@ -4904,6 +4935,7 @@ HAVE_X264, HAVE_SILK, ); + GCC_TREAT_WARNINGS_AS_ERRORS = YES; HEADER_SEARCH_PATHS = ( submodules/linphone/coreapi, submodules/linphone/mediastreamer2/include, diff --git a/submodules/liblinphone.xcodeproj/project.pbxproj b/submodules/liblinphone.xcodeproj/project.pbxproj index 6b9fe6cde..52ba9c37e 100644 --- a/submodules/liblinphone.xcodeproj/project.pbxproj +++ b/submodules/liblinphone.xcodeproj/project.pbxproj @@ -29,7 +29,6 @@ 221DCB6E153584410025E54D /* yuv2rgb.vs in Sources */ = {isa = PBXBuildFile; fileRef = 221DCB6B153584410025E54D /* yuv2rgb.vs */; }; 221DCB6F153584410025E54D /* yuv2rgb.vs in Sources */ = {isa = PBXBuildFile; fileRef = 221DCB6B153584410025E54D /* yuv2rgb.vs */; }; 221F58A013AB50F800D603C9 /* CoreMedia.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 221F589F13AB50F800D603C9 /* CoreMedia.framework */; }; - 221F58A413AB708C00D603C9 /* alldescs.h in Headers */ = {isa = PBXBuildFile; fileRef = 221F58A313AB708C00D603C9 /* alldescs.h */; }; 221F58E413AF44B300D603C9 /* scaler.h in Headers */ = {isa = PBXBuildFile; fileRef = 221F58E313AF44B300D603C9 /* scaler.h */; }; 222CA63211F6CF7600621220 /* allfilters.h in Headers */ = {isa = PBXBuildFile; fileRef = 222CA5BE11F6CF7600621220 /* allfilters.h */; }; 222CA63311F6CF7600621220 /* dsptools.h in Headers */ = {isa = PBXBuildFile; fileRef = 222CA5BF11F6CF7600621220 /* dsptools.h */; }; @@ -113,6 +112,12 @@ 222CA78411F6CFB100621220 /* siplogin.c in Sources */ = {isa = PBXBuildFile; fileRef = 222CA76211F6CFB100621220 /* siplogin.c */; }; 222CA78511F6CFB100621220 /* sipsetup.c in Sources */ = {isa = PBXBuildFile; fileRef = 222CA76311F6CFB100621220 /* sipsetup.c */; }; 222CA78611F6CFB100621220 /* sipsetup.h in Headers */ = {isa = PBXBuildFile; fileRef = 222CA76411F6CFB100621220 /* sipsetup.h */; }; + 22405EDD160065C200B92522 /* basedescs.h in Headers */ = {isa = PBXBuildFile; fileRef = 22405EDC160065C200B92522 /* basedescs.h */; }; + 22405EE01600668800B92522 /* msvoip.c in Sources */ = {isa = PBXBuildFile; fileRef = 22405EDF1600668800B92522 /* msvoip.c */; }; + 22405EE2160066C700B92522 /* voipdescs.h in Headers */ = {isa = PBXBuildFile; fileRef = 22405EE1160066C700B92522 /* voipdescs.h */; }; + 22405EE51600671D00B92522 /* logging.c in Sources */ = {isa = PBXBuildFile; fileRef = 22405EE31600671D00B92522 /* logging.c */; }; + 22405EE61600671D00B92522 /* rtpprofile.c in Sources */ = {isa = PBXBuildFile; fileRef = 22405EE41600671D00B92522 /* rtpprofile.c */; }; + 22405EE81600675C00B92522 /* genericplc.c in Sources */ = {isa = PBXBuildFile; fileRef = 22405EE71600675C00B92522 /* genericplc.c */; }; 2258C44113A9377B0087A596 /* swscale.h in Headers */ = {isa = PBXBuildFile; fileRef = 2258C44013A9377B0087A596 /* swscale.h */; }; 2258C44513A945520087A596 /* libswscale.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2258C44213A945520087A596 /* libswscale.a */; }; 2258C44613A945520087A596 /* libavutil.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2258C44313A945520087A596 /* libavutil.a */; }; @@ -191,7 +196,6 @@ 225D64761521BFA6008B2E81 /* linphonecore_utils.h in Headers */ = {isa = PBXBuildFile; fileRef = 229B9D5813043EAB00EFCD1C /* linphonecore_utils.h */; }; 225D64781521BFA6008B2E81 /* nowebcam.h in Headers */ = {isa = PBXBuildFile; fileRef = 220ED1AA13A9062500AC21E0 /* nowebcam.h */; }; 225D64791521BFA6008B2E81 /* swscale.h in Headers */ = {isa = PBXBuildFile; fileRef = 2258C44013A9377B0087A596 /* swscale.h */; }; - 225D647A1521BFA6008B2E81 /* alldescs.h in Headers */ = {isa = PBXBuildFile; fileRef = 221F58A313AB708C00D603C9 /* alldescs.h */; }; 225D647B1521BFA6008B2E81 /* scaler.h in Headers */ = {isa = PBXBuildFile; fileRef = 221F58E313AF44B300D603C9 /* scaler.h */; }; 225D647C1521BFA6008B2E81 /* g722.h in Headers */ = {isa = PBXBuildFile; fileRef = 229A614B13DDFE3500090183 /* g722.h */; }; 225D647D1521BFA6008B2E81 /* shaders.h in Headers */ = {isa = PBXBuildFile; fileRef = 70E542F613E14816002BA2C0 /* shaders.h */; }; @@ -339,7 +343,6 @@ 225D65431521C009008B2E81 /* linphonecore_utils.h in Headers */ = {isa = PBXBuildFile; fileRef = 229B9D5813043EAB00EFCD1C /* linphonecore_utils.h */; }; 225D65451521C009008B2E81 /* nowebcam.h in Headers */ = {isa = PBXBuildFile; fileRef = 220ED1AA13A9062500AC21E0 /* nowebcam.h */; }; 225D65461521C009008B2E81 /* swscale.h in Headers */ = {isa = PBXBuildFile; fileRef = 2258C44013A9377B0087A596 /* swscale.h */; }; - 225D65471521C009008B2E81 /* alldescs.h in Headers */ = {isa = PBXBuildFile; fileRef = 221F58A313AB708C00D603C9 /* alldescs.h */; }; 225D65481521C009008B2E81 /* scaler.h in Headers */ = {isa = PBXBuildFile; fileRef = 221F58E313AF44B300D603C9 /* scaler.h */; }; 225D65491521C009008B2E81 /* g722.h in Headers */ = {isa = PBXBuildFile; fileRef = 229A614B13DDFE3500090183 /* g722.h */; }; 225D654A1521C009008B2E81 /* shaders.h in Headers */ = {isa = PBXBuildFile; fileRef = 70E542F613E14816002BA2C0 /* shaders.h */; }; @@ -466,7 +469,6 @@ 221F589D13AB503F00D603C9 /* CoreVideo.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreVideo.framework; path = System/Library/Frameworks/CoreVideo.framework; sourceTree = SDKROOT; }; 221F589F13AB50F800D603C9 /* CoreMedia.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMedia.framework; path = System/Library/Frameworks/CoreMedia.framework; sourceTree = SDKROOT; }; 221F58A113AB6F8000D603C9 /* pixconv.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pixconv.c; sourceTree = ""; }; - 221F58A313AB708C00D603C9 /* alldescs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = alldescs.h; path = build/iphone/alldescs.h; sourceTree = ""; }; 221F58A513AB716300D603C9 /* tonedetector.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tonedetector.c; sourceTree = ""; }; 221F58A613AB716300D603C9 /* jpegwriter.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = jpegwriter.c; sourceTree = ""; }; 221F58A713AB716300D603C9 /* h264dec.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = h264dec.c; sourceTree = ""; }; @@ -639,6 +641,12 @@ 222CA76311F6CFB100621220 /* sipsetup.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = sipsetup.c; sourceTree = ""; }; 222CA76411F6CFB100621220 /* sipsetup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sipsetup.h; sourceTree = ""; }; 22313679143DED490035C1F4 /* msandroidvideo.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = msandroidvideo.cpp; sourceTree = ""; }; + 22405EDC160065C200B92522 /* basedescs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = basedescs.h; path = build/iphone/basedescs.h; sourceTree = ""; }; + 22405EDF1600668800B92522 /* msvoip.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = msvoip.c; sourceTree = ""; }; + 22405EE1160066C700B92522 /* voipdescs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = voipdescs.h; path = build/iphone/voipdescs.h; sourceTree = ""; }; + 22405EE31600671D00B92522 /* logging.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = logging.c; sourceTree = ""; }; + 22405EE41600671D00B92522 /* rtpprofile.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = rtpprofile.c; sourceTree = ""; }; + 22405EE71600675C00B92522 /* genericplc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = genericplc.c; sourceTree = ""; }; 224AD571143208BB00510FF3 /* android-display.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = "android-display.c"; path = "../../../../../../workspace-android/linphone-android/submodules/linphone/mediastreamer2/src/android-display.c"; sourceTree = ""; }; 224AD57314320EB400510FF3 /* scaler_arm.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; name = scaler_arm.S; path = "../../../../../../workspace-android/linphone-android/submodules/linphone/mediastreamer2/src/scaler_arm.S"; sourceTree = ""; }; 22512698145F13CE0041FBF2 /* aqsnd.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = aqsnd.c; sourceTree = ""; }; @@ -846,8 +854,9 @@ 222CA4CF11F6CF2000621220 /* mediastreamer2 */ = { isa = PBXGroup; children = ( + 22405EE1160066C700B92522 /* voipdescs.h */, + 22405EDC160065C200B92522 /* basedescs.h */, 22B5106813AFD37B00CD87DA /* nowebcamCIF.jpg */, - 221F58A313AB708C00D603C9 /* alldescs.h */, 22DD19E013A8D82C0018ECD4 /* tests */, 222CA5B811F6CF7600621220 /* include */, 222CA5DC11F6CF7600621220 /* src */, @@ -916,6 +925,8 @@ 222CA5DC11F6CF7600621220 /* src */ = { isa = PBXGroup; children = ( + 22405EE71600675C00B92522 /* genericplc.c */, + 22405EDF1600668800B92522 /* msvoip.c */, 221DCB6A153584410025E54D /* yuv2rgb.fs */, 221DCB6B153584410025E54D /* yuv2rgb.vs */, 221DCB6715347EF80025E54D /* opengles_display.c */, @@ -1045,6 +1056,8 @@ 222CA6B611F6CF9F00621220 /* src */ = { isa = PBXGroup; children = ( + 22405EE31600671D00B92522 /* logging.c */, + 22405EE41600671D00B92522 /* rtpprofile.c */, F4D9F23D145710540035B0D0 /* netsim.c */, F4D9F23E145710540035B0D0 /* ortp_srtp.c */, 7014533D13FA841E00A01D86 /* zrtp.c */, @@ -1281,11 +1294,12 @@ 225D64761521BFA6008B2E81 /* linphonecore_utils.h in Headers */, 225D64781521BFA6008B2E81 /* nowebcam.h in Headers */, 225D64791521BFA6008B2E81 /* swscale.h in Headers */, - 225D647A1521BFA6008B2E81 /* alldescs.h in Headers */, 225D647B1521BFA6008B2E81 /* scaler.h in Headers */, 225D647C1521BFA6008B2E81 /* g722.h in Headers */, 225D647D1521BFA6008B2E81 /* shaders.h in Headers */, 225D64811521BFA6008B2E81 /* zrtp.h in Headers */, + 22405EDD160065C200B92522 /* basedescs.h in Headers */, + 22405EE2160066C700B92522 /* voipdescs.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1367,7 +1381,6 @@ 225D65431521C009008B2E81 /* linphonecore_utils.h in Headers */, 225D65451521C009008B2E81 /* nowebcam.h in Headers */, 225D65461521C009008B2E81 /* swscale.h in Headers */, - 225D65471521C009008B2E81 /* alldescs.h in Headers */, 225D65481521C009008B2E81 /* scaler.h in Headers */, 225D65491521C009008B2E81 /* g722.h in Headers */, 225D654A1521C009008B2E81 /* shaders.h in Headers */, @@ -1453,7 +1466,6 @@ 229B9D5913043EAB00EFCD1C /* linphonecore_utils.h in Headers */, 220ED1AC13A9062600AC21E0 /* nowebcam.h in Headers */, 2258C44113A9377B0087A596 /* swscale.h in Headers */, - 221F58A413AB708C00D603C9 /* alldescs.h in Headers */, 221F58E413AF44B300D603C9 /* scaler.h in Headers */, 229A614F13DDFE3500090183 /* g722.h in Headers */, 70E542FA13E14816002BA2C0 /* shaders.h in Headers */, @@ -1658,6 +1670,8 @@ 221DCB6915347EF80025E54D /* opengles_display.c in Sources */, 221DCB6D153584410025E54D /* yuv2rgb.fs in Sources */, 221DCB6F153584410025E54D /* yuv2rgb.vs in Sources */, + 22405EE01600668800B92522 /* msvoip.c in Sources */, + 22405EE81600675C00B92522 /* genericplc.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1690,6 +1704,8 @@ 225D65B41521C009008B2E81 /* zrtp.c in Sources */, 225D65B81521C009008B2E81 /* netsim.c in Sources */, 225D65B91521C009008B2E81 /* ortp_srtp.c in Sources */, + 22405EE51600671D00B92522 /* logging.c in Sources */, + 22405EE61600671D00B92522 /* rtpprofile.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/submodules/linphone b/submodules/linphone index 88703bcc1..800460760 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit 88703bcc139e124598732b0babc762fddff0309c +Subproject commit 8004607607c344a0f1dd09d1854848fca0e52d59 diff --git a/submodules/mssilk b/submodules/mssilk index d3a6a0a13..f9015a91c 160000 --- a/submodules/mssilk +++ b/submodules/mssilk @@ -1 +1 @@ -Subproject commit d3a6a0a130730c0eaf9a0b6ed2fc466432852684 +Subproject commit f9015a91ca056cc5be577dfb78c7c224f1fd77b2 From 5d75afcec8d824584255fce50ee933edcb01e045 Mon Sep 17 00:00:00 2001 From: Yann Diorcet Date: Fri, 14 Sep 2012 11:12:47 +0200 Subject: [PATCH 02/16] Add preview in dialer view on iPad --- Classes/ChatViewController.m | 1 + Classes/DialerViewController.h | 3 + Classes/DialerViewController.m | 49 ++++ Classes/InCallViewController.m | 55 +--- Classes/LinphoneUI/UICamSwitch.m | 13 +- Classes/LinphoneUI/UIChatCell.m | 9 +- Classes/PhoneMainView.m | 30 +++ .../en.lproj/DialerViewController~ipad.xib | 236 +++++++++++++++--- .../fr.lproj/DialerViewController~ipad.xib | 231 ++++++++++++++--- Resources/background_alt.png | Bin 0 -> 5336 bytes linphone.ldb/Contents.plist | 37 ++- .../{2 => 3}/DialerViewController~ipad.xib | 236 +++++++++++++++--- linphone.xcodeproj/project.pbxproj | 6 + 13 files changed, 734 insertions(+), 172 deletions(-) create mode 100644 Resources/background_alt.png rename linphone.ldb/Resources/Classes/DialerViewController~ipad/{2 => 3}/DialerViewController~ipad.xib (89%) diff --git a/Classes/ChatViewController.m b/Classes/ChatViewController.m index 3c1a294a5..ffd9008de 100644 --- a/Classes/ChatViewController.m +++ b/Classes/ChatViewController.m @@ -39,6 +39,7 @@ [tableController release]; [editButton release]; + [addressField release]; [super dealloc]; } diff --git a/Classes/DialerViewController.h b/Classes/DialerViewController.h index ef088b355..c23b7218f 100644 --- a/Classes/DialerViewController.h +++ b/Classes/DialerViewController.h @@ -22,6 +22,7 @@ #import "UICompositeViewController.h" #import "UIEraseButton.h" +#import "UICamSwitch.h" #import "UICallButton.h" #import "UITransferButton.h" #import "UIDigitButton.h" @@ -55,6 +56,8 @@ @property (nonatomic, retain) IBOutlet UIDigitButton* starButton; @property (nonatomic, retain) IBOutlet UIDigitButton* zeroButton; @property (nonatomic, retain) IBOutlet UIDigitButton* sharpButton; +@property (nonatomic, retain) IBOutlet UIView* videoPreview; +@property (nonatomic, retain) IBOutlet UICamSwitch* videoCameraSwitch; - (IBAction)onAddContactClick: (id) event; - (IBAction)onBackClick: (id) event; diff --git a/Classes/DialerViewController.m b/Classes/DialerViewController.m index 707d4a829..9abd60d74 100644 --- a/Classes/DialerViewController.m +++ b/Classes/DialerViewController.m @@ -54,6 +54,9 @@ @synthesize zeroButton; @synthesize sharpButton; +@synthesize videoPreview; +@synthesize videoCameraSwitch; + #pragma mark - Lifecycle Functions - (id)init { @@ -86,6 +89,8 @@ [zeroButton release]; [sharpButton release]; + [videoPreview release]; + [videoCameraSwitch release]; // Remove all observers [[NSNotificationCenter defaultCenter] removeObserver:self]; @@ -130,6 +135,10 @@ static UICompositeViewDescription *compositeDescription = nil; LinphoneCallState state = (call != NULL)?linphone_call_get_state(call): 0; [self callUpdate:call state:state]; } + + if(videoPreview) { + linphone_core_set_native_preview_window_id([LinphoneManager getLc], (unsigned long)videoPreview); + } } - (void)viewWillDisappear:(BOOL)animated { @@ -158,8 +167,48 @@ static UICompositeViewDescription *compositeDescription = nil; [sharpButton setDigit:'#']; [addressField setAdjustsFontSizeToFitWidth:TRUE]; // Not put it in IB: issue with placeholder size + + if([LinphoneManager runningOnIpad]) { + linphone_core_enable_video_preview([LinphoneManager getLc], TRUE); + + if ([LinphoneManager instance].frontCamId != nil) { + // only show camera switch button if we have more than 1 camera + [videoCameraSwitch setHidden:FALSE]; + } + } } +- (void)viewDidUnload { + [super viewDidUnload]; + + if([LinphoneManager runningOnIpad]) { + linphone_core_enable_video_preview([LinphoneManager getLc], FALSE); + } +} + +- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { + [super willAnimateRotationToInterfaceOrientation:toInterfaceOrientation duration:duration]; + CGRect frame = [videoPreview frame]; + switch (toInterfaceOrientation) { + case UIInterfaceOrientationPortrait: + [videoPreview setTransform: CGAffineTransformMakeRotation(0)]; + break; + case UIInterfaceOrientationPortraitUpsideDown: + [videoPreview setTransform: CGAffineTransformMakeRotation(M_PI)]; + break; + case UIInterfaceOrientationLandscapeLeft: + [videoPreview setTransform: CGAffineTransformMakeRotation(-M_PI / 2)]; + break; + case UIInterfaceOrientationLandscapeRight: + [videoPreview setTransform: CGAffineTransformMakeRotation(M_PI / 2)]; + break; + default: + break; + } + [videoPreview setFrame:frame]; +} + + #pragma mark - Event Functions - (void)callUpdateEvent:(NSNotification*)notif { diff --git a/Classes/InCallViewController.m b/Classes/InCallViewController.m index a3a6c0a11..26063c382 100644 --- a/Classes/InCallViewController.m +++ b/Classes/InCallViewController.m @@ -153,11 +153,17 @@ static UICompositeViewDescription *compositeDescription = nil; LinphoneCall* call = linphone_core_get_current_call([LinphoneManager getLc]); LinphoneCallState state = (call != NULL)?linphone_call_get_state(call): 0; [self callUpdate:call state:state animated:FALSE]; - [self orientationUpdate:[PhoneMainView instance].interfaceOrientation]; if ([[UIDevice currentDevice].systemVersion doubleValue] < 5.0) { [callTableController viewDidAppear:animated]; - } + } + + // Set windows (warn memory leaks) + linphone_core_set_native_video_window_id([LinphoneManager getLc], (unsigned long)videoView); + linphone_core_set_native_preview_window_id([LinphoneManager getLc], (unsigned long)videoPreview); + + // Enable tap + [singleFingerTap setEnabled:TRUE]; } - (void)viewDidDisappear:(BOOL)animated { @@ -169,16 +175,15 @@ static UICompositeViewDescription *compositeDescription = nil; if ([[UIDevice currentDevice].systemVersion doubleValue] < 5.0) { [callTableController viewDidDisappear:animated]; - } + } + + // Disable tap + [singleFingerTap setEnabled:FALSE]; } - (void)viewDidLoad { [super viewDidLoad]; - // Set windows (warn memory leaks) - linphone_core_set_native_video_window_id([LinphoneManager getLc],(unsigned long)videoView); - linphone_core_set_native_preview_window_id([LinphoneManager getLc],(unsigned long)videoPreview); - [singleFingerTap setNumberOfTapsRequired:1]; [singleFingerTap setCancelsTouchesInView: FALSE]; [[PhoneMainView instance].view addGestureRecognizer:singleFingerTap]; @@ -196,11 +201,6 @@ static UICompositeViewDescription *compositeDescription = nil; [[PhoneMainView instance].view removeGestureRecognizer:singleFingerTap]; } -- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { - [super willRotateToInterfaceOrientation:toInterfaceOrientation duration:duration]; - [self orientationUpdate:toInterfaceOrientation]; -} - - (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { [super willAnimateRotationToInterfaceOrientation:toInterfaceOrientation duration:duration]; CGRect frame = [videoPreview frame]; @@ -226,35 +226,6 @@ static UICompositeViewDescription *compositeDescription = nil; #pragma mark - -- (void)orientationUpdate:(UIInterfaceOrientation)orientation { - int oldLinphoneOrientation = linphone_core_get_device_rotation([LinphoneManager getLc]); - int newRotation = 0; - switch (orientation) { - case UIInterfaceOrientationPortrait: - newRotation = 0; - break; - case UIInterfaceOrientationPortraitUpsideDown: - newRotation = 180; - break; - case UIInterfaceOrientationLandscapeRight: - newRotation = 270; - break; - case UIInterfaceOrientationLandscapeLeft: - newRotation = 90; - break; - default: - newRotation = oldLinphoneOrientation; - } - if (oldLinphoneOrientation != newRotation) { - linphone_core_set_device_rotation([LinphoneManager getLc], newRotation); - LinphoneCall* call = linphone_core_get_current_call([LinphoneManager getLc]); - if (call && linphone_call_params_video_enabled(linphone_call_get_current_params(call))) { - //Orientation has changed, must call update call - linphone_core_update_call([LinphoneManager getLc], call, NULL); - } - } -} - - (void)callUpdate:(LinphoneCall *)call state:(LinphoneCallState)state animated:(BOOL)animated { // Update table [callTableView reloadData]; @@ -409,7 +380,7 @@ static UICompositeViewDescription *compositeDescription = nil; [videoPreview setHidden:TRUE]; } - if ([LinphoneManager instance].frontCamId !=nil) { + if ([LinphoneManager instance].frontCamId != nil) { // only show camera switch button if we have more than 1 camera [videoCameraSwitch setHidden:FALSE]; } diff --git a/Classes/LinphoneUI/UICamSwitch.m b/Classes/LinphoneUI/UICamSwitch.m index bc4a621c3..8dba965ed 100644 --- a/Classes/LinphoneUI/UICamSwitch.m +++ b/Classes/LinphoneUI/UICamSwitch.m @@ -82,15 +82,14 @@ return; } if (nextCamId != currentCamId) { - [LinphoneLogger logc:LinphoneLoggerLog format:"Switching from [%s] to [%s]",currentCamId,nextCamId]; + [LinphoneLogger logc:LinphoneLoggerLog format:"Switching from [%s] to [%s]", currentCamId, nextCamId]; linphone_core_set_video_device([LinphoneManager getLc], nextCamId); - nextCamId=currentCamId; + nextCamId = currentCamId; currentCamId = linphone_core_get_video_device([LinphoneManager getLc]); - linphone_core_update_call([LinphoneManager getLc] - , linphone_core_get_current_call([LinphoneManager getLc]) - , NULL); - /*linphone_core_set_native_preview_window_id([LinphoneManager getLc], - (unsigned long)preview);*/ + LinphoneCall *call = linphone_core_get_current_call([LinphoneManager getLc]); + if(call != NULL) { + linphone_core_update_call([LinphoneManager getLc], call, NULL); + } } } diff --git a/Classes/LinphoneUI/UIChatCell.m b/Classes/LinphoneUI/UIChatCell.m index dc6100161..3e1057014 100644 --- a/Classes/LinphoneUI/UIChatCell.m +++ b/Classes/LinphoneUI/UIChatCell.m @@ -63,7 +63,14 @@ #pragma mark - Property Funcitons - (void)setChat:(ChatModel *)achat { - chat = achat; + if(chat == achat) + return; + if(chat != nil) { + [chat release]; + } + if(achat) { + chat = [achat retain]; + } [self update]; } diff --git a/Classes/PhoneMainView.m b/Classes/PhoneMainView.m index 9817aaa1c..c451292b0 100644 --- a/Classes/PhoneMainView.m +++ b/Classes/PhoneMainView.m @@ -247,6 +247,7 @@ static PhoneMainView* phoneMainViewInstance=nil; - (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { [super willRotateToInterfaceOrientation:toInterfaceOrientation duration:duration]; [mainViewController willRotateToInterfaceOrientation:toInterfaceOrientation duration:duration]; + [self orientationUpdate:toInterfaceOrientation]; } - (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { @@ -371,6 +372,35 @@ static PhoneMainView* phoneMainViewInstance=nil; #pragma mark - +- (void)orientationUpdate:(UIInterfaceOrientation)orientation { + int oldLinphoneOrientation = linphone_core_get_device_rotation([LinphoneManager getLc]); + int newRotation = 0; + switch (orientation) { + case UIInterfaceOrientationPortrait: + newRotation = 0; + break; + case UIInterfaceOrientationPortraitUpsideDown: + newRotation = 180; + break; + case UIInterfaceOrientationLandscapeRight: + newRotation = 270; + break; + case UIInterfaceOrientationLandscapeLeft: + newRotation = 90; + break; + default: + newRotation = oldLinphoneOrientation; + } + if (oldLinphoneOrientation != newRotation) { + linphone_core_set_device_rotation([LinphoneManager getLc], newRotation); + LinphoneCall* call = linphone_core_get_current_call([LinphoneManager getLc]); + if (call && linphone_call_params_video_enabled(linphone_call_get_current_params(call))) { + //Orientation has changed, must call update call + linphone_core_update_call([LinphoneManager getLc], call, NULL); + } + } +} + - (void)startUp { if ([[LinphoneManager instance] lpConfigBoolForKey:@"enable_first_login_view_preference"] == true) { // Change to fist login view diff --git a/Classes/en.lproj/DialerViewController~ipad.xib b/Classes/en.lproj/DialerViewController~ipad.xib index c4844b21a..26bc622af 100644 --- a/Classes/en.lproj/DialerViewController~ipad.xib +++ b/Classes/en.lproj/DialerViewController~ipad.xib @@ -37,6 +37,73 @@ 292 + + + 301 + {{-1000, -1000}, {2768, 2900}} + + + + _NS:9 + + 3 + MAA + + IBIPadFramework + + + + 274 + {{0, 58}, {768, 842}} + + + + + 3 + MCAwAA + + 1 + IBIPadFramework + + + + -2147483356 + {{0, 77}, {85, 33}} + + + + _NS:9 + NO + + Switch camera + + IBIPadFramework + 0 + 0 + NO + NO + + 3 + MC41AA + + + NSImage + switch_camera_over.png + + + NSImage + switch_camera_default.png + + + 2 + 15 + + + Helvetica-Bold + 15 + 16 + + 290 @@ -104,7 +171,7 @@ {{698, 4}, {70, 51}} - + _NS:9 NO @@ -120,10 +187,7 @@ 15 15 15 - - 3 - MC41AA - + NSImage backspace_over~ipad.png @@ -136,15 +200,8 @@ NSImage backspace_default~ipad.png - - 2 - 15 - - - Helvetica-Bold - 15 - 16 - + + {768, 80} @@ -166,6 +223,22 @@ 268 + + + 274 + {320, 280} + + + + _NS:9 + 2 + NO + IBIPadFramework + + NSImage + background_alt.png + + 292 @@ -200,7 +273,7 @@ 2 15 - + @@ -227,7 +300,7 @@ numpad_two_default.png - + @@ -254,7 +327,7 @@ numpad_three_default.png - + @@ -281,7 +354,7 @@ numpad_four_default.png - + @@ -308,7 +381,7 @@ numpad_five_default.png - + @@ -335,7 +408,7 @@ numpad_six_default.png - + @@ -362,7 +435,7 @@ numpad_seven_default.png - + @@ -389,7 +462,7 @@ numpad_eight_default.png - + @@ -416,7 +489,7 @@ numpad_nine_default.png - + @@ -443,7 +516,7 @@ numpad_star_default.png - + @@ -470,7 +543,7 @@ numpad_zero_default.png - + @@ -497,18 +570,15 @@ numpad_sharp_default.png - + {{0, 640}, {320, 260}} - + _NS:9 - - 3 - MCAwAA - + IBIPadFramework @@ -547,7 +617,7 @@ add_contact_default~ipad.png - + @@ -580,7 +650,7 @@ back_default~ipad.png - + @@ -614,7 +684,7 @@ call_default~ipad.png - + @@ -648,7 +718,7 @@ add_call_default~ipad.png - + @@ -656,7 +726,6 @@ {{126, 0}, {186, 85}} - _NS:9 NO @@ -682,7 +751,7 @@ transfer_call_default~ipad.png - + {{456, 815}, {312, 85}} @@ -701,7 +770,7 @@ {768, 900} - + _NS:9 IBIPadFramework @@ -869,6 +938,22 @@ 69 + + + videoCameraSwitch + + + + 74 + + + + videoPreview + + + + 75 + onAddressChange: @@ -1024,6 +1109,14 @@ 39 + + + preview + + + + 72 + @@ -1051,6 +1144,9 @@ + + + @@ -1083,6 +1179,7 @@ + pad @@ -1218,6 +1315,29 @@ backspaceButton + + 70 + + + preview + + + 71 + + + videoCameraSwitch + + + 73 + + + background + + + 76 + + + @@ -1279,6 +1399,12 @@ UIAddressTextField com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + UICamSwitch + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin UIDigitButton com.apple.InterfaceBuilder.IBCocoaTouchPlugin @@ -1290,7 +1416,7 @@ - 69 + 76 @@ -1335,6 +1461,8 @@ UIDigitButton UITransferButton UIDigitButton + UICamSwitch + UIView UIDigitButton @@ -1410,6 +1538,14 @@ twoButton UIDigitButton + + videoCameraSwitch + UICamSwitch + + + videoPreview + UIView + zeroButton UIDigitButton @@ -1447,6 +1583,25 @@ ./Classes/UICallButton.h + + UICamSwitch + UIButton + + preview + UIView + + + preview + + preview + UIView + + + + IBProjectSource + ./Classes/UICamSwitch.h + + UIDigitButton UILongTouchButton @@ -1532,6 +1687,7 @@ {251, 170} {251, 170} {251, 170} + {640, 561} {81, 43} {81, 43} {81, 43} @@ -1563,6 +1719,8 @@ {220, 113} {220, 113} {220, 113} + {170, 65} + {170, 65} {371, 170} {371, 170} {371, 170} diff --git a/Classes/fr.lproj/DialerViewController~ipad.xib b/Classes/fr.lproj/DialerViewController~ipad.xib index b9b6c98fd..58f381dce 100644 --- a/Classes/fr.lproj/DialerViewController~ipad.xib +++ b/Classes/fr.lproj/DialerViewController~ipad.xib @@ -37,6 +37,70 @@ 292 + + + 301 + {{-1000, -1000}, {2768, 2900}} + + + _NS:9 + + 3 + MAA + + IBIPadFramework + + + + 274 + {{0, 58}, {768, 842}} + + + + 3 + MCAwAA + + 1 + IBIPadFramework + + + + -2147483356 + {{0, 77}, {85, 33}} + + + _NS:9 + NO + + Changer de camera + + IBIPadFramework + 0 + 0 + NO + NO + + 3 + MC41AA + + + NSImage + switch_camera_over.png + + + NSImage + switch_camera_default.png + + + 2 + 15 + + + Helvetica-Bold + 15 + 16 + + 290 @@ -101,7 +165,7 @@ 289 {{698, 4}, {70, 51}} - + _NS:9 NO @@ -117,10 +181,7 @@ 15 15 15 - - 3 - MC41AA - + NSImage backspace_over~ipad.png @@ -133,15 +194,8 @@ NSImage backspace_default~ipad.png - - 2 - 15 - - - Helvetica-Bold - 15 - 16 - + + {768, 80} @@ -162,6 +216,21 @@ 268 + + + 274 + {320, 280} + + + _NS:9 + 2 + NO + IBIPadFramework + + NSImage + background_alt.png + + 292 @@ -195,7 +264,7 @@ 2 15 - + @@ -221,7 +290,7 @@ numpad_two_default.png - + @@ -247,7 +316,7 @@ numpad_three_default.png - + @@ -273,7 +342,7 @@ numpad_four_default.png - + @@ -299,7 +368,7 @@ numpad_five_default.png - + @@ -325,7 +394,7 @@ numpad_six_default.png - + @@ -351,7 +420,7 @@ numpad_seven_default.png - + @@ -377,7 +446,7 @@ numpad_eight_default.png - + @@ -403,7 +472,7 @@ numpad_nine_default.png - + @@ -429,7 +498,7 @@ numpad_star_default.png - + @@ -455,7 +524,7 @@ numpad_zero_default.png - + @@ -481,17 +550,14 @@ numpad_sharp_default.png - + {{0, 640}, {320, 260}} - + _NS:9 - - 3 - MCAwAA - + IBIPadFramework @@ -529,7 +595,7 @@ add_contact_default~ipad.png - + @@ -561,7 +627,7 @@ back_default~ipad.png - + @@ -594,7 +660,7 @@ call_default~ipad.png - + @@ -627,7 +693,7 @@ add_call_default~ipad.png - + @@ -659,7 +725,7 @@ transfer_call_default~ipad.png - + {{456, 815}, {312, 85}} @@ -675,7 +741,7 @@ {768, 900} - + _NS:9 IBIPadFramework @@ -843,6 +909,22 @@ 69 + + + videoCameraSwitch + + + + 74 + + + + videoPreview + + + + 75 + onAddressChange: @@ -998,6 +1080,14 @@ 39 + + + preview + + + + 72 + @@ -1025,6 +1115,9 @@ + + + @@ -1057,6 +1150,7 @@ + pad @@ -1192,6 +1286,29 @@ backspaceButton + + 70 + + + preview + + + 71 + + + videoCameraSwitch + + + 73 + + + background + + + 76 + + + @@ -1253,6 +1370,12 @@ UIAddressTextField com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + UICamSwitch + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin UIDigitButton com.apple.InterfaceBuilder.IBCocoaTouchPlugin @@ -1264,7 +1387,7 @@ - 69 + 76 @@ -1309,6 +1432,8 @@ UIDigitButton UITransferButton UIDigitButton + UICamSwitch + UIView UIDigitButton @@ -1384,6 +1509,14 @@ twoButton UIDigitButton + + videoCameraSwitch + UICamSwitch + + + videoPreview + UIView + zeroButton UIDigitButton @@ -1421,6 +1554,25 @@ ./Classes/UICallButton.h + + UICamSwitch + UIButton + + preview + UIView + + + preview + + preview + UIView + + + + IBProjectSource + ./Classes/UICamSwitch.h + + UIDigitButton UILongTouchButton @@ -1506,6 +1658,7 @@ {251, 170} {251, 170} {251, 170} + {640, 561} {81, 43} {81, 43} {81, 43} @@ -1537,6 +1690,8 @@ {220, 113} {220, 113} {220, 113} + {170, 65} + {170, 65} {371, 170} {371, 170} {371, 170} diff --git a/Resources/background_alt.png b/Resources/background_alt.png new file mode 100644 index 0000000000000000000000000000000000000000..3e178844a6e8cbf6dea249d686ec771d9c70fa91 GIT binary patch literal 5336 zcmbtW3p~?%8~+WJP9^K&u8D4niK!IE+aX7alX^?;OsJKGMCDe_VVcWZk)&{r7sshl zrePWa!dnA_po{)`Mx@1+%-~vn*M`{tq23Evf_bYXWX+YIePRyje)SP?oWd8&51c zj3+BH6YQUDp|k{JFgDs|A4>*r)9Cqmtv02D?`Eo2bYWecR`hK3nTdZQP zq`nAtQB%LGiTQQtSCjjT;Z(Cy#qm)sf0b zvjk$W0R~St)6OoVjE%5H!Xma|7$)%mB%-IM++0I9uPme))dc8U_6P@PhL&E{+06#g zza%7TviK9X`oFvAVlwAgkG+#-FHyB>5AYJxd5rl#p(T!~(ZlXupa< zO9<9KG_-7TVmhDV%Al{+3`Zg>jxJYbzsXKI!eB7$47ed`wJ4vS+Ns|F81Ks44>EF~ zFArjKfO=HZ){{B$$}ZaeA@}0)lS-N4{e(l_e>z4ar4lTw9q?hgn#?*n*O6`QJ@qi@ zlPft$CAu@Yp%wvTEA@0#@bUFli}cU9&?z-1iiyY7v@|_cgbunno3bsA7|0#2|4=&k zG&BmsDxkPF&{dKCD(vIk#z=kd9yX-~kMzHunp?GXLKDN{)vf^Yk#6pWuDcv)Mtpt7 zw!$OxYMwd`7MqN1MV3vKP@|n+9LGuraJB| zcEzh}b-muYwBTF~h_re!t`O?|6Roxo8~dv4a&Z2wZ!GqD^8rpy%%GBNnox|IbYvb+ZeOKY& zzHTM1Gft@lR>w}yLodfcS238@*)yoD+g`y>ORH}l`qOcoUZ#vZ zf-8^CW!+lAy+)t#O7F#DSjx4W)r?(0)_f|XGbG@=v8^qEb*{gh!708&TSYn^cP<^L z7Gva~^GMG*mS$Mfc|w`eQb#u?QBhliOo&9YcI;H9Z<*l!DHFeN^`TbB2zg|cH=&zH zp9m)hZOVSPL1Q{Fz4w=-tEpq1TbG)R^h;M_2IU0c5qZn8u-NnczqaraQ%II^-zx^j zE0v(-j?`~Drhcu-sQSg@kFo9S5WBi?H6-f}MJ_GGw2_{ICl~J3-pSxvYroGvmrn4z z^y#Ep?VYso^$1w5ro;GZqY?kU)9OEM)2yMAvZA7l&DIFfXw;gwi)*Otu1_x>H+@&P zQY38d7P>@qAPuq~9{X1HJP{2qjS%evHVLEBQhSm9>ou{jEpTLtD{CLB&}Kc}!nvn4iptr-2SN=UsL;U9dyNi`bdMkF>3;8NR??Okv5j(Lqc zvuOjRX#b4%ro1ojq=lr^6`erHsrJO{jMiVYk-Tj|HQ+aLkUkD@u9qzFD4URu$Kc^ zwd%~`j8CbPR>vmsMJtd)&5ngXI~j1v^fDD>hBL7ajVWkxWD$uEPMyAPFZ57yZKM}Y zYQrI}#4R`$Uo|6Gr#80`9hQEtqu3O7U@SSS>I2$Yp_0ZF5lt=Se(dKl>v%6Y_JeZu&7Mfo@ghB=M7hKIrX9Z3B-Bb| zMA=v`RbblBMXyOK3Of4;OYZG5;0_3WYZ0FJo(c^N?V^pA-A-*iK_)maecoV0Bb;pf z5H6UQC@USNz7$Me$WF>AIV2}*?q2ZZQ&w7G`mi(#)CfAA5LNM*%EDC4R1h+FXSOV&sLW0@W?K`kf=|{A>29~7I3)h}s zgRE$zyD>4GIOpjeza)FtSfW#JZ*Q;*TQA#7`+XL5D5Aq|6YSS*Qhkh_F2Uq}UFh?% z*KaZ+O80zV3W8i>n>{bz9~ydXQ|xjz{GRjMZIhwIV`QG)8inMFExU%6HIkt=r1!>H z_O_7e6N5DCUK%Ud;?|yO8%j$Wr|&(NbY*9&BMS~ysQ<@vjMh9PXUcGYj2~foV`r>bdMo6XMsRM{SGpOR{pNMu=5kNMCB z!x$dga5j!$xXTWZfJ{d{&n%NT`cX^AerOz>aQKdu@MdDkjq;(raQUb6m<=vmHnB(n zS%})^Y^LRFV==KE6QPXERZM6OeR(ncK9$nhOb;FRDBRGWWxp5dL`F{EF@!8g%=@yK zttw7Y*?Zw;%D^x8A#amQAt}}BV+kqP{$`$`Fy&5zG9SqyWG7Xq)^boX8eq7R=)CXX zU4`zIv2_ERe`}U@y)ymppzP`sJ84Esjf1Dz-6}C?IWydD>bbQoc$e0&(xGw1M~N3! zZv}7%Zp_W~4>;lSK3^po4P{3=d>UV&=yqZ7)AnkN=G1V1e?QC4)|P6zzbP2Ts!T5m z8#iH|7o0ES4f2c+Os7O}df(*v#u6(`O-OC_LE>noi9nk#pWP#q2_Q##rWg^Y4_AVAO#-EUql8E zE?yN0A8E&G6{l@PXW2PG2KdH_-Y#E&K5uHlHwX-B7Kki=kvoI{<_Gu9Ig3dX*?CII z0uA_wJai{(4#an$5`#$St)s24YJ)F`%((%hh`+y(6}(6Tm^;n&=Oir)o-3?`KEB*F zhgT$BQ-2I|kbyR+>@9nrH z0~1h^sG&Q-Xo(WY)c=xeWLVE8BUn61j2Eg7oCY9XvXcC0iO3r-!lcEK?=f^PEu0%w z)S_4WZKV*OkIiv&KvZG_SI7c$oJ6lhO{w$?m_1hMUI*(ogUPT)6Ov^Pysstv`wP|@ z^T3N)tKRX|ZH}EZC z4$pj6j_&3?f~GUf5}E$r!7EeZP2m8{^wc-b^7*$a%@0ZZBViZypKIU^Tol2Q5E(Hm+C@_|c;H4GS`*MA~8lCrI2;<~>;zNosn3MS~Mn zc$PEc^fjW1pG(?VqDXMYu;wp@Fj!=}m&je<*WAo;{ZKdN%+9&Yhlw|bg0sYYauJll6nI5E zOXZ!jvm|zYp-R+&7O5Yn5#XUDM0bM2{2bj0uSDYR2+l8qS}QbJ&r8z6fL{ispY4B zW6AyP@eKUT=$h}-+cry?-9eD zFybfrh9t2?#f1N#fp#$eIfIrrjwifxj-7ozI D!QF&i literal 0 HcmV?d00001 diff --git a/linphone.ldb/Contents.plist b/linphone.ldb/Contents.plist index 70072ae50..3e1f5e832 100644 --- a/linphone.ldb/Contents.plist +++ b/linphone.ldb/Contents.plist @@ -1285,17 +1285,17 @@ backup - 2 + 3 class BLWrapperHandle name - Classes/DialerViewController~ipad/2/DialerViewController~ipad.xib + Classes/DialerViewController~ipad/3/DialerViewController~ipad.xib change date - 2012-09-11T07:20:16Z + 2012-09-14T08:21:20Z changed values class @@ -1305,7 +1305,7 @@ flags 0 hash - fc4e4cbece826acf96d8cbb7d692bf2f + 199b213a86204679336e2f627d919b3d name DialerViewController~ipad.xib @@ -1811,6 +1811,31 @@ snapshots + + change date + 2001-01-01T00:00:00Z + changed values + + class + BLStringKeyObject + comment + Class = "IBUIButton"; accessibilityLabel = "Switch camera"; ObjectID = "71"; + errors + + flags + 0 + key + 71.accessibilityLabel + localizations + + en + Switch camera + fr + Changer de camera + + snapshots + + old objects @@ -1819,9 +1844,9 @@ versions en - 2 + 3 fr - 2 + 3 diff --git a/linphone.ldb/Resources/Classes/DialerViewController~ipad/2/DialerViewController~ipad.xib b/linphone.ldb/Resources/Classes/DialerViewController~ipad/3/DialerViewController~ipad.xib similarity index 89% rename from linphone.ldb/Resources/Classes/DialerViewController~ipad/2/DialerViewController~ipad.xib rename to linphone.ldb/Resources/Classes/DialerViewController~ipad/3/DialerViewController~ipad.xib index c4844b21a..26bc622af 100644 --- a/linphone.ldb/Resources/Classes/DialerViewController~ipad/2/DialerViewController~ipad.xib +++ b/linphone.ldb/Resources/Classes/DialerViewController~ipad/3/DialerViewController~ipad.xib @@ -37,6 +37,73 @@ 292 + + + 301 + {{-1000, -1000}, {2768, 2900}} + + + + _NS:9 + + 3 + MAA + + IBIPadFramework + + + + 274 + {{0, 58}, {768, 842}} + + + + + 3 + MCAwAA + + 1 + IBIPadFramework + + + + -2147483356 + {{0, 77}, {85, 33}} + + + + _NS:9 + NO + + Switch camera + + IBIPadFramework + 0 + 0 + NO + NO + + 3 + MC41AA + + + NSImage + switch_camera_over.png + + + NSImage + switch_camera_default.png + + + 2 + 15 + + + Helvetica-Bold + 15 + 16 + + 290 @@ -104,7 +171,7 @@ {{698, 4}, {70, 51}} - + _NS:9 NO @@ -120,10 +187,7 @@ 15 15 15 - - 3 - MC41AA - + NSImage backspace_over~ipad.png @@ -136,15 +200,8 @@ NSImage backspace_default~ipad.png - - 2 - 15 - - - Helvetica-Bold - 15 - 16 - + + {768, 80} @@ -166,6 +223,22 @@ 268 + + + 274 + {320, 280} + + + + _NS:9 + 2 + NO + IBIPadFramework + + NSImage + background_alt.png + + 292 @@ -200,7 +273,7 @@ 2 15 - + @@ -227,7 +300,7 @@ numpad_two_default.png - + @@ -254,7 +327,7 @@ numpad_three_default.png - + @@ -281,7 +354,7 @@ numpad_four_default.png - + @@ -308,7 +381,7 @@ numpad_five_default.png - + @@ -335,7 +408,7 @@ numpad_six_default.png - + @@ -362,7 +435,7 @@ numpad_seven_default.png - + @@ -389,7 +462,7 @@ numpad_eight_default.png - + @@ -416,7 +489,7 @@ numpad_nine_default.png - + @@ -443,7 +516,7 @@ numpad_star_default.png - + @@ -470,7 +543,7 @@ numpad_zero_default.png - + @@ -497,18 +570,15 @@ numpad_sharp_default.png - + {{0, 640}, {320, 260}} - + _NS:9 - - 3 - MCAwAA - + IBIPadFramework @@ -547,7 +617,7 @@ add_contact_default~ipad.png - + @@ -580,7 +650,7 @@ back_default~ipad.png - + @@ -614,7 +684,7 @@ call_default~ipad.png - + @@ -648,7 +718,7 @@ add_call_default~ipad.png - + @@ -656,7 +726,6 @@ {{126, 0}, {186, 85}} - _NS:9 NO @@ -682,7 +751,7 @@ transfer_call_default~ipad.png - + {{456, 815}, {312, 85}} @@ -701,7 +770,7 @@ {768, 900} - + _NS:9 IBIPadFramework @@ -869,6 +938,22 @@ 69 + + + videoCameraSwitch + + + + 74 + + + + videoPreview + + + + 75 + onAddressChange: @@ -1024,6 +1109,14 @@ 39 + + + preview + + + + 72 + @@ -1051,6 +1144,9 @@ + + + @@ -1083,6 +1179,7 @@ + pad @@ -1218,6 +1315,29 @@ backspaceButton + + 70 + + + preview + + + 71 + + + videoCameraSwitch + + + 73 + + + background + + + 76 + + + @@ -1279,6 +1399,12 @@ UIAddressTextField com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + UICamSwitch + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin UIDigitButton com.apple.InterfaceBuilder.IBCocoaTouchPlugin @@ -1290,7 +1416,7 @@ - 69 + 76 @@ -1335,6 +1461,8 @@ UIDigitButton UITransferButton UIDigitButton + UICamSwitch + UIView UIDigitButton @@ -1410,6 +1538,14 @@ twoButton UIDigitButton + + videoCameraSwitch + UICamSwitch + + + videoPreview + UIView + zeroButton UIDigitButton @@ -1447,6 +1583,25 @@ ./Classes/UICallButton.h + + UICamSwitch + UIButton + + preview + UIView + + + preview + + preview + UIView + + + + IBProjectSource + ./Classes/UICamSwitch.h + + UIDigitButton UILongTouchButton @@ -1532,6 +1687,7 @@ {251, 170} {251, 170} {251, 170} + {640, 561} {81, 43} {81, 43} {81, 43} @@ -1563,6 +1719,8 @@ {220, 113} {220, 113} {220, 113} + {170, 65} + {170, 65} {371, 170} {371, 170} {371, 170} diff --git a/linphone.xcodeproj/project.pbxproj b/linphone.xcodeproj/project.pbxproj index 60e1d94c3..224701b1c 100755 --- a/linphone.xcodeproj/project.pbxproj +++ b/linphone.xcodeproj/project.pbxproj @@ -778,6 +778,8 @@ D389363B15A6D53200A3A3AA /* chat_bubble_outgoing.9.png in Resources */ = {isa = PBXBuildFile; fileRef = D389363815A6D53200A3A3AA /* chat_bubble_outgoing.9.png */; }; D38D14AF15A30B3D008497E8 /* cell_call_first_highlight.png in Resources */ = {isa = PBXBuildFile; fileRef = D38D14AD15A30B3D008497E8 /* cell_call_first_highlight.png */; }; D38D14B115A30B3D008497E8 /* cell_call_highlight.png in Resources */ = {isa = PBXBuildFile; fileRef = D38D14AE15A30B3D008497E8 /* cell_call_highlight.png */; }; + D3998D0416031937009DD22C /* background_alt.png in Resources */ = {isa = PBXBuildFile; fileRef = D3998D0316031937009DD22C /* background_alt.png */; }; + D3998D0516031937009DD22C /* background_alt.png in Resources */ = {isa = PBXBuildFile; fileRef = D3998D0316031937009DD22C /* background_alt.png */; }; D3A55FBC15877E5E003FD403 /* UIContactCell.m in Sources */ = {isa = PBXBuildFile; fileRef = D3A55FBB15877E5E003FD403 /* UIContactCell.m */; }; D3A55FBD15877E5E003FD403 /* UIContactCell.m in Sources */ = {isa = PBXBuildFile; fileRef = D3A55FBB15877E5E003FD403 /* UIContactCell.m */; }; D3A55FBF15877E69003FD403 /* UIContactCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = D3A55FBE15877E69003FD403 /* UIContactCell.xib */; }; @@ -1807,6 +1809,7 @@ D389363815A6D53200A3A3AA /* chat_bubble_outgoing.9.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = chat_bubble_outgoing.9.png; path = Resources/chat_bubble_outgoing.9.png; sourceTree = ""; }; D38D14AD15A30B3D008497E8 /* cell_call_first_highlight.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = cell_call_first_highlight.png; path = Resources/cell_call_first_highlight.png; sourceTree = ""; }; D38D14AE15A30B3D008497E8 /* cell_call_highlight.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = cell_call_highlight.png; path = Resources/cell_call_highlight.png; sourceTree = ""; }; + D3998D0316031937009DD22C /* background_alt.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = background_alt.png; path = Resources/background_alt.png; sourceTree = ""; }; D3A55FBA15877E5E003FD403 /* UIContactCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIContactCell.h; sourceTree = ""; }; D3A55FBB15877E5E003FD403 /* UIContactCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UIContactCell.m; sourceTree = ""; }; D3A55FBE15877E69003FD403 /* UIContactCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = UIContactCell.xib; sourceTree = ""; }; @@ -2735,6 +2738,7 @@ D3211BBD159CBFD60098460B /* back_over.png */, D3A74E6615C69392001500B9 /* back_over~ipad.png */, D3ED3E401585FB4A006C0DE4 /* background.png */, + D3998D0316031937009DD22C /* background_alt.png */, D3A74E6715C69392001500B9 /* background_top~ipad.png */, D3ED3E7615861B1B006C0DE4 /* backspace_default.png */, D3A74E6815C69392001500B9 /* backspace_default~ipad.png */, @@ -3845,6 +3849,7 @@ D381885615FE448400C3EDCA /* UICallBar~ipad.xib in Resources */, D3ED40241602257400BF332B /* chat_background.9.png in Resources */, D3ED40261602257400BF332B /* chat_background.9@2x.png in Resources */, + D3998D0416031937009DD22C /* background_alt.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -4295,6 +4300,7 @@ D381885715FE448400C3EDCA /* UICallBar~ipad.xib in Resources */, D3ED40251602257400BF332B /* chat_background.9.png in Resources */, D3ED40271602257400BF332B /* chat_background.9@2x.png in Resources */, + D3998D0516031937009DD22C /* background_alt.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; From e4b6d3bc00a835278c363b5ba9733d406f68f127 Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Fri, 14 Sep 2012 11:58:26 +0200 Subject: [PATCH 03/16] fix localization --- Classes/fr.lproj/ChatRoomViewController.xib | 190 +++++- Resources/en.lproj/Localizable.strings | Bin 13566 -> 16702 bytes Resources/fr.lproj/Localizable.strings | Bin 14020 -> 17176 bytes linphone.ldb/Contents.plist | 631 ++++++++++++++++-- .../{11 => 12}/ChatRoomViewController.xib | 194 +++++- .../Localizable/1/Localizable.strings | Bin 13566 -> 16702 bytes 6 files changed, 951 insertions(+), 64 deletions(-) rename linphone.ldb/Resources/Classes/ChatRoomViewController/{11 => 12}/ChatRoomViewController.xib (82%) diff --git a/Classes/fr.lproj/ChatRoomViewController.xib b/Classes/fr.lproj/ChatRoomViewController.xib index d529292f6..925eb238d 100644 --- a/Classes/fr.lproj/ChatRoomViewController.xib +++ b/Classes/fr.lproj/ChatRoomViewController.xib @@ -15,6 +15,7 @@ IBUIImageView IBUILabel IBProxyObject + IBUIProgressView IBUITapGestureRecognizer IBUITableViewController IBUITableView @@ -134,7 +135,7 @@ _NS:9 - + 3 MQA @@ -248,6 +249,77 @@ IBCocoaTouchFramework + + + 292 + + + + 292 + {{238, 11}, {62, 37}} + + _NS:9 + NO + IBCocoaTouchFramework + 0 + 0 + 1 + cancel + + + 1 + MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + + + + + + + + 292 + {{7, 25}, {213, 9}} + + + _NS:9 + NO + IBCocoaTouchFramework + 0.5 + + + {320, 59} + + + _NS:9 + + 3 + MQA + + 2 + + + IBCocoaTouchFramework + + + + 292 + {{6, 11}, {50, 37}} + + _NS:9 + NO + IBCocoaTouchFramework + 0 + 0 + 1 + Pict + + + 1 + MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + + + + + {{0, 357}, {320, 59}} @@ -482,6 +554,38 @@ 71 + + + transfertView + + + + 76 + + + + cancelTransfertButton + + + + 77 + + + + imageTransferProgressBar + + + + 79 + + + + pictButton + + + + 80 + dataSource @@ -551,6 +655,24 @@ 62 + + + onPictClick: + + + 7 + + 81 + + + + onTransferCancelClick: + + + 7 + + 78 + @@ -669,6 +791,8 @@ + + footerView @@ -713,6 +837,34 @@ messageField + + 72 + + + + + + + transferView + + + 75 + + + cancel + + + 74 + + + progressBar + + + 73 + + + pictureButton + @@ -742,6 +894,10 @@ 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 com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin @@ -751,7 +907,7 @@ - 71 + 81 @@ -771,7 +927,9 @@ id id id + id id + id @@ -790,25 +948,37 @@ onMessageChange: id + + onPictClick: + id + onSendClick: id + + onTransferCancelClick: + id + UILabel UIImageView + UIButton UIView UIToggleButton UIImageView UIView UIView + UIProgressView UITapGestureRecognizer UIImageView HPGrowingTextView UIView + UIButton UIButton ChatRoomTableViewController + UIView @@ -819,6 +989,10 @@ avatarImage UIImageView + + cancelTransfertButton + UIButton + chatView UIView @@ -839,6 +1013,10 @@ headerView UIView + + imageTransferProgressBar + UIProgressView + listTapGestureRecognizer UITapGestureRecognizer @@ -855,6 +1033,10 @@ messageView UIView + + pictButton + UIButton + sendButton UIButton @@ -863,6 +1045,10 @@ tableController ChatRoomTableViewController + + transfertView + UIView + IBProjectSource diff --git a/Resources/en.lproj/Localizable.strings b/Resources/en.lproj/Localizable.strings index 7bb5ecb9f7486359e18aa4a353367318225cc2b2..d2123bd9c9fbc02cbcbd192765c91a1d87243990 100644 GIT binary patch delta 1421 zcmb_cO=}ZT6n!(brcMUY2Ac28OC<%}NQ59&>j%0ihy*NF4Hd_BtdY!gn2ADn;?j-C z1-FXp;MWwF{RtJ^E4Yy?t7{R@dov-UX^I*dGIMj^z4x7W&w2MpbMv9{`h`l{%CzEB zO0D62P`O6+F^xLvOZ*B&&f08^adw$m%wzXilP$xVhG&j(dZr#u?GQn4Dvh8%c71Qr zmT6`$0pIh?WRaJudV}i8Jwa#RekCvJwtfqAL9l1t$0)1{LEPsV$#0n9P+1+u3R1WRN z2-#KL3ce@LCiANxWKA|a(g+xxXVOcrDob=C{e?C%3rB5`uqx^B@peE>Jbqx6K2J61 zX(mUmF+tt*Bt0^2lAD=KL`|lT>EgJwh4#eCxqkb7sbO*K6^J2h!a7ji15VCdc1KD> zsJsR7+=4e02x|U^DgyaLwo{(R&KzR3@Ywir7GmJo-^9(bsGKtr9JT{-mQ%;+(~R~H zSzC##!AAD9TC+q^dBl+MCJL{_+I$JC0}=GKU{bCy73hTv3TdT_^t^PJwzEg*L8%p7 zF*cQxL)sOqTp!xfCq{#A9MS_`emlM>uIaMuii^GrOE4m?t{<@zn>8peX3!tx$mz2+ z)75GVl1e9<4;<+p9wE=Z*al+gao(Kmd3&>E_uN>N$PV6BPbrl}sUim_bD;G8hQIj5 KybZn`)77676E(>I delta 147 zcmdnj#P~0B!y=~1cUZV4$1$&)tjB7$S%y`LZSw|h0mjLB0vwYwcm*~G@hUKGjuG_Y zo~$7IWO5yEz~l#VvnER^uG*}mY{xWNOigMtkD3eP1JhBSsuhP=s})pU_~ u@72~$j#Ji}Y@m@d`GvaN<^T;Yrp+I;_OWhGF?_g@-KN@R7T>9(CbjXzq#NW=i@I>Bk`sK2 zR1chV)s;nAm@nX)r6M))vGCBr!v^k}v;y}w=MPr65Q_$LqZ39F5n$|h^8lhl4gN5* z928<@gMY>1SKEkV!Qj(fm8p$*Ce9MsQKuGSyEsWcSMsQPjiA?;pv0N@;i5^lvhR*7 zg=t$8AcPbB%SXIA@>}>XT(vkKUlwGg-4O)Ye}L=qa9p~P|HRd~;apkZ=?@$Q`S|I0 zss`HDRa?R?mq_1w(q* z!aH4x)~~2TWrzaK+7ABxoSS@+DIuF!9eiA+Je}7BZVLrFyqV98$Q1NAb>z&Yu)30( zFY$DNNKeED5T5`-nLH1toHpmGQyt^cN3^Hn11UM&_o{jt2mu+pvft%9Q=(@#dHnyg79! F@*6|uFUtS` delta 156 zcmbQy#&{%m!xE;+e#}QUKVmt;w%LG3ig9uQAIIi%ybg?$4+wE>RuDSJJvmG6*5oyE zL6i3=2uwCp=$LG!v}UuOiV@T1e`;xrljo>Q@uo1OGNdtNGUNg2l*zuT;*%e!i*ctg zyo8EoPHc>voS+dfIZj1uvWsTUYpa H6k-AZEnYS> diff --git a/linphone.ldb/Contents.plist b/linphone.ldb/Contents.plist index 70072ae50..7cb75514b 100644 --- a/linphone.ldb/Contents.plist +++ b/linphone.ldb/Contents.plist @@ -12,7 +12,9 @@ change date 2001-01-01T00:00:00Z changed values - + + fr + class BLBundleObject errors @@ -212,19 +214,21 @@ backup - 11 + 12 class BLWrapperHandle name - Classes/ChatRoomViewController/11/ChatRoomViewController.xib + Classes/ChatRoomViewController/12/ChatRoomViewController.xib change date - 2012-09-13T16:01:39Z + 2012-09-14T08:42:01Z changed values - + + fr + class BLNibFileObject errors @@ -232,7 +236,7 @@ flags 0 hash - 1017e47ad2fcb46b91d384f53e88bb41 + fe17a7cc443845e0f73af8ee35e892e5 name ChatRoomViewController.xib @@ -386,6 +390,60 @@ snapshots + + change date + 2001-01-01T00:00:00Z + changed values + + fr + + class + BLStringKeyObject + comment + Class = "IBUIButton"; normalTitle = "Pict"; ObjectID = "73"; + errors + + flags + 0 + key + 73.normalTitle + localizations + + en + Pict + fr + Img + + snapshots + + + + change date + 2001-01-01T00:00:00Z + changed values + + fr + + class + BLStringKeyObject + comment + Class = "IBUIButton"; normalTitle = "cancel"; ObjectID = "75"; + errors + + flags + 0 + key + 75.normalTitle + localizations + + en + cancel + fr + Annuler + + snapshots + + old objects @@ -443,9 +501,9 @@ versions en - 11 + 12 fr - 11 + 12 @@ -7135,7 +7193,7 @@ change date - 2012-09-11T10:28:55Z + 2012-09-14T09:51:58Z changed values class @@ -7145,7 +7203,7 @@ flags 0 hash - e6f2d74fc56bbbdbcee0adb3a997cc4c + 7fcce4bdc516e1d8f77ce093860a38dd name Localizable.strings @@ -7254,6 +7312,34 @@ La cause était: %2$@ snapshots + + change date + 2001-01-01T00:00:00Z + changed values + + class + BLStringKeyObject + comment + No comment provided by engineer. + errors + + flags + 0 + key + %@ +Reason was: %s + localizations + + en + %1$@ +Reason was: %2$s + fr + %1$@ +Raison: %2$s + + snapshots + + change date 2001-01-01T00:00:00Z @@ -7279,6 +7365,31 @@ La cause était: %2$@ snapshots + + change date + 2001-01-01T00:00:00Z + changed values + + class + BLStringKeyObject + comment + No comment provided by engineer. + errors + + flags + 0 + key + '%@' not registered to Service + localizations + + en + '%@' not registered to Service + fr + '%@' n'est pas enregistré + + snapshots + + change date 2001-01-01T00:00:00Z @@ -7504,6 +7615,31 @@ La cause était: %2$@ snapshots + + change date + 2001-01-01T00:00:00Z + changed values + + class + BLStringKeyObject + comment + No comment provided by engineer. + errors + + flags + 0 + key + Camera + localizations + + en + Camera + fr + Appareil photo + + snapshots + + change date 2001-01-01T00:00:00Z @@ -7529,6 +7665,31 @@ La cause était: %2$@ snapshots + + change date + 2001-01-01T00:00:00Z + changed values + + class + BLStringKeyObject + comment + No comment provided by engineer. + errors + + flags + 0 + key + Cancel + localizations + + en + Cancel + fr + Annuler + + snapshots + + change date 2001-01-01T00:00:00Z @@ -7579,6 +7740,81 @@ La cause était: %2$@ snapshots + + change date + 2001-01-01T00:00:00Z + changed values + + class + BLStringKeyObject + comment + No comment provided by engineer. + errors + + flags + 0 + key + Cannot transfert file from remote pary + localizations + + en + Cannot transfert file from remote pary + fr + Impossible de transferer depuis destinataire + + snapshots + + + + change date + 2001-01-01T00:00:00Z + changed values + + class + BLStringKeyObject + comment + No comment provided by engineer. + errors + + flags + 0 + key + Cannot transfert file from remote pary + localizations + + en + Cannot transfert file from remote pary + fr + Impossible de transferer depuis destinataire + + snapshots + + + + change date + 2001-01-01T00:00:00Z + changed values + + class + BLStringKeyObject + comment + No comment provided by engineer. + errors + + flags + 0 + key + Cannot transfert file to remote pary + localizations + + en + Cannot transfert file to remote pary + fr + Impossible de transferer au destinataire + + snapshots + + change date 2001-01-01T00:00:00Z @@ -7904,6 +8140,31 @@ La cause était: %2$@ snapshots + + change date + 2001-01-01T00:00:00Z + changed values + + class + BLStringKeyObject + comment + No comment provided by engineer. + errors + + flags + 0 + key + Ignore + localizations + + en + Ignore + fr + Ignoner + + snapshots + + change date 2001-01-01T00:00:00Z @@ -7954,6 +8215,31 @@ La cause était: %2$@ snapshots + + change date + 2001-01-01T00:00:00Z + changed values + + class + BLStringKeyObject + comment + No comment provided by engineer. + errors + + flags + 0 + key + Image sent + localizations + + en + Image sent + fr + Image envoyé + + snapshots + + change date 2001-01-01T00:00:00Z @@ -7979,6 +8265,56 @@ La cause était: %2$@ snapshots + + change date + 2001-01-01T00:00:00Z + changed values + + class + BLStringKeyObject + comment + No comment provided by engineer. + errors + + flags + 0 + key + Incoming file + localizations + + en + Incoming file + fr + Fichier entrant + + snapshots + + + + change date + 2001-01-01T00:00:00Z + changed values + + class + BLStringKeyObject + comment + No comment provided by engineer. + errors + + flags + 0 + key + Incoming file stored to your photo library + localizations + + en + Incoming file stored to your photo library + fr + Fichier entrant stocké + + snapshots + + change date 2001-01-01T00:00:00Z @@ -8004,6 +8340,31 @@ La cause était: %2$@ snapshots + + change date + 2001-01-01T00:00:00Z + changed values + + class + BLStringKeyObject + comment + No comment provided by engineer. + errors + + flags + 0 + key + It seems you have not configured any proxy server from settings + localizations + + en + It seems you have not configured any proxy server from settings + fr + Il semble qu'il n'y est pas de serveur SIP configuré + + snapshots + + change date 2001-01-01T00:00:00Z @@ -8102,6 +8463,31 @@ La cause était: %2$@ snapshots + + change date + 2001-01-01T00:00:00Z + changed values + + class + BLStringKeyObject + comment + No comment provided by engineer. + errors + + flags + 0 + key + Never remind + localizations + + en + Never remind + fr + Ne pas me rappeler + + snapshots + + change date 2001-01-01T00:00:00Z @@ -8152,31 +8538,6 @@ La cause était: %2$@ snapshots - - change date - 2001-01-01T00:00:00Z - changed values - - class - BLStringKeyObject - comment - No comment provided by engineer. - errors - - flags - 0 - key - No SIP account defined - localizations - - en - No SIP account defined - fr - Aucun compte SIP défini - - snapshots - - change date 2001-01-01T00:00:00Z @@ -8202,31 +8563,6 @@ La cause était: %2$@ snapshots - - change date - 2001-01-01T00:00:00Z - changed values - - class - BLStringKeyObject - comment - InAppSettingsKit - errors - - flags - 0 - key - OK - localizations - - en - OK - fr - OK - - snapshots - - change date 2001-01-01T00:00:00Z @@ -8252,6 +8588,31 @@ La cause était: %2$@ snapshots + + change date + 2001-01-01T00:00:00Z + changed values + + class + BLStringKeyObject + comment + InAppSettingsKit + errors + + flags + 0 + key + OK + localizations + + en + OK + fr + OK + + snapshots + + change date 2001-01-01T00:00:00Z @@ -8327,6 +8688,31 @@ La cause était: %2$@ snapshots + + change date + 2001-01-01T00:00:00Z + changed values + + class + BLStringKeyObject + comment + No comment provided by engineer. + errors + + flags + 0 + key + Photo library + localizations + + en + Photo library + fr + Photos + + snapshots + + change date 2001-01-01T00:00:00Z @@ -8477,6 +8863,31 @@ La cause était: %2$@ snapshots + + change date + 2001-01-01T00:00:00Z + changed values + + class + BLStringKeyObject + comment + No comment provided by engineer. + errors + + flags + 0 + key + Select picture source + localizations + + en + Select picture source + fr + Selectionner une source d'image + + snapshots + + change date 2001-01-01T00:00:00Z @@ -8783,6 +9194,56 @@ La cause était: %2$@ snapshots + + change date + 2001-01-01T00:00:00Z + changed values + + class + BLStringKeyObject + comment + No comment provided by engineer. + errors + + flags + 0 + key + Tranfer error + localizations + + en + Tranfer error + fr + Erreur de transfert + + snapshots + + + + change date + 2001-01-01T00:00:00Z + changed values + + class + BLStringKeyObject + comment + No comment provided by engineer. + errors + + flags + 0 + key + Transfer error + localizations + + en + Transfer error + fr + Erreur de transfert + + snapshots + + change date 2001-01-01T00:00:00Z @@ -8833,6 +9294,31 @@ La cause était: %2$@ snapshots + + change date + 2001-01-01T00:00:00Z + changed values + + class + BLStringKeyObject + comment + No comment provided by engineer. + errors + + flags + 0 + key + Warning + localizations + + en + Warning + fr + Attention + + snapshots + + change date 2001-01-01T00:00:00Z @@ -8939,6 +9425,31 @@ La cause était: %2$@ snapshots + + change date + 2001-01-01T00:00:00Z + changed values + + class + BLStringKeyObject + comment + No comment provided by engineer. + errors + + flags + 0 + key + No SIP account defined + localizations + + en + No SIP account defined + fr + Aucun compte SIP défini + + snapshots + + plist file diff --git a/linphone.ldb/Resources/Classes/ChatRoomViewController/11/ChatRoomViewController.xib b/linphone.ldb/Resources/Classes/ChatRoomViewController/12/ChatRoomViewController.xib similarity index 82% rename from linphone.ldb/Resources/Classes/ChatRoomViewController/11/ChatRoomViewController.xib rename to linphone.ldb/Resources/Classes/ChatRoomViewController/12/ChatRoomViewController.xib index 76a72edf1..dd7c2c6ba 100644 --- a/linphone.ldb/Resources/Classes/ChatRoomViewController/11/ChatRoomViewController.xib +++ b/linphone.ldb/Resources/Classes/ChatRoomViewController/12/ChatRoomViewController.xib @@ -15,6 +15,7 @@ IBUIButton IBUIImageView IBUILabel + IBUIProgressView IBUITableView IBUITableViewController IBUITapGestureRecognizer @@ -139,7 +140,7 @@ _NS:9 - + 3 MQA @@ -258,6 +259,81 @@ IBCocoaTouchFramework + + + 292 + + + + 292 + {{238, 11}, {62, 37}} + + + _NS:9 + NO + IBCocoaTouchFramework + 0 + 0 + 1 + cancel + + + 1 + MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + + + + + + + + 292 + {{7, 25}, {213, 9}} + + + + _NS:9 + NO + IBCocoaTouchFramework + 0.5 + + + {320, 59} + + + + _NS:9 + + 3 + MQA + + 2 + + + IBCocoaTouchFramework + + + + 292 + {{6, 11}, {50, 37}} + + + _NS:9 + NO + IBCocoaTouchFramework + 0 + 0 + 1 + Pict + + + 1 + MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + + + + + {{0, 357}, {320, 59}} @@ -500,6 +576,38 @@ 71 + + + transfertView + + + + 76 + + + + cancelTransfertButton + + + + 77 + + + + imageTransferProgressBar + + + + 79 + + + + pictButton + + + + 80 + dataSource @@ -569,6 +677,24 @@ 62 + + + onPictClick: + + + 7 + + 81 + + + + onTransferCancelClick: + + + 7 + + 78 + @@ -687,6 +813,8 @@ + + footerView @@ -731,6 +859,34 @@ messageField + + 72 + + + + + + + transferView + + + 75 + + + cancel + + + 74 + + + progressBar + + + 73 + + + pictureButton + @@ -760,6 +916,10 @@ 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 com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin @@ -769,7 +929,7 @@ - 71 + 81 @@ -789,7 +949,9 @@ id id id + id id + id @@ -808,25 +970,37 @@ onMessageChange: id + + onPictClick: + id + onSendClick: id + + onTransferCancelClick: + id + UILabel UIImageView + UIButton UIView UIToggleButton UIImageView UIView UIView + UIProgressView UITapGestureRecognizer UIImageView HPGrowingTextView UIView + UIButton UIButton ChatRoomTableViewController + UIView @@ -837,6 +1011,10 @@ avatarImage UIImageView + + cancelTransfertButton + UIButton + chatView UIView @@ -857,6 +1035,10 @@ headerView UIView + + imageTransferProgressBar + UIProgressView + listTapGestureRecognizer UITapGestureRecognizer @@ -873,6 +1055,10 @@ messageView UIView + + pictButton + UIButton + sendButton UIButton @@ -881,6 +1067,10 @@ tableController ChatRoomTableViewController + + transfertView + UIView + IBProjectSource diff --git a/linphone.ldb/Resources/Resources/Localizable/1/Localizable.strings b/linphone.ldb/Resources/Resources/Localizable/1/Localizable.strings index 7bb5ecb9f7486359e18aa4a353367318225cc2b2..d2123bd9c9fbc02cbcbd192765c91a1d87243990 100644 GIT binary patch delta 1421 zcmb_cO=}ZT6n!(brcMUY2Ac28OC<%}NQ59&>j%0ihy*NF4Hd_BtdY!gn2ADn;?j-C z1-FXp;MWwF{RtJ^E4Yy?t7{R@dov-UX^I*dGIMj^z4x7W&w2MpbMv9{`h`l{%CzEB zO0D62P`O6+F^xLvOZ*B&&f08^adw$m%wzXilP$xVhG&j(dZr#u?GQn4Dvh8%c71Qr zmT6`$0pIh?WRaJudV}i8Jwa#RekCvJwtfqAL9l1t$0)1{LEPsV$#0n9P+1+u3R1WRN z2-#KL3ce@LCiANxWKA|a(g+xxXVOcrDob=C{e?C%3rB5`uqx^B@peE>Jbqx6K2J61 zX(mUmF+tt*Bt0^2lAD=KL`|lT>EgJwh4#eCxqkb7sbO*K6^J2h!a7ji15VCdc1KD> zsJsR7+=4e02x|U^DgyaLwo{(R&KzR3@Ywir7GmJo-^9(bsGKtr9JT{-mQ%;+(~R~H zSzC##!AAD9TC+q^dBl+MCJL{_+I$JC0}=GKU{bCy73hTv3TdT_^t^PJwzEg*L8%p7 zF*cQxL)sOqTp!xfCq{#A9MS_`emlM>uIaMuii^GrOE4m?t{<@zn>8peX3!tx$mz2+ z)75GVl1e9<4;<+p9wE=Z*al+gao(Kmd3&>E_uN>N$PV6BPbrl}sUim_bD;G8hQIj5 KybZn`)77676E(>I delta 147 zcmdnj#P~0B!y=~1cUZV4$1$&)tjB7$S%y`LZSw|h0mjLB0vwYwcm*~G@hUKGjuG_Y zo~$7IWO5yEz~l#VvnER^uG*}mY{xWNOigMtkD3eP1JhBSsuhP=s})pU_~ u@72~$j#Ji}Y@m@d`GvaN<^T;Yrp+I;_OWhGF?_ Date: Fri, 14 Sep 2012 16:51:41 +0200 Subject: [PATCH 04/16] Improve ChatRoomView --- Classes/ChatRoomViewController.h | 17 +- Classes/ChatRoomViewController.m | 435 ++++++------ ...ViewController.h => ImageViewController.h} | 12 +- Classes/ImageViewController.m | 71 ++ Classes/ImageViewerViewController.m | 62 -- Classes/PhoneMainView.h | 1 + Classes/Utils/DTFoundation/DTActionSheet.h | 49 ++ Classes/Utils/DTFoundation/DTActionSheet.m | 191 ++++++ Classes/en.lproj/ChatRoomViewController.xib | 335 +++++---- Classes/en.lproj/ChatViewController.xib | 10 +- Classes/en.lproj/HistoryViewController.xib | 2 +- Classes/en.lproj/ImageViewController.xib | 299 ++++++++ Classes/fr.lproj/ChatRoomViewController.xib | 325 +++++---- Classes/fr.lproj/ChatViewController.xib | 10 +- Classes/fr.lproj/HistoryViewController.xib | 5 +- .../ImageViewController.xib} | 217 +++--- Resources/en.lproj/Localizable.strings | Bin 16702 -> 15680 bytes Resources/fr.lproj/Localizable.strings | Bin 17176 -> 16172 bytes Settings/InAppSettings.bundle/Advanced.plist | 2 +- .../en.lproj/Advanced.strings | 3 + .../fr.lproj/Advanced.strings | 3 + linphone.ldb/Contents.plist | 649 ++++++++++++------ .../{12 => 15}/ChatRoomViewController.xib | 335 +++++---- .../{2 => 3}/ChatViewController.xib | 10 +- .../{1 => 2}/HistoryViewController.xib | 2 +- .../3/ImageViewController.xib | 299 ++++++++ .../Advanced/1/Advanced.strings | 3 + .../Localizable/1/Localizable.strings | Bin 16702 -> 15680 bytes linphone.xcodeproj/project.pbxproj | 89 ++- 29 files changed, 2345 insertions(+), 1091 deletions(-) rename Classes/{ImageViewerViewController.h => ImageViewController.h} (86%) create mode 100644 Classes/ImageViewController.m delete mode 100644 Classes/ImageViewerViewController.m create mode 100755 Classes/Utils/DTFoundation/DTActionSheet.h create mode 100755 Classes/Utils/DTFoundation/DTActionSheet.m create mode 100644 Classes/en.lproj/ImageViewController.xib rename Classes/{ImageViewerViewController.xib => fr.lproj/ImageViewController.xib} (56%) rename linphone.ldb/Resources/Classes/ChatRoomViewController/{12 => 15}/ChatRoomViewController.xib (88%) rename linphone.ldb/Resources/Classes/ChatViewController/{2 => 3}/ChatViewController.xib (100%) rename linphone.ldb/Resources/Classes/HistoryViewController/{1 => 2}/HistoryViewController.xib (99%) create mode 100644 linphone.ldb/Resources/Classes/ImageViewController/3/ImageViewController.xib diff --git a/Classes/ChatRoomViewController.h b/Classes/ChatRoomViewController.h index 578301aab..282d2087e 100644 --- a/Classes/ChatRoomViewController.h +++ b/Classes/ChatRoomViewController.h @@ -27,14 +27,11 @@ #include "linphonecore.h" -@interface ChatRoomViewController : UIViewController { +@interface ChatRoomViewController : UIViewController { @private LinphoneChatRoom *chatRoom; - NSString *_remoteAddress; - UIActionSheet* photoSourceSelector; - NSURLConnection* uploadCnx; - NSURLConnection* downloadCnx; - NSString* pendingFileUrl; /*Url received from the remote party to be downloaded*/ + NSURLConnection* uploadContext; + NSURLConnection* downloadContext; NSMutableData* downloadedData; NSInteger totalBytesExpectedToRead; } @@ -55,17 +52,17 @@ @property (nonatomic, retain) IBOutlet UITapGestureRecognizer *listTapGestureRecognizer; @property (nonatomic, copy) NSString *remoteAddress; -@property (nonatomic, retain) IBOutlet UIButton* pictButton; -@property (nonatomic, retain) IBOutlet UIButton* cancelTransfertButton; +@property (nonatomic, retain) IBOutlet UIButton* pictureButton; +@property (nonatomic, retain) IBOutlet UIButton* cancelTransferButton; @property (nonatomic, retain) IBOutlet UIProgressView* imageTransferProgressBar; -@property (nonatomic, retain) IBOutlet UIView* transfertView; +@property (nonatomic, retain) IBOutlet UIView* transferView; - (IBAction)onBackClick:(id)event; - (IBAction)onEditClick:(id)event; - (IBAction)onMessageChange:(id)sender; - (IBAction)onSendClick:(id)event; -- (IBAction)onPictClick:(id)event; +- (IBAction)onPictureClick:(id)event; - (IBAction)onTransferCancelClick:(id)event; - (IBAction)onListTap:(id)sender; diff --git a/Classes/ChatRoomViewController.m b/Classes/ChatRoomViewController.m index ffd1b36fb..746adb0c3 100644 --- a/Classes/ChatRoomViewController.m +++ b/Classes/ChatRoomViewController.m @@ -22,10 +22,7 @@ #import #import #import -#import "ImageViewerViewController.h" - -#define FILE_DOWNLOAD_ACTION_SHEET 1 -#define FILE_CHOOSER_ACTION_SHEET 2 +#import "DTActionSheet.h" @implementation ChatRoomViewController @@ -33,7 +30,7 @@ @synthesize sendButton; @synthesize messageField; @synthesize editButton; -@synthesize remoteAddress = _remoteAddress; +@synthesize remoteAddress; @synthesize addressLabel; @synthesize avatarImage; @synthesize headerView; @@ -43,10 +40,12 @@ @synthesize messageBackgroundImage; @synthesize footerBackgroundImage; @synthesize listTapGestureRecognizer; -@synthesize pictButton; +@synthesize pictureButton; @synthesize imageTransferProgressBar; -@synthesize cancelTransfertButton; -@synthesize transfertView; +@synthesize cancelTransferButton; +@synthesize transferView; + + #pragma mark - Lifecycle Functions - (id)init { @@ -63,7 +62,7 @@ [messageField release]; [sendButton release]; [editButton release]; - [_remoteAddress release]; + [remoteAddress release]; [addressLabel release]; [avatarImage release]; [headerView release]; @@ -71,11 +70,13 @@ [messageView release]; [messageBackgroundImage release]; [footerBackgroundImage release]; + [listTapGestureRecognizer release]; - [transfertView release]; - [pictButton release]; + + [transferView release]; + [pictureButton release]; [imageTransferProgressBar release]; - [cancelTransfertButton release]; + [cancelTransferButton release]; [super dealloc]; } @@ -117,7 +118,8 @@ static UICompositeViewDescription *compositeDescription = nil; messageField.font = [UIFont systemFontOfSize:18.0f]; messageField.contentInset = UIEdgeInsetsZero; messageField.backgroundColor = [UIColor clearColor]; - [self enableTransfertView:FALSE]; + [self enableTransferView:FALSE]; + [sendButton setEnabled:FALSE]; } @@ -150,18 +152,21 @@ static UICompositeViewDescription *compositeDescription = nil; [footerBackgroundImage setImage:[TUNinePatchCache imageOfSize:[footerBackgroundImage bounds].size forNinePatchNamed:@"chat_background"]]; BOOL fileSharingEnabled = [[LinphoneManager instance] lpConfigStringForKey:@"file_upload_url_preference"] != NULL - && [[[LinphoneManager instance] lpConfigStringForKey:@"file_upload_url_preference"] length]>0 ; - [pictButton setHidden:!fileSharingEnabled]; - - CGRect frame = messageView.frame; + && [[[LinphoneManager instance] lpConfigStringForKey:@"file_upload_url_preference"] length]>0; + + CGRect pictureFrame = pictureButton.frame; + CGRect messageframe = messageView.frame; + CGRect sendFrame = sendButton.frame; if (fileSharingEnabled) { - frame.origin.x=61; - frame.size.width=175; + [pictureButton setHidden:FALSE]; + messageframe.origin.x = pictureFrame.origin.x + pictureFrame.size.width; + messageframe.size.width = sendFrame.origin.x - messageframe.origin.x; } else { - frame.origin.x=0; - frame.size.width=175+61; + [pictureButton setHidden:TRUE]; + messageframe.origin.x = pictureFrame.origin.x; + messageframe.size.width = sendFrame.origin.x - messageframe.origin.x; } - [messageView setFrame:frame]; + [messageView setFrame:messageframe]; } @@ -196,24 +201,24 @@ static UICompositeViewDescription *compositeDescription = nil; #pragma mark - - (void)setRemoteAddress:(NSString*)aRemoteAddress { - if(_remoteAddress != nil) { - [_remoteAddress release]; + if(remoteAddress != nil) { + [remoteAddress release]; } - _remoteAddress = [aRemoteAddress copy]; + remoteAddress = [aRemoteAddress copy]; [messageField setText:@""]; [self update]; - [tableController setRemoteAddress: _remoteAddress]; + [tableController setRemoteAddress: remoteAddress]; } - (void)update { - if(_remoteAddress == NULL) { + if(remoteAddress == NULL) { [LinphoneLogger logc:LinphoneLoggerWarning format:"Cannot update chat room header: null contact"]; return; } NSString *displayName = nil; UIImage *image = nil; - LinphoneAddress* linphoneAddress = linphone_core_interpret_url([LinphoneManager getLc], [_remoteAddress UTF8String]); + LinphoneAddress* linphoneAddress = linphone_core_interpret_url([LinphoneManager getLc], [remoteAddress UTF8String]); if (linphoneAddress == NULL) { [[PhoneMainView instance] popCurrentView]; UIAlertView* error = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Invalid SIP address",nil) @@ -234,8 +239,8 @@ static UICompositeViewDescription *compositeDescription = nil; displayName = [FastAddressBook getContactDisplayName:acontact]; image = [FastAddressBook getContactImage:acontact thumbnail:true]; } - [_remoteAddress release]; - _remoteAddress = [normalizedSipAddress retain]; + [remoteAddress release]; + remoteAddress = [normalizedSipAddress retain]; // Display name if(displayName == nil) { @@ -267,17 +272,17 @@ static void message_status(LinphoneChatMessage* msg,LinphoneChatMessageState sta [LinphoneLogger logc:LinphoneLoggerWarning format:"Cannot send message: Linphone core not ready"]; return FALSE; } - if(_remoteAddress == nil) { + if(remoteAddress == nil) { [LinphoneLogger logc:LinphoneLoggerWarning format:"Cannot send message: Null remoteAddress"]; return FALSE; } if(chatRoom == NULL) { - chatRoom = linphone_core_create_chat_room([LinphoneManager getLc], [_remoteAddress UTF8String]); + chatRoom = linphone_core_create_chat_room([LinphoneManager getLc], [remoteAddress UTF8String]); } // Save message in database ChatModel *chat = [[ChatModel alloc] init]; - [chat setRemoteContact:_remoteAddress]; + [chat setRemoteContact:remoteAddress]; [chat setLocalContact:@""]; [chat setMessage:message]; [chat setDirection:[NSNumber numberWithInt:0]]; @@ -286,7 +291,8 @@ static void message_status(LinphoneChatMessage* msg,LinphoneChatMessageState sta [chat setState:[NSNumber numberWithInt:1]]; //INPROGRESS [chat create]; [tableController addChatEntry:chat]; - // [chat release]; commenting this line avoid a crash on first message sent, specially when picture + [chat release]; + LinphoneChatMessage* msg = linphone_chat_room_create_message(chatRoom, [message UTF8String]); linphone_chat_message_set_user_data(msg, chat); if (url) { @@ -309,7 +315,7 @@ static void message_status(LinphoneChatMessage* msg,LinphoneChatMessageState sta char *fromStr = linphone_address_as_string_uri_only(from); if(fromStr != NULL) { if([[NSString stringWithUTF8String:fromStr] - caseInsensitiveCompare:_remoteAddress] == NSOrderedSame) { + caseInsensitiveCompare:remoteAddress] == NSOrderedSame) { [chat setRead:[NSNumber numberWithInt:1]]; [chat update]; [[NSNotificationCenter defaultCenter] postNotificationName:kLinphoneTextReceived object:self]; @@ -317,16 +323,18 @@ static void message_status(LinphoneChatMessage* msg,LinphoneChatMessageState sta } ms_free(fromStr); } + if ([[notif userInfo] objectForKey:@"external_body_url"]) { - pendingFileUrl=[[[notif userInfo] objectForKey:@"external_body_url"] retain]; - UIActionSheet* new_incoming_file = [[UIActionSheet alloc] initWithTitle:NSLocalizedString(@"Incoming file stored to your photo library",nil) - delegate:self - cancelButtonTitle:NSLocalizedString(@"Ignore",nil) - destructiveButtonTitle:nil - otherButtonTitles:NSLocalizedString(@"Accept",nil),nil]; - [new_incoming_file setTag:FILE_DOWNLOAD_ACTION_SHEET]; - [new_incoming_file showInView:self.view]; - [new_incoming_file release]; + NSString *pendingFileUrl = [[[notif userInfo] objectForKey:@"external_body_url"] retain]; + + DTActionSheet *sheet = [[[DTActionSheet alloc] initWithTitle:NSLocalizedString(@"Incoming file stored to your photo library",nil)] autorelease]; + [sheet addButtonWithTitle:NSLocalizedString(@"Accept",nil) block:^(){ + [downloadContext release]; + downloadContext = [self downloadImageFrom:pendingFileUrl]; + [self startDownload]; + }]; + [sheet addCancelButtonWithTitle:NSLocalizedString(@"Ignore",nil)]; + [sheet showInView:self.view]; } } else { [LinphoneLogger logc:LinphoneLoggerWarning format:"Invalid textReceivedEvent"]; @@ -384,6 +392,7 @@ static void message_status(LinphoneChatMessage* msg,LinphoneChatMessageState sta - (IBAction)onSendClick:(id)event { if([self sendMessage:[messageField text] withExterlBodyUrl:nil]) { [messageField setText:@""]; + [self onMessageChange:nil]; } } @@ -399,246 +408,210 @@ static void message_status(LinphoneChatMessage* msg,LinphoneChatMessageState sta } } -- (IBAction)onPictClick:(id)event { - - photoSourceSelector = [[UIActionSheet alloc] initWithTitle:NSLocalizedString(@"Select picture source",nil) - delegate:self - cancelButtonTitle:NSLocalizedString(@"Cancel",nil) - destructiveButtonTitle:nil - otherButtonTitles:NSLocalizedString(@"Camera",nil),NSLocalizedString(@"Photo library",nil), nil]; +- (IBAction)onPictureClick:(id)event { + [messageField resignFirstResponder]; - photoSourceSelector.actionSheetStyle = UIActionSheetStyleDefault; - [photoSourceSelector setTag:FILE_CHOOSER_ACTION_SHEET]; - [photoSourceSelector showInView:self.view]; - [photoSourceSelector release]; - - + DTActionSheet *sheet = [[[DTActionSheet alloc] initWithTitle:NSLocalizedString(@"Select picture source",nil)] autorelease]; + if([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) { + [sheet addButtonWithTitle:NSLocalizedString(@"Camera",nil) block:^(){ + UIImagePickerController *mediaUI = [[UIImagePickerController alloc] init]; + mediaUI.sourceType = UIImagePickerControllerSourceTypeCamera; + + // Displays a control that allows the user to choose picture or + // movie capture, if both are available: + mediaUI.mediaTypes = + [UIImagePickerController availableMediaTypesForSourceType: + UIImagePickerControllerSourceTypeCamera]; + + // Hides the controls for moving & scaling pictures, or for + // trimming movies. To instead show the controls, use YES. + mediaUI.allowsEditing = NO; + mediaUI.delegate = self; + [self presentModalViewController: mediaUI animated: YES]; + }]; + } + if([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary]) { + [sheet addButtonWithTitle:NSLocalizedString(@"Photo library",nil) block:^(){ + UIImagePickerController *mediaUI = [[UIImagePickerController alloc] init]; + mediaUI.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; + + // Displays saved pictures and movies, if both are available, from the + // Camera Roll album. + mediaUI.mediaTypes = + [UIImagePickerController availableMediaTypesForSourceType: + UIImagePickerControllerSourceTypePhotoLibrary]; + + // Hides the controls for moving & scaling pictures, or for + // trimming movies. To instead show the controls, use YES. + mediaUI.allowsEditing = NO; + mediaUI.delegate = self; + [self presentModalViewController: mediaUI animated: YES]; + }]; + } + [sheet addCancelButtonWithTitle:NSLocalizedString(@"Cancel",nil)]; + [sheet showInView:self.view]; } + - (IBAction)onTransferCancelClick:(id)event { - [uploadCnx cancel]; - [downloadCnx cancel]; - [self stopUpload]; - [self stopDownload]; - [LinphoneLogger log:LinphoneLoggerLog format:@"File transfert interrupted by user "]; + if(uploadContext) { + [uploadContext cancel]; + [self stopUpload]; + } + if(downloadContext) { + [downloadContext cancel]; + [self stopDownload]; + } + [LinphoneLogger log:LinphoneLoggerLog format:@"File transfer interrupted by user"]; } --(void) enableTransfertView:(BOOL) isTranfer { +- (void)enableTransferView:(BOOL)isTranfer { if (isTranfer) { [imageTransferProgressBar setProgress:0.0]; } else { - //[uploadCnx cancel]; - + //[uploadContext cancel]; } - [transfertView setHidden:!isTranfer]; + [footerView setHidden:isTranfer]; + [transferView setHidden:!isTranfer]; [imageTransferProgressBar setHidden:!isTranfer]; - [cancelTransfertButton setHidden:!isTranfer]; - [pictButton setHidden:isTranfer]; + [cancelTransferButton setHidden:!isTranfer]; [sendButton setEnabled:!isTranfer]; } --(void) startUpload { - [self enableTransfertView:TRUE]; -} --(void) stopUpload { - [self enableTransfertView:FALSE]; -} --(void) startDownload { - [self enableTransfertView:TRUE]; -} --(void) stopDownload { - [self enableTransfertView:FALSE]; +- (void)startUpload { + [self enableTransferView:TRUE]; } --(void) actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex { - - switch (actionSheet.tag) { - case FILE_CHOOSER_ACTION_SHEET: { - UIImagePickerController *mediaUI = [[UIImagePickerController alloc] init]; - switch (buttonIndex) { - case 0: { - if ([UIImagePickerController isSourceTypeAvailable: - UIImagePickerControllerSourceTypeCamera] == NO) { - [LinphoneLogger log:LinphoneLoggerLog format:@"no camera found, using image library"]; - } else { - mediaUI.sourceType = UIImagePickerControllerSourceTypeCamera; - - // Displays a control that allows the user to choose picture or - // movie capture, if both are available: - mediaUI.mediaTypes = - [UIImagePickerController availableMediaTypesForSourceType: - UIImagePickerControllerSourceTypeCamera]; - - // Hides the controls for moving & scaling pictures, or for - // trimming movies. To instead show the controls, use YES. - mediaUI.allowsEditing = NO; - break; - } - } - case 1: { - - mediaUI.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; - - // Displays saved pictures and movies, if both are available, from the - // Camera Roll album. - mediaUI.mediaTypes = - [UIImagePickerController availableMediaTypesForSourceType: - UIImagePickerControllerSourceTypePhotoLibrary]; - - // Hides the controls for moving & scaling pictures, or for - // trimming movies. To instead show the controls, use YES. - mediaUI.allowsEditing = NO; - - break; - } - default: - [mediaUI release]; - return ;break; - - } - mediaUI.delegate = self; - [self presentModalViewController: mediaUI animated: YES]; - break; - } - case FILE_DOWNLOAD_ACTION_SHEET: { - switch (buttonIndex) { - case 0: - [downloadCnx release]; - downloadCnx= [self downloadImageFrom:pendingFileUrl]; - [self startDownload]; - break; - case 1: - default: { - //nop - } - break; - } - break; - } - default: - [LinphoneLogger log:LinphoneLoggerError format:@"Unexpected action sheet result for tag [%i]",actionSheet.tag]; - - } - +- (void)stopUpload { + [self enableTransferView:FALSE]; } + +- (void)startDownload { + [self enableTransferView:TRUE]; +} + +- (void)stopDownload { + [self enableTransferView:FALSE]; +} + + #pragma mark - NSURLConnectionDelegate + - (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error { - UIAlertView* errorAlert = [UIAlertView alloc]; - if (connection == uploadCnx) { + if (connection == uploadContext) { [self stopUpload]; - [LinphoneLogger log:LinphoneLoggerError format:@"Cannot upload file to server [%@] because [%@]",[[LinphoneManager instance] lpConfigStringForKey:@"file_upload_url"],[error localizedDescription]]; - [errorAlert initWithTitle:NSLocalizedString(@"Tranfer error",nil) - message:NSLocalizedString(@"Cannot transfert file to remote pary",nil) + NSString *serverUrl = [[LinphoneManager instance] lpConfigStringForKey:@"file_upload_url"]; + [LinphoneLogger log:LinphoneLoggerError format:@"Cannot upload file to server [%@] because [%@]", serverUrl, [error localizedDescription]]; + UIAlertView* errorAlert = [UIAlertView alloc]; + [errorAlert initWithTitle:NSLocalizedString(@"Transfer error", nil) + message:NSLocalizedString(@"Cannot transfer file to remote contact", nil) delegate:nil cancelButtonTitle:NSLocalizedString(@"Ok",nil) otherButtonTitles:nil ,nil]; [errorAlert show]; - }else if (connection == downloadCnx) { - [LinphoneLogger log:LinphoneLoggerError format:@"Cannot dowanlod file from [%@] because [%@]",pendingFileUrl,[error localizedDescription]]; - [errorAlert initWithTitle:NSLocalizedString(@"Tranfer error",nil) - message:NSLocalizedString(@"Cannot transfert file from remote pary",nil) + [errorAlert release]; + }else if (connection == downloadContext) { + [LinphoneLogger log:LinphoneLoggerError format:@"Cannot dowanlod file from [%@] because [%@]", [connection.currentRequest.URL absoluteString], [error localizedDescription]]; + UIAlertView* errorAlert = [UIAlertView alloc]; + [errorAlert initWithTitle:NSLocalizedString(@"Transfer error", nil) + message:NSLocalizedString(@"Cannot transfer file from remote contact", nil) delegate:nil - cancelButtonTitle:NSLocalizedString(@"Continue",nil) - otherButtonTitles:nil ,nil]; + cancelButtonTitle:NSLocalizedString(@"Continue", nil) + otherButtonTitles:nil, nil]; [errorAlert show]; + [errorAlert release]; } else { - [LinphoneLogger log:LinphoneLoggerError format:@"Unknown connection error [%@]",[error localizedDescription]]; + [LinphoneLogger log:LinphoneLoggerError format:@"Invalid file transfer connection", connection]; } - [errorAlert release]; - } --(void)connection:(NSURLConnection *)connection didSendBodyData:(NSInteger)bytesWritten totalBytesWritten:(NSInteger)totalBytesWritten totalBytesExpectedToWrite:(NSInteger)totalBytesExpectedToWrite { +- (void)connection:(NSURLConnection *)connection didSendBodyData:(NSInteger)bytesWritten totalBytesWritten:(NSInteger)totalBytesWritten totalBytesExpectedToWrite:(NSInteger)totalBytesExpectedToWrite { [imageTransferProgressBar setProgress:(float)((float)totalBytesWritten/(float)totalBytesExpectedToWrite) animated:FALSE]; } + - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data { - if (connection == uploadCnx) { + if (connection == uploadContext) { NSString* imageRemoteUrl=[[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; - [LinphoneLogger log:LinphoneLoggerLog format:@"File can be downloaded from [%@]",imageRemoteUrl]; + [LinphoneLogger log:LinphoneLoggerLog format:@"File can be downloaded from [%@]", imageRemoteUrl]; [self sendMessage:NSLocalizedString(@"Image sent",nil) withExterlBodyUrl:imageRemoteUrl]; - } else if (connection == downloadCnx) { - if (downloadedData == nil) downloadedData = [[NSMutableData alloc] initWithCapacity:4096]; + } else if (connection == downloadContext) { + if (downloadedData == nil) downloadedData = [[NSMutableData alloc] initWithCapacity:[data length]]; [downloadedData appendData:data]; - [imageTransferProgressBar setProgress:(float)((float)downloadedData.length/(float)totalBytesExpectedToRead) animated:FALSE]; + [imageTransferProgressBar setProgress:((float)downloadedData.length/(float)totalBytesExpectedToRead) animated:FALSE]; } else { - [LinphoneLogger log:LinphoneLoggerError format:@"Unknown received value error"]; + [LinphoneLogger log:LinphoneLoggerError format:@"Invalid file transfer connection", connection]; } } + - (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response { NSHTTPURLResponse * httpResponse = (NSHTTPURLResponse *) response; int statusCode = httpResponse.statusCode;; - [LinphoneLogger log:LinphoneLoggerLog format:@"File transfert status code [%i]",statusCode]; - UIAlertView* errorAlert = [UIAlertView alloc]; - if (connection == uploadCnx) { + [LinphoneLogger log:LinphoneLoggerLog format:@"File transfer status code [%i]",statusCode]; + + if (connection == uploadContext) { if (statusCode == 200) { //nop } else if (statusCode >= 400) { - - [errorAlert initWithTitle:NSLocalizedString(@"Transfer error",nil) - message:NSLocalizedString(@"Cannot transfert file to remote pary",nil) + UIAlertView* errorAlert = [UIAlertView alloc]; + [errorAlert initWithTitle:NSLocalizedString(@"Transfer error",nil) + message:NSLocalizedString(@"Cannot transfer file to remote contact",nil) delegate:nil cancelButtonTitle:NSLocalizedString(@"Continue",nil) otherButtonTitles:nil ,nil]; [errorAlert show]; - + [errorAlert release]; } - - } else if (connection == downloadCnx) { + } else if (connection == downloadContext) { if (statusCode == 200) { - totalBytesExpectedToRead=[response expectedContentLength]; + totalBytesExpectedToRead = [response expectedContentLength]; } else if (statusCode >= 400) { + UIAlertView* errorAlert = [UIAlertView alloc]; [errorAlert initWithTitle:NSLocalizedString(@"Transfer error",nil) - message:NSLocalizedString(@"Cannot transfert file from remote pary",nil) + message:NSLocalizedString(@"Cannot transfer file from remote contact",nil) delegate:nil cancelButtonTitle:NSLocalizedString(@"Continue",nil) otherButtonTitles:nil ,nil]; [errorAlert show]; - } else { - //TODO - } - + [errorAlert release]; + } } else { - //FIXE + [LinphoneLogger log:LinphoneLoggerError format:@"Invalid file transfer connection", connection]; } - - [errorAlert release]; - - } - (void)connectionDidFinishLoading:(NSURLConnection *)connection { - if (connection == uploadCnx) { - //nothing to do [self enableTransfert:FALSE]; + if (connection == uploadContext) { [self stopUpload]; - //[uploadCnx release]; - uploadCnx=nil; - } else if (connection == downloadCnx) { + uploadContext = nil; + } else if (connection == downloadContext) { ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init]; - [library writeImageDataToSavedPhotosAlbum:downloadedData + [library writeImageDataToSavedPhotosAlbum:downloadedData metadata:nil completionBlock:^(NSURL *assetURL, NSError *error){ if (error) { - [LinphoneLogger log:LinphoneLoggerError format:@"Cannot save image data downloaded because [%@]",[error localizedDescription]]; + [LinphoneLogger log:LinphoneLoggerError format:@"Cannot save image data downloaded [%@]",[error localizedDescription]]; } else { [LinphoneLogger log:LinphoneLoggerLog format:@"Image saved to [%@]",[assetURL absoluteString]]; } - - ImageViewerViewController* imageView = [[ImageViewerViewController alloc ]initWithNibName:@"ImageViewerViewController" bundle:[NSBundle mainBundle]]; - [imageView setImageToDisplay:[UIImage imageWithData:downloadedData]]; - [self presentModalViewController: imageView animated: YES]; + ImageViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:[ImageViewController compositeViewDescription] push:TRUE], ImageViewController); + if(controller != nil) { + [controller setImage:[UIImage imageWithData:downloadedData]]; + } [downloadedData release]; - downloadedData=nil; + downloadedData = nil; }]; [library release]; [self stopDownload]; - //[downloadCnx release]; - downloadCnx=nil; + downloadContext = nil; + } else { + [LinphoneLogger log:LinphoneLoggerError format:@"Invalid file transfer connection", connection]; } } --(NSURLConnection*) downloadImageFrom:(NSString*) address { - [LinphoneLogger log:LinphoneLoggerLog format:@"downloading [%@]",address]; + +- (NSURLConnection*)downloadImageFrom:(NSString*)address { + [LinphoneLogger log:LinphoneLoggerLog format:@"downloading [%@]", address]; NSURL* url = [NSURL URLWithString: address ]; NSURLRequest* request = [NSURLRequest requestWithURL:url cachePolicy:NSURLRequestUseProtocolCachePolicy @@ -648,7 +621,7 @@ static void message_status(LinphoneChatMessage* msg,LinphoneChatMessageState sta } --(NSURLConnection*) uploadImage:(UIImage*) image Named:(NSString*) name { +- (NSURLConnection*)uploadImage:(UIImage*)image Named:(NSString*)name { /* turning the image into a NSData object getting the image back out of the UIImageView @@ -671,7 +644,7 @@ static void message_status(LinphoneChatMessage* msg,LinphoneChatMessageState sta You might want to generate a random boundary.. this is just the same as my output from wireshark on a valid html post */ - NSString *boundary =@"---------------------------14737809831466499882746641449"; + NSString *boundary = @"---------------------------14737809831466499882746641449"; NSString *contentType = [NSString stringWithFormat:@"multipart/form-data; boundary=%@",boundary]; [request addValue:contentType forHTTPHeaderField: @"Content-Type"]; @@ -687,41 +660,39 @@ static void message_status(LinphoneChatMessage* msg,LinphoneChatMessageState sta // setting the body of the post to the reqeust [request setHTTPBody:body]; - return [NSURLConnection connectionWithRequest:(NSURLRequest *)request - delegate:self]; + return [NSURLConnection connectionWithRequest:(NSURLRequest *)request delegate:self]; } #pragma mark UIImagePickerControllerDelegate -// For responding to the user tapping Cancel. -- (void) imagePickerControllerDidCancel: (UIImagePickerController *) picker { + +- (void)imagePickerControllerDidCancel:(UIImagePickerController *) picker { [self dismissModalViewControllerAnimated: YES]; [picker release]; } -- (void) imagePickerController: (UIImagePickerController *) picker - didFinishPickingMediaWithInfo: (NSDictionary *) info { - +- (void)imagePickerController: (UIImagePickerController *) picker didFinishPickingMediaWithInfo: (NSDictionary *) info { NSURL *imageURL = [info valueForKey: UIImagePickerControllerReferenceURL]; - UIImage* imageToUse = (UIImage *) [info objectForKey: UIImagePickerControllerOriginalImage]; - NSString* imageName; - if (imageURL) { - // extract id from asset-url ex: assets-library://asset/asset.JPG?id=1645156-6151-1513&ext=JPG - NSArray *parameters = [[imageURL query] componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"=&"]]; - for (int i = 0; i < [parameters count]; i=i+2) { - if ([(NSString*)[parameters objectAtIndex:i] isEqualToString:@"id"]) { - imageName=[NSString stringWithFormat:@"%@.jpg",(NSString*)[parameters objectAtIndex:i+1]]; - } - } - } else { - // must be "unique" - imageName=[NSString stringWithFormat:@"%i.jpg",[imageToUse hash]]; - } - uploadCnx =[self uploadImage:imageToUse Named: imageName]; - [self startUpload]; - + UIImage* imageToUse = (UIImage *) [info objectForKey: UIImagePickerControllerOriginalImage]; + NSString* imageName; + if (imageURL) { + // extract id from asset-url ex: assets-library://asset/asset.JPG?id=1645156-6151-1513&ext=JPG + NSArray *parameters = [[imageURL query] componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"=&"]]; + for (int i = 0; i < [parameters count]; i=i+2) { + if ([(NSString*)[parameters objectAtIndex:i] isEqualToString:@"id"]) { + imageName=[NSString stringWithFormat:@"%@.jpg",(NSString*)[parameters objectAtIndex:i+1]]; + } + } + } else { + // must be "unique" + imageName=[NSString stringWithFormat:@"%i.jpg",[imageToUse hash]]; + } + uploadContext = [self uploadImage:imageToUse Named: imageName]; + [self startUpload]; + [picker.presentingViewController dismissModalViewControllerAnimated: YES]; [picker release]; } + #pragma mark - Keyboard Event Functions - (void)keyboardWillHide:(NSNotification *)notif { diff --git a/Classes/ImageViewerViewController.h b/Classes/ImageViewController.h similarity index 86% rename from Classes/ImageViewerViewController.h rename to Classes/ImageViewController.h index 24d29ac0e..7befe1552 100644 --- a/Classes/ImageViewerViewController.h +++ b/Classes/ImageViewController.h @@ -1,4 +1,4 @@ -/* ImageViewerViewController.h +/* ImageViewController.h * * Copyright (C) 2012 Belledonne Comunications, Grenoble, France * @@ -19,16 +19,16 @@ #import -@interface ImageViewerViewController : UIViewController { +#import "UICompositeViewController.h" + +@interface ImageViewController : UIViewController { } - - @property (nonatomic, retain) IBOutlet UIImageView *imageView; -@property (nonatomic, retain) UIImage *imageToDisplay; +@property (nonatomic, retain) UIImage *image; @property (nonatomic, retain) IBOutlet UIButton *backButton; - - (IBAction)onBackClick:(id)sender; + @end \ No newline at end of file diff --git a/Classes/ImageViewController.m b/Classes/ImageViewController.m new file mode 100644 index 000000000..e71d91e89 --- /dev/null +++ b/Classes/ImageViewController.m @@ -0,0 +1,71 @@ +/* ImageViewController.m + * + * Copyright (C) 2012 Belledonne Comunications, Grenoble, France + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#import "ImageViewController.h" +#import "PhoneMainView.h" + +@interface ImageViewController () + +@end + +@implementation ImageViewController + +@synthesize imageView; +@synthesize backButton; +@synthesize image; + +#pragma mark - UICompositeViewDelegate Functions + +static UICompositeViewDescription *compositeDescription = nil; + ++ (UICompositeViewDescription *)compositeViewDescription { + if(compositeDescription == nil) { + compositeDescription = [[UICompositeViewDescription alloc] init:@"ImageView" + content:@"ImageViewController" + stateBar:nil + stateBarEnabled:false + tabBar:nil + tabBarEnabled:false + fullscreen:false + landscapeMode:[LinphoneManager runningOnIpad] + portraitMode:true]; + } + return compositeDescription; +} + +#pragma mark - Property Functions + +- (void)setImage:(UIImage *)aimage { + imageView.image = aimage; +} + +- (UIImage *)image { + return imageView.image; +} + + +#pragma mark - Action Functions + +- (IBAction)onBackClick:(id)sender { + if([[[PhoneMainView instance] currentView] equal:[ImageViewController compositeViewDescription]]) { + [[PhoneMainView instance] popCurrentView]; + } +} + +@end diff --git a/Classes/ImageViewerViewController.m b/Classes/ImageViewerViewController.m deleted file mode 100644 index eb3bcd0ce..000000000 --- a/Classes/ImageViewerViewController.m +++ /dev/null @@ -1,62 +0,0 @@ -/* ImageViewerViewController.h - * - * Copyright (C) 2012 Belledonne Comunications, Grenoble, France - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - - -#import "ImageViewerViewController.h" - -@interface ImageViewerViewController () - -@end - -@implementation ImageViewerViewController -@synthesize imageView; -@synthesize backButton; -@synthesize imageToDisplay; - -- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil -{ - self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; - if (self) { - // Custom initialization - } - return self; -} - -- (void)viewDidLoad -{ - [super viewDidLoad]; - [imageView setImage:imageToDisplay]; -} - -- (void)viewDidUnload -{ - [super viewDidUnload]; - // Release any retained subviews of the main view. - // e.g. self.myOutlet = nil; -} - -- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation -{ - return (interfaceOrientation == UIInterfaceOrientationPortrait); -} - -- (IBAction)onBackClick:(id)sender { - [self.presentingViewController dismissModalViewControllerAnimated: YES]; -} -@end diff --git a/Classes/PhoneMainView.h b/Classes/PhoneMainView.h index 4d6c91ede..e92f28834 100644 --- a/Classes/PhoneMainView.h +++ b/Classes/PhoneMainView.h @@ -39,6 +39,7 @@ #import "WizardViewController.h" #import "IncomingCallViewController.h" #import "ConsoleViewController.h" +#import "ImageViewController.h" @interface PhoneMainView : UIViewController { @private diff --git a/Classes/Utils/DTFoundation/DTActionSheet.h b/Classes/Utils/DTFoundation/DTActionSheet.h new file mode 100755 index 000000000..2c2a8b23d --- /dev/null +++ b/Classes/Utils/DTFoundation/DTActionSheet.h @@ -0,0 +1,49 @@ +// +// DTActionSheet.h +// DTFoundation +// +// Created by Oliver Drobnik on 08.06.12. +// Copyright (c) 2012 Cocoanetics. All rights reserved. +// + +typedef void (^DTActionSheetBlock)(void); + +/** + Extends UIActionSheet with support for blocks + */ + +@interface DTActionSheet : UIActionSheet + +/** + Initializes the action sheet using the specified title. + */ +- (id)initWithTitle:(NSString *)title; + +/** + Adds a custom button to the action sheet. + @param title The title of the new button. + @param block The block to execute when the button is tapped. + @returns The index of the new button. Button indices start at 0 and increase in the order they are added. +*/ +- (NSInteger)addButtonWithTitle:(NSString *)title block:(DTActionSheetBlock)block; + +/** + Adds a custom destructive button to the action sheet. + + Since there can only be one destructive button a previously marked destructive button becomes a normal button. + @param title The title of the new button. + @param block The block to execute when the button is tapped. + @returns The index of the new button. Button indices start at 0 and increase in the order they are added. + */ +- (NSInteger)addDestructiveButtonWithTitle:(NSString *)title block:(DTActionSheetBlock)block; + +/** + Adds a custom cancel button to the action sheet. + + Since there can only be one cancel button a previously marked cancel button becomes a normal button. + @param title The title of the new button. + @returns The index of the new button. Button indices start at 0 and increase in the order they are added. + */ +- (NSInteger)addCancelButtonWithTitle:(NSString *)title; + +@end diff --git a/Classes/Utils/DTFoundation/DTActionSheet.m b/Classes/Utils/DTFoundation/DTActionSheet.m new file mode 100755 index 000000000..eeb2161bc --- /dev/null +++ b/Classes/Utils/DTFoundation/DTActionSheet.m @@ -0,0 +1,191 @@ +// +// DTActionSheet.m +// DTFoundation +// +// Created by Oliver Drobnik on 08.06.12. +// Copyright (c) 2012 Cocoanetics. All rights reserved. +// + +#import "DTActionSheet.h" + +@interface DTActionSheet () + +@end + +@implementation DTActionSheet +{ + id _externalDelegate; + + NSMutableDictionary *_actionsPerIndex; + + // lookup bitmask what delegate methods are implemented + struct + { + unsigned int delegateSupportsActionSheetCancel:1; + unsigned int delegateSupportsWillPresentActionSheet:1; + unsigned int delegateSupportsDidPresentActionSheet:1; + unsigned int delegateSupportsWillDismissWithButtonIndex:1; + unsigned int delegateSupportsDidDismissWithButtonIndex:1; + } _delegateFlags; +} + +- (id)init +{ + self = [super init]; + if (self) + { + _actionsPerIndex = [[NSMutableDictionary alloc] init]; + self.delegate = self; + } + + return self; +} + +// designated initializer +- (id)initWithTitle:(NSString *)title +{ + self = [self init]; + if (self) + { + self.title = title; + } + + return self; +} + +- (NSInteger)addButtonWithTitle:(NSString *)title block:(DTActionSheetBlock)block +{ + NSInteger retIndex = [self addButtonWithTitle:title]; + + if (block) + { + NSNumber *key = [NSNumber numberWithInt:retIndex]; + [_actionsPerIndex setObject:[block copy] forKey:key]; + } + + return retIndex; +} + +- (NSInteger)addDestructiveButtonWithTitle:(NSString *)title block:(DTActionSheetBlock)block +{ + NSInteger retIndex = [self addButtonWithTitle:title block:block]; + [self setDestructiveButtonIndex:retIndex]; + + return retIndex; +} + +- (NSInteger)addCancelButtonWithTitle:(NSString *)title +{ + NSInteger retIndex = [self addButtonWithTitle:title]; + [self setCancelButtonIndex:retIndex]; + + return retIndex; +} + +#pragma UIActionSheetDelegate (forwarded) + +- (void)actionSheetCancel:(UIActionSheet *)actionSheet +{ + if (_delegateFlags.delegateSupportsActionSheetCancel) + { + [_externalDelegate actionSheetCancel:actionSheet]; + } +} + +- (void)willPresentActionSheet:(UIActionSheet *)actionSheet +{ + if (_delegateFlags.delegateSupportsWillPresentActionSheet) + { + [_externalDelegate willPresentActionSheet:actionSheet]; + } +} + +- (void)didPresentActionSheet:(UIActionSheet *)actionSheet +{ + if (_delegateFlags.delegateSupportsDidPresentActionSheet) + { + [_externalDelegate didPresentActionSheet:actionSheet]; + } +} + +- (void)actionSheet:(UIActionSheet *)actionSheet willDismissWithButtonIndex:(NSInteger)buttonIndex +{ + if (_delegateFlags.delegateSupportsWillDismissWithButtonIndex) + { + [_externalDelegate actionSheet:actionSheet willDismissWithButtonIndex:buttonIndex]; + } +} + + +- (void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex +{ + NSNumber *key = [NSNumber numberWithInt:buttonIndex]; + + DTActionSheetBlock block = [_actionsPerIndex objectForKey:key]; + + if (block) + { + block(); + } + + if (_delegateFlags.delegateSupportsDidDismissWithButtonIndex) + { + [_externalDelegate actionSheet:actionSheet didDismissWithButtonIndex:buttonIndex]; + } +} + + +#pragma mark Properties + +- (id )delegate +{ + return _externalDelegate; +} + +- (void)setDelegate:(id )delegate +{ + if (delegate == self) + { + [super setDelegate:self]; + } + else if (delegate == nil) + { + [super setDelegate:nil]; + _externalDelegate = nil; + } + else + { + _externalDelegate = delegate; + } + + // wipe + memset(&_delegateFlags, 0, sizeof(_delegateFlags)); + + // set flags according to available methods in delegate + if ([_externalDelegate respondsToSelector:@selector(actionSheetCancel:)]) + { + _delegateFlags.delegateSupportsActionSheetCancel = YES; + } + + if ([_externalDelegate respondsToSelector:@selector(willPresentActionSheet:)]) + { + _delegateFlags.delegateSupportsWillPresentActionSheet = YES; + } + + if ([_externalDelegate respondsToSelector:@selector(didPresentActionSheet:)]) + { + _delegateFlags.delegateSupportsDidPresentActionSheet = YES; + } + + if ([_externalDelegate respondsToSelector:@selector(actionSheet:willDismissWithButtonIndex:)]) + { + _delegateFlags.delegateSupportsWillDismissWithButtonIndex = YES; + } + + if ([_externalDelegate respondsToSelector:@selector(actionSheet:didDismissWithButtonIndex:)]) + { + _delegateFlags.delegateSupportsDidDismissWithButtonIndex = YES; + } +} + +@end diff --git a/Classes/en.lproj/ChatRoomViewController.xib b/Classes/en.lproj/ChatRoomViewController.xib index dd7c2c6ba..dfb378fa5 100644 --- a/Classes/en.lproj/ChatRoomViewController.xib +++ b/Classes/en.lproj/ChatRoomViewController.xib @@ -138,7 +138,7 @@ {{0, 80}, {320, 277}} - + _NS:9 3 @@ -154,6 +154,89 @@ 22 22 + + + -2147483356 + + + + 274 + {320, 59} + + + + _NS:9 + + 1 + MSAwLjI4MzE1ODM3MjYgMC4wNTY3ODY4OTE2MQA + + NO + IBCocoaTouchFramework + + NSImage + chat_background.png + + + + + 292 + {{250, 0}, {70, 59}} + + + + _NS:9 + NO + + Cancel + + IBCocoaTouchFramework + 0 + 0 + Cancel + + + 1 + MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + + + 3 + MC41AA + + + 2 + 15 + + + Helvetica-Bold + 15 + 16 + + + + + 292 + {{20, 25}, {213, 9}} + + + + _NS:9 + NO + + Upload or download progression + + + IBCocoaTouchFramework + 0.5 + + + {{0, 357}, {320, 59}} + + + + _NS:9 + + IBCocoaTouchFramework + 266 @@ -164,7 +247,7 @@ {320, 59} - + _NS:9 1 @@ -172,10 +255,18 @@ NO IBCocoaTouchFramework - - NSImage - chat_background.png - + + + + + 274 + {320, 59} + + + + _NS:9 + + IBCocoaTouchFramework @@ -194,10 +285,7 @@ 0 NO NO - - 3 - MC41AA - + NSImage chat_send_over.png @@ -210,15 +298,33 @@ NSImage chat_send_default.png - - 2 - 15 + + + + + + 300 + {40, 59} + + + + _NS:9 + NO + + Send picture - - Helvetica-Bold - 15 - 16 + IBCocoaTouchFramework + 0 + 0 + Pict + + + 1 + MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + + + @@ -227,7 +333,7 @@ 274 - {250, 59} + {210, 59} @@ -242,7 +348,7 @@ 274 - {{10, 10}, {230, 39}} + {{10, 10}, {190, 39}} @@ -251,7 +357,7 @@ IBCocoaTouchFramework - {250, 59} + {{40, 0}, {210, 59}} @@ -259,81 +365,6 @@ IBCocoaTouchFramework - - - 292 - - - - 292 - {{238, 11}, {62, 37}} - - - _NS:9 - NO - IBCocoaTouchFramework - 0 - 0 - 1 - cancel - - - 1 - MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA - - - - - - - - 292 - {{7, 25}, {213, 9}} - - - - _NS:9 - NO - IBCocoaTouchFramework - 0.5 - - - {320, 59} - - - - _NS:9 - - 3 - MQA - - 2 - - - IBCocoaTouchFramework - - - - 292 - {{6, 11}, {50, 37}} - - - _NS:9 - NO - IBCocoaTouchFramework - 0 - 0 - 1 - Pict - - - 1 - MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA - - - - - {{0, 357}, {320, 59}} @@ -397,7 +428,7 @@ chat_back_default.png - + @@ -429,7 +460,7 @@ chat_edit_default.png - + {320, 44} @@ -576,22 +607,6 @@ 71 - - - transfertView - - - - 76 - - - - cancelTransfertButton - - - - 77 - imageTransferProgressBar @@ -602,11 +617,27 @@ - pictButton + pictureButton - 80 + 84 + + + + cancelTransferButton + + + + 85 + + + + transferView + + + + 86 @@ -679,12 +710,12 @@ - onPictClick: + onPictureClick: 7 - 81 + 87 @@ -766,6 +797,7 @@ + chatView @@ -813,8 +845,8 @@ - + footerView @@ -859,33 +891,46 @@ messageField + + 73 + + + pictureButton + + + 82 + + + normalView + 72 - + + - + transferView - - 75 - - - cancel - 74 - progressBar + transferProgressBar - 73 - - - pictureButton + 75 + + + cancelTransferButton + + + 83 + + + footerBackgroundImage @@ -921,6 +966,8 @@ com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin @@ -929,7 +976,7 @@ - 81 + 87 @@ -949,7 +996,7 @@ id id id - id + id id id @@ -970,8 +1017,8 @@ onMessageChange: id - - onPictClick: + + onPictureClick: id @@ -986,7 +1033,7 @@ UILabel UIImageView - UIButton + UIButton UIView UIToggleButton UIImageView @@ -997,10 +1044,10 @@ UIImageView HPGrowingTextView UIView - UIButton + UIButton UIButton ChatRoomTableViewController - UIView + UIView @@ -1011,8 +1058,8 @@ avatarImage UIImageView - - cancelTransfertButton + + cancelTransferButton UIButton @@ -1055,8 +1102,8 @@ messageView UIView - - pictButton + + pictureButton UIButton @@ -1067,8 +1114,8 @@ tableController ChatRoomTableViewController - - transfertView + + transferView UIView diff --git a/Classes/en.lproj/ChatViewController.xib b/Classes/en.lproj/ChatViewController.xib index 69cc378e4..20eedaf14 100644 --- a/Classes/en.lproj/ChatViewController.xib +++ b/Classes/en.lproj/ChatViewController.xib @@ -61,8 +61,8 @@ - 289 - {{160, 0}, {160, 44}} + 292 + {160, 44} @@ -99,8 +99,8 @@ - 292 - {160, 44} + 289 + {{160, 0}, {160, 44}} @@ -389,8 +389,8 @@ 7 - + diff --git a/Classes/en.lproj/HistoryViewController.xib b/Classes/en.lproj/HistoryViewController.xib index 2e9e1f3ed..8761a2255 100644 --- a/Classes/en.lproj/HistoryViewController.xib +++ b/Classes/en.lproj/HistoryViewController.xib @@ -186,7 +186,7 @@ - {320, 58} + {320, 44} diff --git a/Classes/en.lproj/ImageViewController.xib b/Classes/en.lproj/ImageViewController.xib new file mode 100644 index 000000000..0e9bb3507 --- /dev/null +++ b/Classes/en.lproj/ImageViewController.xib @@ -0,0 +1,299 @@ + + + + 1296 + 11E53 + 2549 + 1138.47 + 569.00 + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + 1498 + + + IBProxyObject + IBUIButton + IBUIImageView + IBUIView + + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + PluginDependencyRecalculationVersion + + + + + IBFilesOwner + IBCocoaTouchFramework + + + IBFirstResponder + IBCocoaTouchFramework + + + + 274 + + + + 274 + {{0, 44}, {320, 416}} + + + + _NS:9 + + 3 + MCAwAA + + 4 + NO + IBCocoaTouchFramework + + + + 290 + + + + 292 + {320, 44} + + + + _NS:9 + NO + IBCocoaTouchFramework + + NSImage + toolsbar_background.png + + + + + 292 + {80, 44} + + + + _NS:9 + NO + + Back + + IBCocoaTouchFramework + 0 + 0 + + 3 + MQA + + + 1 + MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + + + 3 + MC41AA + + + NSImage + chat_back_default.png + + + NSImage + chat_back_over.png + + + 2 + 15 + + + Helvetica-Bold + 15 + 16 + + + + {320, 44} + + + + _NS:9 + + IBCocoaTouchFramework + + + {{0, 20}, {320, 460}} + + + + + + IBCocoaTouchFramework + + + + + + + view + + + + 3 + + + + imageView + + + + 9 + + + + backButton + + + + 8 + + + + onBackClick: + + + 7 + + 10 + + + + + + 0 + + + + + + 1 + + + + + + + + + -1 + + + File's Owner + + + -2 + + + + + 4 + + + imageView + + + 11 + + + + + + + toolbar + + + 7 + + + + + 6 + + + + + + + ImageViewController + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + UIResponder + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + + + + 11 + + + + + ImageViewController + UIViewController + + onBackClick: + id + + + onBackClick: + + onBackClick: + id + + + + UIButton + UIImageView + + + + backButton + UIButton + + + imageView + UIImageView + + + + IBProjectSource + ./Classes/ImageViewController.h + + + + + 0 + IBCocoaTouchFramework + + com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS + + + YES + 3 + + {320, 88} + {320, 88} + {5, 117} + + 1498 + + diff --git a/Classes/fr.lproj/ChatRoomViewController.xib b/Classes/fr.lproj/ChatRoomViewController.xib index 925eb238d..effff9788 100644 --- a/Classes/fr.lproj/ChatRoomViewController.xib +++ b/Classes/fr.lproj/ChatRoomViewController.xib @@ -133,7 +133,7 @@ 274 {{0, 80}, {320, 277}} - + _NS:9 3 @@ -149,6 +149,85 @@ 22 22 + + + -2147483356 + + + + 274 + {320, 59} + + + _NS:9 + + 1 + MSAwLjI4MzE1ODM3MjYgMC4wNTY3ODY4OTE2MQA + + NO + IBCocoaTouchFramework + + NSImage + chat_background.png + + + + + 292 + {{250, 0}, {70, 59}} + + + _NS:9 + NO + + Annuler + + IBCocoaTouchFramework + 0 + 0 + Annuler + + + 1 + MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + + + 3 + MC41AA + + + 2 + 15 + + + Helvetica-Bold + 15 + 16 + + + + + 292 + {{20, 25}, {213, 9}} + + + _NS:9 + NO + + Progression du téléversement/téléchargement + + + IBCocoaTouchFramework + 0.5 + + + {{0, 357}, {320, 59}} + + + _NS:9 + + IBCocoaTouchFramework + 266 @@ -158,7 +237,7 @@ 274 {320, 59} - + _NS:9 1 @@ -166,10 +245,17 @@ NO IBCocoaTouchFramework - - NSImage - chat_background.png - + + + + + 274 + {320, 59} + + + _NS:9 + + IBCocoaTouchFramework @@ -187,10 +273,7 @@ 0 NO NO - - 3 - MC41AA - + NSImage chat_send_over.png @@ -203,15 +286,32 @@ NSImage chat_send_default.png - - 2 - 15 + + + + + + 300 + {40, 59} + + + _NS:9 + NO + + Envoyer l'image - - Helvetica-Bold - 15 - 16 + IBCocoaTouchFramework + 0 + 0 + Img + + + 1 + MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + + + @@ -220,7 +320,7 @@ 274 - {250, 59} + {210, 59} _NS:9 @@ -234,7 +334,7 @@ 274 - {{10, 10}, {230, 39}} + {{10, 10}, {190, 39}} _NS:9 @@ -242,84 +342,13 @@ IBCocoaTouchFramework - {250, 59} + {{40, 0}, {210, 59}} _NS:9 IBCocoaTouchFramework - - - 292 - - - - 292 - {{238, 11}, {62, 37}} - - _NS:9 - NO - IBCocoaTouchFramework - 0 - 0 - 1 - cancel - - - 1 - MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA - - - - - - - - 292 - {{7, 25}, {213, 9}} - - - _NS:9 - NO - IBCocoaTouchFramework - 0.5 - - - {320, 59} - - - _NS:9 - - 3 - MQA - - 2 - - - IBCocoaTouchFramework - - - - 292 - {{6, 11}, {50, 37}} - - _NS:9 - NO - IBCocoaTouchFramework - 0 - 0 - 1 - Pict - - - 1 - MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA - - - - - {{0, 357}, {320, 59}} @@ -379,7 +408,7 @@ chat_back_default.png - + @@ -410,7 +439,7 @@ chat_edit_default.png - + {320, 44} @@ -554,22 +583,6 @@ 71 - - - transfertView - - - - 76 - - - - cancelTransfertButton - - - - 77 - imageTransferProgressBar @@ -580,11 +593,27 @@ - pictButton + pictureButton - 80 + 84 + + + + cancelTransferButton + + + + 85 + + + + transferView + + + + 86 @@ -657,12 +686,12 @@ - onPictClick: + onPictureClick: 7 - 81 + 87 @@ -744,6 +773,7 @@ + chatView @@ -791,8 +821,8 @@ - + footerView @@ -837,33 +867,46 @@ messageField + + 73 + + + pictureButton + + + 82 + + + normalView + 72 - + + - + transferView - - 75 - - - cancel - 74 - progressBar + transferProgressBar - 73 - - - pictureButton + 75 + + + cancelTransferButton + + + 83 + + + footerBackgroundImage @@ -899,6 +942,8 @@ com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin @@ -907,7 +952,7 @@ - 81 + 87 @@ -927,7 +972,7 @@ id id id - id + id id id @@ -948,8 +993,8 @@ onMessageChange: id - - onPictClick: + + onPictureClick: id @@ -964,7 +1009,7 @@ UILabel UIImageView - UIButton + UIButton UIView UIToggleButton UIImageView @@ -975,10 +1020,10 @@ UIImageView HPGrowingTextView UIView - UIButton + UIButton UIButton ChatRoomTableViewController - UIView + UIView @@ -989,8 +1034,8 @@ avatarImage UIImageView - - cancelTransfertButton + + cancelTransferButton UIButton @@ -1033,8 +1078,8 @@ messageView UIView - - pictButton + + pictureButton UIButton @@ -1045,8 +1090,8 @@ tableController ChatRoomTableViewController - - transfertView + + transferView UIView diff --git a/Classes/fr.lproj/ChatViewController.xib b/Classes/fr.lproj/ChatViewController.xib index c19606afd..ba35e017a 100644 --- a/Classes/fr.lproj/ChatViewController.xib +++ b/Classes/fr.lproj/ChatViewController.xib @@ -60,8 +60,8 @@ - 289 - {{160, 0}, {160, 44}} + 292 + {160, 44} _NS:9 @@ -97,8 +97,8 @@ - 292 - {160, 44} + 289 + {{160, 0}, {160, 44}} _NS:9 @@ -380,8 +380,8 @@ 7 - + diff --git a/Classes/fr.lproj/HistoryViewController.xib b/Classes/fr.lproj/HistoryViewController.xib index f16aac91b..a226f3825 100644 --- a/Classes/fr.lproj/HistoryViewController.xib +++ b/Classes/fr.lproj/HistoryViewController.xib @@ -109,11 +109,10 @@ 0 NO - + NSImage history_all_selected.png - NSImage history_all_default.png @@ -181,7 +180,7 @@ - {320, 58} + {320, 44} _NS:9 diff --git a/Classes/ImageViewerViewController.xib b/Classes/fr.lproj/ImageViewController.xib similarity index 56% rename from Classes/ImageViewerViewController.xib rename to Classes/fr.lproj/ImageViewController.xib index 488929954..2cd6fe824 100644 --- a/Classes/ImageViewerViewController.xib +++ b/Classes/fr.lproj/ImageViewController.xib @@ -3,12 +3,12 @@ 1296 11E53 - 2182 + 1938 1138.47 569.00 com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 1181 + 933 IBUIButton @@ -33,7 +33,7 @@ IBCocoaTouchFramework - + 274 @@ -42,76 +42,88 @@ {{0, 44}, {320, 416}} _NS:9 + + 3 + MCAwAA + 4 NO IBCocoaTouchFramework - + - 292 + 290 + + + + 292 + {320, 44} + + + _NS:9 + NO + IBCocoaTouchFramework + + NSImage + toolsbar_background.png + + + + + 292 + {80, 44} + + + _NS:9 + NO + + Retour + + IBCocoaTouchFramework + 0 + 0 + + 3 + MQA + + + 1 + MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + + + 3 + MC41AA + + + NSImage + chat_back_default.png + + + NSImage + chat_back_over.png + + + 2 + 15 + + + Helvetica-Bold + 15 + 16 + + + {320, 44} - + _NS:9 - NO + IBCocoaTouchFramework - - NSImage - background.png - - - - - 292 - {{235, 0}, {80, 44}} - - - _NS:9 - NO - IBCocoaTouchFramework - 0 - 0 - - 3 - MQA - - - 1 - MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA - - - 3 - MC41AA - - - NSImage - chat_back_default.png - - - NSImage - chat_back_over.png - - - 2 - 15 - - - Helvetica-Bold - 15 - 16 - {{0, 20}, {320, 460}} - - - - 3 - MQA - - 2 - - + + IBCocoaTouchFramework @@ -126,14 +138,6 @@ 3 - - - backButton - - - - 8 - imageView @@ -142,6 +146,14 @@ 9 + + + backButton + + + + 8 + onBackClick: @@ -165,8 +177,7 @@ - - + @@ -185,25 +196,37 @@ 4 + imageView - 6 - + 11 + + + + + + toolbar 7 - + + + + 6 + + - ImageViewerViewController + ImageViewController com.apple.InterfaceBuilder.IBCocoaTouchPlugin UIResponder com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin @@ -212,9 +235,45 @@ - 10 + 11 + + + + + ImageViewController + UIViewController + + onBackClick: + id + + + onBackClick: + + onBackClick: + id + + + + UIButton + UIImageView + + + + backButton + UIButton + + + imageView + UIImageView + + + + IBProjectSource + ./Classes/ImageViewController.h + + + - 0 IBCocoaTouchFramework @@ -224,10 +283,10 @@ YES 3 - {640, 523} {320, 88} {320, 88} + {5, 117} - 1181 + 933 diff --git a/Resources/en.lproj/Localizable.strings b/Resources/en.lproj/Localizable.strings index d2123bd9c9fbc02cbcbd192765c91a1d87243990..77e98c0aebfadcfe5429948995256911fe4b7664 100644 GIT binary patch delta 213 zcmdnj#CV{J>EHj!flPrLg94Z)-(lgJ9LKzFvL371W*OEZ&dHPbRCtpa@)`0NN*EFu zk{L=SuNTn7BAUn(KRHi80*efO^|u5Ru$Ye_x|vb%u)t;|Wjm(HVro*GdDJE_PL5O7 bnrxtvGx>$O+~NQYk;y!^Vw?ZiII;i$ts6cw delta 426 zcmX?5wXcbh>HojU3mF481_v-r{>Z4rSUg#T$#k-!Uex5pOgkp8Ws;FqU?^e8XHZ}W zW=LfyVkl$CWJm_Glz<|(3<{GMFlh>7Q89UgK=kH7=1rW;B|t@Se5&jP42eMPm6Of* zG+|p9OJvDsI_j>$X~ zWFXLY3P239E)!^M3M`0#v>#9ui;B$#N~}zi>s7KQcPeO2j#tUqY^u6Nc(S0S$mIVP P0zf)z^Fxbx7DfgDY_n~z diff --git a/Resources/fr.lproj/Localizable.strings b/Resources/fr.lproj/Localizable.strings index bddbaa5c2b85cb5e0e47c428c1b49cfbaae0aa4a..4afcd5a69212f0f77d901698fe28ad2f97fa0ba2 100644 GIT binary patch delta 144 zcmbQy#<-?#!xE;+e#}QUKVtFVnykmK!kf&H&ydGZ!jQ<2%uq5pQP6hs905M&9EQ}% z3;8D!p~6Z~0o9DniGr5qP+$mVNM$HuC;*uBiWn*{jozfUZad!dxJ&z)%UauM|jU0F5nUNS(ajLXkBQ z=*G&)juPh1NType PSTextFieldSpecifier Title - sharing server + Sharing server Key file_upload_url_preference diff --git a/Settings/InAppSettings.bundle/en.lproj/Advanced.strings b/Settings/InAppSettings.bundle/en.lproj/Advanced.strings index c7b00a51f..0cc1bcac5 100644 --- a/Settings/InAppSettings.bundle/en.lproj/Advanced.strings +++ b/Settings/InAppSettings.bundle/en.lproj/Advanced.strings @@ -34,6 +34,9 @@ /* Display name */ "Display name" = "Display name"; +/* Sharing server */ +"Sharing server" = "Sharing server"; + /* Username */ "Username" = "Username"; diff --git a/Settings/InAppSettings.bundle/fr.lproj/Advanced.strings b/Settings/InAppSettings.bundle/fr.lproj/Advanced.strings index cf45cf575..ffe163ea2 100644 --- a/Settings/InAppSettings.bundle/fr.lproj/Advanced.strings +++ b/Settings/InAppSettings.bundle/fr.lproj/Advanced.strings @@ -34,6 +34,9 @@ /* Display name */ "Display name" = "Nom d'affichage"; +/* Sharing server */ +"Sharing server" = "Serveur de partage"; + /* Username */ "Username" = "Nom d'utilisateur"; diff --git a/linphone.ldb/Contents.plist b/linphone.ldb/Contents.plist index c98111ad5..47e4dc01c 100644 --- a/linphone.ldb/Contents.plist +++ b/linphone.ldb/Contents.plist @@ -12,9 +12,7 @@ change date 2001-01-01T00:00:00Z changed values - - fr - + class BLBundleObject errors @@ -214,21 +212,19 @@ backup - 12 + 15 class BLWrapperHandle name - Classes/ChatRoomViewController/12/ChatRoomViewController.xib + Classes/ChatRoomViewController/15/ChatRoomViewController.xib change date - 2012-09-14T08:42:01Z + 2012-09-14T14:45:49Z changed values - - fr - + class BLNibFileObject errors @@ -236,7 +232,7 @@ flags 0 hash - fe17a7cc443845e0f73af8ee35e892e5 + 1f8683826a86cb2ad7e55cc5c9dcafaf name ChatRoomViewController.xib @@ -394,9 +390,32 @@ change date 2001-01-01T00:00:00Z changed values - - fr - + + class + BLStringKeyObject + comment + Class = "IBUIButton"; accessibilityLabel = "Send picture"; ObjectID = "73"; + errors + + flags + 0 + key + 73.accessibilityLabel + localizations + + en + Send picture + fr + Envoyer l'image + + snapshots + + + + change date + 2001-01-01T00:00:00Z + changed values + class BLStringKeyObject comment @@ -421,13 +440,61 @@ change date 2001-01-01T00:00:00Z changed values - - fr - + class BLStringKeyObject comment - Class = "IBUIButton"; normalTitle = "cancel"; ObjectID = "75"; + Class = "IBUIProgressView"; accessibilityLabel = "Upload or download progression"; ObjectID = "74"; + errors + + flags + 0 + key + 74.accessibilityLabel + localizations + + en + Upload or download progression + fr + Progression du téléversement/téléchargement + + snapshots + + + + change date + 2001-01-01T00:00:00Z + changed values + + class + BLStringKeyObject + comment + Class = "IBUIButton"; accessibilityLabel = "Cancel"; ObjectID = "75"; + errors + + flags + 0 + key + 75.accessibilityLabel + localizations + + en + Cancel + fr + Annuler + + snapshots + + + + change date + 2001-01-01T00:00:00Z + changed values + + class + BLStringKeyObject + comment + Class = "IBUIButton"; normalTitle = "Cancel"; ObjectID = "75"; errors flags @@ -437,7 +504,7 @@ localizations en - cancel + Cancel fr Annuler @@ -501,9 +568,9 @@ versions en - 12 + 15 fr - 12 + 15 @@ -511,17 +578,17 @@ backup - 2 + 3 class BLWrapperHandle name - Classes/ChatViewController/2/ChatViewController.xib + Classes/ChatViewController/3/ChatViewController.xib change date - 2012-09-13T15:35:03Z + 2012-09-14T12:06:16Z changed values class @@ -531,7 +598,7 @@ flags 0 hash - d02ecf8f1bacbfa8e5793231b6735940 + e5821f865fd72c1ed8f4c7762f6f37ea name ChatViewController.xib @@ -645,9 +712,9 @@ versions en - 2 + 3 fr - 2 + 3 @@ -2540,17 +2607,17 @@ backup - 1 + 2 class BLWrapperHandle name - Classes/HistoryViewController/1/HistoryViewController.xib + Classes/HistoryViewController/2/HistoryViewController.xib change date - 2012-09-10T15:18:57Z + 2012-09-14T12:14:28Z changed values class @@ -2560,7 +2627,7 @@ flags 0 hash - 298b795268cf5c06a0f890835be7ddb3 + 186d9f6cd76ac4df197bc2a1eb51921e name HistoryViewController.xib @@ -2699,9 +2766,9 @@ versions en - 1 + 2 fr - 1 + 2 @@ -4209,6 +4276,75 @@ 2 + + attachments + + backup + + 3 + + class + BLWrapperHandle + name + Classes/ImageViewController/3/ImageViewController.xib + + + + change date + 2012-09-14T13:00:17Z + changed values + + class + BLNibFileObject + errors + + flags + 0 + hash + 724a8c5069c0fbde9b1e56ef37a42cba + + name + ImageViewController.xib + objects + + + change date + 2001-01-01T00:00:00Z + changed values + + class + BLStringKeyObject + comment + Class = "IBUIButton"; accessibilityLabel = "Back"; ObjectID = "7"; + errors + + flags + 0 + key + 7.accessibilityLabel + localizations + + en + Back + fr + Retour + + snapshots + + + + old objects + + snapshots + + versions + + en + 3 + fr + 3 + + flags 0 @@ -7218,7 +7354,7 @@ change date - 2012-09-14T09:51:58Z + 2012-09-14T11:57:58Z changed values class @@ -7228,7 +7364,7 @@ flags 0 hash - 7fcce4bdc516e1d8f77ce093860a38dd + dcecc0eedf9132813ef8a938d07d7917 name Localizable.strings @@ -7337,34 +7473,6 @@ La cause était: %2$@ snapshots - - change date - 2001-01-01T00:00:00Z - changed values - - class - BLStringKeyObject - comment - No comment provided by engineer. - errors - - flags - 0 - key - %@ -Reason was: %s - localizations - - en - %1$@ -Reason was: %2$s - fr - %1$@ -Raison: %2$s - - snapshots - - change date 2001-01-01T00:00:00Z @@ -7390,31 +7498,6 @@ Raison: %2$s snapshots - - change date - 2001-01-01T00:00:00Z - changed values - - class - BLStringKeyObject - comment - No comment provided by engineer. - errors - - flags - 0 - key - '%@' not registered to Service - localizations - - en - '%@' not registered to Service - fr - '%@' n'est pas enregistré - - snapshots - - change date 2001-01-01T00:00:00Z @@ -7779,13 +7862,13 @@ Raison: %2$s flags 0 key - Cannot transfert file from remote pary + Cannot transfer file from remote contact localizations en - Cannot transfert file from remote pary + Cannot transfer file from remote contact fr - Impossible de transferer depuis destinataire + Impossible de transferer depuis le destinataire snapshots @@ -7804,36 +7887,11 @@ Raison: %2$s flags 0 key - Cannot transfert file from remote pary + Cannot transfer file to remote contact localizations en - Cannot transfert file from remote pary - fr - Impossible de transferer depuis destinataire - - snapshots - - - - change date - 2001-01-01T00:00:00Z - changed values - - class - BLStringKeyObject - comment - No comment provided by engineer. - errors - - flags - 0 - key - Cannot transfert file to remote pary - localizations - - en - Cannot transfert file to remote pary + Cannot transfer file to remote contact fr Impossible de transferer au destinataire @@ -8365,31 +8423,6 @@ Raison: %2$s snapshots - - change date - 2001-01-01T00:00:00Z - changed values - - class - BLStringKeyObject - comment - No comment provided by engineer. - errors - - flags - 0 - key - It seems you have not configured any proxy server from settings - localizations - - en - It seems you have not configured any proxy server from settings - fr - Il semble qu'il n'y est pas de serveur SIP configuré - - snapshots - - change date 2001-01-01T00:00:00Z @@ -8488,31 +8521,6 @@ Raison: %2$s snapshots - - change date - 2001-01-01T00:00:00Z - changed values - - class - BLStringKeyObject - comment - No comment provided by engineer. - errors - - flags - 0 - key - Never remind - localizations - - en - Never remind - fr - Ne pas me rappeler - - snapshots - - change date 2001-01-01T00:00:00Z @@ -8588,31 +8596,6 @@ Raison: %2$s snapshots - - change date - 2001-01-01T00:00:00Z - changed values - - class - BLStringKeyObject - comment - No comment provided by engineer. - errors - - flags - 0 - key - Ok - localizations - - en - Ok - fr - Ok - - snapshots - - change date 2001-01-01T00:00:00Z @@ -8638,6 +8621,31 @@ Raison: %2$s snapshots + + change date + 2001-01-01T00:00:00Z + changed values + + class + BLStringKeyObject + comment + No comment provided by engineer. + errors + + flags + 0 + key + Ok + localizations + + en + Ok + fr + Ok + + snapshots + + change date 2001-01-01T00:00:00Z @@ -9219,31 +9227,6 @@ Raison: %2$s snapshots - - change date - 2001-01-01T00:00:00Z - changed values - - class - BLStringKeyObject - comment - No comment provided by engineer. - errors - - flags - 0 - key - Tranfer error - localizations - - en - Tranfer error - fr - Erreur de transfert - - snapshots - - change date 2001-01-01T00:00:00Z @@ -9475,6 +9458,209 @@ Raison: %2$s snapshots + + change date + 2001-01-01T00:00:00Z + changed values + + class + BLStringKeyObject + comment + No comment provided by engineer. + errors + + flags + 0 + key + %@ +Reason was: %s + localizations + + en + %1$@ +Reason was: %2$s + fr + %1$@ +Raison: %2$s + + snapshots + + + + change date + 2001-01-01T00:00:00Z + changed values + + class + BLStringKeyObject + comment + No comment provided by engineer. + errors + + flags + 0 + key + '%@' not registered to Service + localizations + + en + '%@' not registered to Service + fr + '%@' n'est pas enregistré + + snapshots + + + + change date + 2001-01-01T00:00:00Z + changed values + + class + BLStringKeyObject + comment + No comment provided by engineer. + errors + + flags + 0 + key + Cannot transfert file from remote pary + localizations + + en + Cannot transfert file from remote pary + fr + Impossible de transferer depuis destinataire + + snapshots + + + + change date + 2001-01-01T00:00:00Z + changed values + + class + BLStringKeyObject + comment + No comment provided by engineer. + errors + + flags + 0 + key + Cannot transfert file from remote pary + localizations + + en + Cannot transfert file from remote pary + fr + Impossible de transferer depuis destinataire + + snapshots + + + + change date + 2001-01-01T00:00:00Z + changed values + + class + BLStringKeyObject + comment + No comment provided by engineer. + errors + + flags + 0 + key + Cannot transfert file to remote pary + localizations + + en + Cannot transfert file to remote pary + fr + Impossible de transferer au destinataire + + snapshots + + + + change date + 2001-01-01T00:00:00Z + changed values + + class + BLStringKeyObject + comment + No comment provided by engineer. + errors + + flags + 0 + key + It seems you have not configured any proxy server from settings + localizations + + en + It seems you have not configured any proxy server from settings + fr + Il semble qu'il n'y est pas de serveur SIP configuré + + snapshots + + + + change date + 2001-01-01T00:00:00Z + changed values + + class + BLStringKeyObject + comment + No comment provided by engineer. + errors + + flags + 0 + key + Never remind + localizations + + en + Never remind + fr + Ne pas me rappeler + + snapshots + + + + change date + 2001-01-01T00:00:00Z + changed values + + class + BLStringKeyObject + comment + No comment provided by engineer. + errors + + flags + 0 + key + Tranfer error + localizations + + en + Tranfer error + fr + Erreur de transfert + + snapshots + + plist file @@ -10112,7 +10298,7 @@ Raison: %2$s change date - 2012-09-11T10:05:14Z + 2012-09-14T09:59:52Z changed values class @@ -10122,7 +10308,7 @@ Raison: %2$s flags 0 hash - f72b15c7c0f7f2cba6c1df114414e788 + 04783f5ae79079b4d782aa4842c5a054 name Advanced.strings @@ -10396,6 +10582,31 @@ Raison: %2$s snapshots + + change date + 2001-01-01T00:00:00Z + changed values + + class + BLStringKeyObject + comment + Sharing server + errors + + flags + 0 + key + Sharing server + localizations + + en + Sharing server + fr + Serveur de partage + + snapshots + + change date 2001-01-01T00:00:00Z diff --git a/linphone.ldb/Resources/Classes/ChatRoomViewController/12/ChatRoomViewController.xib b/linphone.ldb/Resources/Classes/ChatRoomViewController/15/ChatRoomViewController.xib similarity index 88% rename from linphone.ldb/Resources/Classes/ChatRoomViewController/12/ChatRoomViewController.xib rename to linphone.ldb/Resources/Classes/ChatRoomViewController/15/ChatRoomViewController.xib index dd7c2c6ba..dfb378fa5 100644 --- a/linphone.ldb/Resources/Classes/ChatRoomViewController/12/ChatRoomViewController.xib +++ b/linphone.ldb/Resources/Classes/ChatRoomViewController/15/ChatRoomViewController.xib @@ -138,7 +138,7 @@ {{0, 80}, {320, 277}} - + _NS:9 3 @@ -154,6 +154,89 @@ 22 22 + + + -2147483356 + + + + 274 + {320, 59} + + + + _NS:9 + + 1 + MSAwLjI4MzE1ODM3MjYgMC4wNTY3ODY4OTE2MQA + + NO + IBCocoaTouchFramework + + NSImage + chat_background.png + + + + + 292 + {{250, 0}, {70, 59}} + + + + _NS:9 + NO + + Cancel + + IBCocoaTouchFramework + 0 + 0 + Cancel + + + 1 + MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + + + 3 + MC41AA + + + 2 + 15 + + + Helvetica-Bold + 15 + 16 + + + + + 292 + {{20, 25}, {213, 9}} + + + + _NS:9 + NO + + Upload or download progression + + + IBCocoaTouchFramework + 0.5 + + + {{0, 357}, {320, 59}} + + + + _NS:9 + + IBCocoaTouchFramework + 266 @@ -164,7 +247,7 @@ {320, 59} - + _NS:9 1 @@ -172,10 +255,18 @@ NO IBCocoaTouchFramework - - NSImage - chat_background.png - + + + + + 274 + {320, 59} + + + + _NS:9 + + IBCocoaTouchFramework @@ -194,10 +285,7 @@ 0 NO NO - - 3 - MC41AA - + NSImage chat_send_over.png @@ -210,15 +298,33 @@ NSImage chat_send_default.png - - 2 - 15 + + + + + + 300 + {40, 59} + + + + _NS:9 + NO + + Send picture - - Helvetica-Bold - 15 - 16 + IBCocoaTouchFramework + 0 + 0 + Pict + + + 1 + MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + + + @@ -227,7 +333,7 @@ 274 - {250, 59} + {210, 59} @@ -242,7 +348,7 @@ 274 - {{10, 10}, {230, 39}} + {{10, 10}, {190, 39}} @@ -251,7 +357,7 @@ IBCocoaTouchFramework - {250, 59} + {{40, 0}, {210, 59}} @@ -259,81 +365,6 @@ IBCocoaTouchFramework - - - 292 - - - - 292 - {{238, 11}, {62, 37}} - - - _NS:9 - NO - IBCocoaTouchFramework - 0 - 0 - 1 - cancel - - - 1 - MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA - - - - - - - - 292 - {{7, 25}, {213, 9}} - - - - _NS:9 - NO - IBCocoaTouchFramework - 0.5 - - - {320, 59} - - - - _NS:9 - - 3 - MQA - - 2 - - - IBCocoaTouchFramework - - - - 292 - {{6, 11}, {50, 37}} - - - _NS:9 - NO - IBCocoaTouchFramework - 0 - 0 - 1 - Pict - - - 1 - MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA - - - - - {{0, 357}, {320, 59}} @@ -397,7 +428,7 @@ chat_back_default.png - + @@ -429,7 +460,7 @@ chat_edit_default.png - + {320, 44} @@ -576,22 +607,6 @@ 71 - - - transfertView - - - - 76 - - - - cancelTransfertButton - - - - 77 - imageTransferProgressBar @@ -602,11 +617,27 @@ - pictButton + pictureButton - 80 + 84 + + + + cancelTransferButton + + + + 85 + + + + transferView + + + + 86 @@ -679,12 +710,12 @@ - onPictClick: + onPictureClick: 7 - 81 + 87 @@ -766,6 +797,7 @@ + chatView @@ -813,8 +845,8 @@ - + footerView @@ -859,33 +891,46 @@ messageField + + 73 + + + pictureButton + + + 82 + + + normalView + 72 - + + - + transferView - - 75 - - - cancel - 74 - progressBar + transferProgressBar - 73 - - - pictureButton + 75 + + + cancelTransferButton + + + 83 + + + footerBackgroundImage @@ -921,6 +966,8 @@ com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin @@ -929,7 +976,7 @@ - 81 + 87 @@ -949,7 +996,7 @@ id id id - id + id id id @@ -970,8 +1017,8 @@ onMessageChange: id - - onPictClick: + + onPictureClick: id @@ -986,7 +1033,7 @@ UILabel UIImageView - UIButton + UIButton UIView UIToggleButton UIImageView @@ -997,10 +1044,10 @@ UIImageView HPGrowingTextView UIView - UIButton + UIButton UIButton ChatRoomTableViewController - UIView + UIView @@ -1011,8 +1058,8 @@ avatarImage UIImageView - - cancelTransfertButton + + cancelTransferButton UIButton @@ -1055,8 +1102,8 @@ messageView UIView - - pictButton + + pictureButton UIButton @@ -1067,8 +1114,8 @@ tableController ChatRoomTableViewController - - transfertView + + transferView UIView diff --git a/linphone.ldb/Resources/Classes/ChatViewController/2/ChatViewController.xib b/linphone.ldb/Resources/Classes/ChatViewController/3/ChatViewController.xib similarity index 100% rename from linphone.ldb/Resources/Classes/ChatViewController/2/ChatViewController.xib rename to linphone.ldb/Resources/Classes/ChatViewController/3/ChatViewController.xib index 69cc378e4..20eedaf14 100644 --- a/linphone.ldb/Resources/Classes/ChatViewController/2/ChatViewController.xib +++ b/linphone.ldb/Resources/Classes/ChatViewController/3/ChatViewController.xib @@ -61,8 +61,8 @@ - 289 - {{160, 0}, {160, 44}} + 292 + {160, 44} @@ -99,8 +99,8 @@ - 292 - {160, 44} + 289 + {{160, 0}, {160, 44}} @@ -389,8 +389,8 @@ 7 - + diff --git a/linphone.ldb/Resources/Classes/HistoryViewController/1/HistoryViewController.xib b/linphone.ldb/Resources/Classes/HistoryViewController/2/HistoryViewController.xib similarity index 99% rename from linphone.ldb/Resources/Classes/HistoryViewController/1/HistoryViewController.xib rename to linphone.ldb/Resources/Classes/HistoryViewController/2/HistoryViewController.xib index 2e9e1f3ed..8761a2255 100644 --- a/linphone.ldb/Resources/Classes/HistoryViewController/1/HistoryViewController.xib +++ b/linphone.ldb/Resources/Classes/HistoryViewController/2/HistoryViewController.xib @@ -186,7 +186,7 @@ - {320, 58} + {320, 44} diff --git a/linphone.ldb/Resources/Classes/ImageViewController/3/ImageViewController.xib b/linphone.ldb/Resources/Classes/ImageViewController/3/ImageViewController.xib new file mode 100644 index 000000000..0e9bb3507 --- /dev/null +++ b/linphone.ldb/Resources/Classes/ImageViewController/3/ImageViewController.xib @@ -0,0 +1,299 @@ + + + + 1296 + 11E53 + 2549 + 1138.47 + 569.00 + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + 1498 + + + IBProxyObject + IBUIButton + IBUIImageView + IBUIView + + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + PluginDependencyRecalculationVersion + + + + + IBFilesOwner + IBCocoaTouchFramework + + + IBFirstResponder + IBCocoaTouchFramework + + + + 274 + + + + 274 + {{0, 44}, {320, 416}} + + + + _NS:9 + + 3 + MCAwAA + + 4 + NO + IBCocoaTouchFramework + + + + 290 + + + + 292 + {320, 44} + + + + _NS:9 + NO + IBCocoaTouchFramework + + NSImage + toolsbar_background.png + + + + + 292 + {80, 44} + + + + _NS:9 + NO + + Back + + IBCocoaTouchFramework + 0 + 0 + + 3 + MQA + + + 1 + MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + + + 3 + MC41AA + + + NSImage + chat_back_default.png + + + NSImage + chat_back_over.png + + + 2 + 15 + + + Helvetica-Bold + 15 + 16 + + + + {320, 44} + + + + _NS:9 + + IBCocoaTouchFramework + + + {{0, 20}, {320, 460}} + + + + + + IBCocoaTouchFramework + + + + + + + view + + + + 3 + + + + imageView + + + + 9 + + + + backButton + + + + 8 + + + + onBackClick: + + + 7 + + 10 + + + + + + 0 + + + + + + 1 + + + + + + + + + -1 + + + File's Owner + + + -2 + + + + + 4 + + + imageView + + + 11 + + + + + + + toolbar + + + 7 + + + + + 6 + + + + + + + ImageViewController + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + UIResponder + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + + + + 11 + + + + + ImageViewController + UIViewController + + onBackClick: + id + + + onBackClick: + + onBackClick: + id + + + + UIButton + UIImageView + + + + backButton + UIButton + + + imageView + UIImageView + + + + IBProjectSource + ./Classes/ImageViewController.h + + + + + 0 + IBCocoaTouchFramework + + com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS + + + YES + 3 + + {320, 88} + {320, 88} + {5, 117} + + 1498 + + diff --git a/linphone.ldb/Resources/InAppSettings.bundle/Advanced/1/Advanced.strings b/linphone.ldb/Resources/InAppSettings.bundle/Advanced/1/Advanced.strings index c7b00a51f..0cc1bcac5 100644 --- a/linphone.ldb/Resources/InAppSettings.bundle/Advanced/1/Advanced.strings +++ b/linphone.ldb/Resources/InAppSettings.bundle/Advanced/1/Advanced.strings @@ -34,6 +34,9 @@ /* Display name */ "Display name" = "Display name"; +/* Sharing server */ +"Sharing server" = "Sharing server"; + /* Username */ "Username" = "Username"; diff --git a/linphone.ldb/Resources/Resources/Localizable/1/Localizable.strings b/linphone.ldb/Resources/Resources/Localizable/1/Localizable.strings index d2123bd9c9fbc02cbcbd192765c91a1d87243990..77e98c0aebfadcfe5429948995256911fe4b7664 100644 GIT binary patch delta 213 zcmdnj#CV{J>EHj!flPrLg94Z)-(lgJ9LKzFvL371W*OEZ&dHPbRCtpa@)`0NN*EFu zk{L=SuNTn7BAUn(KRHi80*efO^|u5Ru$Ye_x|vb%u)t;|Wjm(HVro*GdDJE_PL5O7 bnrxtvGx>$O+~NQYk;y!^Vw?ZiII;i$ts6cw delta 426 zcmX?5wXcbh>HojU3mF481_v-r{>Z4rSUg#T$#k-!Uex5pOgkp8Ws;FqU?^e8XHZ}W zW=LfyVkl$CWJm_Glz<|(3<{GMFlh>7Q89UgK=kH7=1rW;B|t@Se5&jP42eMPm6Of* zG+|p9OJvDsI_j>$X~ zWFXLY3P239E)!^M3M`0#v>#9ui;B$#N~}zi>s7KQcPeO2j#tUqY^u6Nc(S0S$mIVP P0zf)z^Fxbx7DfgDY_n~z diff --git a/linphone.xcodeproj/project.pbxproj b/linphone.xcodeproj/project.pbxproj index 23a93a274..15ef38c86 100755 --- a/linphone.xcodeproj/project.pbxproj +++ b/linphone.xcodeproj/project.pbxproj @@ -39,13 +39,9 @@ 2234C8EE15EE744200E18E83 /* chat_message_inprogress.png in Resources */ = {isa = PBXBuildFile; fileRef = 2234C8ED15EE744200E18E83 /* chat_message_inprogress.png */; }; 2234C8EF15EE744200E18E83 /* chat_message_inprogress.png in Resources */ = {isa = PBXBuildFile; fileRef = 2234C8ED15EE744200E18E83 /* chat_message_inprogress.png */; }; 2237D4091084D7A9001383EE /* ring.wav in Resources */ = {isa = PBXBuildFile; fileRef = 2237D4081084D7A9001383EE /* ring.wav */; }; - 22405EEB16006F0800B92522 /* libmediastreamer_base.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 22405EE916006F0700B92522 /* libmediastreamer_base.a */; }; - 22405EEC16006F0800B92522 /* libmediastreamer_voip.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 22405EEA16006F0700B92522 /* libmediastreamer_voip.a */; }; 22405EEE1600B4E400B92522 /* AssetsLibrary.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 22405EED1600B4E400B92522 /* AssetsLibrary.framework */; }; - 22405F001601C19200B92522 /* ImageViewerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 22405EFE1601C19100B92522 /* ImageViewerViewController.m */; }; - 22405F011601C19200B92522 /* ImageViewerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 22405EFE1601C19100B92522 /* ImageViewerViewController.m */; }; - 22405F021601C19200B92522 /* ImageViewerViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 22405EFF1601C19100B92522 /* ImageViewerViewController.xib */; }; - 22405F031601C19200B92522 /* ImageViewerViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 22405EFF1601C19100B92522 /* ImageViewerViewController.xib */; }; + 22405F001601C19200B92522 /* ImageViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 22405EFE1601C19100B92522 /* ImageViewController.m */; }; + 22405F011601C19200B92522 /* ImageViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 22405EFE1601C19100B92522 /* ImageViewController.m */; }; 2242E313125235120061DDCE /* ring.caf in Resources */ = {isa = PBXBuildFile; fileRef = 2242E312125235120061DDCE /* ring.caf */; }; 224567C2107B968500F10948 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 224567C1107B968500F10948 /* AVFoundation.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; 2245F78A1201D38000C4179D /* MoreViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 22E0A81B111C44E100B04932 /* MoreViewController.xib */; }; @@ -138,8 +134,6 @@ 344ABDF114850AE9007420B6 /* libc++.1.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 344ABDEF14850AE9007420B6 /* libc++.1.dylib */; settings = {ATTRIBUTES = (Weak, ); }; }; 344ABDF214850AE9007420B6 /* libstdc++.6.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 344ABDF014850AE9007420B6 /* libstdc++.6.dylib */; settings = {ATTRIBUTES = (Weak, ); }; }; 34A6ECEB14CF13CB00460C04 /* linphone_icon_72.png in Resources */ = {isa = PBXBuildFile; fileRef = 34A6ECEA14CF13CB00460C04 /* linphone_icon_72.png */; }; - 570B130115FE44AF00DE62B6 /* libmediastreamer_voip.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 570B130015FE44AF00DE62B6 /* libmediastreamer_voip.a */; }; - 570B130315FE44ED00DE62B6 /* libmediastreamer_base.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 570B130215FE44ED00DE62B6 /* libmediastreamer_base.a */; }; 57F005C415EE2CCF00914747 /* linphonerc in Resources */ = {isa = PBXBuildFile; fileRef = 57F005C315EE2CCF00914747 /* linphonerc */; }; 57F005C515EE2CCF00914747 /* linphonerc in Resources */ = {isa = PBXBuildFile; fileRef = 57F005C315EE2CCF00914747 /* linphonerc */; }; 57F005C815EE2D9200914747 /* linphonerc-factory in Resources */ = {isa = PBXBuildFile; fileRef = 57F005C615EE2D9200914747 /* linphonerc-factory */; }; @@ -325,7 +319,6 @@ D347347F1580E5F8003C7B8C /* history_selected.png in Resources */ = {isa = PBXBuildFile; fileRef = D347347D1580E5F8003C7B8C /* history_selected.png */; }; D34BD61515C13B7B0070C209 /* libsqlite3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = D32B6E2E15A5C0AC0033019F /* libsqlite3.dylib */; }; D34BD61815C13D0B0070C209 /* liblinphone.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2211DB911475562600DEE054 /* liblinphone.a */; }; - D34BD61915C13D0B0070C209 /* libmediastreamer.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2211DB8F147555C800DEE054 /* libmediastreamer.a */; }; D34BD61A15C13DB60070C209 /* accept_default.png in Resources */ = {isa = PBXBuildFile; fileRef = D3F83F741582253100336684 /* accept_default.png */; }; D34BD61B15C13DB60070C209 /* accept_over.png in Resources */ = {isa = PBXBuildFile; fileRef = D3F83F751582253100336684 /* accept_over.png */; }; D34BD61C15C13DB60070C209 /* add_call_default.png in Resources */ = {isa = PBXBuildFile; fileRef = D3D6A39B159B0EEF005F692C /* add_call_default.png */; }; @@ -676,6 +669,14 @@ D37DC6C21594AE1800B2A5EB /* LinphoneCoreSettingsStore.m in Sources */ = {isa = PBXBuildFile; fileRef = D37DC6C01594AE1800B2A5EB /* LinphoneCoreSettingsStore.m */; }; D37DC7181594AF3400B2A5EB /* MessageUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D37DC7171594AF3400B2A5EB /* MessageUI.framework */; }; D37DC7191594AF3F00B2A5EB /* MessageUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D37DC7171594AF3400B2A5EB /* MessageUI.framework */; }; + D37EE10916032DA4003608A6 /* libmediastreamer_base.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 22405EE916006F0700B92522 /* libmediastreamer_base.a */; }; + D37EE10A16032DA4003608A6 /* libmediastreamer_voip.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 22405EEA16006F0700B92522 /* libmediastreamer_voip.a */; }; + D37EE10B16032DC2003608A6 /* libmediastreamer_base.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 22405EE916006F0700B92522 /* libmediastreamer_base.a */; }; + D37EE10C16032DC2003608A6 /* libmediastreamer_voip.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 22405EEA16006F0700B92522 /* libmediastreamer_voip.a */; }; + D37EE10D16035793003608A6 /* ImageViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = D37EE11016035793003608A6 /* ImageViewController.xib */; }; + D37EE10E16035793003608A6 /* ImageViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = D37EE11016035793003608A6 /* ImageViewController.xib */; }; + D37EE162160377D7003608A6 /* DTActionSheet.m in Sources */ = {isa = PBXBuildFile; fileRef = D37EE161160377D7003608A6 /* DTActionSheet.m */; }; + D37EE163160377D7003608A6 /* DTActionSheet.m in Sources */ = {isa = PBXBuildFile; fileRef = D37EE161160377D7003608A6 /* DTActionSheet.m */; }; D3804E6015D92A57008072A5 /* msg.caf in Resources */ = {isa = PBXBuildFile; fileRef = D3804E5E15D92A57008072A5 /* msg.caf */; }; D3804E6115D92A57008072A5 /* msg.caf in Resources */ = {isa = PBXBuildFile; fileRef = D3804E5E15D92A57008072A5 /* msg.caf */; }; D3804E6215D92A57008072A5 /* msg.wav in Resources */ = {isa = PBXBuildFile; fileRef = D3804E5F15D92A57008072A5 /* msg.wav */; }; @@ -1348,7 +1349,6 @@ 220FAD2E10765B400068D98F /* libosipparser2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libosipparser2.a; path = "liblinphone-sdk/apple-darwin/lib/libosipparser2.a"; sourceTree = ""; }; 220FAD2F10765B400068D98F /* libspeex.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libspeex.a; path = "liblinphone-sdk/apple-darwin/lib/libspeex.a"; sourceTree = ""; }; 220FAD3010765B400068D98F /* libspeexdsp.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libspeexdsp.a; path = "liblinphone-sdk/apple-darwin/lib/libspeexdsp.a"; sourceTree = ""; }; - 2211DB8F147555C800DEE054 /* libmediastreamer.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libmediastreamer.a; path = "liblinphone-sdk/apple-darwin/lib/libmediastreamer.a"; sourceTree = ""; }; 2211DB911475562600DEE054 /* liblinphone.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = liblinphone.a; path = "liblinphone-sdk/apple-darwin/lib/liblinphone.a"; sourceTree = ""; }; 2211DBBB14769C8200DEE054 /* CallDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CallDelegate.m; sourceTree = ""; }; 2214783C1386A2030020F8B8 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = Resources/en.lproj/Localizable.strings; sourceTree = ""; }; @@ -1374,9 +1374,8 @@ 22405EE916006F0700B92522 /* libmediastreamer_base.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libmediastreamer_base.a; path = "liblinphone-sdk/apple-darwin/lib/libmediastreamer_base.a"; sourceTree = ""; }; 22405EEA16006F0700B92522 /* libmediastreamer_voip.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libmediastreamer_voip.a; path = "liblinphone-sdk/apple-darwin/lib/libmediastreamer_voip.a"; sourceTree = ""; }; 22405EED1600B4E400B92522 /* AssetsLibrary.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AssetsLibrary.framework; path = System/Library/Frameworks/AssetsLibrary.framework; sourceTree = SDKROOT; }; - 22405EFD1601C19000B92522 /* ImageViewerViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageViewerViewController.h; sourceTree = ""; }; - 22405EFE1601C19100B92522 /* ImageViewerViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ImageViewerViewController.m; sourceTree = ""; }; - 22405EFF1601C19100B92522 /* ImageViewerViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ImageViewerViewController.xib; sourceTree = ""; }; + 22405EFD1601C19000B92522 /* ImageViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageViewController.h; sourceTree = ""; }; + 22405EFE1601C19100B92522 /* ImageViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ImageViewController.m; sourceTree = ""; }; 2242E312125235120061DDCE /* ring.caf */ = {isa = PBXFileReference; lastKnownFileType = file; name = ring.caf; path = Resources/ring.caf; sourceTree = ""; }; 224567C1107B968500F10948 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; 2248E90C12F7E4CF00220D9C /* UIDigitButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIDigitButton.h; sourceTree = ""; }; @@ -1507,8 +1506,6 @@ 344ABDEF14850AE9007420B6 /* libc++.1.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libc++.1.dylib"; path = "usr/lib/libc++.1.dylib"; sourceTree = SDKROOT; }; 344ABDF014850AE9007420B6 /* libstdc++.6.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libstdc++.6.dylib"; path = "usr/lib/libstdc++.6.dylib"; sourceTree = SDKROOT; }; 34A6ECEA14CF13CB00460C04 /* linphone_icon_72.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = linphone_icon_72.png; path = Resources/linphone_icon_72.png; sourceTree = ""; }; - 570B130015FE44AF00DE62B6 /* libmediastreamer_voip.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libmediastreamer_voip.a; path = "liblinphone-sdk/apple-darwin/lib/libmediastreamer_voip.a"; sourceTree = ""; }; - 570B130215FE44ED00DE62B6 /* libmediastreamer_base.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libmediastreamer_base.a; path = "liblinphone-sdk/apple-darwin/lib/libmediastreamer_base.a"; sourceTree = ""; }; 57F005C315EE2CCF00914747 /* linphonerc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = linphonerc; path = Resources/linphonerc; sourceTree = ""; }; 57F005C615EE2D9200914747 /* linphonerc-factory */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = "linphonerc-factory"; path = "Resources/linphonerc-factory"; sourceTree = ""; }; 57F005C715EE2D9200914747 /* linphonerc-factory~ipad */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = "linphonerc-factory~ipad"; path = "Resources/linphonerc-factory~ipad"; sourceTree = ""; }; @@ -1723,6 +1720,10 @@ D37DC6BF1594AE1800B2A5EB /* LinphoneCoreSettingsStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LinphoneCoreSettingsStore.h; sourceTree = ""; }; D37DC6C01594AE1800B2A5EB /* LinphoneCoreSettingsStore.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LinphoneCoreSettingsStore.m; sourceTree = ""; }; D37DC7171594AF3400B2A5EB /* MessageUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MessageUI.framework; path = System/Library/Frameworks/MessageUI.framework; sourceTree = SDKROOT; }; + D37EE10F16035793003608A6 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/ImageViewController.xib; sourceTree = ""; }; + D37EE11116036197003608A6 /* fr */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = fr; path = fr.lproj/ImageViewController.xib; sourceTree = ""; }; + D37EE160160377D7003608A6 /* DTActionSheet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DTActionSheet.h; sourceTree = ""; }; + D37EE161160377D7003608A6 /* DTActionSheet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DTActionSheet.m; sourceTree = ""; }; D3804E5E15D92A57008072A5 /* msg.caf */ = {isa = PBXFileReference; lastKnownFileType = file; name = msg.caf; path = Resources/msg.caf; sourceTree = ""; }; D3804E5F15D92A57008072A5 /* msg.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; name = msg.wav; path = Resources/msg.wav; sourceTree = ""; }; D3807FB715C28940005BE9BC /* DCRoundSwitch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DCRoundSwitch.h; sourceTree = ""; }; @@ -2114,12 +2115,9 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 22405EEE1600B4E400B92522 /* AssetsLibrary.framework in Frameworks */, - 22405EEB16006F0800B92522 /* libmediastreamer_base.a in Frameworks */, - 22405EEC16006F0800B92522 /* libmediastreamer_voip.a in Frameworks */, - 226EF06C15FA256B005865C7 /* MobileCoreServices.framework in Frameworks */, 22B5F03510CE6B2F00777D97 /* AddressBook.framework in Frameworks */, 22B5EFA310CE50BD00777D97 /* AddressBookUI.framework in Frameworks */, + 22405EEE1600B4E400B92522 /* AssetsLibrary.framework in Frameworks */, 2274402F106F335E006EC466 /* AudioToolbox.framework in Frameworks */, 224567C2107B968500F10948 /* AVFoundation.framework in Frameworks */, 228697C411AC29B800E9E0CA /* CFNetwork.framework in Frameworks */, @@ -2130,6 +2128,7 @@ 22276E8713C73D8A00210156 /* CoreVideo.framework in Frameworks */, 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */, D37DC7181594AF3400B2A5EB /* MessageUI.framework in Frameworks */, + 226EF06C15FA256B005865C7 /* MobileCoreServices.framework in Frameworks */, 70E542F313E147E3002BA2C0 /* OpenGLES.framework in Frameworks */, 70E542F513E147EB002BA2C0 /* QuartzCore.framework in Frameworks */, 2264B6D211200342002C2C53 /* SystemConfiguration.framework in Frameworks */, @@ -2145,9 +2144,9 @@ 220FAD3110765B400068D98F /* libeXosip2.a in Frameworks */, 220FAD3210765B400068D98F /* libgsm.a in Frameworks */, 223148E41178A08200637D6A /* libilbc.a in Frameworks */, - 570B130315FE44ED00DE62B6 /* libmediastreamer_base.a in Frameworks */, - 570B130115FE44AF00DE62B6 /* libmediastreamer_voip.a in Frameworks */, F476004B147AAF2800FFF19B /* liblinphone.a in Frameworks */, + D37EE10916032DA4003608A6 /* libmediastreamer_base.a in Frameworks */, + D37EE10A16032DA4003608A6 /* libmediastreamer_voip.a in Frameworks */, 226F2ED81344B0EF00F6EF27 /* libmsamr.a in Frameworks */, 223148E61178A09900637D6A /* libmsilbc.a in Frameworks */, 226183B0147259670037138E /* libmssilk.a in Frameworks */, @@ -2197,7 +2196,8 @@ 22D8F174147548E2008C97DB /* libilbc.a in Frameworks */, 22D8F16B147548E2008C97DB /* libgsm.a in Frameworks */, D34BD61815C13D0B0070C209 /* liblinphone.a in Frameworks */, - D34BD61915C13D0B0070C209 /* libmediastreamer.a in Frameworks */, + D37EE10B16032DC2003608A6 /* libmediastreamer_base.a in Frameworks */, + D37EE10C16032DC2003608A6 /* libmediastreamer_voip.a in Frameworks */, 22D8F17B147548E2008C97DB /* libmsamr.a in Frameworks */, 22D8F175147548E2008C97DB /* libmsilbc.a in Frameworks */, 22D8F179147548E2008C97DB /* libopencore-amrwb.a in Frameworks */, @@ -2266,6 +2266,9 @@ D3ED3EB515873928006C0DE4 /* HistoryViewController.h */, D3ED3EB615873929006C0DE4 /* HistoryViewController.m */, D38187D415FE346B00C3EDCA /* HistoryViewController.xib */, + 22405EFD1601C19000B92522 /* ImageViewController.h */, + 22405EFE1601C19100B92522 /* ImageViewController.m */, + D37EE11016035793003608A6 /* ImageViewController.xib */, D31AAF5C159B3919002C6B02 /* InCallTableViewController.h */, D31AAF5D159B3919002C6B02 /* InCallTableViewController.m */, D3F83EE91582021700336684 /* InCallViewController.h */, @@ -2297,9 +2300,6 @@ 34216F3F1547EBCD00EA9777 /* VideoZoomHandler.m */, D350F20B15A43BB100149E54 /* WizardViewController.h */, D350F20C15A43BB100149E54 /* WizardViewController.m */, - 22405EFD1601C19000B92522 /* ImageViewerViewController.h */, - 22405EFE1601C19100B92522 /* ImageViewerViewController.m */, - 22405EFF1601C19100B92522 /* ImageViewerViewController.xib */, D38187E015FE348A00C3EDCA /* WizardViewController.xib */, ); path = Classes; @@ -2662,10 +2662,6 @@ 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = { isa = PBXGroup; children = ( - 22405EED1600B4E400B92522 /* AssetsLibrary.framework */, - 22405EE916006F0700B92522 /* libmediastreamer_base.a */, - 22405EEA16006F0700B92522 /* libmediastreamer_voip.a */, - 226EF06B15FA256B005865C7 /* MobileCoreServices.framework */, 2258633C11410BAC00C5A737 /* README */, 22276E8013C73D3100210156 /* libavcodec.a */, 22276E8113C73D3100210156 /* libavutil.a */, @@ -2675,7 +2671,8 @@ 220FAD2910765B400068D98F /* libgsm.a */, 223148E31178A08200637D6A /* libilbc.a */, 2211DB911475562600DEE054 /* liblinphone.a */, - 2211DB8F147555C800DEE054 /* libmediastreamer.a */, + 22405EE916006F0700B92522 /* libmediastreamer_base.a */, + 22405EEA16006F0700B92522 /* libmediastreamer_voip.a */, 226F2ED51344B0EF00F6EF27 /* libmsamr.a */, 226CDADE14E2D0B800513B67 /* libmsbcg729.a */, 223148E51178A09900637D6A /* libmsilbc.a */, @@ -2701,6 +2698,7 @@ 344ABDF014850AE9007420B6 /* libstdc++.6.dylib */, 22B5F03410CE6B2F00777D97 /* AddressBook.framework */, 22B5EFA210CE50BD00777D97 /* AddressBookUI.framework */, + 22405EED1600B4E400B92522 /* AssetsLibrary.framework */, 2274402E106F335E006EC466 /* AudioToolbox.framework */, 224567C1107B968500F10948 /* AVFoundation.framework */, 228697C311AC29B800E9E0CA /* CFNetwork.framework */, @@ -2710,6 +2708,7 @@ 340751961506459A00B89C47 /* CoreTelephony.framework */, 22276E8613C73D8A00210156 /* CoreVideo.framework */, D37DC7171594AF3400B2A5EB /* MessageUI.framework */, + 226EF06B15FA256B005865C7 /* MobileCoreServices.framework */, 70E542F213E147E3002BA2C0 /* OpenGLES.framework */, 70E542F413E147EB002BA2C0 /* QuartzCore.framework */, 22744043106F33FC006EC466 /* Security.framework */, @@ -3167,6 +3166,7 @@ D380801215C299D0005BE9BC /* ColorSpaceUtilites.m */, D380801115C29984005BE9BC /* ColorSpaceUtilities.h */, D3807FB615C28940005BE9BC /* DCRoundSwitch */, + D37EE15F160377D7003608A6 /* DTFoundation */, D32B9DFA15A2F131000B6DEC /* FastAddressBook.h */, D32B9DFB15A2F131000B6DEC /* FastAddressBook.m */, D3ED40141602172200BF332B /* GrowingTextView */, @@ -3200,6 +3200,16 @@ name = Products; sourceTree = ""; }; + D37EE15F160377D7003608A6 /* DTFoundation */ = { + isa = PBXGroup; + children = ( + D37EE160160377D7003608A6 /* DTActionSheet.h */, + D37EE161160377D7003608A6 /* DTActionSheet.m */, + ); + name = DTFoundation; + path = Utils/DTFoundation; + sourceTree = ""; + }; D3807FB615C28940005BE9BC /* DCRoundSwitch */ = { isa = PBXGroup; children = ( @@ -3865,7 +3875,7 @@ 2234C8E915EE2F7F00E18E83 /* chat_message_delivered.png in Resources */, 2234C8EB15EE2F7F00E18E83 /* chat_message_not_delivered.png in Resources */, 2234C8EE15EE744200E18E83 /* chat_message_inprogress.png in Resources */, - 22405F021601C19200B92522 /* ImageViewerViewController.xib in Resources */, + D37EE10D16035793003608A6 /* ImageViewController.xib in Resources */, D381881115FE3F0B00C3EDCA /* UICallCell.xib in Resources */, D381881915FE3FCA00C3EDCA /* InCallViewController.xib in Resources */, D381883E15FE447200C3EDCA /* ChatRoomViewController.xib in Resources */, @@ -4317,7 +4327,7 @@ 2234C8EA15EE2F7F00E18E83 /* chat_message_delivered.png in Resources */, 2234C8EC15EE2F7F00E18E83 /* chat_message_not_delivered.png in Resources */, 2234C8EF15EE744200E18E83 /* chat_message_inprogress.png in Resources */, - 22405F031601C19200B92522 /* ImageViewerViewController.xib in Resources */, + D37EE10E16035793003608A6 /* ImageViewController.xib in Resources */, D381881215FE3F0B00C3EDCA /* UICallCell.xib in Resources */, D381881A15FE3FCA00C3EDCA /* InCallViewController.xib in Resources */, D381883F15FE447200C3EDCA /* ChatRoomViewController.xib in Resources */, @@ -4449,9 +4459,10 @@ D380800515C28A7A005BE9BC /* UILinphone.m in Sources */, D380801315C299D0005BE9BC /* ColorSpaceUtilites.m in Sources */, D378AB2A15DCDB4A0098505D /* ContactDetailsImagePickerController.m in Sources */, - 22405F001601C19200B92522 /* ImageViewerViewController.m in Sources */, + 22405F001601C19200B92522 /* ImageViewController.m in Sources */, D3ED40191602172200BF332B /* HPGrowingTextView.m in Sources */, D3ED401B1602172200BF332B /* HPTextViewInternal.m in Sources */, + D37EE162160377D7003608A6 /* DTActionSheet.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -4542,9 +4553,10 @@ D380800615C28A7A005BE9BC /* UILinphone.m in Sources */, D380801415C299D0005BE9BC /* ColorSpaceUtilites.m in Sources */, D378AB2B15DCDB4A0098505D /* ContactDetailsImagePickerController.m in Sources */, - 22405F011601C19200B92522 /* ImageViewerViewController.m in Sources */, + 22405F011601C19200B92522 /* ImageViewController.m in Sources */, D3ED401A1602172200BF332B /* HPGrowingTextView.m in Sources */, D3ED401C1602172200BF332B /* HPTextViewInternal.m in Sources */, + D37EE163160377D7003608A6 /* DTActionSheet.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -4583,6 +4595,15 @@ name = Localizable.strings; sourceTree = ""; }; + D37EE11016035793003608A6 /* ImageViewController.xib */ = { + isa = PBXVariantGroup; + children = ( + D37EE10F16035793003608A6 /* en */, + D37EE11116036197003608A6 /* fr */, + ); + name = ImageViewController.xib; + sourceTree = ""; + }; D38187B015FE340100C3EDCA /* ChatRoomViewController.xib */ = { isa = PBXVariantGroup; children = ( From 942c0c44e61728696e42453a8b85a0302deb0abc Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Fri, 14 Sep 2012 17:55:07 +0200 Subject: [PATCH 05/16] activate edge mode --- Resources/linphonerc | 2 +- Resources/linphonerc-factory | 3 +++ Resources/linphonerc-factory~ipad | 3 +++ submodules/mssilk | 2 +- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Resources/linphonerc b/Resources/linphonerc index 26241fa72..5057f2f02 100644 --- a/Resources/linphonerc +++ b/Resources/linphonerc @@ -21,4 +21,4 @@ display_filter_auto_rotate=1 [default_values] -reg_expires=610 \ No newline at end of file +reg_expires=600 \ No newline at end of file diff --git a/Resources/linphonerc-factory b/Resources/linphonerc-factory index 488ee816c..9f430caa8 100644 --- a/Resources/linphonerc-factory +++ b/Resources/linphonerc-factory @@ -3,6 +3,9 @@ download_bw=380 upload_bw=380 firewall_policy=0 mtu=1300 +activate_edge_workarounds=1 +edge_ping_time=200 +edge_bw=10 [sip] guess_hostname=1 diff --git a/Resources/linphonerc-factory~ipad b/Resources/linphonerc-factory~ipad index ca50942ac..68428263e 100644 --- a/Resources/linphonerc-factory~ipad +++ b/Resources/linphonerc-factory~ipad @@ -3,6 +3,9 @@ download_bw=512 upload_bw=512 firewall_policy=0 mtu=1300 +activate_edge_workarounds=1 +edge_ping_time=200 +edge_bw=10 [sip] guess_hostname=1 diff --git a/submodules/mssilk b/submodules/mssilk index f9015a91c..1d81e34d6 160000 --- a/submodules/mssilk +++ b/submodules/mssilk @@ -1 +1 @@ -Subproject commit f9015a91ca056cc5be577dfb78c7c224f1fd77b2 +Subproject commit 1d81e34d6e3234797a726f9e66fc02ac5f28a637 From 3e78c72b6ba2b29babbbe923f9401dcd0f7a9858 Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Fri, 14 Sep 2012 18:16:55 +0200 Subject: [PATCH 06/16] update liblinphone --- submodules/linphone | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/linphone b/submodules/linphone index 800460760..efe7222f2 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit 8004607607c344a0f1dd09d1854848fca0e52d59 +Subproject commit efe7222f2efb7eae906b7337925fc080ce9d6b0e From 40b735ef5acf37363402c7228a95309b3a9d6fc6 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Sun, 16 Sep 2012 11:02:17 +0200 Subject: [PATCH 07/16] change default values for video policiy. --- Resources/linphonerc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Resources/linphonerc b/Resources/linphonerc index 5057f2f02..d5d14881f 100644 --- a/Resources/linphonerc +++ b/Resources/linphonerc @@ -17,7 +17,8 @@ show_local=0 enabled=1 size=qvga display_filter_auto_rotate=1 - +automatically_initiate=0 +automatically_accept=0 [default_values] From 93e61518b5c1b1b377a65ac7d33f0a8653b3e349 Mon Sep 17 00:00:00 2001 From: Yann Diorcet Date: Mon, 17 Sep 2012 09:48:27 +0200 Subject: [PATCH 08/16] Factorize ImagePicker code --- Classes/ChatRoomViewController.h | 3 +- Classes/ChatRoomViewController.m | 79 +++++-------------- ...ntroller.h => ImagePickerViewController.h} | 10 ++- ...ntroller.m => ImagePickerViewController.m} | 32 ++++++-- Classes/ImageViewController.m | 2 + Classes/LinphoneUI/UIContactDetailsHeader.h | 4 +- Classes/LinphoneUI/UIContactDetailsHeader.m | 23 ++++-- Classes/PhoneMainView.h | 2 +- linphone.xcodeproj/project.pbxproj | 16 ++-- 9 files changed, 82 insertions(+), 89 deletions(-) rename Classes/{ContactDetailsImagePickerController.h => ImagePickerViewController.h} (69%) rename Classes/{ContactDetailsImagePickerController.m => ImagePickerViewController.m} (67%) diff --git a/Classes/ChatRoomViewController.h b/Classes/ChatRoomViewController.h index 282d2087e..47f44bfc5 100644 --- a/Classes/ChatRoomViewController.h +++ b/Classes/ChatRoomViewController.h @@ -24,10 +24,11 @@ #import "ChatRoomTableViewController.h" #import "HPGrowingTextView.h" #import "ChatModel.h" +#import "ImagePickerViewController.h" #include "linphonecore.h" -@interface ChatRoomViewController : UIViewController { +@interface ChatRoomViewController : UIViewController { @private LinphoneChatRoom *chatRoom; NSURLConnection* uploadContext; diff --git a/Classes/ChatRoomViewController.m b/Classes/ChatRoomViewController.m index 746adb0c3..e72461314 100644 --- a/Classes/ChatRoomViewController.m +++ b/Classes/ChatRoomViewController.m @@ -19,10 +19,12 @@ #import "ChatRoomViewController.h" #import "PhoneMainView.h" +#import "DTActionSheet.h" + #import #import #import -#import "DTActionSheet.h" + @implementation ChatRoomViewController @@ -411,45 +413,24 @@ static void message_status(LinphoneChatMessage* msg,LinphoneChatMessageState sta - (IBAction)onPictureClick:(id)event { [messageField resignFirstResponder]; - DTActionSheet *sheet = [[[DTActionSheet alloc] initWithTitle:NSLocalizedString(@"Select picture source",nil)] autorelease]; - if([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) { - [sheet addButtonWithTitle:NSLocalizedString(@"Camera",nil) block:^(){ - UIImagePickerController *mediaUI = [[UIImagePickerController alloc] init]; - mediaUI.sourceType = UIImagePickerControllerSourceTypeCamera; + [ImagePickerViewController promptSelectSource:^(UIImagePickerControllerSourceType type) { + UICompositeViewDescription *description = [[[ImagePickerViewController compositeViewDescription] copy] autorelease]; + description.tabBar = nil; // Disable default tarbar + description.tabBarEnabled = false; + ImagePickerViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:description push:TRUE], ImagePickerViewController); + if(controller != nil) { + controller.sourceType = type; // Displays a control that allows the user to choose picture or // movie capture, if both are available: - mediaUI.mediaTypes = - [UIImagePickerController availableMediaTypesForSourceType: - UIImagePickerControllerSourceTypeCamera]; + controller.mediaTypes = [UIImagePickerController availableMediaTypesForSourceType:type]; // Hides the controls for moving & scaling pictures, or for // trimming movies. To instead show the controls, use YES. - mediaUI.allowsEditing = NO; - mediaUI.delegate = self; - [self presentModalViewController: mediaUI animated: YES]; - }]; - } - if([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary]) { - [sheet addButtonWithTitle:NSLocalizedString(@"Photo library",nil) block:^(){ - UIImagePickerController *mediaUI = [[UIImagePickerController alloc] init]; - mediaUI.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; - - // Displays saved pictures and movies, if both are available, from the - // Camera Roll album. - mediaUI.mediaTypes = - [UIImagePickerController availableMediaTypesForSourceType: - UIImagePickerControllerSourceTypePhotoLibrary]; - - // Hides the controls for moving & scaling pictures, or for - // trimming movies. To instead show the controls, use YES. - mediaUI.allowsEditing = NO; - mediaUI.delegate = self; - [self presentModalViewController: mediaUI animated: YES]; - }]; - } - [sheet addCancelButtonWithTitle:NSLocalizedString(@"Cancel",nil)]; - [sheet showInView:self.view]; + controller.allowsEditing = NO; + controller.imagePickerDelegate = self; + } + }]; } - (IBAction)onTransferCancelClick:(id)event { @@ -663,36 +644,16 @@ static void message_status(LinphoneChatMessage* msg,LinphoneChatMessageState sta return [NSURLConnection connectionWithRequest:(NSURLRequest *)request delegate:self]; } -#pragma mark UIImagePickerControllerDelegate -- (void)imagePickerControllerDidCancel:(UIImagePickerController *) picker { - [self dismissModalViewControllerAnimated: YES]; - [picker release]; -} +#pragma mark ImpagePickerDelegate -- (void)imagePickerController: (UIImagePickerController *) picker didFinishPickingMediaWithInfo: (NSDictionary *) info { - NSURL *imageURL = [info valueForKey: UIImagePickerControllerReferenceURL]; - UIImage* imageToUse = (UIImage *) [info objectForKey: UIImagePickerControllerOriginalImage]; - NSString* imageName; - if (imageURL) { - // extract id from asset-url ex: assets-library://asset/asset.JPG?id=1645156-6151-1513&ext=JPG - NSArray *parameters = [[imageURL query] componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"=&"]]; - for (int i = 0; i < [parameters count]; i=i+2) { - if ([(NSString*)[parameters objectAtIndex:i] isEqualToString:@"id"]) { - imageName=[NSString stringWithFormat:@"%@.jpg",(NSString*)[parameters objectAtIndex:i+1]]; - } - } - } else { - // must be "unique" - imageName=[NSString stringWithFormat:@"%i.jpg",[imageToUse hash]]; - } - uploadContext = [self uploadImage:imageToUse Named: imageName]; +- (void)imagePickerDelegateImage:(UIImage*)image { + NSString *imageName = [NSString stringWithFormat:@"%i.jpg", [image hash]]; + uploadContext = [self uploadImage:image Named: imageName]; [self startUpload]; - - [picker.presentingViewController dismissModalViewControllerAnimated: YES]; - [picker release]; } + #pragma mark - Keyboard Event Functions - (void)keyboardWillHide:(NSNotification *)notif { diff --git a/Classes/ContactDetailsImagePickerController.h b/Classes/ImagePickerViewController.h similarity index 69% rename from Classes/ContactDetailsImagePickerController.h rename to Classes/ImagePickerViewController.h index 3e0fcff72..91eb9c07d 100644 --- a/Classes/ContactDetailsImagePickerController.h +++ b/Classes/ImagePickerViewController.h @@ -19,15 +19,17 @@ #import "UICompositeViewController.h" -@protocol ContactDetailsImagePickerDelegate +@protocol ImagePickerDelegate -- (void)changeContactImage:(UIImage*)image; +- (void)imagePickerDelegateImage:(UIImage*)image; @end -@interface ContactDetailsImagePickerController : UIImagePickerController { +@interface ImagePickerViewController : UIImagePickerController { } -@property (nonatomic, retain) id imagePickerDelegate; +@property (nonatomic, retain) id imagePickerDelegate; + ++ (void)promptSelectSource:(void (^)(UIImagePickerControllerSourceType))block; @end diff --git a/Classes/ContactDetailsImagePickerController.m b/Classes/ImagePickerViewController.m similarity index 67% rename from Classes/ContactDetailsImagePickerController.m rename to Classes/ImagePickerViewController.m index 0b68fcf1b..dad0a57a1 100644 --- a/Classes/ContactDetailsImagePickerController.m +++ b/Classes/ImagePickerViewController.m @@ -17,10 +17,11 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#import "ContactDetailsImagePickerController.h" +#import "ImagePickerViewController.h" #import "PhoneMainView.h" +#import "DTActionSheet.h" -@implementation ContactDetailsImagePickerController +@implementation ImagePickerViewController @synthesize imagePickerDelegate; @@ -31,8 +32,8 @@ static UICompositeViewDescription *compositeDescription = nil; + (UICompositeViewDescription *)compositeViewDescription { if(compositeDescription == nil) { - compositeDescription = [[UICompositeViewDescription alloc] init:@"ContactDetailsImage" - content:@"ContactDetailsImagePickerController" + compositeDescription = [[UICompositeViewDescription alloc] init:@"ImagePicker" + content:@"ImagePickerViewController" stateBar:nil stateBarEnabled:false tabBar:@"UIMainBar" @@ -56,11 +57,28 @@ static UICompositeViewDescription *compositeDescription = nil; #pragma mark - - (void)dismiss { - if([[[PhoneMainView instance] currentView] equal:[ContactDetailsImagePickerController compositeViewDescription]]) { + if([[[PhoneMainView instance] currentView] equal:[ImagePickerViewController compositeViewDescription]]) { [[PhoneMainView instance] popCurrentView]; } } ++ (void)promptSelectSource:(void (^)(UIImagePickerControllerSourceType))block { + DTActionSheet *sheet = [[[DTActionSheet alloc] initWithTitle:NSLocalizedString(@"Select picture source",nil)] autorelease]; + if([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) { + [sheet addButtonWithTitle:NSLocalizedString(@"Camera",nil) block:^(){ + block(UIImagePickerControllerSourceTypeCamera); + }]; + } + if([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary]) { + [sheet addButtonWithTitle:NSLocalizedString(@"Photo library",nil) block:^(){ + block(UIImagePickerControllerSourceTypePhotoLibrary); + }]; + } + [sheet addCancelButtonWithTitle:NSLocalizedString(@"Cancel",nil)]; + + [sheet showInView:[PhoneMainView instance].view]; +} + #pragma mark - UIImagePickerControllerDelegate Functions @@ -69,8 +87,8 @@ static UICompositeViewDescription *compositeDescription = nil; if(image == nil) { image = [info objectForKey:UIImagePickerControllerOriginalImage]; } - if(image != nil) { - [imagePickerDelegate changeContactImage:image]; + if(image != nil && imagePickerDelegate != nil) { + [imagePickerDelegate imagePickerDelegateImage:image]; } [self dismiss]; } diff --git a/Classes/ImageViewController.m b/Classes/ImageViewController.m index e71d91e89..225ca9a4f 100644 --- a/Classes/ImageViewController.m +++ b/Classes/ImageViewController.m @@ -30,6 +30,7 @@ @synthesize backButton; @synthesize image; + #pragma mark - UICompositeViewDelegate Functions static UICompositeViewDescription *compositeDescription = nil; @@ -49,6 +50,7 @@ static UICompositeViewDescription *compositeDescription = nil; return compositeDescription; } + #pragma mark - Property Functions - (void)setImage:(UIImage *)aimage { diff --git a/Classes/LinphoneUI/UIContactDetailsHeader.h b/Classes/LinphoneUI/UIContactDetailsHeader.h index a9279f002..af82ed75a 100644 --- a/Classes/LinphoneUI/UIContactDetailsHeader.h +++ b/Classes/LinphoneUI/UIContactDetailsHeader.h @@ -20,10 +20,10 @@ #import #import -#import "ContactDetailsImagePickerController.h" +#import "ImagePickerViewController.h" #import "ContactDetailsDelegate.h" -@interface UIContactDetailsHeader : UIViewController { +@interface UIContactDetailsHeader : UIViewController { @private NSArray *propertyList; BOOL editing; diff --git a/Classes/LinphoneUI/UIContactDetailsHeader.m b/Classes/LinphoneUI/UIContactDetailsHeader.m index 24221d60a..3a2544958 100644 --- a/Classes/LinphoneUI/UIContactDetailsHeader.m +++ b/Classes/LinphoneUI/UIContactDetailsHeader.m @@ -243,19 +243,28 @@ - (IBAction)onAvatarClick:(id)event { if(self.isEditing) { - ContactDetailsImagePickerController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:[ContactDetailsImagePickerController compositeViewDescription] push:TRUE], ContactDetailsImagePickerController); - if(controller != nil) { - [controller setAllowsEditing:TRUE]; - [controller setSourceType:UIImagePickerControllerSourceTypePhotoLibrary]; - [controller setImagePickerDelegate:self]; - } + [ImagePickerViewController promptSelectSource:^(UIImagePickerControllerSourceType type) { + ImagePickerViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:[ImagePickerViewController compositeViewDescription] push:TRUE], ImagePickerViewController); + if(controller != nil) { + controller.sourceType = type; + + // Displays a control that allows the user to choose picture or + // movie capture, if both are available: + controller.mediaTypes = [UIImagePickerController availableMediaTypesForSourceType:type]; + + // Hides the controls for moving & scaling pictures, or for + // trimming movies. To instead show the controls, use YES. + controller.allowsEditing = NO; + controller.imagePickerDelegate = self; + } + }]; } } #pragma mark - ContactDetailsImagePickerDelegate Functions -- (void)changeContactImage:(UIImage*)image { +- (void)imagePickerDelegateImage:(UIImage*)image { NSError* error = NULL; if(!ABPersonRemoveImageData(contact, (CFErrorRef*)error)) { [LinphoneLogger log:LinphoneLoggerLog format:@"Can't add entry: %@", [error localizedDescription]]; diff --git a/Classes/PhoneMainView.h b/Classes/PhoneMainView.h index e92f28834..f76e3cb6a 100644 --- a/Classes/PhoneMainView.h +++ b/Classes/PhoneMainView.h @@ -30,7 +30,7 @@ #import "ContactsViewController.h" #import "ContactDetailsViewController.h" #import "ContactDetailsLabelViewController.h" -#import "ContactDetailsImagePickerController.h" +#import "ImagePickerViewController.h" #import "HistoryViewController.h" #import "HistoryDetailsViewController.h" #import "InCallViewController.h" diff --git a/linphone.xcodeproj/project.pbxproj b/linphone.xcodeproj/project.pbxproj index 15ef38c86..1906d3515 100755 --- a/linphone.xcodeproj/project.pbxproj +++ b/linphone.xcodeproj/project.pbxproj @@ -655,8 +655,8 @@ D377BBFA15A19DA6002B696B /* video_on_disabled.png in Resources */ = {isa = PBXBuildFile; fileRef = D377BBF915A19DA6002B696B /* video_on_disabled.png */; }; D378906515AC373B00BD776C /* ContactDetailsLabelViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D378906315AC373B00BD776C /* ContactDetailsLabelViewController.m */; }; D378906615AC373B00BD776C /* ContactDetailsLabelViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D378906315AC373B00BD776C /* ContactDetailsLabelViewController.m */; }; - D378AB2A15DCDB4A0098505D /* ContactDetailsImagePickerController.m in Sources */ = {isa = PBXBuildFile; fileRef = D378AB2915DCDB490098505D /* ContactDetailsImagePickerController.m */; }; - D378AB2B15DCDB4A0098505D /* ContactDetailsImagePickerController.m in Sources */ = {isa = PBXBuildFile; fileRef = D378AB2915DCDB490098505D /* ContactDetailsImagePickerController.m */; }; + D378AB2A15DCDB4A0098505D /* ImagePickerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D378AB2915DCDB490098505D /* ImagePickerViewController.m */; }; + D378AB2B15DCDB4A0098505D /* ImagePickerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D378AB2915DCDB490098505D /* ImagePickerViewController.m */; }; D37B96B715A1A6F20005CCD2 /* call_state_delete_default.png in Resources */ = {isa = PBXBuildFile; fileRef = D37B96B515A1A6F20005CCD2 /* call_state_delete_default.png */; }; D37B96B915A1A6F20005CCD2 /* call_state_delete_over.png in Resources */ = {isa = PBXBuildFile; fileRef = D37B96B615A1A6F20005CCD2 /* call_state_delete_over.png */; }; D37C638E15AAD251009D0BAC /* contact_number_over.png in Resources */ = {isa = PBXBuildFile; fileRef = D37C638C15AAD251009D0BAC /* contact_number_over.png */; }; @@ -1707,8 +1707,8 @@ D377BBF915A19DA6002B696B /* video_on_disabled.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = video_on_disabled.png; path = Resources/video_on_disabled.png; sourceTree = ""; }; D378906215AC373B00BD776C /* ContactDetailsLabelViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContactDetailsLabelViewController.h; sourceTree = ""; }; D378906315AC373B00BD776C /* ContactDetailsLabelViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ContactDetailsLabelViewController.m; sourceTree = ""; }; - D378AB2815DCDB480098505D /* ContactDetailsImagePickerController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContactDetailsImagePickerController.h; sourceTree = ""; }; - D378AB2915DCDB490098505D /* ContactDetailsImagePickerController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ContactDetailsImagePickerController.m; sourceTree = ""; }; + D378AB2815DCDB480098505D /* ImagePickerViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImagePickerViewController.h; sourceTree = ""; }; + D378AB2915DCDB490098505D /* ImagePickerViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ImagePickerViewController.m; sourceTree = ""; }; D37B96B515A1A6F20005CCD2 /* call_state_delete_default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = call_state_delete_default.png; path = Resources/call_state_delete_default.png; sourceTree = ""; }; D37B96B615A1A6F20005CCD2 /* call_state_delete_over.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = call_state_delete_over.png; path = Resources/call_state_delete_over.png; sourceTree = ""; }; D37C638C15AAD251009D0BAC /* contact_number_over.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = contact_number_over.png; path = Resources/contact_number_over.png; sourceTree = ""; }; @@ -2236,8 +2236,6 @@ 22E0A81F111C44E100B04932 /* ConsoleViewController.m */, 22E0A81E111C44E100B04932 /* ConsoleViewController.xib */, D30BBD1215D3EFEB000F93DD /* ContactDetailsDelegate.h */, - D378AB2815DCDB480098505D /* ContactDetailsImagePickerController.h */, - D378AB2915DCDB490098505D /* ContactDetailsImagePickerController.m */, D378906215AC373B00BD776C /* ContactDetailsLabelViewController.h */, D378906315AC373B00BD776C /* ContactDetailsLabelViewController.m */, D38187B815FE341B00C3EDCA /* ContactDetailsLabelViewController.xib */, @@ -2266,6 +2264,8 @@ D3ED3EB515873928006C0DE4 /* HistoryViewController.h */, D3ED3EB615873929006C0DE4 /* HistoryViewController.m */, D38187D415FE346B00C3EDCA /* HistoryViewController.xib */, + D378AB2815DCDB480098505D /* ImagePickerViewController.h */, + D378AB2915DCDB490098505D /* ImagePickerViewController.m */, 22405EFD1601C19000B92522 /* ImageViewController.h */, 22405EFE1601C19100B92522 /* ImageViewController.m */, D37EE11016035793003608A6 /* ImageViewController.xib */, @@ -4458,7 +4458,7 @@ D380800215C2894A005BE9BC /* IASKTextField.m in Sources */, D380800515C28A7A005BE9BC /* UILinphone.m in Sources */, D380801315C299D0005BE9BC /* ColorSpaceUtilites.m in Sources */, - D378AB2A15DCDB4A0098505D /* ContactDetailsImagePickerController.m in Sources */, + D378AB2A15DCDB4A0098505D /* ImagePickerViewController.m in Sources */, 22405F001601C19200B92522 /* ImageViewController.m in Sources */, D3ED40191602172200BF332B /* HPGrowingTextView.m in Sources */, D3ED401B1602172200BF332B /* HPTextViewInternal.m in Sources */, @@ -4552,7 +4552,7 @@ D380800315C2894A005BE9BC /* IASKTextField.m in Sources */, D380800615C28A7A005BE9BC /* UILinphone.m in Sources */, D380801415C299D0005BE9BC /* ColorSpaceUtilites.m in Sources */, - D378AB2B15DCDB4A0098505D /* ContactDetailsImagePickerController.m in Sources */, + D378AB2B15DCDB4A0098505D /* ImagePickerViewController.m in Sources */, 22405F011601C19200B92522 /* ImageViewController.m in Sources */, D3ED401A1602172200BF332B /* HPGrowingTextView.m in Sources */, D3ED401C1602172200BF332B /* HPTextViewInternal.m in Sources */, From f118e62af74717438e8229a541c4d52c5b2ab7ba Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Mon, 17 Sep 2012 11:22:16 +0200 Subject: [PATCH 09/16] move default firewall policy from linphonerc-factory to linphonerc --- Resources/linphonerc | 2 ++ Resources/linphonerc-factory | 1 - Resources/linphonerc-factory~ipad | 1 - Resources/linphonerc~ipad | 5 ++++- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Resources/linphonerc b/Resources/linphonerc index 5057f2f02..b2e2d04a0 100644 --- a/Resources/linphonerc +++ b/Resources/linphonerc @@ -19,6 +19,8 @@ size=qvga display_filter_auto_rotate=1 +[net] +firewall_policy=0 [default_values] reg_expires=600 \ No newline at end of file diff --git a/Resources/linphonerc-factory b/Resources/linphonerc-factory index 9f430caa8..6364d3100 100644 --- a/Resources/linphonerc-factory +++ b/Resources/linphonerc-factory @@ -1,7 +1,6 @@ [net] download_bw=380 upload_bw=380 -firewall_policy=0 mtu=1300 activate_edge_workarounds=1 edge_ping_time=200 diff --git a/Resources/linphonerc-factory~ipad b/Resources/linphonerc-factory~ipad index 68428263e..121edc3e6 100644 --- a/Resources/linphonerc-factory~ipad +++ b/Resources/linphonerc-factory~ipad @@ -1,7 +1,6 @@ [net] download_bw=512 upload_bw=512 -firewall_policy=0 mtu=1300 activate_edge_workarounds=1 edge_ping_time=200 diff --git a/Resources/linphonerc~ipad b/Resources/linphonerc~ipad index 2b37b20f2..768e62443 100644 --- a/Resources/linphonerc~ipad +++ b/Resources/linphonerc~ipad @@ -7,4 +7,7 @@ keepalive_period=30000 [rtp] audio_rtp_port=7076 -video_rtp_port=9078 \ No newline at end of file +video_rtp_port=9078 + +[net] +firewall_policy=0 \ No newline at end of file From 515921039482467e75e261b44245ff1e3c077392 Mon Sep 17 00:00:00 2001 From: Yann Diorcet Date: Mon, 17 Sep 2012 11:55:33 +0200 Subject: [PATCH 10/16] Split Image sharing code --- Classes/ChatRoomViewController.h | 8 +- Classes/ChatRoomViewController.m | 266 +++++++--------------------- Classes/ImagePickerViewController.h | 2 +- Classes/ImagePickerViewController.m | 2 +- Classes/ImageSharing.h | 50 ++++++ Classes/ImageSharing.m | 182 +++++++++++++++++++ linphone.xcodeproj/project.pbxproj | 8 + 7 files changed, 312 insertions(+), 206 deletions(-) create mode 100644 Classes/ImageSharing.h create mode 100644 Classes/ImageSharing.m diff --git a/Classes/ChatRoomViewController.h b/Classes/ChatRoomViewController.h index 47f44bfc5..730342317 100644 --- a/Classes/ChatRoomViewController.h +++ b/Classes/ChatRoomViewController.h @@ -25,16 +25,14 @@ #import "HPGrowingTextView.h" #import "ChatModel.h" #import "ImagePickerViewController.h" +#import "ImageSharing.h" #include "linphonecore.h" -@interface ChatRoomViewController : UIViewController { +@interface ChatRoomViewController : UIViewController { @private LinphoneChatRoom *chatRoom; - NSURLConnection* uploadContext; - NSURLConnection* downloadContext; - NSMutableData* downloadedData; - NSInteger totalBytesExpectedToRead; + ImageSharing *imageSharing; } diff --git a/Classes/ChatRoomViewController.m b/Classes/ChatRoomViewController.m index e72461314..a412da064 100644 --- a/Classes/ChatRoomViewController.m +++ b/Classes/ChatRoomViewController.m @@ -54,6 +54,7 @@ self = [super initWithNibName:@"ChatRoomViewController" bundle:[NSBundle mainBundle]]; if (self != nil) { self->chatRoom = NULL; + self->imageSharing = NULL; } return self; } @@ -83,7 +84,6 @@ } - #pragma mark - UICompositeViewDelegate Functions static UICompositeViewDescription *compositeDescription = nil; @@ -106,7 +106,6 @@ static UICompositeViewDescription *compositeDescription = nil; #pragma mark - ViewController Functions - - (void)viewDidLoad { [super viewDidLoad]; @@ -120,7 +119,6 @@ static UICompositeViewDescription *compositeDescription = nil; messageField.font = [UIFont systemFontOfSize:18.0f]; messageField.contentInset = UIEdgeInsetsZero; messageField.backgroundColor = [UIColor clearColor]; - [self enableTransferView:FALSE]; [sendButton setEnabled:FALSE]; } @@ -331,9 +329,9 @@ static void message_status(LinphoneChatMessage* msg,LinphoneChatMessageState sta DTActionSheet *sheet = [[[DTActionSheet alloc] initWithTitle:NSLocalizedString(@"Incoming file stored to your photo library",nil)] autorelease]; [sheet addButtonWithTitle:NSLocalizedString(@"Accept",nil) block:^(){ - [downloadContext release]; - downloadContext = [self downloadImageFrom:pendingFileUrl]; - [self startDownload]; + imageSharing = [ImageSharing imageSharingDownload:[NSURL URLWithString:pendingFileUrl] delegate:self]; + [footerView setHidden:TRUE]; + [transferView setHidden:FALSE]; }]; [sheet addCancelButtonWithTitle:NSLocalizedString(@"Ignore",nil)]; [sheet showInView:self.view]; @@ -379,6 +377,7 @@ static void message_status(LinphoneChatMessage* msg,LinphoneChatMessageState sta forNinePatchNamed:@"chat_background"]]; } + #pragma mark - Action Functions - (IBAction)onBackClick:(id)event { @@ -434,223 +433,92 @@ static void message_status(LinphoneChatMessage* msg,LinphoneChatMessageState sta } - (IBAction)onTransferCancelClick:(id)event { - if(uploadContext) { - [uploadContext cancel]; - [self stopUpload]; + if(imageSharing) { + [imageSharing cancel]; } - if(downloadContext) { - [downloadContext cancel]; - [self stopDownload]; - } - [LinphoneLogger log:LinphoneLoggerLog format:@"File transfer interrupted by user"]; -} - -- (void)enableTransferView:(BOOL)isTranfer { - if (isTranfer) { - [imageTransferProgressBar setProgress:0.0]; - } else { - //[uploadContext cancel]; - } - [footerView setHidden:isTranfer]; - [transferView setHidden:!isTranfer]; - [imageTransferProgressBar setHidden:!isTranfer]; - [cancelTransferButton setHidden:!isTranfer]; - [sendButton setEnabled:!isTranfer]; -} - -- (void)startUpload { - [self enableTransferView:TRUE]; -} - -- (void)stopUpload { - [self enableTransferView:FALSE]; -} - -- (void)startDownload { - [self enableTransferView:TRUE]; -} - -- (void)stopDownload { - [self enableTransferView:FALSE]; } -#pragma mark - NSURLConnectionDelegate +#pragma mark ImageSharingDelegate -- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error { - if (connection == uploadContext) { - [self stopUpload]; - NSString *serverUrl = [[LinphoneManager instance] lpConfigStringForKey:@"file_upload_url"]; - [LinphoneLogger log:LinphoneLoggerError format:@"Cannot upload file to server [%@] because [%@]", serverUrl, [error localizedDescription]]; - UIAlertView* errorAlert = [UIAlertView alloc]; +- (void)imageSharingProgress:(ImageSharing*)aimageSharing progress:(float)progress { + [imageTransferProgressBar setProgress:progress animated:FALSE]; +} + +- (void)imageSharingAborted:(ImageSharing*)aimageSharing { + [footerView setHidden:FALSE]; + [transferView setHidden:TRUE]; + imageSharing = NULL; +} + +- (void)imageSharingError:(ImageSharing*)aimageSharing error:(NSError *)error { + [footerView setHidden:FALSE]; + [transferView setHidden:TRUE]; + NSString *url = [aimageSharing.connection.currentRequest.URL absoluteString]; + if (aimageSharing.upload) { + [LinphoneLogger log:LinphoneLoggerError format:@"Cannot upload file to server [%@] because [%@]", url, [error localizedDescription]]; + UIAlertView* errorAlert = [UIAlertView alloc]; [errorAlert initWithTitle:NSLocalizedString(@"Transfer error", nil) - message:NSLocalizedString(@"Cannot transfer file to remote contact", nil) - delegate:nil - cancelButtonTitle:NSLocalizedString(@"Ok",nil) + message:NSLocalizedString(@"Cannot transfer file to remote contact", nil) + delegate:nil + cancelButtonTitle:NSLocalizedString(@"Ok",nil) otherButtonTitles:nil ,nil]; [errorAlert show]; [errorAlert release]; - }else if (connection == downloadContext) { - [LinphoneLogger log:LinphoneLoggerError format:@"Cannot dowanlod file from [%@] because [%@]", [connection.currentRequest.URL absoluteString], [error localizedDescription]]; - UIAlertView* errorAlert = [UIAlertView alloc]; + } else { + [LinphoneLogger log:LinphoneLoggerError format:@"Cannot dowanlod file from [%@] because [%@]", url, [error localizedDescription]]; + UIAlertView* errorAlert = [UIAlertView alloc]; [errorAlert initWithTitle:NSLocalizedString(@"Transfer error", nil) message:NSLocalizedString(@"Cannot transfer file from remote contact", nil) - delegate:nil - cancelButtonTitle:NSLocalizedString(@"Continue", nil) - otherButtonTitles:nil, nil]; + delegate:nil + cancelButtonTitle:NSLocalizedString(@"Continue", nil) + otherButtonTitles:nil, nil]; [errorAlert show]; [errorAlert release]; - } else { - [LinphoneLogger log:LinphoneLoggerError format:@"Invalid file transfer connection", connection]; } + imageSharing = NULL; } -- (void)connection:(NSURLConnection *)connection didSendBodyData:(NSInteger)bytesWritten totalBytesWritten:(NSInteger)totalBytesWritten totalBytesExpectedToWrite:(NSInteger)totalBytesExpectedToWrite { - [imageTransferProgressBar setProgress:(float)((float)totalBytesWritten/(float)totalBytesExpectedToWrite) animated:FALSE]; - -} - -- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data { - if (connection == uploadContext) { - NSString* imageRemoteUrl=[[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; - [LinphoneLogger log:LinphoneLoggerLog format:@"File can be downloaded from [%@]", imageRemoteUrl]; - [self sendMessage:NSLocalizedString(@"Image sent",nil) withExterlBodyUrl:imageRemoteUrl]; - } else if (connection == downloadContext) { - if (downloadedData == nil) downloadedData = [[NSMutableData alloc] initWithCapacity:[data length]]; - [downloadedData appendData:data]; - [imageTransferProgressBar setProgress:((float)downloadedData.length/(float)totalBytesExpectedToRead) animated:FALSE]; - } else { - [LinphoneLogger log:LinphoneLoggerError format:@"Invalid file transfer connection", connection]; - } -} - -- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response { - NSHTTPURLResponse * httpResponse = (NSHTTPURLResponse *) response; - int statusCode = httpResponse.statusCode;; - [LinphoneLogger log:LinphoneLoggerLog format:@"File transfer status code [%i]",statusCode]; +- (void)imageSharingUploadDone:(ImageSharing*)aimageSharing url:(NSURL*)url{ + [self sendMessage:NSLocalizedString(@"Image sent", nil) withExterlBodyUrl:[url absoluteString]]; - if (connection == uploadContext) { - if (statusCode == 200) { - //nop - } else if (statusCode >= 400) { - UIAlertView* errorAlert = [UIAlertView alloc]; - [errorAlert initWithTitle:NSLocalizedString(@"Transfer error",nil) - message:NSLocalizedString(@"Cannot transfer file to remote contact",nil) - delegate:nil - cancelButtonTitle:NSLocalizedString(@"Continue",nil) - otherButtonTitles:nil ,nil]; - [errorAlert show]; - [errorAlert release]; - } - } else if (connection == downloadContext) { - if (statusCode == 200) { - totalBytesExpectedToRead = [response expectedContentLength]; - } else if (statusCode >= 400) { - UIAlertView* errorAlert = [UIAlertView alloc]; - [errorAlert initWithTitle:NSLocalizedString(@"Transfer error",nil) - message:NSLocalizedString(@"Cannot transfer file from remote contact",nil) - delegate:nil - cancelButtonTitle:NSLocalizedString(@"Continue",nil) - otherButtonTitles:nil ,nil]; - [errorAlert show]; - [errorAlert release]; - } - } else { - [LinphoneLogger log:LinphoneLoggerError format:@"Invalid file transfer connection", connection]; - } + [footerView setHidden:FALSE]; + [transferView setHidden:TRUE]; + imageSharing = NULL; } -- (void)connectionDidFinishLoading:(NSURLConnection *)connection { - if (connection == uploadContext) { - [self stopUpload]; - uploadContext = nil; - } else if (connection == downloadContext) { - ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init]; - [library writeImageDataToSavedPhotosAlbum:downloadedData - metadata:nil - completionBlock:^(NSURL *assetURL, NSError *error){ - if (error) { - [LinphoneLogger log:LinphoneLoggerError format:@"Cannot save image data downloaded [%@]",[error localizedDescription]]; - } else { - [LinphoneLogger log:LinphoneLoggerLog format:@"Image saved to [%@]",[assetURL absoluteString]]; - } - ImageViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:[ImageViewController compositeViewDescription] push:TRUE], ImageViewController); - if(controller != nil) { - [controller setImage:[UIImage imageWithData:downloadedData]]; - } - [downloadedData release]; - downloadedData = nil; - }]; - - - [library release]; - [self stopDownload]; - downloadContext = nil; - } else { - [LinphoneLogger log:LinphoneLoggerError format:@"Invalid file transfer connection", connection]; - } -} - -- (NSURLConnection*)downloadImageFrom:(NSString*)address { - [LinphoneLogger log:LinphoneLoggerLog format:@"downloading [%@]", address]; - NSURL* url = [NSURL URLWithString: address ]; - NSURLRequest* request = [NSURLRequest requestWithURL:url - cachePolicy:NSURLRequestUseProtocolCachePolicy - timeoutInterval:60.0]; - - return [[NSURLConnection alloc] initWithRequest:request delegate: self]; +- (void)imageSharingDownloadDone:(ImageSharing*)aimageSharing image:(UIImage *)image { + [footerView setHidden:FALSE]; + [transferView setHidden:TRUE]; + + ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init]; + [library writeImageToSavedPhotosAlbum:(CGImageRef)image + metadata:nil + completionBlock:^(NSURL *assetURL, NSError *error){ + if (error) { + [LinphoneLogger log:LinphoneLoggerError format:@"Cannot save image data downloaded [%@]",[error localizedDescription]]; + } else { + [LinphoneLogger log:LinphoneLoggerLog format:@"Image saved to [%@]",[assetURL absoluteString]]; + } + ImageViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:[ImageViewController compositeViewDescription] push:TRUE], ImageViewController); + if(controller != nil) { + [controller setImage:image]; + } + }]; + + + [library release]; + imageSharing = NULL; } -- (NSURLConnection*)uploadImage:(UIImage*)image Named:(NSString*)name { - /* - turning the image into a NSData object - getting the image back out of the UIImageView - setting the quality to 90 - */ - NSData *imageData = UIImageJPEGRepresentation(image, 80); - // setting up the URL to post to - NSString *urlString = [[LinphoneManager instance] lpConfigStringForKey:@"file_upload_url_preference"]; - - // setting up the request object now - NSMutableURLRequest *request = [[[NSMutableURLRequest alloc] init] autorelease]; - [request setURL:[NSURL URLWithString:urlString]]; - [request setHTTPMethod:@"POST"]; - - /* - add some header info now - we always need a boundary when we post a file - also we need to set the content type - - You might want to generate a random boundary.. this is just the same - as my output from wireshark on a valid html post - */ - NSString *boundary = @"---------------------------14737809831466499882746641449"; - NSString *contentType = [NSString stringWithFormat:@"multipart/form-data; boundary=%@",boundary]; - [request addValue:contentType forHTTPHeaderField: @"Content-Type"]; - - /* - now lets create the body of the post - */ - NSMutableData *body = [NSMutableData data]; - [body appendData:[[NSString stringWithFormat:@"\r\n--%@\r\n",boundary] dataUsingEncoding:NSUTF8StringEncoding]]; - [body appendData:[[NSString stringWithFormat:@"Content-Disposition: form-data; name=\"userfile\"; filename=\"%@\"\r\n",name] dataUsingEncoding:NSUTF8StringEncoding]]; - [body appendData:[@"Content-Type: application/octet-stream\r\n\r\n" dataUsingEncoding:NSUTF8StringEncoding]]; - [body appendData:[NSData dataWithData:imageData]]; - [body appendData:[[NSString stringWithFormat:@"\r\n--%@--\r\n",boundary] dataUsingEncoding:NSUTF8StringEncoding]]; - // setting the body of the post to the reqeust - [request setHTTPBody:body]; - - return [NSURLConnection connectionWithRequest:(NSURLRequest *)request delegate:self]; -} - - -#pragma mark ImpagePickerDelegate +#pragma mark ImagePickerDelegate - (void)imagePickerDelegateImage:(UIImage*)image { - NSString *imageName = [NSString stringWithFormat:@"%i.jpg", [image hash]]; - uploadContext = [self uploadImage:image Named: imageName]; - [self startUpload]; + NSString *urlString = [[LinphoneManager instance] lpConfigStringForKey:@"file_upload_url_preference"]; + imageSharing = [ImageSharing imageSharingUpload:[NSURL URLWithString:urlString] image:image delegate:self]; + [footerView setHidden:TRUE]; + [transferView setHidden:FALSE]; } diff --git a/Classes/ImagePickerViewController.h b/Classes/ImagePickerViewController.h index 91eb9c07d..4acdebf21 100644 --- a/Classes/ImagePickerViewController.h +++ b/Classes/ImagePickerViewController.h @@ -1,4 +1,4 @@ -/* ContactDetailsImagePickerController.h +/* ImagePickerViewController.h * * Copyright (C) 2012 Belledonne Comunications, Grenoble, France * diff --git a/Classes/ImagePickerViewController.m b/Classes/ImagePickerViewController.m index dad0a57a1..46be9914b 100644 --- a/Classes/ImagePickerViewController.m +++ b/Classes/ImagePickerViewController.m @@ -1,4 +1,4 @@ -/* ContactDetailsImagePickerController.m +/* ImagePickerViewController.m * * Copyright (C) 2012 Belledonne Comunications, Grenoble, France * diff --git a/Classes/ImageSharing.h b/Classes/ImageSharing.h new file mode 100644 index 000000000..13cf22fc0 --- /dev/null +++ b/Classes/ImageSharing.h @@ -0,0 +1,50 @@ +/* ImageSharing.h + * + * Copyright (C) 2012 Belledonne Comunications, Grenoble, France + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#import + +@class ImageSharing; + +@protocol ImageSharingDelegate + +- (void)imageSharingProgress:(ImageSharing*)imageSharing progress:(float)progress; +- (void)imageSharingAborted:(ImageSharing*)imageSharing; +- (void)imageSharingError:(ImageSharing*)imageSharing error:(NSError *)error; +- (void)imageSharingUploadDone:(ImageSharing*)imageSharing url:(NSURL*)url; +- (void)imageSharingDownloadDone:(ImageSharing*)imageSharing image:(UIImage *)image; + +@end + +@interface ImageSharing : NSObject { +@private + NSInteger totalBytesExpectedToRead; + id delegate; + int statusCode; +} + ++ (id)imageSharingUpload:(NSURL*)url image:(UIImage*)image delegate:(id)delegate; ++ (id)imageSharingDownload:(NSURL*)url delegate:(id)delegate; + +- (void)cancel; + +@property (nonatomic, readonly) BOOL upload; +@property (nonatomic, readonly) NSMutableData* data; +@property (nonatomic, readonly) NSURLConnection* connection; + +@end diff --git a/Classes/ImageSharing.m b/Classes/ImageSharing.m new file mode 100644 index 000000000..d2c5db458 --- /dev/null +++ b/Classes/ImageSharing.m @@ -0,0 +1,182 @@ +/* ImageSharing.m + * + * Copyright (C) 2012 Belledonne Comunications, Grenoble, France + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#import "ImageSharing.h" +#import "Utils.h" +#import "LinphoneManager.h" + +@implementation ImageSharing + +@synthesize connection; +@synthesize data; +@synthesize upload; + + +#pragma mark - Lifecycle Functions + ++ (id)imageSharingUpload:(NSURL*)url image:(UIImage*)image delegate:(id)delegate { + ImageSharing *imgs = [[ImageSharing alloc] init]; + if(imgs != nil) { + imgs->upload = TRUE; + imgs->delegate = delegate; + imgs->data = [[NSMutableData alloc] init]; + if(delegate) { + [delegate imageSharingProgress:imgs progress:0]; + } + [imgs uploadImageTo:url image:image]; + } + return imgs; +} + ++ (id)imageSharingDownload:(NSURL*)url delegate:(id)delegate { + ImageSharing *imgs = [[ImageSharing alloc] init]; + if(imgs != nil) { + imgs->upload = FALSE; + imgs->delegate = delegate; + imgs->data = [[NSMutableData alloc] init]; + if(delegate) { + [delegate imageSharingProgress:imgs progress:0]; + } + [imgs downloadImageFrom:url]; + } + return imgs; +} + +- (void)dealloc { + [connection release]; + [data release]; + [super dealloc]; +} + + +#pragma mark - + +- (void)cancel { + [connection cancel]; + [LinphoneLogger log:LinphoneLoggerLog format:@"File transfer [%@] interrupted by user", [connection.currentRequest.URL absoluteString]]; + if(delegate) { + [delegate imageSharingAborted:self]; + } +} + + +- (void)downloadImageFrom:(NSURL*)url { + [LinphoneLogger log:LinphoneLoggerLog format:@"downloading [%@]", [url absoluteString]]; + + NSURLRequest* request = [NSURLRequest requestWithURL:url + cachePolicy:NSURLRequestUseProtocolCachePolicy + timeoutInterval:60.0]; + + connection = [[NSURLConnection alloc] initWithRequest:request delegate: self]; +} + + +- (void)uploadImageTo:(NSURL*)url image:(UIImage*)image { + [LinphoneLogger log:LinphoneLoggerLog format:@"downloading [%@]", [url absoluteString]]; + + // setting up the request object now + NSMutableURLRequest *request = [[[NSMutableURLRequest alloc] init] autorelease]; + [request setURL:url]; + [request setHTTPMethod:@"POST"]; + + /* + add some header info now + we always need a boundary when we post a file + also we need to set the content type + + You might want to generate a random boundary.. this is just the same + as my output from wireshark on a valid html post + */ + NSString *boundary = @"---------------------------14737809831466499882746641449"; + NSString *contentType = [NSString stringWithFormat:@"multipart/form-data; boundary=%@",boundary]; + [request addValue:contentType forHTTPHeaderField: @"Content-Type"]; + + /* + now lets create the body of the post + */ + NSMutableData *body = [NSMutableData data]; + NSString *imageName = [NSString stringWithFormat:@"%i.jpg", [image hash]]; + [body appendData:[[NSString stringWithFormat:@"\r\n--%@\r\n",boundary] dataUsingEncoding:NSUTF8StringEncoding]]; + [body appendData:[[NSString stringWithFormat:@"Content-Disposition: form-data; name=\"userfile\"; filename=\"%@\"\r\n",imageName] dataUsingEncoding:NSUTF8StringEncoding]]; + [body appendData:[@"Content-Type: application/octet-stream\r\n\r\n" dataUsingEncoding:NSUTF8StringEncoding]]; + [body appendData:[NSData dataWithData:UIImageJPEGRepresentation(image, 1.0)]]; + [body appendData:[[NSString stringWithFormat:@"\r\n--%@--\r\n",boundary] dataUsingEncoding:NSUTF8StringEncoding]]; + [request setHTTPBody:body]; + + connection = [[NSURLConnection alloc] initWithRequest:(NSURLRequest *)request delegate:self]; +} + + +#pragma mark - NSURLConnectionDelegate + +- (void)connection:(NSURLConnection *)aconnection didFailWithError:(NSError *)error { + if(delegate) { + [delegate imageSharingError:self error:error]; + } + [self release]; +} + +- (void)connection:(NSURLConnection *)connection didSendBodyData:(NSInteger)bytesWritten totalBytesWritten:(NSInteger)totalBytesWritten totalBytesExpectedToWrite:(NSInteger)totalBytesExpectedToWrite { + if(upload && delegate) { + [delegate imageSharingProgress:self progress:(float)totalBytesWritten/(float)totalBytesExpectedToWrite]; + } +} + +- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)adata { + [data appendData:adata]; + if(!upload && delegate) { + [delegate imageSharingProgress:self progress:(float)data.length/(float)totalBytesExpectedToRead]; + } +} + +- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response { + NSHTTPURLResponse * httpResponse = (NSHTTPURLResponse *) response; + statusCode = httpResponse.statusCode; + [LinphoneLogger log:LinphoneLoggerLog format:@"File transfer status code [%i]",statusCode]; + + if (statusCode == 200 && !upload) { + totalBytesExpectedToRead = [response expectedContentLength]; + } +} + +- (void)connectionDidFinishLoading:(NSURLConnection *)connection { + if(statusCode >= 400) { + NSError *error = [NSError errorWithDomain:@"ImageSharing" code:statusCode userInfo:nil]; + if(delegate) { + [delegate imageSharingError:self error:error]; + } + return; + } + if (upload) { + NSString* imageRemoteUrl = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; + [LinphoneLogger log:LinphoneLoggerLog format:@"File can be downloaded from [%@]", imageRemoteUrl]; + if(delegate) { + [delegate imageSharingUploadDone:self url:[NSURL URLWithString:imageRemoteUrl]]; + } + } else { + UIImage* image = [UIImage imageWithData:data]; + [LinphoneLogger log:LinphoneLoggerLog format:@"File downloaded"]; + if(delegate) { + [delegate imageSharingDownloadDone:self image:image]; + } + } + [self release]; +} + +@end diff --git a/linphone.xcodeproj/project.pbxproj b/linphone.xcodeproj/project.pbxproj index 1906d3515..7964e2951 100755 --- a/linphone.xcodeproj/project.pbxproj +++ b/linphone.xcodeproj/project.pbxproj @@ -652,6 +652,8 @@ D36FB2D51589EF7C0036F6F2 /* UIPauseButton.m in Sources */ = {isa = PBXBuildFile; fileRef = D36FB2D41589EF7C0036F6F2 /* UIPauseButton.m */; }; D36FB2D61589EF7C0036F6F2 /* UIPauseButton.m in Sources */ = {isa = PBXBuildFile; fileRef = D36FB2D41589EF7C0036F6F2 /* UIPauseButton.m */; }; D37295DB158B3C9600D2C0C7 /* video_off_disabled.png in Resources */ = {isa = PBXBuildFile; fileRef = D37295DA158B3C9600D2C0C7 /* video_off_disabled.png */; }; + D374D3FD16071762003D25FF /* ImageSharing.m in Sources */ = {isa = PBXBuildFile; fileRef = D374D3FC16071762003D25FF /* ImageSharing.m */; }; + D374D3FE16071762003D25FF /* ImageSharing.m in Sources */ = {isa = PBXBuildFile; fileRef = D374D3FC16071762003D25FF /* ImageSharing.m */; }; D377BBFA15A19DA6002B696B /* video_on_disabled.png in Resources */ = {isa = PBXBuildFile; fileRef = D377BBF915A19DA6002B696B /* video_on_disabled.png */; }; D378906515AC373B00BD776C /* ContactDetailsLabelViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D378906315AC373B00BD776C /* ContactDetailsLabelViewController.m */; }; D378906615AC373B00BD776C /* ContactDetailsLabelViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D378906315AC373B00BD776C /* ContactDetailsLabelViewController.m */; }; @@ -1704,6 +1706,8 @@ D36FB2D31589EF7C0036F6F2 /* UIPauseButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIPauseButton.h; sourceTree = ""; }; D36FB2D41589EF7C0036F6F2 /* UIPauseButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UIPauseButton.m; sourceTree = ""; }; D37295DA158B3C9600D2C0C7 /* video_off_disabled.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = video_off_disabled.png; path = Resources/video_off_disabled.png; sourceTree = ""; }; + D374D3FB16071762003D25FF /* ImageSharing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageSharing.h; sourceTree = ""; }; + D374D3FC16071762003D25FF /* ImageSharing.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ImageSharing.m; sourceTree = ""; }; D377BBF915A19DA6002B696B /* video_on_disabled.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = video_on_disabled.png; path = Resources/video_on_disabled.png; sourceTree = ""; }; D378906215AC373B00BD776C /* ContactDetailsLabelViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContactDetailsLabelViewController.h; sourceTree = ""; }; D378906315AC373B00BD776C /* ContactDetailsLabelViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ContactDetailsLabelViewController.m; sourceTree = ""; }; @@ -2266,6 +2270,8 @@ D38187D415FE346B00C3EDCA /* HistoryViewController.xib */, D378AB2815DCDB480098505D /* ImagePickerViewController.h */, D378AB2915DCDB490098505D /* ImagePickerViewController.m */, + D374D3FB16071762003D25FF /* ImageSharing.h */, + D374D3FC16071762003D25FF /* ImageSharing.m */, 22405EFD1601C19000B92522 /* ImageViewController.h */, 22405EFE1601C19100B92522 /* ImageViewController.m */, D37EE11016035793003608A6 /* ImageViewController.xib */, @@ -4463,6 +4469,7 @@ D3ED40191602172200BF332B /* HPGrowingTextView.m in Sources */, D3ED401B1602172200BF332B /* HPTextViewInternal.m in Sources */, D37EE162160377D7003608A6 /* DTActionSheet.m in Sources */, + D374D3FD16071762003D25FF /* ImageSharing.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -4557,6 +4564,7 @@ D3ED401A1602172200BF332B /* HPGrowingTextView.m in Sources */, D3ED401C1602172200BF332B /* HPTextViewInternal.m in Sources */, D37EE163160377D7003608A6 /* DTActionSheet.m in Sources */, + D374D3FE16071762003D25FF /* ImageSharing.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; From 63fb1b2cceda8e7a19884327a5f6bdaf2ca6b60d Mon Sep 17 00:00:00 2001 From: Yann Diorcet Date: Mon, 17 Sep 2012 12:02:01 +0200 Subject: [PATCH 11/16] Disable correction in Wizard fields Add notices in README --- Classes/en.lproj/WizardViewController.xib | 18 +++++++++++------- Classes/fr.lproj/WizardViewController.xib | 11 +++++++++++ README | 8 ++++++++ linphone.ldb/Contents.plist | 12 ++++++------ .../{2 => 3}/WizardViewController.xib | 18 +++++++++++------- 5 files changed, 47 insertions(+), 20 deletions(-) rename linphone.ldb/Resources/Classes/WizardViewController/{2 => 3}/WizardViewController.xib (99%) diff --git a/Classes/en.lproj/WizardViewController.xib b/Classes/en.lproj/WizardViewController.xib index cb745509c..ab9756a64 100644 --- a/Classes/en.lproj/WizardViewController.xib +++ b/Classes/en.lproj/WizardViewController.xib @@ -136,7 +136,6 @@ {{160, 0}, {160, 77}} - _NS:9 NO @@ -243,7 +242,6 @@ {{40, 290}, {240, 44}} - _NS:9 NO YES @@ -372,7 +370,6 @@ {{33, 269}, {255, 50}} - _NS:9 NO @@ -473,6 +470,7 @@ YES 17 + 1 IBCocoaTouchFramework @@ -515,6 +513,7 @@ YES 17 + 1 YES IBCocoaTouchFramework @@ -548,6 +547,7 @@ YES 17 + 1 YES IBCocoaTouchFramework @@ -581,6 +581,7 @@ YES 17 + 1 IBCocoaTouchFramework @@ -593,7 +594,6 @@ {{33, 330}, {255, 50}} - _NS:9 NO @@ -678,7 +678,6 @@ {{32, 330}, {255, 50}} - _NS:9 NO @@ -722,6 +721,7 @@ YES 17 + 1 YES IBCocoaTouchFramework @@ -755,6 +755,7 @@ YES 17 + 1 IBCocoaTouchFramework @@ -841,6 +842,7 @@ YES 17 + 1 IBCocoaTouchFramework @@ -873,6 +875,7 @@ YES 17 + 1 YES IBCocoaTouchFramework @@ -906,6 +909,7 @@ YES 17 + 1 IBCocoaTouchFramework @@ -918,7 +922,6 @@ {{34, 330}, {255, 50}} - _NS:9 NO @@ -996,7 +999,6 @@ {{32, 330}, {255, 50}} - _NS:9 NO @@ -1040,6 +1042,7 @@ YES 17 + 1 YES IBCocoaTouchFramework @@ -1073,6 +1076,7 @@ YES 17 + 1 IBCocoaTouchFramework diff --git a/Classes/fr.lproj/WizardViewController.xib b/Classes/fr.lproj/WizardViewController.xib index 58ef418ab..93e61e955 100644 --- a/Classes/fr.lproj/WizardViewController.xib +++ b/Classes/fr.lproj/WizardViewController.xib @@ -448,6 +448,7 @@ YES 17 + 1 IBCocoaTouchFramework @@ -489,6 +490,7 @@ YES 17 + 1 YES IBCocoaTouchFramework @@ -521,6 +523,7 @@ YES 17 + 1 YES IBCocoaTouchFramework @@ -553,6 +556,7 @@ YES 17 + 1 IBCocoaTouchFramework @@ -685,6 +689,7 @@ YES 17 + 1 YES IBCocoaTouchFramework @@ -717,6 +722,7 @@ YES 17 + 1 IBCocoaTouchFramework @@ -798,6 +804,7 @@ YES 17 + 1 IBCocoaTouchFramework @@ -829,6 +836,7 @@ YES 17 + 1 YES IBCocoaTouchFramework @@ -861,6 +869,7 @@ YES 17 + 1 IBCocoaTouchFramework @@ -986,6 +995,7 @@ YES 17 + 1 YES IBCocoaTouchFramework @@ -1018,6 +1028,7 @@ YES 17 + 1 IBCocoaTouchFramework diff --git a/README b/README index 7bb193edd..bf685d608 100644 --- a/README +++ b/README @@ -32,6 +32,8 @@ Link host's strings to simulator SDK For newer XCode: $ sudo ln -s /usr/bin/strings /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/strings +ImageMagick & Optipng + sudo port install ImageMagick optipng BUILDING THE SDK **************** @@ -76,6 +78,12 @@ The liblinphone-sdk is compiled with third parties code that are subject to pate Linphone controls the embedding of these codecs thanks to the preprocessor macros HAVE_SILK, HAVE_AMR, HAVE_G729 HAVE_X264 positioned in xcode project. Before embeding these 4 codecs in the final application, make sure to have the right to do so. +TRANSLATER THE APPLICATION +************************** + +You have to download the application Localization Suite(http://www.loc-suite.org/) +Each modification in a xib have to be scanned and synchronized + LIMITATIONS, KNOWN BUGS *********************** diff --git a/linphone.ldb/Contents.plist b/linphone.ldb/Contents.plist index 47e4dc01c..83ccf3060 100644 --- a/linphone.ldb/Contents.plist +++ b/linphone.ldb/Contents.plist @@ -3037,17 +3037,17 @@ backup - 2 + 3 class BLWrapperHandle name - Classes/WizardViewController/2/WizardViewController.xib + Classes/WizardViewController/3/WizardViewController.xib change date - 2012-09-11T07:32:37Z + 2012-09-17T09:57:03Z changed values class @@ -3057,7 +3057,7 @@ flags 0 hash - 6feda2909660b9c654e2bde3ba932af7 + ae1a75bdceef90126c40e63243b77c0c name WizardViewController.xib @@ -4271,9 +4271,9 @@ versions en - 2 + 3 fr - 2 + 3 diff --git a/linphone.ldb/Resources/Classes/WizardViewController/2/WizardViewController.xib b/linphone.ldb/Resources/Classes/WizardViewController/3/WizardViewController.xib similarity index 99% rename from linphone.ldb/Resources/Classes/WizardViewController/2/WizardViewController.xib rename to linphone.ldb/Resources/Classes/WizardViewController/3/WizardViewController.xib index cb745509c..ab9756a64 100644 --- a/linphone.ldb/Resources/Classes/WizardViewController/2/WizardViewController.xib +++ b/linphone.ldb/Resources/Classes/WizardViewController/3/WizardViewController.xib @@ -136,7 +136,6 @@ {{160, 0}, {160, 77}} - _NS:9 NO @@ -243,7 +242,6 @@ {{40, 290}, {240, 44}} - _NS:9 NO YES @@ -372,7 +370,6 @@ {{33, 269}, {255, 50}} - _NS:9 NO @@ -473,6 +470,7 @@ YES 17 + 1 IBCocoaTouchFramework @@ -515,6 +513,7 @@ YES 17 + 1 YES IBCocoaTouchFramework @@ -548,6 +547,7 @@ YES 17 + 1 YES IBCocoaTouchFramework @@ -581,6 +581,7 @@ YES 17 + 1 IBCocoaTouchFramework @@ -593,7 +594,6 @@ {{33, 330}, {255, 50}} - _NS:9 NO @@ -678,7 +678,6 @@ {{32, 330}, {255, 50}} - _NS:9 NO @@ -722,6 +721,7 @@ YES 17 + 1 YES IBCocoaTouchFramework @@ -755,6 +755,7 @@ YES 17 + 1 IBCocoaTouchFramework @@ -841,6 +842,7 @@ YES 17 + 1 IBCocoaTouchFramework @@ -873,6 +875,7 @@ YES 17 + 1 YES IBCocoaTouchFramework @@ -906,6 +909,7 @@ YES 17 + 1 IBCocoaTouchFramework @@ -918,7 +922,6 @@ {{34, 330}, {255, 50}} - _NS:9 NO @@ -996,7 +999,6 @@ {{32, 330}, {255, 50}} - _NS:9 NO @@ -1040,6 +1042,7 @@ YES 17 + 1 YES IBCocoaTouchFramework @@ -1073,6 +1076,7 @@ YES 17 + 1 IBCocoaTouchFramework From 1efcaaa03db0270c449ecc72c29b9f0f06da24af Mon Sep 17 00:00:00 2001 From: Yann Diorcet Date: Mon, 17 Sep 2012 13:58:28 +0200 Subject: [PATCH 12/16] Remplace UIActionSheet by DTActionSheet --- Classes/CallDelegate.h | 46 ------------- Classes/CallDelegate.m | 68 ------------------- Classes/ChatRoomViewController.h | 2 + Classes/ChatRoomViewController.m | 14 ++-- Classes/InCallViewController.h | 4 +- Classes/InCallViewController.m | 84 ++++++------------------ Classes/LinphoneUI/UIStateBar.m | 10 +-- Classes/PhoneMainView.h | 3 +- Classes/PhoneMainView.m | 48 +++----------- Classes/SettingsViewController.m | 15 ++++- Settings/InAppSettings.bundle/Root.plist | 8 +++ linphone.xcodeproj/project.pbxproj | 8 --- 12 files changed, 67 insertions(+), 243 deletions(-) delete mode 100644 Classes/CallDelegate.h delete mode 100644 Classes/CallDelegate.m diff --git a/Classes/CallDelegate.h b/Classes/CallDelegate.h deleted file mode 100644 index df2bf75e0..000000000 --- a/Classes/CallDelegate.h +++ /dev/null @@ -1,46 +0,0 @@ -/* LinphoneManager.h - * - * Copyright (C) 2011 Belledonne Comunications, Grenoble, France - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#import -#include "linphonecore.h" - -enum CallDelegateType { - CD_UNDEFINED = 0, - CD_ZRTP, - CD_VIDEO_UPDATE, - CD_STOP_VIDEO_ON_LOW_BATTERY -}; - -@protocol CallActionSheetDelegate -- (void)actionSheet:(UIActionSheet *)actionSheet ofType:(enum CallDelegateType) type clickedButtonAtIndex:(NSInteger)buttonIndex withUserDatas:(void*) datas; -@end - -@interface CallDelegate : NSObject { - enum CallDelegateType eventType; - LinphoneCall* call; - id delegate; - NSTimer* timeout; -} - -@property (nonatomic) enum CallDelegateType eventType; -@property (nonatomic) LinphoneCall* call; -@property (nonatomic, retain) id delegate; -@property (nonatomic, retain) NSTimer* timeout; - -@end diff --git a/Classes/CallDelegate.m b/Classes/CallDelegate.m deleted file mode 100644 index 982a99ff1..000000000 --- a/Classes/CallDelegate.m +++ /dev/null @@ -1,68 +0,0 @@ -/* LinphoneManager.h - * - * Copyright (C) 2011 Belledonne Comunications, Grenoble, France - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#import "CallDelegate.h" -#import "Utils.h" - -@implementation CallDelegate - -@synthesize eventType; -@synthesize call; -@synthesize delegate; -@synthesize timeout; - --(void) actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex { - if (timeout) { - [timeout invalidate]; - timeout = nil; - } - if (eventType == CD_UNDEFINED) { - [LinphoneLogger logc:LinphoneLoggerError format:"Incorrect usage of CallDelegate/ActionSheet: eventType must be set"]; - } - [delegate actionSheet:actionSheet ofType:eventType clickedButtonAtIndex:buttonIndex withUserDatas:call]; -} - --(void) actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex { - - - if (timeout) { - [timeout invalidate]; - timeout = nil; - } - if (buttonIndex != actionSheet.cancelButtonIndex) return; - - if (eventType == CD_UNDEFINED) { - [LinphoneLogger logc:LinphoneLoggerError format:"Incorrect usage of CallDelegate/ActionSheet: eventType must be set"]; - } - - [delegate actionSheet:actionSheet ofType:eventType clickedButtonAtIndex:buttonIndex withUserDatas:call]; -} - --(void) actionSheetCancel:(UIActionSheet *)actionSheet { - if (timeout) { - [timeout invalidate]; - timeout = nil; - } - if (eventType == CD_UNDEFINED) { - [LinphoneLogger logc:LinphoneLoggerError format:"Incorrect usage of CallDelegate/ActionSheet: eventType must be set"]; - } - [delegate actionSheet:actionSheet ofType:eventType clickedButtonAtIndex:actionSheet.cancelButtonIndex withUserDatas:call]; -} - -@end diff --git a/Classes/ChatRoomViewController.h b/Classes/ChatRoomViewController.h index 730342317..3abc96ce3 100644 --- a/Classes/ChatRoomViewController.h +++ b/Classes/ChatRoomViewController.h @@ -18,6 +18,7 @@ */ #import +#import #import "UIToggleButton.h" #import "UICompositeViewController.h" @@ -33,6 +34,7 @@ @private LinphoneChatRoom *chatRoom; ImageSharing *imageSharing; + ALAssetsLibrary *photoLibrary; } diff --git a/Classes/ChatRoomViewController.m b/Classes/ChatRoomViewController.m index a412da064..4399b4845 100644 --- a/Classes/ChatRoomViewController.m +++ b/Classes/ChatRoomViewController.m @@ -21,9 +21,7 @@ #import "PhoneMainView.h" #import "DTActionSheet.h" -#import #import -#import @implementation ChatRoomViewController @@ -55,6 +53,7 @@ if (self != nil) { self->chatRoom = NULL; self->imageSharing = NULL; + self->photoLibrary = [[ALAssetsLibrary alloc] init]; } return self; } @@ -80,6 +79,9 @@ [pictureButton release]; [imageTransferProgressBar release]; [cancelTransferButton release]; + + [photoLibrary release]; + [super dealloc]; } @@ -334,7 +336,7 @@ static void message_status(LinphoneChatMessage* msg,LinphoneChatMessageState sta [transferView setHidden:FALSE]; }]; [sheet addCancelButtonWithTitle:NSLocalizedString(@"Ignore",nil)]; - [sheet showInView:self.view]; + [sheet showInView:[PhoneMainView instance].view]; } } else { [LinphoneLogger logc:LinphoneLoggerWarning format:"Invalid textReceivedEvent"]; @@ -491,8 +493,7 @@ static void message_status(LinphoneChatMessage* msg,LinphoneChatMessageState sta [footerView setHidden:FALSE]; [transferView setHidden:TRUE]; - ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init]; - [library writeImageToSavedPhotosAlbum:(CGImageRef)image + [photoLibrary writeImageToSavedPhotosAlbum:(CGImageRef)image metadata:nil completionBlock:^(NSURL *assetURL, NSError *error){ if (error) { @@ -505,9 +506,6 @@ static void message_status(LinphoneChatMessage* msg,LinphoneChatMessageState sta [controller setImage:image]; } }]; - - - [library release]; imageSharing = NULL; } diff --git a/Classes/InCallViewController.h b/Classes/InCallViewController.h index d9df2a3b7..d349c9ea8 100644 --- a/Classes/InCallViewController.h +++ b/Classes/InCallViewController.h @@ -21,20 +21,18 @@ #import "VideoZoomHandler.h" #import "UICamSwitch.h" -#import "CallDelegate.h" #import "UICompositeViewController.h" #import "InCallTableViewController.h" @class VideoViewController; -@interface InCallViewController : UIViewController { +@interface InCallViewController : UIViewController { @private UITapGestureRecognizer* singleFingerTap; NSTimer* hideControlsTimer; BOOL videoShown; VideoZoomHandler* videoZoomHandler; - UIActionSheet* visibleActionSheet; } @property (nonatomic, retain) IBOutlet InCallTableViewController* callTableController; diff --git a/Classes/InCallViewController.m b/Classes/InCallViewController.m index 26063c382..7d991642f 100644 --- a/Classes/InCallViewController.m +++ b/Classes/InCallViewController.m @@ -29,6 +29,7 @@ #import "LinphoneManager.h" #import "PhoneMainView.h" #import "UILinphone.h" +#import "DTActionSheet.h" #include "linphonecore.h" @@ -119,9 +120,6 @@ static UICompositeViewDescription *compositeDescription = nil; - (void)viewWillDisappear:(BOOL)animated { [super viewWillDisappear:animated]; - if (visibleActionSheet != nil) { - [visibleActionSheet dismissWithClickedButtonIndex:visibleActionSheet.cancelButtonIndex animated:NO]; - } if (hideControlsTimer != nil) { [hideControlsTimer invalidate]; hideControlsTimer = nil; @@ -464,13 +462,6 @@ static void hideSpinner(LinphoneCall* call, void* user_data) { #pragma mark - ActionSheet Functions -- (void)dismissActionSheet: (id)o { - if (visibleActionSheet != nil) { - [visibleActionSheet dismissWithClickedButtonIndex:visibleActionSheet.cancelButtonIndex animated:TRUE]; - visibleActionSheet = nil; - } -} - - (void)displayAskToEnableVideoCall:(LinphoneCall*) call { if (linphone_core_get_video_policy([LinphoneManager getLc])->automatically_accept) return; @@ -480,62 +471,29 @@ static void hideSpinner(LinphoneCall* call, void* user_data) { const char* lDisplayNameChars = linphone_address_get_display_name(linphone_call_get_remote_address(call)); NSString* lDisplayName = [lDisplayNameChars?[[NSString alloc] initWithUTF8String:lDisplayNameChars]:@"" autorelease]; - // ask the user if he agrees - CallDelegate* cd = [[CallDelegate alloc] init]; - cd.eventType = CD_VIDEO_UPDATE; - cd.delegate = self; - cd.call = call; - - if (visibleActionSheet != nil) { - [visibleActionSheet dismissWithClickedButtonIndex:visibleActionSheet.cancelButtonIndex animated:TRUE]; - } NSString* title = [NSString stringWithFormat : NSLocalizedString(@"'%@' would like to enable video",nil), ([lDisplayName length] > 0)?lDisplayName:lUserName]; - visibleActionSheet = [[UIActionSheet alloc] initWithTitle:title - delegate:cd - cancelButtonTitle:NSLocalizedString(@"Decline",nil) - destructiveButtonTitle:NSLocalizedString(@"Accept",nil) - otherButtonTitles:nil]; - - visibleActionSheet.actionSheetStyle = UIActionSheetStyleDefault; - [visibleActionSheet showInView:[PhoneMainView instance].view]; - - /* start cancel timer */ - cd.timeout = [NSTimer scheduledTimerWithTimeInterval:30 target:self selector:@selector(dismissActionSheet:) userInfo:nil repeats:NO]; - [visibleActionSheet release]; + DTActionSheet *sheet = [[[DTActionSheet alloc] initWithTitle:title] autorelease]; + NSTimer *timer = [NSTimer scheduledTimerWithTimeInterval:30 target:self selector:@selector(dismissVideoActionSheet:) userInfo:sheet repeats:NO]; + [sheet addButtonWithTitle:NSLocalizedString(@"Accept", nil) block:^() { + [LinphoneLogger logc:LinphoneLoggerLog format:"User accept video proposal"]; + LinphoneCallParams* paramsCopy = linphone_call_params_copy(linphone_call_get_current_params(call)); + linphone_call_params_enable_video(paramsCopy, TRUE); + linphone_core_accept_call_update([LinphoneManager getLc], call, paramsCopy); + linphone_call_params_destroy(paramsCopy); + [timer invalidate]; + }]; + [sheet addDestructiveButtonWithTitle:NSLocalizedString(@"Decline", nil) block:^() { + [LinphoneLogger logc:LinphoneLoggerLog format:"User declined video proposal"]; + linphone_core_accept_call_update([LinphoneManager getLc], call, NULL); + [timer invalidate]; + }]; + [sheet showInView:[PhoneMainView instance].view]; } -- (void)actionSheet:(UIActionSheet *)actionSheet ofType:(enum CallDelegateType)type clickedButtonAtIndex:(NSInteger)buttonIndex withUserDatas:(void *)datas { - LinphoneCall* call = (LinphoneCall*)datas; - // maybe we could verify call validity - - switch (type) { - case CD_ZRTP: { - if (buttonIndex == 0) - linphone_call_set_authentication_token_verified(call, YES); - else if (buttonIndex == 1) - linphone_call_set_authentication_token_verified(call, NO); - visibleActionSheet = nil; - break; - } - case CD_VIDEO_UPDATE: { - LinphoneCall* call = (LinphoneCall*)datas; - LinphoneCallParams* paramsCopy = linphone_call_params_copy(linphone_call_get_current_params(call)); - if ([visibleActionSheet destructiveButtonIndex] == buttonIndex) { - // accept video - linphone_call_params_enable_video(paramsCopy, TRUE); - linphone_core_accept_call_update([LinphoneManager getLc], call, paramsCopy); - } else { - // decline video - [LinphoneLogger logc:LinphoneLoggerLog format:"User declined video proposal"]; - linphone_core_accept_call_update([LinphoneManager getLc], call, NULL); - } - linphone_call_params_destroy(paramsCopy); - visibleActionSheet = nil; - break; - } - default: - [LinphoneLogger logc:LinphoneLoggerError format:"Unhandled CallDelegate event of type: %d received - ignoring", type]; - } +- (void)dismissVideoActionSheet:(NSTimer*)timer { + DTActionSheet *sheet = (DTActionSheet *)timer.userInfo; + [sheet dismissWithClickedButtonIndex:sheet.destructiveButtonIndex animated:TRUE]; } + @end diff --git a/Classes/LinphoneUI/UIStateBar.m b/Classes/LinphoneUI/UIStateBar.m index 0ef68f27a..1d7913855 100644 --- a/Classes/LinphoneUI/UIStateBar.m +++ b/Classes/LinphoneUI/UIStateBar.m @@ -178,12 +178,12 @@ NSTimer *callSecurityTimer; BOOL security = true; if(![LinphoneManager isLcReady]) { - [callSecurityImage setHidden: true]; + [callSecurityImage setHidden:true]; return; } const MSList *list = linphone_core_get_calls([LinphoneManager getLc]); if(list == NULL) { - [callSecurityImage setHidden: true]; + [callSecurityImage setHidden:true]; return; } while(list != NULL) { @@ -229,10 +229,10 @@ NSTimer *callSecurityTimer; } } if(image != nil) { - [callQualityImage setHidden: false]; - [callQualityImage setImage: image]; + [callQualityImage setHidden:false]; + [callQualityImage setImage:image]; } else { - [callQualityImage setHidden: true]; + [callQualityImage setHidden:true]; } } diff --git a/Classes/PhoneMainView.h b/Classes/PhoneMainView.h index f76e3cb6a..44a5084df 100644 --- a/Classes/PhoneMainView.h +++ b/Classes/PhoneMainView.h @@ -41,9 +41,8 @@ #import "ConsoleViewController.h" #import "ImageViewController.h" -@interface PhoneMainView : UIViewController { +@interface PhoneMainView : UIViewController { @private - UIActionSheet *batteryActionSheet; int loadCount; NSMutableArray *viewStack; NSMutableArray *inhibitedEvents; diff --git a/Classes/PhoneMainView.m b/Classes/PhoneMainView.m index c451292b0..87a7f11c6 100644 --- a/Classes/PhoneMainView.m +++ b/Classes/PhoneMainView.m @@ -23,6 +23,7 @@ #import "LinphoneAppDelegate.h" #import "PhoneMainView.h" #import "Utils.h" +#import "DTActionSheet.h" static PhoneMainView* phoneMainViewInstance=nil; @@ -704,7 +705,7 @@ static PhoneMainView* phoneMainViewInstance=nil; } - (void)batteryLevelChanged:(NSNotification*)notif { - if (! [LinphoneManager isLcReady]) return; + if (![LinphoneManager isLcReady]) return; LinphoneCall* call = linphone_core_get_current_call([LinphoneManager getLc]); if (!call || !linphone_call_params_video_enabled(linphone_call_get_current_params(call))) return; @@ -713,48 +714,17 @@ static PhoneMainView* phoneMainViewInstance=nil; float level = [UIDevice currentDevice].batteryLevel; [LinphoneLogger logc:LinphoneLoggerLog format:"Video call is running. Battery level: %.2f", level]; if (level < 0.1 && !appData->batteryWarningShown) { - // notify user - CallDelegate* cd = [[CallDelegate alloc] init]; - cd.eventType = CD_STOP_VIDEO_ON_LOW_BATTERY; - cd.delegate = self; - cd.call = call; - - if (batteryActionSheet != nil) { - [batteryActionSheet dismissWithClickedButtonIndex:batteryActionSheet.cancelButtonIndex animated:TRUE]; - } - NSString* title = NSLocalizedString(@"Battery is running low. Stop video ?",nil); - batteryActionSheet = [[UIActionSheet alloc] initWithTitle:title - delegate:cd - cancelButtonTitle:NSLocalizedString(@"Continue video",nil) - destructiveButtonTitle:NSLocalizedString(@"Stop video",nil) - otherButtonTitles:nil]; - - batteryActionSheet.actionSheetStyle = UIActionSheetStyleDefault; - [batteryActionSheet showInView: self.view]; - [batteryActionSheet release]; - appData->batteryWarningShown = TRUE; - } - } -} - -- (void)actionSheet:(UIActionSheet *)actionSheet ofType:(enum CallDelegateType)type - clickedButtonAtIndex:(NSInteger)buttonIndex - withUserDatas:(void *)datas { - switch(type) { - case CD_STOP_VIDEO_ON_LOW_BATTERY: - { - LinphoneCall* call = (LinphoneCall*)datas; - LinphoneCallParams* paramsCopy = linphone_call_params_copy(linphone_call_get_current_params(call)); - if (buttonIndex == [batteryActionSheet destructiveButtonIndex]) { + DTActionSheet *sheet = [[[DTActionSheet alloc] initWithTitle:NSLocalizedString(@"Battery is running low. Stop video ?",nil)] autorelease]; + [sheet addCancelButtonWithTitle:NSLocalizedString(@"Continue video", nil)]; + [sheet addDestructiveButtonWithTitle:NSLocalizedString(@"Stop video", nil) block:^() { + LinphoneCallParams* paramsCopy = linphone_call_params_copy(linphone_call_get_current_params(call)); // stop video linphone_call_params_enable_video(paramsCopy, FALSE); linphone_core_update_call([LinphoneManager getLc], call, paramsCopy); - } - batteryActionSheet = nil; - break; + }]; + [sheet showInView:self.view]; + appData->batteryWarningShown = TRUE; } - default: - break; } } diff --git a/Classes/SettingsViewController.m b/Classes/SettingsViewController.m index f175f609f..573842b47 100644 --- a/Classes/SettingsViewController.m +++ b/Classes/SettingsViewController.m @@ -31,6 +31,15 @@ #import "IASKTextField.h" #include "lpconfig.h" +#ifdef DEBUG +@interface UIDevice (debug) + +- (void)_setBatteryLevel:(float)level; +- (void)_setBatteryState:(int)state; + +@end +#endif + #pragma mark - IASKSwitchEx Class @interface IASKSwitchEx : DCRoundSwitch { @@ -478,6 +487,7 @@ static UICompositeViewDescription *compositeDescription = nil; #ifndef DEBUG [hiddenKeys addObject:@"release_button"]; [hiddenKeys addObject:@"clear_cache_button"]; + [hiddenKeys addObject:@"battery_alert_button"]; #endif [hiddenKeys addObject:@"quit_button"]; // Hide for the moment @@ -523,7 +533,6 @@ static UICompositeViewDescription *compositeDescription = nil; return hiddenKeys; } - #pragma mark - IASKSettingsDelegate Functions - (void)settingsViewControllerDidEnd:(IASKAppSettingsViewController *)sender { @@ -539,6 +548,10 @@ static UICompositeViewDescription *compositeDescription = nil; [LinphoneManager instanceRelease]; } else if([key isEqual:@"clear_cache_button"]) { [[PhoneMainView instance].mainViewController clearCache]; + } else if([key isEqual:@"battery_alert_button"]) { + [[UIDevice currentDevice] _setBatteryState:UIDeviceBatteryStateUnplugged]; + [[UIDevice currentDevice] _setBatteryLevel:0.09f]; + [[NSNotificationCenter defaultCenter] postNotificationName:UIDeviceBatteryLevelDidChangeNotification object:self]; } #endif if([key isEqual:@"console_button"]) { diff --git a/Settings/InAppSettings.bundle/Root.plist b/Settings/InAppSettings.bundle/Root.plist index 0d496d742..a58e3ff20 100644 --- a/Settings/InAppSettings.bundle/Root.plist +++ b/Settings/InAppSettings.bundle/Root.plist @@ -192,6 +192,14 @@ Type IASKButtonSpecifier + + Key + battery_alert_button + Title + Battery alert + Type + IASKButtonSpecifier + StringsTable Root diff --git a/linphone.xcodeproj/project.pbxproj b/linphone.xcodeproj/project.pbxproj index 7964e2951..c7a5532b8 100755 --- a/linphone.xcodeproj/project.pbxproj +++ b/linphone.xcodeproj/project.pbxproj @@ -18,8 +18,6 @@ 220FAD3710765B400068D98F /* libosipparser2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 220FAD2E10765B400068D98F /* libosipparser2.a */; }; 220FAD3810765B400068D98F /* libspeex.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 220FAD2F10765B400068D98F /* libspeex.a */; }; 220FAD3910765B400068D98F /* libspeexdsp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 220FAD3010765B400068D98F /* libspeexdsp.a */; }; - 2211DBBE14769C8300DEE054 /* CallDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 2211DBBB14769C8200DEE054 /* CallDelegate.m */; }; - 2211DBBF14769C8300DEE054 /* CallDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 2211DBBB14769C8200DEE054 /* CallDelegate.m */; }; 2214783D1386A2030020F8B8 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 2214783B1386A2030020F8B8 /* Localizable.strings */; }; 2214EB7A12F846B1002A5394 /* UICallButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 2214EB7912F846B1002A5394 /* UICallButton.m */; }; 2214EB8912F84EBB002A5394 /* UIHangUpButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 2214EB8812F84EBB002A5394 /* UIHangUpButton.m */; }; @@ -1352,7 +1350,6 @@ 220FAD2F10765B400068D98F /* libspeex.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libspeex.a; path = "liblinphone-sdk/apple-darwin/lib/libspeex.a"; sourceTree = ""; }; 220FAD3010765B400068D98F /* libspeexdsp.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libspeexdsp.a; path = "liblinphone-sdk/apple-darwin/lib/libspeexdsp.a"; sourceTree = ""; }; 2211DB911475562600DEE054 /* liblinphone.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = liblinphone.a; path = "liblinphone-sdk/apple-darwin/lib/liblinphone.a"; sourceTree = ""; }; - 2211DBBB14769C8200DEE054 /* CallDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CallDelegate.m; sourceTree = ""; }; 2214783C1386A2030020F8B8 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = Resources/en.lproj/Localizable.strings; sourceTree = ""; }; 2214EB7812F846B1002A5394 /* UICallButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UICallButton.h; sourceTree = ""; }; 2214EB7912F846B1002A5394 /* UICallButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UICallButton.m; sourceTree = ""; }; @@ -1499,7 +1496,6 @@ 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 32CA4F630368D1EE00C91783 /* linphone_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = linphone_Prefix.pch; sourceTree = ""; }; 340751961506459A00B89C47 /* CoreTelephony.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreTelephony.framework; path = System/Library/Frameworks/CoreTelephony.framework; sourceTree = SDKROOT; }; - 340751E4150E4D0200B89C47 /* CallDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CallDelegate.h; sourceTree = ""; }; 340751E5150F38FC00B89C47 /* UIVideoButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIVideoButton.h; sourceTree = ""; }; 340751E6150F38FD00B89C47 /* UIVideoButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UIVideoButton.m; sourceTree = ""; }; 34216F3E1547EBCD00EA9777 /* VideoZoomHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VideoZoomHandler.h; path = LinphoneUI/VideoZoomHandler.h; sourceTree = ""; }; @@ -2224,8 +2220,6 @@ 080E96DDFE201D6D7F000001 /* Classes */ = { isa = PBXGroup; children = ( - 340751E4150E4D0200B89C47 /* CallDelegate.h */, - 2211DBBB14769C8200DEE054 /* CallDelegate.m */, D32B6E2715A5BC430033019F /* ChatRoomTableViewController.h */, D32B6E2815A5BC430033019F /* ChatRoomTableViewController.m */, D3F795D315A582800077328B /* ChatRoomViewController.h */, @@ -4396,7 +4390,6 @@ 22C755601317E59C007BC101 /* UIBluetoothButton.m in Sources */, 22BB1A69132FF16A005CD7AA /* UIEraseButton.m in Sources */, 22AA8B0113D83F6300B30535 /* UICamSwitch.m in Sources */, - 2211DBBE14769C8300DEE054 /* CallDelegate.m in Sources */, 340751E7150F38FD00B89C47 /* UIVideoButton.m in Sources */, 34216F401547EBCD00EA9777 /* VideoZoomHandler.m in Sources */, D3F83EEC1582021700336684 /* InCallViewController.m in Sources */, @@ -4491,7 +4484,6 @@ 22D8F155147548E2008C97DB /* UIBluetoothButton.m in Sources */, 22D8F156147548E2008C97DB /* UIEraseButton.m in Sources */, 22D8F159147548E2008C97DB /* UICamSwitch.m in Sources */, - 2211DBBF14769C8300DEE054 /* CallDelegate.m in Sources */, 340751E8150F38FD00B89C47 /* UIVideoButton.m in Sources */, 34216F411547EBCD00EA9777 /* VideoZoomHandler.m in Sources */, D3F83EED1582021700336684 /* InCallViewController.m in Sources */, From 3d61162f9024f13e3f41d9b636f72992c7aaba57 Mon Sep 17 00:00:00 2001 From: Yann Diorcet Date: Mon, 17 Sep 2012 17:44:58 +0200 Subject: [PATCH 13/16] Fix iPad dialer preview --- Classes/ChatRoomTableViewController.m | 1 - Classes/DialerViewController.h | 1 + Classes/DialerViewController.m | 50 ++++++++++++----- Classes/InCallViewController.m | 2 +- Classes/LinphoneCoreSettingsStore.m | 7 ++- Classes/LinphoneManager.h | 1 + Classes/LinphoneManager.m | 37 +++++++----- .../LinphoneUI/UICompositeViewController.m | 10 ++-- Classes/PhoneMainView.m | 5 +- Classes/SettingsViewController.m | 4 ++ .../en.lproj/DialerViewController~ipad.xib | 19 ++++++- Classes/en.lproj/InCallViewController.xib | 1 - .../fr.lproj/DialerViewController~ipad.xib | 18 +++++- Resources/linphonerc-factory~ipad | 9 --- Resources/linphonerc~ipad | 10 +++- Settings/InAppSettings.bundle/Video.plist | 8 +++ .../en.lproj/Video.strings | 3 + .../fr.lproj/Video.strings | Bin 488 -> 409 bytes linphone.ldb/Contents.plist | 53 +++++++++++++----- .../{3 => 7}/DialerViewController~ipad.xib | 19 ++++++- .../{1 => 2}/InCallViewController.xib | 1 - .../Video/1/Video.strings | 3 + submodules/linphone | 2 +- 23 files changed, 190 insertions(+), 74 deletions(-) rename linphone.ldb/Resources/Classes/DialerViewController~ipad/{3 => 7}/DialerViewController~ipad.xib (99%) rename linphone.ldb/Resources/Classes/InCallViewController/{1 => 2}/InCallViewController.xib (99%) diff --git a/Classes/ChatRoomTableViewController.m b/Classes/ChatRoomTableViewController.m index 8182eca56..608316be5 100644 --- a/Classes/ChatRoomTableViewController.m +++ b/Classes/ChatRoomTableViewController.m @@ -149,7 +149,6 @@ return cell; } - - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { if(editingStyle == UITableViewCellEditingStyleDelete) { [tableView beginUpdates]; diff --git a/Classes/DialerViewController.h b/Classes/DialerViewController.h index c23b7218f..49e6d857c 100644 --- a/Classes/DialerViewController.h +++ b/Classes/DialerViewController.h @@ -56,6 +56,7 @@ @property (nonatomic, retain) IBOutlet UIDigitButton* starButton; @property (nonatomic, retain) IBOutlet UIDigitButton* zeroButton; @property (nonatomic, retain) IBOutlet UIDigitButton* sharpButton; +@property (nonatomic, retain) IBOutlet UIView* backgroundView; @property (nonatomic, retain) IBOutlet UIView* videoPreview; @property (nonatomic, retain) IBOutlet UICamSwitch* videoCameraSwitch; diff --git a/Classes/DialerViewController.m b/Classes/DialerViewController.m index 9abd60d74..68fe4ed06 100644 --- a/Classes/DialerViewController.m +++ b/Classes/DialerViewController.m @@ -54,6 +54,7 @@ @synthesize zeroButton; @synthesize sharpButton; +@synthesize backgroundView; @synthesize videoPreview; @synthesize videoCameraSwitch; @@ -129,15 +130,27 @@ static UICompositeViewDescription *compositeDescription = nil; selector:@selector(callUpdateEvent:) name:kLinphoneCallUpdate object:nil]; + + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(coreUpdateEvent:) + name:kLinphoneCoreUpdate + object:nil]; // Update on show if([LinphoneManager isLcReady]) { - LinphoneCall* call = linphone_core_get_current_call([LinphoneManager getLc]); + LinphoneCore* lc = [LinphoneManager getLc]; + LinphoneCall* call = linphone_core_get_current_call(lc); LinphoneCallState state = (call != NULL)?linphone_call_get_state(call): 0; [self callUpdate:call state:state]; - } - - if(videoPreview) { - linphone_core_set_native_preview_window_id([LinphoneManager getLc], (unsigned long)videoPreview); + + if([LinphoneManager runningOnIpad]) { + if(linphone_core_video_enabled(lc) && linphone_core_video_preview_enabled(lc)) { + linphone_core_set_native_preview_window_id(lc, (unsigned long)videoPreview); + [backgroundView setHidden:FALSE]; + } else { + linphone_core_set_native_preview_window_id(lc, (unsigned long)NULL); + [backgroundView setHidden:TRUE]; + } + } } } @@ -148,6 +161,11 @@ static UICompositeViewDescription *compositeDescription = nil; [[NSNotificationCenter defaultCenter] removeObserver:self name:kLinphoneCallUpdate object:nil]; + + [[NSNotificationCenter defaultCenter] removeObserver:self + name:kLinphoneCoreUpdate + object:nil]; + } - (void)viewDidLoad { @@ -169,8 +187,6 @@ static UICompositeViewDescription *compositeDescription = nil; [addressField setAdjustsFontSizeToFitWidth:TRUE]; // Not put it in IB: issue with placeholder size if([LinphoneManager runningOnIpad]) { - linphone_core_enable_video_preview([LinphoneManager getLc], TRUE); - if ([LinphoneManager instance].frontCamId != nil) { // only show camera switch button if we have more than 1 camera [videoCameraSwitch setHidden:FALSE]; @@ -180,10 +196,6 @@ static UICompositeViewDescription *compositeDescription = nil; - (void)viewDidUnload { [super viewDidUnload]; - - if([LinphoneManager runningOnIpad]) { - linphone_core_enable_video_preview([LinphoneManager getLc], FALSE); - } } - (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { @@ -197,10 +209,10 @@ static UICompositeViewDescription *compositeDescription = nil; [videoPreview setTransform: CGAffineTransformMakeRotation(M_PI)]; break; case UIInterfaceOrientationLandscapeLeft: - [videoPreview setTransform: CGAffineTransformMakeRotation(-M_PI / 2)]; + [videoPreview setTransform: CGAffineTransformMakeRotation(M_PI / 2)]; break; case UIInterfaceOrientationLandscapeRight: - [videoPreview setTransform: CGAffineTransformMakeRotation(M_PI / 2)]; + [videoPreview setTransform: CGAffineTransformMakeRotation(-M_PI / 2)]; break; default: break; @@ -217,6 +229,18 @@ static UICompositeViewDescription *compositeDescription = nil; [self callUpdate:call state:state]; } +- (void)coreUpdateEvent:(NSNotification*)notif { + if([LinphoneManager isLcReady] && [LinphoneManager runningOnIpad]) { + LinphoneCore* lc = [LinphoneManager getLc]; + if(linphone_core_video_enabled(lc) && linphone_core_video_preview_enabled(lc)) { + linphone_core_set_native_preview_window_id(lc, (unsigned long)videoPreview); + [backgroundView setHidden:FALSE]; + } else { + linphone_core_set_native_preview_window_id(lc, (unsigned long)NULL); + [backgroundView setHidden:TRUE]; + } + } +} #pragma mark - diff --git a/Classes/InCallViewController.m b/Classes/InCallViewController.m index 7d991642f..d094e4ffe 100644 --- a/Classes/InCallViewController.m +++ b/Classes/InCallViewController.m @@ -372,7 +372,7 @@ static UICompositeViewDescription *compositeDescription = nil; [UIView commitAnimations]; } - if([[LinphoneManager instance] lpConfigBoolForKey:@"self_video_preference"]) { + if(linphone_core_self_view_enabled([LinphoneManager getLc])) { [videoPreview setHidden:FALSE]; } else { [videoPreview setHidden:TRUE]; diff --git a/Classes/LinphoneCoreSettingsStore.m b/Classes/LinphoneCoreSettingsStore.m index 6a820991e..31c2c50a8 100644 --- a/Classes/LinphoneCoreSettingsStore.m +++ b/Classes/LinphoneCoreSettingsStore.m @@ -218,7 +218,8 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args); pol=linphone_core_get_video_policy(lc); [self setBool:(pol->automatically_initiate) forKey:@"start_video_preference"]; [self setBool:(pol->automatically_accept) forKey:@"accept_video_preference"]; - [self setBool:lp_config_get_int(linphone_core_get_config(lc),"app","self_video_preference", 1) forKey:@"self_video_preference"]; + [self setBool:linphone_core_self_view_enabled(lc) forKey:@"self_video_preference"]; + [self setBool:linphone_core_video_preview_enabled(lc) forKey:@"preview_preference"]; } { [self setBool: lp_config_get_int(linphone_core_get_config(lc),"app","sipinfo_dtmf_preference", 0) forKey:@"sipinfo_dtmf_preference"]; @@ -460,8 +461,8 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args); policy.automatically_accept = [self boolForKey:@"accept_video_preference"]; policy.automatically_initiate = [self boolForKey:@"start_video_preference"]; linphone_core_set_video_policy(lc, &policy); - lp_config_set_int(linphone_core_get_config(lc),"app","self_video_preference", [self boolForKey:@"self_video_preference"]); - + linphone_core_enable_self_view(lc, [self boolForKey:@"self_video_preference"]); + linphone_core_enable_video_preview(lc, [self boolForKey:@"preview_preference"]); // Primary contact NSString* displayname = [self stringForKey:@"primary_displayname_preference"]; diff --git a/Classes/LinphoneManager.h b/Classes/LinphoneManager.h index 1ab4f74d1..cd288e3f1 100644 --- a/Classes/LinphoneManager.h +++ b/Classes/LinphoneManager.h @@ -31,6 +31,7 @@ #include "linphonecore.h" +extern NSString *const kLinphoneCoreUpdate; extern NSString *const kLinphoneDisplayStatusUpdate; extern NSString *const kLinphoneTextReceived; extern NSString *const kLinphoneCallUpdate; diff --git a/Classes/LinphoneManager.m b/Classes/LinphoneManager.m index 5da9bc990..a16ae335d 100644 --- a/Classes/LinphoneManager.m +++ b/Classes/LinphoneManager.m @@ -44,6 +44,7 @@ static void audioRouteChangeListenerCallback ( static LinphoneCore* theLinphoneCore = nil; static LinphoneManager* theLinphoneManager = nil; +NSString *const kLinphoneCoreUpdate = @"kLinphoneCoreUpdate"; NSString *const kLinphoneDisplayStatusUpdate = @"LinphoneDisplayStatusUpdate"; NSString *const kLinphoneTextReceived = @"LinphoneTextReceived"; NSString *const kLinphoneCallUpdate = @"LinphoneCallUpdate"; @@ -601,13 +602,11 @@ static LinphoneCoreVTable linphonec_vtable = { - (void)startLibLinphone { //get default config from bundle - NSBundle* myBundle = [NSBundle mainBundle]; - NSString* factoryConfig = [myBundle pathForResource:[LinphoneManager runningOnIpad]?@"linphonerc-factory~ipad":@"linphonerc-factory" ofType:nil] ; - NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); - NSString *confiFileName = [[paths objectAtIndex:0] stringByAppendingString:@"/.linphonerc"]; - NSString *zrtpSecretsFileName = [[paths objectAtIndex:0] stringByAppendingString:@"/zrtp_secrets"]; - const char* lRootCa = [[myBundle pathForResource:@"rootca"ofType:@"pem"] cStringUsingEncoding:[NSString defaultCStringEncoding]]; - connectivity=none; + NSString* factoryConfig = [LinphoneManager bundleFile:[LinphoneManager runningOnIpad]?@"linphonerc-factory~ipad":@"linphonerc-factory"]; + NSString *confiFileName = [LinphoneManager documentFile:@".linphonerc"]; + NSString *zrtpSecretsFileName = [LinphoneManager documentFile:@"zrtp_secrets"]; + const char* lRootCa = [[LinphoneManager bundleFile:@"rootca.pem"] cStringUsingEncoding:[NSString defaultCStringEncoding]]; + connectivity = none; signal(SIGPIPE, SIG_IGN); //log management @@ -633,17 +632,16 @@ static LinphoneCoreVTable linphonec_vtable = { , [confiFileName cStringUsingEncoding:[NSString defaultCStringEncoding]] , [factoryConfig cStringUsingEncoding:[NSString defaultCStringEncoding]] ,self); - - + fastAddressBook = [[FastAddressBook alloc] init]; linphone_core_set_root_ca(theLinphoneCore, lRootCa); // Set audio assets - const char* lRing = [[myBundle pathForResource:@"ring"ofType:@"wav"] cStringUsingEncoding:[NSString defaultCStringEncoding]]; - linphone_core_set_ring(theLinphoneCore, lRing ); - const char* lRingBack = [[myBundle pathForResource:@"ringback"ofType:@"wav"] cStringUsingEncoding:[NSString defaultCStringEncoding]]; + const char* lRing = [[LinphoneManager bundleFile:@"ring.wab"] cStringUsingEncoding:[NSString defaultCStringEncoding]]; + linphone_core_set_ring(theLinphoneCore, lRing); + const char* lRingBack = [[LinphoneManager bundleFile:@"ringback.wav"] cStringUsingEncoding:[NSString defaultCStringEncoding]]; linphone_core_set_ringback(theLinphoneCore, lRingBack); - const char* lPlay = [[myBundle pathForResource:@"hold"ofType:@"wav"] cStringUsingEncoding:[NSString defaultCStringEncoding]]; + const char* lPlay = [[LinphoneManager bundleFile:@"hold.wav"] cStringUsingEncoding:[NSString defaultCStringEncoding]]; linphone_core_set_play_file(theLinphoneCore, lPlay); linphone_core_set_zrtp_secrets_file(theLinphoneCore, [zrtpSecretsFileName cStringUsingEncoding:[NSString defaultCStringEncoding]]); @@ -673,7 +671,7 @@ static LinphoneCoreVTable linphonec_vtable = { [error release]; } - NSString* path = [myBundle pathForResource:@"nowebcamCIF" ofType:@"jpg"]; + NSString* path = [LinphoneManager bundleFile:@"nowebcamCIF.jpg"]; if (path) { const char* imagePath = [path cStringUsingEncoding:[NSString defaultCStringEncoding]]; [LinphoneLogger logc:LinphoneLoggerLog format:"Using '%s' as source image for no webcam", imagePath]; @@ -722,7 +720,11 @@ static LinphoneCoreVTable linphonec_vtable = { && [UIApplication sharedApplication].applicationState == UIApplicationStateBackground) { //go directly to bg mode [self resignActive]; - } + } + + // Post event + NSDictionary *dict = [NSDictionary dictionaryWithObject:[NSValue valueWithPointer:theLinphoneCore] forKey:@"core"]; + [[NSNotificationCenter defaultCenter] postNotificationName:kLinphoneCoreUpdate object:[LinphoneManager instance] userInfo:dict]; } - (void)destroyLibLinphone { @@ -734,6 +736,11 @@ static LinphoneCoreVTable linphonec_vtable = { [LinphoneLogger logc:LinphoneLoggerLog format:"Destroy linphonecore"]; linphone_core_destroy(theLinphoneCore); theLinphoneCore = nil; + + // Post event + NSDictionary *dict = [NSDictionary dictionaryWithObject:[NSValue valueWithPointer:theLinphoneCore] forKey:@"core"]; + [[NSNotificationCenter defaultCenter] postNotificationName:kLinphoneCoreUpdate object:[LinphoneManager instance] userInfo:dict]; + SCNetworkReachabilityUnscheduleFromRunLoop(proxyReachability, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode); if (proxyReachability) CFRelease(proxyReachability); diff --git a/Classes/LinphoneUI/UICompositeViewController.m b/Classes/LinphoneUI/UICompositeViewController.m index ea0953c9a..7bbf7f4dc 100644 --- a/Classes/LinphoneUI/UICompositeViewController.m +++ b/Classes/LinphoneUI/UICompositeViewController.m @@ -253,10 +253,12 @@ #pragma mark - Event Functions - (void)orientationDidChange:(NSNotification*)notif { - // Update rotation - UIInterfaceOrientation correctOrientation = [self getCorrectInterfaceOrientation:[[UIDevice currentDevice] orientation]]; - if(currentOrientation != correctOrientation) { - [PhoneMainView setOrientation:correctOrientation animated:currentOrientation!=UIDeviceOrientationUnknown]; + if([LinphoneManager isLcReady]) { + // Update rotation + UIInterfaceOrientation correctOrientation = [self getCorrectInterfaceOrientation:[[UIDevice currentDevice] orientation]]; + if(currentOrientation != correctOrientation) { + [PhoneMainView setOrientation:correctOrientation animated:currentOrientation != UIDeviceOrientationUnknown]; + } } } diff --git a/Classes/PhoneMainView.m b/Classes/PhoneMainView.m index 87a7f11c6..f2e04f05e 100644 --- a/Classes/PhoneMainView.m +++ b/Classes/PhoneMainView.m @@ -32,9 +32,6 @@ static PhoneMainView* phoneMainViewInstance=nil; @synthesize mainViewController; @synthesize currentView; -// TO READ -// If a Controller set wantFullScreenLayout then DON'T set the autoresize! -// So DON'T set autoresize for PhoneMainView #pragma mark - Lifecycle Functions @@ -716,7 +713,7 @@ static PhoneMainView* phoneMainViewInstance=nil; if (level < 0.1 && !appData->batteryWarningShown) { DTActionSheet *sheet = [[[DTActionSheet alloc] initWithTitle:NSLocalizedString(@"Battery is running low. Stop video ?",nil)] autorelease]; [sheet addCancelButtonWithTitle:NSLocalizedString(@"Continue video", nil)]; - [sheet addDestructiveButtonWithTitle:NSLocalizedString(@"Stop video", nil) block:^() { + [sheet addDestructiveButtonWithTitle:NSLocalizedString(@"Stop video", nil) block:^() { LinphoneCallParams* paramsCopy = linphone_call_params_copy(linphone_call_get_current_params(call)); // stop video linphone_call_params_enable_video(paramsCopy, FALSE); diff --git a/Classes/SettingsViewController.m b/Classes/SettingsViewController.m index 573842b47..4ab119257 100644 --- a/Classes/SettingsViewController.m +++ b/Classes/SettingsViewController.m @@ -530,6 +530,10 @@ static UICompositeViewDescription *compositeDescription = nil; [hiddenKeys addObject:@"console_button"]; } + if(![LinphoneManager runningOnIpad]) { + [hiddenKeys addObject:@"preview_preference"]; + } + return hiddenKeys; } diff --git a/Classes/en.lproj/DialerViewController~ipad.xib b/Classes/en.lproj/DialerViewController~ipad.xib index 26bc622af..60f9db3be 100644 --- a/Classes/en.lproj/DialerViewController~ipad.xib +++ b/Classes/en.lproj/DialerViewController~ipad.xib @@ -62,7 +62,7 @@ 3 MCAwAA - 1 + 2 IBIPadFramework @@ -726,6 +726,7 @@ {{126, 0}, {186, 85}} + _NS:9 NO @@ -954,6 +955,14 @@ 75 + + + backgroundView + + + + 77 + onAddressChange: @@ -1337,6 +1346,7 @@ 76 + backgroundView @@ -1416,7 +1426,7 @@ - 76 + 77 @@ -1447,6 +1457,7 @@ UIButton UITextField UIButton + UIView UICallButton UIDigitButton UIEraseButton @@ -1482,6 +1493,10 @@ backButton UIButton + + backgroundView + UIView + callButton UICallButton diff --git a/Classes/en.lproj/InCallViewController.xib b/Classes/en.lproj/InCallViewController.xib index d849e1ca3..87f56054e 100644 --- a/Classes/en.lproj/InCallViewController.xib +++ b/Classes/en.lproj/InCallViewController.xib @@ -146,7 +146,6 @@ {{0, 23}, {85, 33}} - _NS:9 NO diff --git a/Classes/fr.lproj/DialerViewController~ipad.xib b/Classes/fr.lproj/DialerViewController~ipad.xib index 58f381dce..90e271b5c 100644 --- a/Classes/fr.lproj/DialerViewController~ipad.xib +++ b/Classes/fr.lproj/DialerViewController~ipad.xib @@ -60,7 +60,7 @@ 3 MCAwAA - 1 + 2 IBIPadFramework @@ -925,6 +925,14 @@ 75 + + + backgroundView + + + + 77 + onAddressChange: @@ -1308,6 +1316,7 @@ 76 + backgroundView @@ -1387,7 +1396,7 @@ - 76 + 77 @@ -1418,6 +1427,7 @@ UIButton UITextField UIButton + UIView UICallButton UIDigitButton UIEraseButton @@ -1453,6 +1463,10 @@ backButton UIButton + + backgroundView + UIView + callButton UICallButton diff --git a/Resources/linphonerc-factory~ipad b/Resources/linphonerc-factory~ipad index 121edc3e6..35826eef3 100644 --- a/Resources/linphonerc-factory~ipad +++ b/Resources/linphonerc-factory~ipad @@ -30,12 +30,3 @@ dtmf_player_amp=0.007 [misc] history_max_size=30 max_calls=3 - -[video] -display=1 -capture=1 -show_local=0 -enabled=1 -size=vga -display_filter_auto_rotate=1 - diff --git a/Resources/linphonerc~ipad b/Resources/linphonerc~ipad index 768e62443..7275d321e 100644 --- a/Resources/linphonerc~ipad +++ b/Resources/linphonerc~ipad @@ -10,4 +10,12 @@ audio_rtp_port=7076 video_rtp_port=9078 [net] -firewall_policy=0 \ No newline at end of file +firewall_policy=0 + +[video] +display=1 +capture=1 +show_local=1 +enabled=1 +size=vga +display_filter_auto_rotate=1 \ No newline at end of file diff --git a/Settings/InAppSettings.bundle/Video.plist b/Settings/InAppSettings.bundle/Video.plist index 2cc185b15..77aa2e894 100644 --- a/Settings/InAppSettings.bundle/Video.plist +++ b/Settings/InAppSettings.bundle/Video.plist @@ -32,6 +32,14 @@ Key self_video_preference + + Type + PSToggleSwitchSpecifier + Title + Show preview + Key + preview_preference + Title Codecs diff --git a/Settings/InAppSettings.bundle/en.lproj/Video.strings b/Settings/InAppSettings.bundle/en.lproj/Video.strings index 1072b20c8..9ef83a74b 100644 --- a/Settings/InAppSettings.bundle/en.lproj/Video.strings +++ b/Settings/InAppSettings.bundle/en.lproj/Video.strings @@ -7,6 +7,9 @@ /* Show self view */ "Show self view" = "Show self view"; +/* Show preview */ +"Show preview" = "Show preview"; + /* Codecs */ "Codecs" = "Codecs"; diff --git a/Settings/InAppSettings.bundle/fr.lproj/Video.strings b/Settings/InAppSettings.bundle/fr.lproj/Video.strings index a94d95b183680b330fb818248b5bb3a140580959..66d51eea6d9cf016b9682095842b9477c0a16402 100644 GIT binary patch literal 409 zcmZ{fK?=e!5JmSr#gJt;1rZU%MbQHY1@|Ex+dyh!lBRg1o}(8ton%wd)qL{){Q0R$ zs7J2{?xo;Ly}@~IJp|dJhO#Qy56a*S?7GYYx0ZJZJO{i+WT&F2z9YF1X#Qs=OrbS7 zV;BAWk=pcn0*C4m>)}N0wojDNAOtOKZbAlQal4Tp@=Y%TS}=B*gLETT(out)aM3La oN7s_1tt``b2ZP<79HhvQRO0>aknk#ql1T7=JJM>Lgw`3!2clMdNB{r; literal 488 zcmb7=$qm9V6h!BoDl9iZ0f<8c9i#%wghdJ%92QYBO#shuu)_fbS@!o|X8vfNk4h7c zQLVF13fjpLxAMe}bEDT&af-Y~7kW#zOjfcZQ5M{cYqik*y&=Npw1&qJhntV&EwfWL zj8W&%>Oma-)K}uN!n$DlI1#iTsj|@qU#?8|=;^fLm;7p}CAWU{vx0{CgbN_!mk)EQ R$$ig;#8~E;VOUK*z5sI`Qz!rc diff --git a/linphone.ldb/Contents.plist b/linphone.ldb/Contents.plist index 83ccf3060..09f16f942 100644 --- a/linphone.ldb/Contents.plist +++ b/linphone.ldb/Contents.plist @@ -1410,17 +1410,17 @@ backup - 3 + 7 class BLWrapperHandle name - Classes/DialerViewController~ipad/3/DialerViewController~ipad.xib + Classes/DialerViewController~ipad/7/DialerViewController~ipad.xib change date - 2012-09-14T08:21:20Z + 2012-09-17T15:00:19Z changed values class @@ -1430,7 +1430,7 @@ flags 0 hash - 199b213a86204679336e2f627d919b3d + 2ba8580f9c2559276f0f27f8ec043517 name DialerViewController~ipad.xib @@ -1969,9 +1969,9 @@ versions en - 3 + 7 fr - 3 + 7 @@ -2776,17 +2776,17 @@ backup - 1 + 2 class BLWrapperHandle name - Classes/InCallViewController/1/InCallViewController.xib + Classes/InCallViewController/2/InCallViewController.xib change date - 2012-09-10T15:34:47Z + 2012-09-17T15:00:02Z changed values class @@ -2796,7 +2796,7 @@ flags 0 hash - ef39c975bbcbb80f09bc1b599428075d + 43dc274f749d7ce59719b7aff1ab2889 name InCallViewController.xib @@ -2835,9 +2835,9 @@ versions en - 1 + 2 fr - 1 + 2 @@ -11155,7 +11155,7 @@ Raison: %2$s change date - 2012-09-11T10:16:55Z + 2012-09-17T13:29:57Z changed values class @@ -11165,7 +11165,7 @@ Raison: %2$s flags 0 hash - ab1400cd24f02dacc6b2b98b0ce939b5 + b7297749603f255583f59fcea3174690 name Video.strings @@ -11246,6 +11246,31 @@ Raison: %2$s snapshots + + change date + 2001-01-01T00:00:00Z + changed values + + class + BLStringKeyObject + comment + Show preview + errors + + flags + 0 + key + Show preview + localizations + + en + Show preview + fr + Activer prévisualisation + + snapshots + + change date 2001-01-01T00:00:00Z diff --git a/linphone.ldb/Resources/Classes/DialerViewController~ipad/3/DialerViewController~ipad.xib b/linphone.ldb/Resources/Classes/DialerViewController~ipad/7/DialerViewController~ipad.xib similarity index 99% rename from linphone.ldb/Resources/Classes/DialerViewController~ipad/3/DialerViewController~ipad.xib rename to linphone.ldb/Resources/Classes/DialerViewController~ipad/7/DialerViewController~ipad.xib index 26bc622af..60f9db3be 100644 --- a/linphone.ldb/Resources/Classes/DialerViewController~ipad/3/DialerViewController~ipad.xib +++ b/linphone.ldb/Resources/Classes/DialerViewController~ipad/7/DialerViewController~ipad.xib @@ -62,7 +62,7 @@ 3 MCAwAA - 1 + 2 IBIPadFramework @@ -726,6 +726,7 @@ {{126, 0}, {186, 85}} + _NS:9 NO @@ -954,6 +955,14 @@ 75 + + + backgroundView + + + + 77 + onAddressChange: @@ -1337,6 +1346,7 @@ 76 + backgroundView @@ -1416,7 +1426,7 @@ - 76 + 77 @@ -1447,6 +1457,7 @@ UIButton UITextField UIButton + UIView UICallButton UIDigitButton UIEraseButton @@ -1482,6 +1493,10 @@ backButton UIButton + + backgroundView + UIView + callButton UICallButton diff --git a/linphone.ldb/Resources/Classes/InCallViewController/1/InCallViewController.xib b/linphone.ldb/Resources/Classes/InCallViewController/2/InCallViewController.xib similarity index 99% rename from linphone.ldb/Resources/Classes/InCallViewController/1/InCallViewController.xib rename to linphone.ldb/Resources/Classes/InCallViewController/2/InCallViewController.xib index d849e1ca3..87f56054e 100644 --- a/linphone.ldb/Resources/Classes/InCallViewController/1/InCallViewController.xib +++ b/linphone.ldb/Resources/Classes/InCallViewController/2/InCallViewController.xib @@ -146,7 +146,6 @@ {{0, 23}, {85, 33}} - _NS:9 NO diff --git a/linphone.ldb/Resources/InAppSettings.bundle/Video/1/Video.strings b/linphone.ldb/Resources/InAppSettings.bundle/Video/1/Video.strings index 1072b20c8..9ef83a74b 100644 --- a/linphone.ldb/Resources/InAppSettings.bundle/Video/1/Video.strings +++ b/linphone.ldb/Resources/InAppSettings.bundle/Video/1/Video.strings @@ -7,6 +7,9 @@ /* Show self view */ "Show self view" = "Show self view"; +/* Show preview */ +"Show preview" = "Show preview"; + /* Codecs */ "Codecs" = "Codecs"; diff --git a/submodules/linphone b/submodules/linphone index efe7222f2..e683675e5 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit efe7222f2efb7eae906b7337925fc080ce9d6b0e +Subproject commit e683675e57e22cf07744dbf6f6c40e8dd374ef78 From d850800fcd5c193127a8e128437235150572c474 Mon Sep 17 00:00:00 2001 From: Yann Diorcet Date: Tue, 18 Sep 2012 12:14:49 +0200 Subject: [PATCH 14/16] Add push notification setting add default settings for wizard --- Classes/ChatRoomViewController.m | 4 + Classes/ImageSharing.m | 5 +- Classes/LinphoneCoreSettingsStore.m | 58 ++- Classes/LinphoneManager.h | 22 +- Classes/LinphoneManager.m | 79 ++- Classes/SettingsViewController.m | 7 +- Classes/WizardViewController.m | 101 +++- Resources/linphonerc-factory | 9 + Resources/linphonerc-factory~ipad | 10 + Settings/InAppSettings.bundle/Network.plist | 10 + Settings/InAppSettings.bundle/Root.plist | 8 + .../en.lproj/Network.strings | 51 ++ .../en.lproj/Root.strings | 3 + .../fr.lproj/Network.strings | 51 ++ .../fr.lproj/Root.strings | 3 + linphone.ldb/Contents.plist | 473 +++++++++++++++++- .../Network/1/Network.strings | 51 ++ .../InAppSettings.bundle/Root/1/Root.strings | 3 + 18 files changed, 852 insertions(+), 96 deletions(-) create mode 100644 Settings/InAppSettings.bundle/en.lproj/Network.strings create mode 100644 Settings/InAppSettings.bundle/fr.lproj/Network.strings create mode 100644 linphone.ldb/Resources/InAppSettings.bundle/Network/1/Network.strings diff --git a/Classes/ChatRoomViewController.m b/Classes/ChatRoomViewController.m index 4399b4845..a8d863cee 100644 --- a/Classes/ChatRoomViewController.m +++ b/Classes/ChatRoomViewController.m @@ -175,6 +175,10 @@ static UICompositeViewDescription *compositeDescription = nil; - (void)viewWillDisappear:(BOOL)animated { [super viewWillDisappear:animated]; + if(imageSharing) { + [imageSharing cancel]; + } + [messageField resignFirstResponder]; if(chatRoom != NULL) { diff --git a/Classes/ImageSharing.m b/Classes/ImageSharing.m index d2c5db458..b0aee4b06 100644 --- a/Classes/ImageSharing.m +++ b/Classes/ImageSharing.m @@ -34,7 +34,7 @@ ImageSharing *imgs = [[ImageSharing alloc] init]; if(imgs != nil) { imgs->upload = TRUE; - imgs->delegate = delegate; + imgs->delegate = [delegate retain]; imgs->data = [[NSMutableData alloc] init]; if(delegate) { [delegate imageSharingProgress:imgs progress:0]; @@ -48,7 +48,7 @@ ImageSharing *imgs = [[ImageSharing alloc] init]; if(imgs != nil) { imgs->upload = FALSE; - imgs->delegate = delegate; + imgs->delegate = [delegate retain]; imgs->data = [[NSMutableData alloc] init]; if(delegate) { [delegate imageSharingProgress:imgs progress:0]; @@ -61,6 +61,7 @@ - (void)dealloc { [connection release]; [data release]; + [delegate release]; [super dealloc]; } diff --git a/Classes/LinphoneCoreSettingsStore.m b/Classes/LinphoneCoreSettingsStore.m index 31c2c50a8..1ab80c019 100644 --- a/Classes/LinphoneCoreSettingsStore.m +++ b/Classes/LinphoneCoreSettingsStore.m @@ -43,9 +43,9 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args); changedDict=[[NSMutableDictionary alloc] init]; [self transformLinphoneCoreToKeys]; LinphoneCore *lc=[LinphoneManager getLc]; - if (lp_config_get_int(linphone_core_get_config(lc),"app","config_migrated",0) == 0) { + if (lp_config_get_int(linphone_core_get_config(lc), LINPHONERC_APPLICATION_KEY,"config_migrated",0) == 0) { [self handleMigration]; - lp_config_set_int(linphone_core_get_config(lc),"app","config_migrated",1); + lp_config_set_int(linphone_core_get_config(lc), LINPHONERC_APPLICATION_KEY,"config_migrated",1); } } return self; @@ -103,7 +103,7 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args); [self setString: linphone_address_get_username(addr) forKey:@"username_preference"]; [self setString: linphone_address_get_domain(addr) forKey:@"domain_preference"]; [self setInteger: linphone_proxy_config_get_expires(cfg) forKey:@"expire_preference"]; - [self setString:linphone_proxy_config_get_dial_prefix(cfg) forKey:@"prefix_preference"]; + [self setString: linphone_proxy_config_get_dial_prefix(cfg) forKey:@"prefix_preference"]; if (strcmp(linphone_address_get_domain(addr),linphone_address_get_domain(proxy_addr))!=0 || port!=NULL){ char tmp[256]={0}; @@ -120,8 +120,10 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args); } } else { - [self setInteger: lp_config_get_int(linphone_core_get_config(lc),"default_values","reg_expires",600) forKey:@"expire_preference"]; + [self setInteger: lp_config_get_int(linphone_core_get_config(lc),"default_values","reg_expires", 600) forKey:@"expire_preference"]; } + + [self setBool:lp_config_get_int(linphone_core_get_config(lc), LINPHONERC_APPLICATION_KEY, "pushnotification_preference", 0) forKey:@"pushnotification_preference"]; { LinphoneAddress *parsed = linphone_core_get_primary_contact_parsed(lc); if(parsed != NULL) { @@ -187,21 +189,21 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args); } [self setString:val forKey:@"media_encryption_preference"]; } - [self setString: lp_config_get_string(linphone_core_get_config(lc),"app","rotation_preference", "auto") forKey:@"rotation_preference"]; - [self setBool: lp_config_get_int(linphone_core_get_config(lc),"app","enable_first_login_view_preference", 0) forKey:@"enable_first_login_view_preference"]; - [self setBool: lp_config_get_int(linphone_core_get_config(lc),"app","debugenable_preference", 0) forKey:@"debugenable_preference"]; - [self setBool: lp_config_get_int(linphone_core_get_config(lc),"app","animations_preference", 1) forKey:@"animations_preference"]; - [self setBool: lp_config_get_int(linphone_core_get_config(lc),"app","check_config_disable_preference", 0) forKey:@"check_config_disable_preference"]; - [self setBool: lp_config_get_int(linphone_core_get_config(lc),"app","wifi_only_preference", 0) forKey:@"wifi_only_preference"]; - [self setString: lp_config_get_string(linphone_core_get_config(lc),"app","file_upload_url_preference",NULL) forKey:@"file_upload_url_preference"]; + [self setString: lp_config_get_string(linphone_core_get_config(lc), LINPHONERC_APPLICATION_KEY, "rotation_preference", "auto") forKey:@"rotation_preference"]; + [self setBool: lp_config_get_int(linphone_core_get_config(lc), LINPHONERC_APPLICATION_KEY, "enable_first_login_view_preference", 0) forKey:@"enable_first_login_view_preference"]; + [self setBool: lp_config_get_int(linphone_core_get_config(lc), LINPHONERC_APPLICATION_KEY, "debugenable_preference", 0) forKey:@"debugenable_preference"]; + [self setBool: lp_config_get_int(linphone_core_get_config(lc), LINPHONERC_APPLICATION_KEY, "animations_preference", 1) forKey:@"animations_preference"]; + [self setBool: lp_config_get_int(linphone_core_get_config(lc), LINPHONERC_APPLICATION_KEY, "check_config_disable_preference", 0) forKey:@"check_config_disable_preference"]; + [self setBool: lp_config_get_int(linphone_core_get_config(lc), LINPHONERC_APPLICATION_KEY, "wifi_only_preference", 0) forKey:@"wifi_only_preference"]; + [self setString: lp_config_get_string(linphone_core_get_config(lc), LINPHONERC_APPLICATION_KEY, "file_upload_url_preference",NULL) forKey:@"file_upload_url_preference"]; /*keep this one also in the standardUserDefaults so that it can be read before starting liblinphone*/ BOOL start_at_boot = TRUE; - if ([[NSUserDefaults standardUserDefaults] objectForKey:@"start_at_boot_preference"]!=Nil) + if ([[NSUserDefaults standardUserDefaults] objectForKey:@"start_at_boot_preference"] != Nil) start_at_boot = [[NSUserDefaults standardUserDefaults] boolForKey:@"start_at_boot_preference"]; [self setBool: start_at_boot forKey:@"start_at_boot_preference"]; BOOL background_mode = TRUE; - if ([[NSUserDefaults standardUserDefaults] objectForKey:@"backgroundmode_preference"]!=Nil) + if ([[NSUserDefaults standardUserDefaults] objectForKey:@"backgroundmode_preference"] != Nil) background_mode =[[NSUserDefaults standardUserDefaults] boolForKey:@"backgroundmode_preference"]; [self setBool: background_mode forKey:@"backgroundmode_preference"]; @@ -222,11 +224,11 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args); [self setBool:linphone_core_video_preview_enabled(lc) forKey:@"preview_preference"]; } { - [self setBool: lp_config_get_int(linphone_core_get_config(lc),"app","sipinfo_dtmf_preference", 0) forKey:@"sipinfo_dtmf_preference"]; - [self setBool: lp_config_get_int(linphone_core_get_config(lc),"app","rfc_dtmf_preference", 1) forKey:@"rfc_dtmf_preference"]; + [self setBool: lp_config_get_int(linphone_core_get_config(lc), LINPHONERC_APPLICATION_KEY, "sipinfo_dtmf_preference", 0) forKey:@"sipinfo_dtmf_preference"]; + [self setBool: lp_config_get_int(linphone_core_get_config(lc), LINPHONERC_APPLICATION_KEY, "rfc_dtmf_preference", 1) forKey:@"rfc_dtmf_preference"]; } - if (lp_config_get_int(linphone_core_get_config(lc),"app","debugenable_preference",0)) + if (lp_config_get_int(linphone_core_get_config(lc), LINPHONERC_APPLICATION_KEY, "debugenable_preference",0)) linphone_core_enable_logs_with_cb((OrtpLogFunc)linphone_iphone_log_handler); [changedDict release]; @@ -353,9 +355,9 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args); } // configure proxy entries - linphone_proxy_config_set_identity(proxyCfg,identity); - linphone_proxy_config_set_server_addr(proxyCfg,proxy); - linphone_proxy_config_enable_register(proxyCfg,true); + linphone_proxy_config_set_identity(proxyCfg, identity); + linphone_proxy_config_set_server_addr(proxyCfg, proxy); + linphone_proxy_config_enable_register(proxyCfg, true); int expire = [self integerForKey:@"expire_preference"]; @@ -366,11 +368,11 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args); if (isWifiOnly && lLinphoneMgr.connectivity == wwan) { linphone_proxy_config_expires(proxyCfg, 0); } else { - linphone_proxy_config_expires(proxyCfg,expire); + linphone_proxy_config_expires(proxyCfg, expire); } if (isOutboundProxy) - linphone_proxy_config_set_route(proxyCfg,proxy); + linphone_proxy_config_set_route(proxyCfg, proxy); if ([self objectForKey:@"prefix_preference"]) { NSString* prefix = [self stringForKey:@"prefix_preference"]; @@ -383,8 +385,10 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args); linphone_proxy_config_set_dial_escape_plus(proxyCfg,substitute_plus_by_00); } + BOOL pushnotification = [self boolForKey:@"pushnotification_preference"]; + lp_config_set_int(linphone_core_get_config(lc), LINPHONERC_APPLICATION_KEY, "pushnotification_preference", pushnotification); - [[LinphoneManager instance ]addPushTokenToProxyConfig : proxyCfg ]; + [[LinphoneManager instance] addPushTokenToProxyConfig:proxyCfg]; linphone_core_add_proxy_config(lc,proxyCfg); //set to default proxy @@ -494,21 +498,21 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args); } else { isbackgroundModeEnabled = false; } - lp_config_set_int(linphone_core_get_config(lc),"app","backgroundmode_preference", isbackgroundModeEnabled); + lp_config_set_int(linphone_core_get_config(lc), LINPHONERC_APPLICATION_KEY, "backgroundmode_preference", isbackgroundModeEnabled); BOOL firstloginview = [self boolForKey:@"enable_first_login_view_preference"]; - lp_config_set_int(linphone_core_get_config(lc),"app","enable_first_login_view_preference", firstloginview); + lp_config_set_int(linphone_core_get_config(lc), LINPHONERC_APPLICATION_KEY, "enable_first_login_view_preference", firstloginview); NSString *landscape = [self stringForKey:@"rotation_preference"]; - lp_config_set_string(linphone_core_get_config(lc),"app","rotation_preference", [landscape UTF8String]); + lp_config_set_string(linphone_core_get_config(lc), LINPHONERC_APPLICATION_KEY, "rotation_preference", [landscape UTF8String]); BOOL debugmode = [self boolForKey:@"debugenable_preference"]; - lp_config_set_int(linphone_core_get_config(lc),"app","debugenable_preference", debugmode); + lp_config_set_int(linphone_core_get_config(lc), LINPHONERC_APPLICATION_KEY, "debugenable_preference", debugmode); if (debugmode) linphone_core_enable_logs_with_cb((OrtpLogFunc)linphone_iphone_log_handler); else linphone_core_disable_logs(); BOOL animations = [self boolForKey:@"animations_preference"]; - lp_config_set_int(linphone_core_get_config(lc),"app","animations_preference", animations); + lp_config_set_int(linphone_core_get_config(lc), LINPHONERC_APPLICATION_KEY, "animations_preference", animations); NSString* file_upload_url= [self stringForKey:@"file_upload_url_preference"]; [[LinphoneManager instance] lpConfigSetString:file_upload_url forKey:@"file_upload_url_preference"]; diff --git a/Classes/LinphoneManager.h b/Classes/LinphoneManager.h index cd288e3f1..799d4bba0 100644 --- a/Classes/LinphoneManager.h +++ b/Classes/LinphoneManager.h @@ -31,6 +31,8 @@ #include "linphonecore.h" +extern const char *const LINPHONERC_APPLICATION_KEY; + extern NSString *const kLinphoneCoreUpdate; extern NSString *const kLinphoneDisplayStatusUpdate; extern NSString *const kLinphoneTextReceived; @@ -116,14 +118,18 @@ typedef struct _LinphoneManagerSounds { - (void)call:(NSString *)address displayName:(NSString*)displayName transfer:(BOOL)transfer; --(void)lpConfigSetString:(NSString*) value forKey:(NSString*) key; --(NSString*)lpConfigStringForKey:(NSString*) key; - --(void)lpConfigSetInt:(NSInteger) value forKey:(NSString*) key; --(NSInteger)lpConfigIntForKey:(NSString*) key; - --(void)lpConfigSetBool:(BOOL) value forKey:(NSString*) key; --(BOOL)lpConfigBoolForKey:(NSString*) key; +- (void)lpConfigSetString:(NSString*)value forKey:(NSString*)key; +- (NSString*)lpConfigStringForKey:(NSString*)key; +- (void)lpConfigSetString:(NSString*)value forKey:(NSString*)key forSection:(NSString*)section; +- (NSString*)lpConfigStringForKey:(NSString*)key forSection:(NSString*)section; +- (void)lpConfigSetInt:(NSInteger)value forKey:(NSString*)key; +- (NSInteger)lpConfigIntForKey:(NSString*)key; +- (void)lpConfigSetInt:(NSInteger)value forKey:(NSString*)key forSection:(NSString*)section; +- (NSInteger)lpConfigIntForKey:(NSString*)key forSection:(NSString*)section; +- (void)lpConfigSetBool:(BOOL)value forKey:(NSString*)key; +- (BOOL)lpConfigBoolForKey:(NSString*)key; +- (void)lpConfigSetBool:(BOOL)value forKey:(NSString*)key forSection:(NSString*)section; +- (BOOL)lpConfigBoolForKey:(NSString*)key forSection:(NSString*)section; @property (readonly) FastAddressBook* fastAddressBook; @property Connectivity connectivity; diff --git a/Classes/LinphoneManager.m b/Classes/LinphoneManager.m index a16ae335d..db073f120 100644 --- a/Classes/LinphoneManager.m +++ b/Classes/LinphoneManager.m @@ -44,6 +44,8 @@ static void audioRouteChangeListenerCallback ( static LinphoneCore* theLinphoneCore = nil; static LinphoneManager* theLinphoneManager = nil; +const char *const LINPHONERC_APPLICATION_KEY = "app"; + NSString *const kLinphoneCoreUpdate = @"kLinphoneCoreUpdate"; NSString *const kLinphoneDisplayStatusUpdate = @"LinphoneDisplayStatusUpdate"; NSString *const kLinphoneTextReceived = @"LinphoneTextReceived"; @@ -514,7 +516,7 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach [LinphoneManager kickOffNetworkConnection]; } else { Connectivity newConnectivity; - BOOL isWifiOnly = lp_config_get_int(linphone_core_get_config([LinphoneManager getLc]),"app","wifi_only_preference",FALSE); + BOOL isWifiOnly = lp_config_get_int(linphone_core_get_config([LinphoneManager getLc]), LINPHONERC_APPLICATION_KEY, "wifi_only_preference",FALSE); if (!ctx || ctx->testWWan) newConnectivity = flags & kSCNetworkReachabilityFlagsIsWWAN ? wwan:wifi; else @@ -1007,9 +1009,9 @@ static void audioRouteChangeListenerCallback ( } } -- (void)addPushTokenToProxyConfig: (LinphoneProxyConfig*)proxyCfg{ +- (void)addPushTokenToProxyConfig:(LinphoneProxyConfig*)proxyCfg{ NSData *tokenData = pushNotificationToken; - if(tokenData != nil) { + if(tokenData != nil && [self lpConfigBoolForKey:@"pusnotification_preference"]) { const unsigned char *tokenBuffer = [tokenData bytes]; NSMutableString *tokenString = [NSMutableString stringWithCapacity:[tokenData length]*2]; for(int i = 0; i < [tokenData length]; ++i) { @@ -1068,35 +1070,62 @@ static void audioRouteChangeListenerCallback ( } +#pragma mark - LPConfig Functions - - --(void)lpConfigSetString:(NSString*) value forKey:(NSString*) key { - if (!key) return; - lp_config_set_string(linphone_core_get_config(theLinphoneCore),"app",[key UTF8String], value?[value UTF8String]:NULL); +- (void)lpConfigSetString:(NSString*)value forKey:(NSString*)key { + [self lpConfigSetString:value forKey:key forSection:[NSString stringWithUTF8String:LINPHONERC_APPLICATION_KEY]]; } --(NSString*)lpConfigStringForKey:(NSString*) key { - if (!theLinphoneCore) { - [LinphoneLogger log:LinphoneLoggerError format:@"cannot read configuration because linphone core not ready yet"]; - return nil; - }; - const char* value=lp_config_get_string(linphone_core_get_config(theLinphoneCore),"app",[key UTF8String],NULL); - if (value) - return [NSString stringWithCString:value encoding:[NSString defaultCStringEncoding]]; + +- (void)lpConfigSetString:(NSString*)value forKey:(NSString*)key forSection:(NSString *)section { + if (!key) return; + lp_config_set_string(linphone_core_get_config(theLinphoneCore), [section UTF8String], [key UTF8String], value?[value UTF8String]:NULL); +} + +- (NSString*)lpConfigStringForKey:(NSString*)key { + return [self lpConfigStringForKey:key forSection:[NSString stringWithUTF8String:LINPHONERC_APPLICATION_KEY]]; +} + +- (NSString*)lpConfigStringForKey:(NSString*)key forSection:(NSString *)section { + if (!key) return nil; + const char* value = lp_config_get_string(linphone_core_get_config(theLinphoneCore), [section UTF8String], [key UTF8String], NULL); + if (value) + return [NSString stringWithUTF8String:value]; else return nil; } --(void)lpConfigSetInt:(NSInteger) value forKey:(NSString*) key { - lp_config_set_int(linphone_core_get_config(theLinphoneCore),"app",[key UTF8String], value ); -} --(NSInteger)lpConfigIntForKey:(NSString*) key { - return lp_config_get_int(linphone_core_get_config(theLinphoneCore),"app",[key UTF8String],-1); + +- (void)lpConfigSetInt:(NSInteger)value forKey:(NSString*)key { + [self lpConfigSetInt:value forKey:key forSection:[NSString stringWithUTF8String:LINPHONERC_APPLICATION_KEY]]; } --(void)lpConfigSetBool:(BOOL) value forKey:(NSString*) key { - return [self lpConfigSetInt:(NSInteger)(value==TRUE) forKey:key]; +- (void)lpConfigSetInt:(NSInteger)value forKey:(NSString*)key forSection:(NSString *)section { + if (!key) return; + lp_config_set_int(linphone_core_get_config(theLinphoneCore), [section UTF8String], [key UTF8String], value ); } --(BOOL)lpConfigBoolForKey:(NSString*) key { - return [self lpConfigIntForKey:key] == 1; + +- (NSInteger)lpConfigIntForKey:(NSString*)key { + return [self lpConfigIntForKey:key forSection:[NSString stringWithUTF8String:LINPHONERC_APPLICATION_KEY]]; } + +- (NSInteger)lpConfigIntForKey:(NSString*)key forSection:(NSString *)section { + if (!key) return -1; + return lp_config_get_int(linphone_core_get_config(theLinphoneCore), [section UTF8String], [key UTF8String], -1); +} + +- (void)lpConfigSetBool:(BOOL)value forKey:(NSString*)key { + [self lpConfigSetBool:value forKey:key forSection:[NSString stringWithUTF8String:LINPHONERC_APPLICATION_KEY]]; +} + +- (void)lpConfigSetBool:(BOOL)value forKey:(NSString*)key forSection:(NSString *)section { + return [self lpConfigSetInt:(NSInteger)(value == TRUE) forKey:key forSection:section]; +} + +- (BOOL)lpConfigBoolForKey:(NSString*)key { + return [self lpConfigBoolForKey:key forSection:[NSString stringWithUTF8String:LINPHONERC_APPLICATION_KEY]]; +} + +- (BOOL)lpConfigBoolForKey:(NSString*)key forSection:(NSString *)section { + return [self lpConfigIntForKey:key forSection:section] == 1; +} + @end diff --git a/Classes/SettingsViewController.m b/Classes/SettingsViewController.m index 4ab119257..8143f129a 100644 --- a/Classes/SettingsViewController.m +++ b/Classes/SettingsViewController.m @@ -390,7 +390,6 @@ static UICompositeViewDescription *compositeDescription = nil; [super viewDidLoad]; settingsStore = [[LinphoneCoreSettingsStore alloc] init]; - [settingsStore transformLinphoneCoreToKeys]; settingsController.showDoneButton = FALSE; settingsController.delegate = self; @@ -416,6 +415,10 @@ static UICompositeViewDescription *compositeDescription = nil; - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; + + [settingsStore transformLinphoneCoreToKeys]; // Sync settings with linphone core settings + [settingsController.tableView reloadData]; + // Set observer [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(appSettingChanged:) @@ -560,6 +563,8 @@ static UICompositeViewDescription *compositeDescription = nil; #endif if([key isEqual:@"console_button"]) { [[PhoneMainView instance] changeCurrentView:[ConsoleViewController compositeViewDescription] push:TRUE]; + } else if([key isEqual:@"wizard_button"]) { + [[PhoneMainView instance] changeCurrentView:[WizardViewController compositeViewDescription]]; } } @end diff --git a/Classes/WizardViewController.m b/Classes/WizardViewController.m index b42ccd397..c99fba0b5 100644 --- a/Classes/WizardViewController.m +++ b/Classes/WizardViewController.m @@ -52,11 +52,6 @@ typedef enum _ViewElement { @synthesize backButton; @synthesize startButton; -static int LINPHONE_WIZARD_MIN_PASSWORD_LENGTH = 6; -static int LINPHONE_WIZARD_MIN_USERNAME_LENGTH = 4; -static NSString *LINPHONE_WIZARD_URL = @"https://www.linphone.org/wizard.php"; -static NSString *LINPHONE_WIZARD_DOMAIN = @"sip.linphone.org"; - #pragma mark - Lifecycle Functions @@ -258,23 +253,69 @@ static UICompositeViewDescription *compositeDescription = nil; linphone_core_clear_all_auth_info([LinphoneManager getLc]); } -- (void)addProxyConfig:(NSString*)username password:(NSString*)password domain:(NSString*)domain { - const char* identity = [[NSString stringWithFormat:@"sip:%@@%@",username,domain] UTF8String]; +- (void)setDefaultSettings:(LinphoneProxyConfig*)proxyCfg { + BOOL pushnotification = [[LinphoneManager instance] lpConfigBoolForKey:@"push_notification" forSection:@"wizard"]; + [[LinphoneManager instance] lpConfigSetBool:pushnotification forKey:@"pushnotification_preference"]; + if(pushnotification) { + [[LinphoneManager instance] addPushTokenToProxyConfig:proxyCfg]; + } + int expires = [[LinphoneManager instance] lpConfigIntForKey:@"expires" forSection:@"wizard"]; + linphone_proxy_config_expires(proxyCfg, expires); + + NSString* transport = [[LinphoneManager instance] lpConfigStringForKey:@"transport" forSection:@"wizard"]; + LinphoneCore *lc = [LinphoneManager getLc]; + LCSipTransports transportValue={0}; + if (transport!=nil) { + if (linphone_core_get_sip_transports(lc, &transportValue)) { + [LinphoneLogger logc:LinphoneLoggerError format:"cannot get current transport"]; + } + // Only one port can be set at one time, the others's value is 0 + if ([transport isEqualToString:@"tcp"]) { + transportValue.tcp_port=transportValue.tcp_port|transportValue.udp_port|transportValue.tls_port; + transportValue.udp_port=0; + transportValue.tls_port=0; + } else if ([transport isEqualToString:@"udp"]){ + transportValue.udp_port=transportValue.tcp_port|transportValue.udp_port|transportValue.tls_port; + transportValue.tcp_port=0; + transportValue.tls_port=0; + } else if ([transport isEqualToString:@"tls"]){ + transportValue.tls_port=transportValue.tcp_port|transportValue.udp_port|transportValue.tls_port; + transportValue.tcp_port=0; + transportValue.udp_port=0; + } else { + [LinphoneLogger logc:LinphoneLoggerError format:"unexpected transport [%s]",[transport cStringUsingEncoding:[NSString defaultCStringEncoding]]]; + } + if (linphone_core_set_sip_transports(lc, &transportValue)) { + [LinphoneLogger logc:LinphoneLoggerError format:"cannot set transport"]; + } + } +} + +- (void)addProxyConfig:(NSString*)username password:(NSString*)password domain:(NSString*)domain server:(NSString*)server { + if(server == nil) { + server = domain; + } + const char* identity = [[NSString stringWithFormat:@"sip:%@@%@", username, domain] UTF8String]; LinphoneProxyConfig* proxyCfg = linphone_core_create_proxy_config([LinphoneManager getLc]); - LinphoneAuthInfo* info=linphone_auth_info_new([username UTF8String],NULL,[password UTF8String],NULL,NULL); - linphone_proxy_config_set_identity(proxyCfg,identity); - linphone_proxy_config_set_server_addr(proxyCfg,[domain UTF8String]); - linphone_proxy_config_enable_register(proxyCfg,true); - linphone_core_add_proxy_config([LinphoneManager getLc], proxyCfg); + LinphoneAuthInfo* info = linphone_auth_info_new([username UTF8String], NULL, [password UTF8String], NULL, NULL); + linphone_proxy_config_set_identity(proxyCfg, identity); + linphone_proxy_config_set_server_addr(proxyCfg, [server UTF8String]); + if([server compare:domain options:NSCaseInsensitiveSearch] != 0) { + linphone_proxy_config_set_route(proxyCfg, [server UTF8String]); + } + linphone_proxy_config_enable_register(proxyCfg, true); + if([domain compare:[[LinphoneManager instance] lpConfigStringForKey:@"domain" forSection:@"wizard"] options:NSCaseInsensitiveSearch] == 0) { + [self setDefaultSettings:proxyCfg]; + } + linphone_core_add_proxy_config([LinphoneManager getLc], proxyCfg); linphone_core_set_default_proxy([LinphoneManager getLc], proxyCfg); - linphone_core_add_auth_info([LinphoneManager getLc],info) - ; + linphone_core_add_auth_info([LinphoneManager getLc], info); } - (void)checkUserExist:(NSString*)username { [LinphoneLogger log:LinphoneLoggerDebug format:@"XMLRPC check_account %@", username]; - NSURL *URL = [NSURL URLWithString: LINPHONE_WIZARD_URL]; + NSURL *URL = [NSURL URLWithString:[[LinphoneManager instance] lpConfigStringForKey:@"service_url" forSection:@"wizard"]]; XMLRPCRequest *request = [[XMLRPCRequest alloc] initWithURL: URL]; [request setMethod: @"check_account" withParameters:[NSArray arrayWithObjects:username, nil]]; @@ -289,7 +330,7 @@ static UICompositeViewDescription *compositeDescription = nil; NSString *useragent = [LinphoneManager getUserAgent]; [LinphoneLogger log:LinphoneLoggerDebug format:@"XMLRPC create_account_with_useragent %@ %@ %@ %@", identity, password, email, useragent]; - NSURL *URL = [NSURL URLWithString: LINPHONE_WIZARD_URL]; + NSURL *URL = [NSURL URLWithString: [[LinphoneManager instance] lpConfigStringForKey:@"service_url" forSection:@"wizard"]]; XMLRPCRequest *request = [[XMLRPCRequest alloc] initWithURL: URL]; [request setMethod: @"create_account_with_useragent" withParameters:[NSArray arrayWithObjects:identity, password, email, useragent, nil]]; @@ -303,7 +344,7 @@ static UICompositeViewDescription *compositeDescription = nil; - (void)checkAccountValidation:(NSString*)identity { [LinphoneLogger log:LinphoneLoggerDebug format:@"XMLRPC check_account_validated %@", identity]; - NSURL *URL = [NSURL URLWithString: LINPHONE_WIZARD_URL]; + NSURL *URL = [NSURL URLWithString: [[LinphoneManager instance] lpConfigStringForKey:@"service_url" forSection:@"wizard"]]; XMLRPCRequest *request = [[XMLRPCRequest alloc] initWithURL: URL]; [request setMethod: @"check_account_validated" withParameters:[NSArray arrayWithObjects:identity, nil]]; @@ -384,7 +425,7 @@ static UICompositeViewDescription *compositeDescription = nil; - (IBAction)onCheckValidationClick:(id)sender { NSString *username = [WizardViewController findTextField:ViewElement_Username view:contentView].text; - [self checkAccountValidation:[NSString stringWithFormat:@"%@@%@", username, LINPHONE_WIZARD_DOMAIN]]; + [self checkAccountValidation:[NSString stringWithFormat:@"%@@%@", username, [[LinphoneManager instance] lpConfigStringForKey:@"domain" forSection:@"wizard"]]]; } - (IBAction)onSignInExternalClick:(id)sender { @@ -392,14 +433,16 @@ static UICompositeViewDescription *compositeDescription = nil; NSString *username = [WizardViewController findTextField:ViewElement_Username view:contentView].text; NSString *password = [WizardViewController findTextField:ViewElement_Password view:contentView].text; NSString *domain = [WizardViewController findTextField:ViewElement_Domain view:contentView].text; - [self addProxyConfig:username password:password domain:domain]; + [self addProxyConfig:username password:password domain:domain server:nil]; } - (IBAction)onSignInClick:(id)sender { [self.waitView setHidden:false]; NSString *username = [WizardViewController findTextField:ViewElement_Username view:contentView].text; NSString *password = [WizardViewController findTextField:ViewElement_Password view:contentView].text; - [self addProxyConfig:username password:password domain:LINPHONE_WIZARD_DOMAIN]; + [self addProxyConfig:username password:password + domain:[[LinphoneManager instance] lpConfigStringForKey:@"domain" forSection:@"wizard"] + server:[[LinphoneManager instance] lpConfigStringForKey:@"proxy" forSection:@"wizard"]]; } - (IBAction)onRegisterClick:(id)sender { @@ -409,13 +452,16 @@ static UICompositeViewDescription *compositeDescription = nil; NSString *email = [WizardViewController findTextField:ViewElement_Email view:contentView].text; NSMutableString *errors = [NSMutableString string]; - if ([username length] < LINPHONE_WIZARD_MIN_USERNAME_LENGTH) { + int username_length = [[LinphoneManager instance] lpConfigIntForKey:@"username_length" forSection:@"wizard"]; + int password_length = [[LinphoneManager instance] lpConfigIntForKey:@"password_length" forSection:@"wizard"]; + + if ([username length] < username_length) { - [errors appendString:[NSString stringWithFormat:NSLocalizedString(@"The username is too short (minimum %d characters).\n", nil), LINPHONE_WIZARD_MIN_USERNAME_LENGTH]]; + [errors appendString:[NSString stringWithFormat:NSLocalizedString(@"The username is too short (minimum %d characters).\n", nil), username_length]]; } - if ([password length] < LINPHONE_WIZARD_MIN_PASSWORD_LENGTH) { - [errors appendString:[NSString stringWithFormat:NSLocalizedString(@"The password is too short (minimum %d characters).\n", nil), LINPHONE_WIZARD_MIN_PASSWORD_LENGTH]]; + if ([password length] < password_length) { + [errors appendString:[NSString stringWithFormat:NSLocalizedString(@"The password is too short (minimum %d characters).\n", nil), password_length]]; } if (![password2 isEqualToString:password]) { @@ -447,6 +493,7 @@ static UICompositeViewDescription *compositeDescription = nil; [self registrationUpdate:[[notif.userInfo objectForKey: @"state"] intValue]]; } + #pragma mark - Keyboard Event Functions - (void)keyboardWillHide:(NSNotification *)notif { @@ -533,7 +580,7 @@ static UICompositeViewDescription *compositeDescription = nil; NSString *username = [WizardViewController findTextField:ViewElement_Username view:contentView].text; NSString *password = [WizardViewController findTextField:ViewElement_Password view:contentView].text; NSString *email = [WizardViewController findTextField:ViewElement_Email view:contentView].text; - [self createAccount:[NSString stringWithFormat:@"%@@%@", username, LINPHONE_WIZARD_DOMAIN] password:password email:email]; + [self createAccount:[NSString stringWithFormat:@"%@@%@", username, [[LinphoneManager instance] lpConfigStringForKey:@"domain" forSection:@"wizard"]] password:password email:email]; } } else if([[request method] isEqualToString:@"create_account_with_useragent"]) { if([response object] == [NSNumber numberWithInt:0]) { @@ -555,7 +602,9 @@ static UICompositeViewDescription *compositeDescription = nil; if([response object] == [NSNumber numberWithInt:1]) { NSString *username = [WizardViewController findTextField:ViewElement_Username view:contentView].text; NSString *password = [WizardViewController findTextField:ViewElement_Password view:contentView].text; - [self addProxyConfig:username password:password domain:LINPHONE_WIZARD_DOMAIN]; + [self addProxyConfig:username password:password + domain:[[LinphoneManager instance] lpConfigStringForKey:@"domain" forSection:@"wizard"] + server:[[LinphoneManager instance] lpConfigStringForKey:@"proxy" forSection:@"wizard"]]; } else { UIAlertView* errorView = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Account validation issue",nil) message:NSLocalizedString(@"Your account is not validate yet.", nil) diff --git a/Resources/linphonerc-factory b/Resources/linphonerc-factory index 6364d3100..a38a81b51 100644 --- a/Resources/linphonerc-factory +++ b/Resources/linphonerc-factory @@ -31,4 +31,13 @@ dtmf_player_amp=0.007 history_max_size=30 max_calls=3 +[wizard] +service_url=https://www.linphone.org/wizard.php +domain=sip.linphone.org +proxy=sip.linphone.org:5223 +password_length=6 +username_length=4 +expires=600 +push_notification=1 +transport=tls diff --git a/Resources/linphonerc-factory~ipad b/Resources/linphonerc-factory~ipad index 35826eef3..845a67bba 100644 --- a/Resources/linphonerc-factory~ipad +++ b/Resources/linphonerc-factory~ipad @@ -30,3 +30,13 @@ dtmf_player_amp=0.007 [misc] history_max_size=30 max_calls=3 + +[wizard] +service_url=https://www.linphone.org/wizard.php +domain=sip.linphone.org +proxy=sip.linphone.org:5223 +password_length=6 +username_length=4 +expires=600 +push_notification=1 +transport=tls diff --git a/Settings/InAppSettings.bundle/Network.plist b/Settings/InAppSettings.bundle/Network.plist index d4b181699..51104118c 100644 --- a/Settings/InAppSettings.bundle/Network.plist +++ b/Settings/InAppSettings.bundle/Network.plist @@ -140,6 +140,16 @@ ZRTP + + Title + Push Notification + Key + pushnotification_preference + Type + PSToggleSwitchSpecifier + DefaultValue + + diff --git a/Settings/InAppSettings.bundle/Root.plist b/Settings/InAppSettings.bundle/Root.plist index a58e3ff20..1b5da02b0 100644 --- a/Settings/InAppSettings.bundle/Root.plist +++ b/Settings/InAppSettings.bundle/Root.plist @@ -10,6 +10,14 @@ Type PSGroupSpecifier + + Key + wizard_button + Title + Wizard + Type + IASKButtonSpecifier + AutocapitalizationType None diff --git a/Settings/InAppSettings.bundle/en.lproj/Network.strings b/Settings/InAppSettings.bundle/en.lproj/Network.strings new file mode 100644 index 000000000..481b7d438 --- /dev/null +++ b/Settings/InAppSettings.bundle/en.lproj/Network.strings @@ -0,0 +1,51 @@ +/* Wifi only */ +"Wifi only" = "Wifi only"; + +/* Stun server */ +"Stun server" = "Stun server"; + +/* ICE */ +"ICE" = "ICE"; + +/* Random Port */ +"Random Port" = "Random Port"; + +/* Port */ +"Port" = "Port"; + +/* Audio Port */ +"Audio Port" = "Audio Port"; + +/* Video Port */ +"Video Port" = "Video Port"; + +/* Transport */ +"Transport" = "Transport"; + +/* Media Encryption */ +"Media Encryption" = "Media Encryption"; + +/* Push Notifications */ +"Push Notification" = "Push Notification"; + +/* Transport */ +"Transport" = "Transport"; + +/* udp */ +"udp" = "udp"; + +/* tcp */ +"tcp" = "tcp"; + +/* tls */ +"tls" = "tls"; + +/* None */ +"None" = "None"; + +/* SRTP */ +"SRTP" = "SRTP"; + +/* ZRTP */ +"ZRTP" = "ZRTP"; + diff --git a/Settings/InAppSettings.bundle/en.lproj/Root.strings b/Settings/InAppSettings.bundle/en.lproj/Root.strings index ebc359c28..3c249d05c 100644 --- a/Settings/InAppSettings.bundle/en.lproj/Root.strings +++ b/Settings/InAppSettings.bundle/en.lproj/Root.strings @@ -1,6 +1,9 @@ /* SIP account */ "SIP account" = "SIP account"; +/* Wizard */ +"Wizard" = "Wizard"; + /* User name */ "User name" = "User name"; diff --git a/Settings/InAppSettings.bundle/fr.lproj/Network.strings b/Settings/InAppSettings.bundle/fr.lproj/Network.strings new file mode 100644 index 000000000..95cd15fb4 --- /dev/null +++ b/Settings/InAppSettings.bundle/fr.lproj/Network.strings @@ -0,0 +1,51 @@ +/* Wifi only */ +"Wifi only" = "Uniquement Wifi"; + +/* Stun server */ +"Stun server" = "Serveur Stun"; + +/* ICE */ +"ICE" = "ICE"; + +/* Random Port */ +"Random Port" = "Port Aléatoire"; + +/* Port */ +"Port" = "Port"; + +/* Audio Port */ +"Audio Port" = "Port Audio"; + +/* Video Port */ +"Video Port" = "Port Vidéo"; + +/* Transport */ +"Transport" = "Transport"; + +/* Media Encryption */ +"Media Encryption" = "Chiffrement"; + +/* Push Notifications */ +"Push Notification" = "Push Notification"; + +/* Transport */ +"Transport" = "Transport"; + +/* udp */ +"udp" = "udp"; + +/* tcp */ +"tcp" = "tcp"; + +/* tls */ +"tls" = "tls"; + +/* None */ +"None" = "Aucun"; + +/* SRTP */ +"SRTP" = "SRTP"; + +/* ZRTP */ +"ZRTP" = "ZRTP"; + diff --git a/Settings/InAppSettings.bundle/fr.lproj/Root.strings b/Settings/InAppSettings.bundle/fr.lproj/Root.strings index 5ac83fabf..e075895e0 100644 --- a/Settings/InAppSettings.bundle/fr.lproj/Root.strings +++ b/Settings/InAppSettings.bundle/fr.lproj/Root.strings @@ -1,6 +1,9 @@ /* SIP account */ "SIP account" = "Compte SIP"; +/* Wizard */ +"Wizard" = "Assistant"; + /* User name */ "User name" = "Nom d'utilisateur"; diff --git a/linphone.ldb/Contents.plist b/linphone.ldb/Contents.plist index 09f16f942..fe6bc31b8 100644 --- a/linphone.ldb/Contents.plist +++ b/linphone.ldb/Contents.plist @@ -9712,7 +9712,7 @@ Raison: %2$s change date - 2012-09-11T10:05:48Z + 2012-09-18T09:26:35Z changed values class @@ -9722,7 +9722,7 @@ Raison: %2$s flags 0 hash - 0a4db385ce9aee1237f3af978c3a98cf + dc9f190a8a2dcdf8026518ff11e1d480 name Root.strings @@ -9753,6 +9753,31 @@ Raison: %2$s snapshots + + change date + 2001-01-01T00:00:00Z + changed values + + class + BLStringKeyObject + comment + Wizard + errors + + flags + 0 + key + Wizard + localizations + + en + Wizard + fr + Assistant + + snapshots + + change date 2001-01-01T00:00:00Z @@ -10065,7 +10090,7 @@ Raison: %2$s errors flags - 2 + 3 key localizations @@ -10306,7 +10331,7 @@ Raison: %2$s errors flags - 0 + 1 hash 04783f5ae79079b4d782aa4842c5a054 @@ -10743,7 +10768,7 @@ Raison: %2$s errors flags - 0 + 1 hash e3ec0c0a4b3e250fec1852916b6b69ac @@ -11019,7 +11044,7 @@ Raison: %2$s errors flags - 0 + 1 hash 3cc5ec7e298d1a3aa4449641876f5960 @@ -11163,7 +11188,7 @@ Raison: %2$s errors flags - 0 + 1 hash b7297749603f255583f59fcea3174690 @@ -11435,6 +11460,440 @@ Raison: %2$s 1 + + attachments + + backup + + 1 + + class + BLWrapperHandle + name + InAppSettings.bundle/Network/1/Network.strings + + + + change date + 2012-09-18T09:18:41Z + changed values + + class + BLStringsFileObject + errors + + flags + 0 + hash + 3c3bd8331f174699330a8cffb2875fa5 + + name + Network.strings + objects + + + change date + 2001-01-01T00:00:00Z + changed values + + class + BLStringKeyObject + comment + Wifi only + errors + + flags + 0 + key + Wifi only + localizations + + en + Wifi only + fr + Uniquement Wifi + + snapshots + + + + change date + 2001-01-01T00:00:00Z + changed values + + class + BLStringKeyObject + comment + Stun server + errors + + flags + 0 + key + Stun server + localizations + + en + Stun server + fr + Serveur Stun + + snapshots + + + + change date + 2001-01-01T00:00:00Z + changed values + + class + BLStringKeyObject + comment + ICE + errors + + flags + 0 + key + ICE + localizations + + en + ICE + fr + ICE + + snapshots + + + + change date + 2001-01-01T00:00:00Z + changed values + + class + BLStringKeyObject + comment + Random Port + errors + + flags + 0 + key + Random Port + localizations + + en + Random Port + fr + Port Aléatoire + + snapshots + + + + change date + 2001-01-01T00:00:00Z + changed values + + class + BLStringKeyObject + comment + Port + errors + + flags + 0 + key + Port + localizations + + en + Port + fr + Port + + snapshots + + + + change date + 2001-01-01T00:00:00Z + changed values + + class + BLStringKeyObject + comment + Audio Port + errors + + flags + 0 + key + Audio Port + localizations + + en + Audio Port + fr + Port Audio + + snapshots + + + + change date + 2001-01-01T00:00:00Z + changed values + + class + BLStringKeyObject + comment + Video Port + errors + + flags + 0 + key + Video Port + localizations + + en + Video Port + fr + Port Vidéo + + snapshots + + + + change date + 2001-01-01T00:00:00Z + changed values + + class + BLStringKeyObject + comment + Transport + errors + + flags + 0 + key + Transport + localizations + + en + Transport + fr + Transport + + snapshots + + + + change date + 2001-01-01T00:00:00Z + changed values + + class + BLStringKeyObject + comment + Media Encryption + errors + + flags + 0 + key + Media Encryption + localizations + + en + Media Encryption + fr + Chiffrement + + snapshots + + + + change date + 2001-01-01T00:00:00Z + changed values + + class + BLStringKeyObject + comment + Push Notifications + errors + + flags + 0 + key + Push Notification + localizations + + en + Push Notification + fr + Push Notification + + snapshots + + + + change date + 2001-01-01T00:00:00Z + changed values + + class + BLStringKeyObject + comment + udp + errors + + flags + 2 + key + udp + localizations + + en + udp + + snapshots + + + + change date + 2001-01-01T00:00:00Z + changed values + + class + BLStringKeyObject + comment + tcp + errors + + flags + 2 + key + tcp + localizations + + en + tcp + + snapshots + + + + change date + 2001-01-01T00:00:00Z + changed values + + class + BLStringKeyObject + comment + tls + errors + + flags + 2 + key + tls + localizations + + en + tls + + snapshots + + + + change date + 2001-01-01T00:00:00Z + changed values + + class + BLStringKeyObject + comment + None + errors + + flags + 0 + key + None + localizations + + en + None + fr + Aucun + + snapshots + + + + change date + 2001-01-01T00:00:00Z + changed values + + class + BLStringKeyObject + comment + SRTP + errors + + flags + 2 + key + SRTP + localizations + + en + SRTP + + snapshots + + + + change date + 2001-01-01T00:00:00Z + changed values + + class + BLStringKeyObject + comment + ZRTP + errors + + flags + 2 + key + ZRTP + localizations + + en + ZRTP + + snapshots + + + + old objects + + plist file + + snapshots + + versions + + en + 1 + + flags 0 diff --git a/linphone.ldb/Resources/InAppSettings.bundle/Network/1/Network.strings b/linphone.ldb/Resources/InAppSettings.bundle/Network/1/Network.strings new file mode 100644 index 000000000..481b7d438 --- /dev/null +++ b/linphone.ldb/Resources/InAppSettings.bundle/Network/1/Network.strings @@ -0,0 +1,51 @@ +/* Wifi only */ +"Wifi only" = "Wifi only"; + +/* Stun server */ +"Stun server" = "Stun server"; + +/* ICE */ +"ICE" = "ICE"; + +/* Random Port */ +"Random Port" = "Random Port"; + +/* Port */ +"Port" = "Port"; + +/* Audio Port */ +"Audio Port" = "Audio Port"; + +/* Video Port */ +"Video Port" = "Video Port"; + +/* Transport */ +"Transport" = "Transport"; + +/* Media Encryption */ +"Media Encryption" = "Media Encryption"; + +/* Push Notifications */ +"Push Notification" = "Push Notification"; + +/* Transport */ +"Transport" = "Transport"; + +/* udp */ +"udp" = "udp"; + +/* tcp */ +"tcp" = "tcp"; + +/* tls */ +"tls" = "tls"; + +/* None */ +"None" = "None"; + +/* SRTP */ +"SRTP" = "SRTP"; + +/* ZRTP */ +"ZRTP" = "ZRTP"; + diff --git a/linphone.ldb/Resources/InAppSettings.bundle/Root/1/Root.strings b/linphone.ldb/Resources/InAppSettings.bundle/Root/1/Root.strings index ebc359c28..3c249d05c 100644 --- a/linphone.ldb/Resources/InAppSettings.bundle/Root/1/Root.strings +++ b/linphone.ldb/Resources/InAppSettings.bundle/Root/1/Root.strings @@ -1,6 +1,9 @@ /* SIP account */ "SIP account" = "SIP account"; +/* Wizard */ +"Wizard" = "Wizard"; + /* User name */ "User name" = "User name"; From 88119892209a5f6b3a203c388b4511b32135e037 Mon Sep 17 00:00:00 2001 From: Yann Diorcet Date: Tue, 18 Sep 2012 12:25:06 +0200 Subject: [PATCH 15/16] Improve settings --- Classes/LinphoneCoreSettingsStore.m | 3 +-- Resources/linphonerc | 4 ++++ Resources/linphonerc~ipad | 18 ++++++++++++++---- Settings/InAppSettings.bundle/Advanced.plist | 8 ++++++++ Settings/InAppSettings.bundle/Call.plist | 2 ++ Settings/InAppSettings.bundle/Network.plist | 8 ++++++++ 6 files changed, 37 insertions(+), 6 deletions(-) diff --git a/Classes/LinphoneCoreSettingsStore.m b/Classes/LinphoneCoreSettingsStore.m index 1ab80c019..b3e21bddd 100644 --- a/Classes/LinphoneCoreSettingsStore.m +++ b/Classes/LinphoneCoreSettingsStore.m @@ -193,9 +193,8 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args); [self setBool: lp_config_get_int(linphone_core_get_config(lc), LINPHONERC_APPLICATION_KEY, "enable_first_login_view_preference", 0) forKey:@"enable_first_login_view_preference"]; [self setBool: lp_config_get_int(linphone_core_get_config(lc), LINPHONERC_APPLICATION_KEY, "debugenable_preference", 0) forKey:@"debugenable_preference"]; [self setBool: lp_config_get_int(linphone_core_get_config(lc), LINPHONERC_APPLICATION_KEY, "animations_preference", 1) forKey:@"animations_preference"]; - [self setBool: lp_config_get_int(linphone_core_get_config(lc), LINPHONERC_APPLICATION_KEY, "check_config_disable_preference", 0) forKey:@"check_config_disable_preference"]; [self setBool: lp_config_get_int(linphone_core_get_config(lc), LINPHONERC_APPLICATION_KEY, "wifi_only_preference", 0) forKey:@"wifi_only_preference"]; - [self setString: lp_config_get_string(linphone_core_get_config(lc), LINPHONERC_APPLICATION_KEY, "file_upload_url_preference",NULL) forKey:@"file_upload_url_preference"]; + [self setString: lp_config_get_string(linphone_core_get_config(lc), LINPHONERC_APPLICATION_KEY, "file_upload_url_preference", NULL) forKey:@"file_upload_url_preference"]; /*keep this one also in the standardUserDefaults so that it can be read before starting liblinphone*/ BOOL start_at_boot = TRUE; diff --git a/Resources/linphonerc b/Resources/linphonerc index 7c40f420f..b119f76f0 100644 --- a/Resources/linphonerc +++ b/Resources/linphonerc @@ -23,5 +23,9 @@ automatically_accept=0 [net] firewall_policy=0 +[app] +rotation_preference=auto +animations_preference=1 + [default_values] reg_expires=600 \ No newline at end of file diff --git a/Resources/linphonerc~ipad b/Resources/linphonerc~ipad index 7275d321e..f31880409 100644 --- a/Resources/linphonerc~ipad +++ b/Resources/linphonerc~ipad @@ -4,18 +4,28 @@ sip_tcp_random_port=1 sip_tls_random_port=1 contact="Linphone iPhone" keepalive_period=30000 +default_proxy=0 [rtp] audio_rtp_port=7076 video_rtp_port=9078 -[net] -firewall_policy=0 - [video] display=1 capture=1 show_local=1 enabled=1 size=vga -display_filter_auto_rotate=1 \ No newline at end of file +display_filter_auto_rotate=1 +automatically_initiate=0 +automatically_accept=0 + +[net] +firewall_policy=0 + +[app] +rotation_preference=auto +animations_preference=1 + +[default_values] +reg_expires=600 \ No newline at end of file diff --git a/Settings/InAppSettings.bundle/Advanced.plist b/Settings/InAppSettings.bundle/Advanced.plist index d7dab7bc3..9edd14072 100644 --- a/Settings/InAppSettings.bundle/Advanced.plist +++ b/Settings/InAppSettings.bundle/Advanced.plist @@ -111,6 +111,8 @@ NumberPad DefaultValue 600 + IASKTextAlignment + IASKUITextAlignmentRight Title @@ -137,6 +139,8 @@ Display name Type PSTextFieldSpecifier + IASKTextAlignment + IASKUITextAlignmentRight AutocapitalizationType @@ -155,6 +159,8 @@ Username Type PSTextFieldSpecifier + IASKTextAlignment + IASKUITextAlignmentRight Type @@ -169,6 +175,8 @@ Sharing server Key file_upload_url_preference + IASKTextAlignment + IASKUITextAlignmentRight diff --git a/Settings/InAppSettings.bundle/Call.plist b/Settings/InAppSettings.bundle/Call.plist index 378b6b856..6996221ff 100644 --- a/Settings/InAppSettings.bundle/Call.plist +++ b/Settings/InAppSettings.bundle/Call.plist @@ -19,6 +19,8 @@ Prefix Type PSTextFieldSpecifier + IASKTextAlignment + IASKUITextAlignmentRight DefaultValue diff --git a/Settings/InAppSettings.bundle/Network.plist b/Settings/InAppSettings.bundle/Network.plist index 51104118c..8d8e1a082 100644 --- a/Settings/InAppSettings.bundle/Network.plist +++ b/Settings/InAppSettings.bundle/Network.plist @@ -27,6 +27,8 @@ No DefaultValue + IASKTextAlignment + IASKUITextAlignmentRight Title @@ -63,6 +65,8 @@ NumberPad DefaultValue 5060 + IASKTextAlignment + IASKUITextAlignmentRight Key @@ -79,6 +83,8 @@ NumberPad DefaultValue 7076 + IASKTextAlignment + IASKUITextAlignmentRight Key @@ -95,6 +101,8 @@ NumberPad DefaultValue 9078 + IASKTextAlignment + IASKUITextAlignmentRight DefaultValue From c83b75f4ba60661a9dee2818344dff3d67e2d23a Mon Sep 17 00:00:00 2001 From: Yann Diorcet Date: Tue, 18 Sep 2012 12:30:30 +0200 Subject: [PATCH 16/16] Fix wizard --- Classes/PhoneMainView.m | 5 ++++- Classes/SettingsViewController.m | 5 ++++- Classes/WizardViewController.h | 2 ++ Classes/WizardViewController.m | 8 +------- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Classes/PhoneMainView.m b/Classes/PhoneMainView.m index f2e04f05e..fdbb966d1 100644 --- a/Classes/PhoneMainView.m +++ b/Classes/PhoneMainView.m @@ -409,7 +409,10 @@ static PhoneMainView* phoneMainViewInstance=nil; if(list != NULL) { [self changeCurrentView: [DialerViewController compositeViewDescription]]; } else { - [self changeCurrentView: [WizardViewController compositeViewDescription]]; + WizardViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:[WizardViewController compositeViewDescription]], WizardViewController); + if(controller != nil) { + [controller reset]; + } } } diff --git a/Classes/SettingsViewController.m b/Classes/SettingsViewController.m index 8143f129a..ec63fea7e 100644 --- a/Classes/SettingsViewController.m +++ b/Classes/SettingsViewController.m @@ -564,7 +564,10 @@ static UICompositeViewDescription *compositeDescription = nil; if([key isEqual:@"console_button"]) { [[PhoneMainView instance] changeCurrentView:[ConsoleViewController compositeViewDescription] push:TRUE]; } else if([key isEqual:@"wizard_button"]) { - [[PhoneMainView instance] changeCurrentView:[WizardViewController compositeViewDescription]]; + WizardViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:[WizardViewController compositeViewDescription]], WizardViewController); + if(controller != nil) { + [controller reset]; + } } } @end diff --git a/Classes/WizardViewController.h b/Classes/WizardViewController.h index f0e8f2b99..6140edc44 100644 --- a/Classes/WizardViewController.h +++ b/Classes/WizardViewController.h @@ -42,6 +42,8 @@ @property (nonatomic, retain) IBOutlet UIButton *backButton; @property (nonatomic, retain) IBOutlet UIButton *startButton; +- (void)reset; + - (IBAction)onStartClick:(id)sender; - (IBAction)onBackClick:(id)sender; - (IBAction)onCancelClick:(id)sender; diff --git a/Classes/WizardViewController.m b/Classes/WizardViewController.m index c99fba0b5..ba97c98a1 100644 --- a/Classes/WizardViewController.m +++ b/Classes/WizardViewController.m @@ -109,12 +109,6 @@ static UICompositeViewDescription *compositeDescription = nil; #pragma mark - ViewController Functions -- (void)viewDidLoad { - [super viewDidLoad]; - [self resetWizard]; -} - - - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; @@ -161,7 +155,7 @@ static UICompositeViewDescription *compositeDescription = nil; } } -- (void)resetWizard { +- (void)reset { [self clearProxyConfig]; [WizardViewController cleanTextField:welcomeView]; [WizardViewController cleanTextField:choiceView];