From 280fd1376fb9da06a7f80139cbb2a77c4b971928 Mon Sep 17 00:00:00 2001 From: Yann Diorcet Date: Thu, 13 Sep 2012 15:15:56 +0200 Subject: [PATCH 01/28] ChatRoomView: hide keyboard on list tap --- Classes/ChatRoomViewController.h | 1 + Classes/ChatRoomViewController.m | 5 +++ Classes/en.lproj/ChatRoomViewController.xib | 40 ++++++++++++++++++- Classes/fr.lproj/ChatRoomViewController.xib | 39 +++++++++++++++++- linphone.ldb/Contents.plist | 12 +++--- .../{1 => 3}/ChatRoomViewController.xib | 40 ++++++++++++++++++- 6 files changed, 125 insertions(+), 12 deletions(-) rename linphone.ldb/Resources/Classes/ChatRoomViewController/{1 => 3}/ChatRoomViewController.xib (95%) diff --git a/Classes/ChatRoomViewController.h b/Classes/ChatRoomViewController.h index 82a8a2a75..a93f3275e 100644 --- a/Classes/ChatRoomViewController.h +++ b/Classes/ChatRoomViewController.h @@ -49,5 +49,6 @@ - (IBAction)onEditClick:(id)event; - (IBAction)onMessageChange:(id)sender; - (IBAction)onSendClick:(id)event; +- (IBAction)onListTap:(id)sender; @end diff --git a/Classes/ChatRoomViewController.m b/Classes/ChatRoomViewController.m index 154b670d2..8fe55b620 100644 --- a/Classes/ChatRoomViewController.m +++ b/Classes/ChatRoomViewController.m @@ -292,6 +292,7 @@ static void message_status(LinphoneChatMessage* msg,LinphoneChatMessageState sta - (IBAction)onEditClick:(id)event { [tableController setEditing:![tableController isEditing] animated:TRUE]; + [messageField resignFirstResponder]; } - (IBAction)onSendClick:(id)event { @@ -300,6 +301,10 @@ static void message_status(LinphoneChatMessage* msg,LinphoneChatMessageState sta } } +- (IBAction)onListTap:(id)sender { + [messageField resignFirstResponder]; +} + - (IBAction)onMessageChange:(id)sender { if([[messageField text] length] > 0) { [sendButton setEnabled:TRUE]; diff --git a/Classes/en.lproj/ChatRoomViewController.xib b/Classes/en.lproj/ChatRoomViewController.xib index 3b1a431c4..5bae93e66 100644 --- a/Classes/en.lproj/ChatRoomViewController.xib +++ b/Classes/en.lproj/ChatRoomViewController.xib @@ -17,6 +17,7 @@ IBUILabel IBUITableView IBUITableViewController + IBUITapGestureRecognizer IBUITextView IBUIView @@ -144,6 +145,7 @@ MQA YES + IBCocoaTouchFramework YES 0 @@ -162,6 +164,7 @@ {{250, 0}, {70, 59}} + _NS:9 NO @@ -358,6 +361,7 @@ _NS:9 + IBCocoaTouchFramework @@ -370,6 +374,7 @@ IBCocoaTouchFramework NO + @@ -477,6 +482,16 @@ 31 + + + gestureRecognizers + + + NSArray + YES + + 61 + onBackClick: @@ -512,12 +527,20 @@ 33 + + + onListTap: + + + + 62 + 0 - + @@ -619,6 +642,7 @@ 8 + tableView @@ -651,6 +675,12 @@ messageField + + 58 + + + listTapGestureRecognizer + @@ -674,6 +704,7 @@ com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin @@ -685,7 +716,7 @@ - 57 + 62 @@ -703,6 +734,7 @@ id id + id id id @@ -715,6 +747,10 @@ onEditClick: id + + onListTap: + id + onMessageChange: id diff --git a/Classes/fr.lproj/ChatRoomViewController.xib b/Classes/fr.lproj/ChatRoomViewController.xib index 86e584f55..4998f284e 100644 --- a/Classes/fr.lproj/ChatRoomViewController.xib +++ b/Classes/fr.lproj/ChatRoomViewController.xib @@ -15,6 +15,7 @@ IBUIImageView IBUILabel IBProxyObject + IBUITapGestureRecognizer IBUITableViewController IBUITableView IBUITextView @@ -139,6 +140,7 @@ MQA YES + IBCocoaTouchFramework YES 0 @@ -342,6 +344,7 @@ _NS:9 + IBCocoaTouchFramework @@ -354,6 +357,7 @@ IBCocoaTouchFramework NO + @@ -461,6 +465,16 @@ 31 + + + gestureRecognizers + + + NSArray + YES + + 61 + onBackClick: @@ -496,12 +510,20 @@ 33 + + + onListTap: + + + + 62 + 0 - + @@ -603,6 +625,7 @@ 8 + tableView @@ -635,6 +658,12 @@ messageField + + 58 + + + listTapGestureRecognizer + @@ -658,6 +687,7 @@ com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin @@ -669,7 +699,7 @@ - 57 + 62 @@ -687,6 +717,7 @@ id id + id id id @@ -699,6 +730,10 @@ onEditClick: id + + onListTap: + id + onMessageChange: id diff --git a/linphone.ldb/Contents.plist b/linphone.ldb/Contents.plist index d4220eca9..15280059c 100644 --- a/linphone.ldb/Contents.plist +++ b/linphone.ldb/Contents.plist @@ -212,17 +212,17 @@ backup - 1 + 3 class BLWrapperHandle name - Classes/ChatRoomViewController/1/ChatRoomViewController.xib + Classes/ChatRoomViewController/3/ChatRoomViewController.xib change date - 2012-09-10T15:21:35Z + 2012-09-13T13:08:20Z changed values class @@ -232,7 +232,7 @@ flags 0 hash - 73bafe5878db223f8ccca7a749e21d89 + c2184e590274d82e838a91d16b383b3d name ChatRoomViewController.xib @@ -442,9 +442,9 @@ versions en - 1 + 3 fr - 1 + 3 diff --git a/linphone.ldb/Resources/Classes/ChatRoomViewController/1/ChatRoomViewController.xib b/linphone.ldb/Resources/Classes/ChatRoomViewController/3/ChatRoomViewController.xib similarity index 95% rename from linphone.ldb/Resources/Classes/ChatRoomViewController/1/ChatRoomViewController.xib rename to linphone.ldb/Resources/Classes/ChatRoomViewController/3/ChatRoomViewController.xib index 3b1a431c4..5bae93e66 100644 --- a/linphone.ldb/Resources/Classes/ChatRoomViewController/1/ChatRoomViewController.xib +++ b/linphone.ldb/Resources/Classes/ChatRoomViewController/3/ChatRoomViewController.xib @@ -17,6 +17,7 @@ IBUILabel IBUITableView IBUITableViewController + IBUITapGestureRecognizer IBUITextView IBUIView @@ -144,6 +145,7 @@ MQA YES + IBCocoaTouchFramework YES 0 @@ -162,6 +164,7 @@ {{250, 0}, {70, 59}} + _NS:9 NO @@ -358,6 +361,7 @@ _NS:9 + IBCocoaTouchFramework @@ -370,6 +374,7 @@ IBCocoaTouchFramework NO + @@ -477,6 +482,16 @@ 31 + + + gestureRecognizers + + + NSArray + YES + + 61 + onBackClick: @@ -512,12 +527,20 @@ 33 + + + onListTap: + + + + 62 + 0 - + @@ -619,6 +642,7 @@ 8 + tableView @@ -651,6 +675,12 @@ messageField + + 58 + + + listTapGestureRecognizer + @@ -674,6 +704,7 @@ com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin @@ -685,7 +716,7 @@ - 57 + 62 @@ -703,6 +734,7 @@ id id + id id id @@ -715,6 +747,10 @@ onEditClick: id + + onListTap: + id + onMessageChange: id From 19f26f2780edbcf106acfdd714735be2f135a706 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Thu, 13 Sep 2012 16:36:09 +0200 Subject: [PATCH 02/28] update linphone and exosip for important bugfixes - don't block too long in refresh_register() in order be below 10s in keep alive handler - fix TLS support bug (SYSCALL ERROR) --- submodules/externals/exosip | 2 +- submodules/linphone | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/submodules/externals/exosip b/submodules/externals/exosip index 1195a20a0..972e9d009 160000 --- a/submodules/externals/exosip +++ b/submodules/externals/exosip @@ -1 +1 @@ -Subproject commit 1195a20a0c61bb90b9b580ca6f394c742236dda8 +Subproject commit 972e9d009e1fe9dc3e2e1d672e39c98de0affa37 diff --git a/submodules/linphone b/submodules/linphone index e45053170..cb0fe631e 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit e4505317065b76a89665bd1bf07a66ee3972d771 +Subproject commit cb0fe631e18ad86f37739afeef5c2d6c60231421 From b870faed794496830ff8d77e45970542e766d17e Mon Sep 17 00:00:00 2001 From: Yann Diorcet Date: Thu, 13 Sep 2012 16:58:18 +0200 Subject: [PATCH 03/28] Add growning multiline in chatroom --- .../Utils/GrowingTextView/HPGrowingTextView.h | 104 ++++ .../Utils/GrowingTextView/HPGrowingTextView.m | 539 ++++++++++++++++++ .../GrowingTextView/HPTextViewInternal.h | 34 ++ .../GrowingTextView/HPTextViewInternal.m | 95 +++ Resources/chat_background.9.png | Bin 0 -> 592 bytes Resources/chat_background.9@2x.png | Bin 0 -> 1030 bytes Resources/chat_background.png | Bin 0 -> 969 bytes 7 files changed, 772 insertions(+) create mode 100755 Classes/Utils/GrowingTextView/HPGrowingTextView.h create mode 100755 Classes/Utils/GrowingTextView/HPGrowingTextView.m create mode 100755 Classes/Utils/GrowingTextView/HPTextViewInternal.h create mode 100755 Classes/Utils/GrowingTextView/HPTextViewInternal.m create mode 100644 Resources/chat_background.9.png create mode 100644 Resources/chat_background.9@2x.png create mode 100644 Resources/chat_background.png diff --git a/Classes/Utils/GrowingTextView/HPGrowingTextView.h b/Classes/Utils/GrowingTextView/HPGrowingTextView.h new file mode 100755 index 000000000..56fc70ca5 --- /dev/null +++ b/Classes/Utils/GrowingTextView/HPGrowingTextView.h @@ -0,0 +1,104 @@ +// +// HPTextView.h +// +// Created by Hans Pinckaers on 29-06-10. +// +// MIT License +// +// Copyright (c) 2011 Hans Pinckaers +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import + +@class HPGrowingTextView; +@class HPTextViewInternal; + +@protocol HPGrowingTextViewDelegate + +@optional +- (BOOL)growingTextViewShouldBeginEditing:(HPGrowingTextView *)growingTextView; +- (BOOL)growingTextViewShouldEndEditing:(HPGrowingTextView *)growingTextView; + +- (void)growingTextViewDidBeginEditing:(HPGrowingTextView *)growingTextView; +- (void)growingTextViewDidEndEditing:(HPGrowingTextView *)growingTextView; + +- (BOOL)growingTextView:(HPGrowingTextView *)growingTextView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text; +- (void)growingTextViewDidChange:(HPGrowingTextView *)growingTextView; + +- (void)growingTextView:(HPGrowingTextView *)growingTextView willChangeHeight:(float)height; +- (void)growingTextView:(HPGrowingTextView *)growingTextView didChangeHeight:(float)height; + +- (void)growingTextViewDidChangeSelection:(HPGrowingTextView *)growingTextView; +- (BOOL)growingTextViewShouldReturn:(HPGrowingTextView *)growingTextView; +@end + +@interface HPGrowingTextView : UIView { + HPTextViewInternal *internalTextView; + + int minHeight; + int maxHeight; + + //class properties + int maxNumberOfLines; + int minNumberOfLines; + + BOOL animateHeightChange; + + //uitextview properties + NSObject *__unsafe_unretained delegate; + UITextAlignment textAlignment; + NSRange selectedRange; + BOOL editable; + UIDataDetectorTypes dataDetectorTypes; + UIReturnKeyType returnKeyType; + + UIEdgeInsets contentInset; +} + +//real class properties +@property int maxNumberOfLines; +@property int minNumberOfLines; +@property BOOL animateHeightChange; +@property (nonatomic, strong) UITextView *internalTextView; + + +//uitextview properties +@property(unsafe_unretained) NSObject *delegate; +@property(nonatomic,strong) NSString *text; +@property(nonatomic,strong) UIFont *font; +@property(nonatomic,strong) UIColor *textColor; +@property(nonatomic) UITextAlignment textAlignment; // default is UITextAlignmentLeft +@property(nonatomic) NSRange selectedRange; // only ranges of length 0 are supported +@property(nonatomic,getter=isEditable) BOOL editable; +@property(nonatomic) UIDataDetectorTypes dataDetectorTypes __OSX_AVAILABLE_STARTING(__MAC_NA, __IPHONE_3_0); +@property (nonatomic) UIReturnKeyType returnKeyType; +@property (assign) UIEdgeInsets contentInset; +@property(nonatomic) BOOL enablesReturnKeyAutomatically; + +//uitextview methods +//need others? use .internalTextView +- (BOOL)becomeFirstResponder; +- (BOOL)resignFirstResponder; +- (BOOL)isFirstResponder; + +- (BOOL)hasText; +- (void)scrollRangeToVisible:(NSRange)range; + +@end diff --git a/Classes/Utils/GrowingTextView/HPGrowingTextView.m b/Classes/Utils/GrowingTextView/HPGrowingTextView.m new file mode 100755 index 000000000..5094a59a6 --- /dev/null +++ b/Classes/Utils/GrowingTextView/HPGrowingTextView.m @@ -0,0 +1,539 @@ +// +// HPTextView.m +// +// Created by Hans Pinckaers on 29-06-10. +// +// MIT License +// +// Copyright (c) 2011 Hans Pinckaers +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import "HPGrowingTextView.h" +#import "HPTextViewInternal.h" + +@interface HPGrowingTextView(private) +-(void)commonInitialiser; +-(void)resizeTextView:(NSInteger)newSizeH; +-(void)growDidStop; +@end + +@implementation HPGrowingTextView +@synthesize internalTextView; +@synthesize delegate; + +@synthesize font; +@synthesize textColor; +@synthesize textAlignment; +@synthesize selectedRange; +@synthesize editable; +@synthesize dataDetectorTypes; +@synthesize animateHeightChange; +@synthesize returnKeyType; + +// having initwithcoder allows us to use HPGrowingTextView in a Nib. -- aob, 9/2011 +- (id)initWithCoder:(NSCoder *)aDecoder +{ + if ((self = [super initWithCoder:aDecoder])) { + [self commonInitialiser]; + } + return self; +} + +- (id)initWithFrame:(CGRect)frame { + if ((self = [super initWithFrame:frame])) { + [self commonInitialiser]; + } + return self; +} + +-(void)commonInitialiser +{ + // Initialization code + CGRect r = self.frame; + r.origin.y = 0; + r.origin.x = 0; + internalTextView = [[HPTextViewInternal alloc] initWithFrame:r]; + internalTextView.delegate = self; + internalTextView.scrollEnabled = NO; + internalTextView.font = [UIFont fontWithName:@"Helvetica" size:13]; + internalTextView.contentInset = UIEdgeInsetsZero; + internalTextView.showsHorizontalScrollIndicator = NO; + internalTextView.text = @"-"; + [self addSubview:internalTextView]; + + minHeight = internalTextView.frame.size.height; + minNumberOfLines = 1; + + animateHeightChange = YES; + + internalTextView.text = @""; + + [self setMaxNumberOfLines:3]; +} + +-(CGSize)sizeThatFits:(CGSize)size +{ + if (self.text.length == 0) { + size.height = minHeight; + } + return size; +} + +-(void)layoutSubviews +{ + [super layoutSubviews]; + + CGRect r = self.bounds; + r.origin.y = 0; + r.origin.x = contentInset.left; + r.size.width -= contentInset.left + contentInset.right; + + internalTextView.frame = r; +} + +-(void)setContentInset:(UIEdgeInsets)inset +{ + contentInset = inset; + + CGRect r = self.frame; + r.origin.y = inset.top - inset.bottom; + r.origin.x = inset.left; + r.size.width -= inset.left + inset.right; + + internalTextView.frame = r; + + [self setMaxNumberOfLines:maxNumberOfLines]; + [self setMinNumberOfLines:minNumberOfLines]; +} + +-(UIEdgeInsets)contentInset +{ + return contentInset; +} + +-(void)setMaxNumberOfLines:(int)n +{ + // Use internalTextView for height calculations, thanks to Gwynne + NSString *saveText = internalTextView.text, *newText = @"-"; + + internalTextView.delegate = nil; + internalTextView.hidden = YES; + + for (int i = 1; i < n; ++i) + newText = [newText stringByAppendingString:@"\n|W|"]; + + internalTextView.text = newText; + + maxHeight = internalTextView.contentSize.height; + + internalTextView.text = saveText; + internalTextView.hidden = NO; + internalTextView.delegate = self; + + [self sizeToFit]; + + maxNumberOfLines = n; +} + +-(int)maxNumberOfLines +{ + return maxNumberOfLines; +} + +-(void)setMinNumberOfLines:(int)m +{ + // Use internalTextView for height calculations, thanks to Gwynne + NSString *saveText = internalTextView.text, *newText = @"-"; + + internalTextView.delegate = nil; + internalTextView.hidden = YES; + + for (int i = 1; i < m; ++i) + newText = [newText stringByAppendingString:@"\n|W|"]; + + internalTextView.text = newText; + + minHeight = internalTextView.contentSize.height; + + internalTextView.text = saveText; + internalTextView.hidden = NO; + internalTextView.delegate = self; + + [self sizeToFit]; + + minNumberOfLines = m; +} + +-(int)minNumberOfLines +{ + return minNumberOfLines; +} + + +- (void)textViewDidChange:(UITextView *)textView +{ + //size of content, so we can set the frame of self + NSInteger newSizeH = internalTextView.contentSize.height; + if(newSizeH < minHeight || !internalTextView.hasText) newSizeH = minHeight; //not smalles than minHeight + if (internalTextView.frame.size.height > maxHeight) newSizeH = maxHeight; // not taller than maxHeight + + if (internalTextView.frame.size.height != newSizeH) + { + // [fixed] Pasting too much text into the view failed to fire the height change, + // thanks to Gwynne + + if (newSizeH > maxHeight && internalTextView.frame.size.height <= maxHeight) + { + newSizeH = maxHeight; + } + + if (newSizeH <= maxHeight) + { + if(animateHeightChange) { + + if ([UIView resolveClassMethod:@selector(animateWithDuration:animations:)]) { +#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 40000 + [UIView animateWithDuration:0.1f + delay:0 + options:(UIViewAnimationOptionAllowUserInteraction| + UIViewAnimationOptionBeginFromCurrentState) + animations:^(void) { + [self resizeTextView:newSizeH]; + } + completion:^(BOOL finished) { + if ([delegate respondsToSelector:@selector(growingTextView:didChangeHeight:)]) { + [delegate growingTextView:self didChangeHeight:newSizeH]; + } + }]; +#endif + } else { + [UIView beginAnimations:@"" context:nil]; + [UIView setAnimationDuration:0.1f]; + [UIView setAnimationDelegate:self]; + [UIView setAnimationDidStopSelector:@selector(growDidStop)]; + [UIView setAnimationBeginsFromCurrentState:YES]; + [self resizeTextView:newSizeH]; + [UIView commitAnimations]; + } + } else { + [self resizeTextView:newSizeH]; + // [fixed] The growingTextView:didChangeHeight: delegate method was not called at all when not animating height changes. + // thanks to Gwynne + + if ([delegate respondsToSelector:@selector(growingTextView:didChangeHeight:)]) { + [delegate growingTextView:self didChangeHeight:newSizeH]; + } + } + } + + + // if our new height is greater than the maxHeight + // sets not set the height or move things + // around and enable scrolling + if (newSizeH >= maxHeight) + { + if(!internalTextView.scrollEnabled){ + internalTextView.scrollEnabled = YES; + [internalTextView flashScrollIndicators]; + } + + } else { + internalTextView.scrollEnabled = NO; + } + + } + + + if ([delegate respondsToSelector:@selector(growingTextViewDidChange:)]) { + [delegate growingTextViewDidChange:self]; + } + +} + +-(void)resizeTextView:(NSInteger)newSizeH +{ + if ([delegate respondsToSelector:@selector(growingTextView:willChangeHeight:)]) { + [delegate growingTextView:self willChangeHeight:newSizeH]; + } + + CGRect internalTextViewFrame = self.frame; + internalTextViewFrame.size.height = newSizeH; // + padding + self.frame = internalTextViewFrame; + + internalTextViewFrame.origin.y = contentInset.top - contentInset.bottom; + internalTextViewFrame.origin.x = contentInset.left; + internalTextViewFrame.size.width = internalTextView.contentSize.width; + + internalTextView.frame = internalTextViewFrame; +} + +-(void)growDidStop +{ + if ([delegate respondsToSelector:@selector(growingTextView:didChangeHeight:)]) { + [delegate growingTextView:self didChangeHeight:self.frame.size.height]; + } + +} + +-(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event +{ + [internalTextView becomeFirstResponder]; +} + +- (BOOL)becomeFirstResponder +{ + [super becomeFirstResponder]; + return [self.internalTextView becomeFirstResponder]; +} + +-(BOOL)resignFirstResponder +{ + [super resignFirstResponder]; + return [internalTextView resignFirstResponder]; +} + +-(BOOL)isFirstResponder +{ + return [self.internalTextView isFirstResponder]; +} + + + +/////////////////////////////////////////////////////////////////////////////////////////////////// +#pragma mark UITextView properties +/////////////////////////////////////////////////////////////////////////////////////////////////// + +-(void)setText:(NSString *)newText +{ + internalTextView.text = newText; + + // include this line to analyze the height of the textview. + // fix from Ankit Thakur + [self performSelector:@selector(textViewDidChange:) withObject:internalTextView]; +} + +-(NSString*) text +{ + return internalTextView.text; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// + +-(void)setFont:(UIFont *)afont +{ + internalTextView.font= afont; + + [self setMaxNumberOfLines:maxNumberOfLines]; + [self setMinNumberOfLines:minNumberOfLines]; +} + +-(UIFont *)font +{ + return internalTextView.font; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// + +-(void)setTextColor:(UIColor *)color +{ + internalTextView.textColor = color; +} + +-(UIColor*)textColor{ + return internalTextView.textColor; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// + +-(void)setBackgroundColor:(UIColor *)backgroundColor +{ + [super setBackgroundColor:backgroundColor]; + internalTextView.backgroundColor = backgroundColor; +} + +-(UIColor*)backgroundColor +{ + return internalTextView.backgroundColor; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// + +-(void)setTextAlignment:(UITextAlignment)aligment +{ + internalTextView.textAlignment = aligment; +} + +-(UITextAlignment)textAlignment +{ + return internalTextView.textAlignment; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// + +-(void)setSelectedRange:(NSRange)range +{ + internalTextView.selectedRange = range; +} + +-(NSRange)selectedRange +{ + return internalTextView.selectedRange; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// + +-(void)setEditable:(BOOL)beditable +{ + internalTextView.editable = beditable; +} + +-(BOOL)isEditable +{ + return internalTextView.editable; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// + +-(void)setReturnKeyType:(UIReturnKeyType)keyType +{ + internalTextView.returnKeyType = keyType; +} + +-(UIReturnKeyType)returnKeyType +{ + return internalTextView.returnKeyType; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// + +- (void)setEnablesReturnKeyAutomatically:(BOOL)enablesReturnKeyAutomatically +{ + internalTextView.enablesReturnKeyAutomatically = enablesReturnKeyAutomatically; +} + +- (BOOL)enablesReturnKeyAutomatically +{ + return internalTextView.enablesReturnKeyAutomatically; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// + +-(void)setDataDetectorTypes:(UIDataDetectorTypes)datadetector +{ + internalTextView.dataDetectorTypes = datadetector; +} + +-(UIDataDetectorTypes)dataDetectorTypes +{ + return internalTextView.dataDetectorTypes; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// + +- (BOOL)hasText{ + return [internalTextView hasText]; +} + +- (void)scrollRangeToVisible:(NSRange)range +{ + [internalTextView scrollRangeToVisible:range]; +} + +///////////////////////////////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////////////////////////////////////// +#pragma mark - +#pragma mark UITextViewDelegate + + +/////////////////////////////////////////////////////////////////////////////////////////////////// +- (BOOL)textViewShouldBeginEditing:(UITextView *)textView { + if ([delegate respondsToSelector:@selector(growingTextViewShouldBeginEditing:)]) { + return [delegate growingTextViewShouldBeginEditing:self]; + + } else { + return YES; + } +} + + +/////////////////////////////////////////////////////////////////////////////////////////////////// +- (BOOL)textViewShouldEndEditing:(UITextView *)textView { + if ([delegate respondsToSelector:@selector(growingTextViewShouldEndEditing:)]) { + return [delegate growingTextViewShouldEndEditing:self]; + + } else { + return YES; + } +} + + +/////////////////////////////////////////////////////////////////////////////////////////////////// +- (void)textViewDidBeginEditing:(UITextView *)textView { + if ([delegate respondsToSelector:@selector(growingTextViewDidBeginEditing:)]) { + [delegate growingTextViewDidBeginEditing:self]; + } +} + + +/////////////////////////////////////////////////////////////////////////////////////////////////// +- (void)textViewDidEndEditing:(UITextView *)textView { + if ([delegate respondsToSelector:@selector(growingTextViewDidEndEditing:)]) { + [delegate growingTextViewDidEndEditing:self]; + } +} + + +/////////////////////////////////////////////////////////////////////////////////////////////////// +- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range + replacementText:(NSString *)atext { + + //weird 1 pixel bug when clicking backspace when textView is empty + if(![textView hasText] && [atext isEqualToString:@""]) return NO; + + //Added by bretdabaker: sometimes we want to handle this ourselves + if ([delegate respondsToSelector:@selector(growingTextView:shouldChangeTextInRange:replacementText:)]) + return [delegate growingTextView:self shouldChangeTextInRange:range replacementText:atext]; + + if ([atext isEqualToString:@"\n"]) { + if ([delegate respondsToSelector:@selector(growingTextViewShouldReturn:)]) { + if (![delegate performSelector:@selector(growingTextViewShouldReturn:) withObject:self]) { + return YES; + } else { + [textView resignFirstResponder]; + return NO; + } + } + } + + return YES; + + +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// +- (void)textViewDidChangeSelection:(UITextView *)textView { + if ([delegate respondsToSelector:@selector(growingTextViewDidChangeSelection:)]) { + [delegate growingTextViewDidChangeSelection:self]; + } +} + + + +@end diff --git a/Classes/Utils/GrowingTextView/HPTextViewInternal.h b/Classes/Utils/GrowingTextView/HPTextViewInternal.h new file mode 100755 index 000000000..c44ac63dc --- /dev/null +++ b/Classes/Utils/GrowingTextView/HPTextViewInternal.h @@ -0,0 +1,34 @@ +// +// HPTextViewInternal.h +// +// Created by Hans Pinckaers on 29-06-10. +// +// MIT License +// +// Copyright (c) 2011 Hans Pinckaers +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import + + +@interface HPTextViewInternal : UITextView { +} + +@end diff --git a/Classes/Utils/GrowingTextView/HPTextViewInternal.m b/Classes/Utils/GrowingTextView/HPTextViewInternal.m new file mode 100755 index 000000000..060081b22 --- /dev/null +++ b/Classes/Utils/GrowingTextView/HPTextViewInternal.m @@ -0,0 +1,95 @@ +// +// HPTextViewInternal.m +// +// Created by Hans Pinckaers on 29-06-10. +// +// MIT License +// +// Copyright (c) 2011 Hans Pinckaers +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import "HPTextViewInternal.h" + + +@implementation HPTextViewInternal + +-(void)setText:(NSString *)text +{ + BOOL originalValue = self.scrollEnabled; + //If one of GrowingTextView's superviews is a scrollView, and self.scrollEnabled == NO, + //setting the text programatically will cause UIKit to search upwards until it finds a scrollView with scrollEnabled==yes + //then scroll it erratically. Setting scrollEnabled temporarily to YES prevents this. + [self setScrollEnabled:YES]; + [super setText:text]; + [self setScrollEnabled:originalValue]; +} + +-(void)setContentOffset:(CGPoint)s +{ + if(self.tracking || self.decelerating){ + //initiated by user... + + UIEdgeInsets insets = self.contentInset; + insets.bottom = 0; + insets.top = 0; + self.contentInset = insets; + + } else { + + float bottomOffset = (self.contentSize.height - self.frame.size.height + self.contentInset.bottom); + if(s.y < bottomOffset && self.scrollEnabled){ + UIEdgeInsets insets = self.contentInset; + insets.bottom = 8; + insets.top = 0; + self.contentInset = insets; + } + } + + [super setContentOffset:s]; +} + +-(void)setContentInset:(UIEdgeInsets)s +{ + UIEdgeInsets insets = s; + + if(s.bottom>8) insets.bottom = 0; + insets.top = 0; + + [super setContentInset:insets]; +} + +-(void)setContentSize:(CGSize)contentSize +{ + // is this an iOS5 bug? Need testing! + if(self.contentSize.height > contentSize.height) + { + UIEdgeInsets insets = self.contentInset; + insets.bottom = 0; + insets.top = 0; + self.contentInset = insets; + } + + [super setContentSize:contentSize]; +} + + + + +@end diff --git a/Resources/chat_background.9.png b/Resources/chat_background.9.png new file mode 100644 index 0000000000000000000000000000000000000000..9119454eba06f4b87f3b0bf6efdba1dfe8efea30 GIT binary patch literal 592 zcmeAS@N?(olHy`uVBq!ia0y~yU~~eqZ8_M0i(P=vF< zBeIx*fm;}a85w5HkpK#^mw5WRvftt4`>cFJ!*QXbGOnScjxa_{aM^nzNW7M(cTN^d|SAdw}2CJr} zDFxCE_c#?5TJjhbS{R%-2oiTKRgTZ!mhYK8pIyL7k)q+u^<-Q>@;hpViwr7`rbhvFJE;3%tk>jEkxl zQ@n6hY0s8_I!*_aws16F6MuOAMP!RZdH09)U(A(P#AzZGC-S31}xrV_5&O z?EZs&#~gyY3r_#q%+a_^?BO(!BC&<899uSUJU0Z2k z>lN>OO6GFnFcAmZ4)Q>r$Nn o_9?TxI}oXRMq`1w^Q2#_saZ#KnnQj}07f)}r>mdKI;Vst03egzWB>pF literal 0 HcmV?d00001 diff --git a/Resources/chat_background.9@2x.png b/Resources/chat_background.9@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..2094325bf0e6b400a4354e4d637f0b9b7550ee05 GIT binary patch literal 1030 zcmbtTYe-XJ7=AYodYrCiiY>dHEh7=Bkw(^5?b@8;CF_TyFjt$GLR~i4DwTE8qzt<# zRyt~wp3 zya*lu@O265bO0`mb1UhO-?I`?Ee`&>lC)~@F^|*LSdEcDbAo<9Ku{?2a-hy3#9)9$ zm#hgG3*^sP9e=))@4}GSqRFtR3iI<#1r|^hnG6<_k+SAlaw)AYIgKhTpbS*9VRuE7 zRR!Q@(y0~OY@=_-t`~$Vgyloh+Mu$s8Xhrn$LF_2n;;`pAV2tWWJ&zhl2Yv<{vu+_|ZAop%vHpVuMl zM}c9MlryPwmln^H9+=fXc_@Ka*VKrxQygC+;VB@?NZfvrCj@7-hy;q@fB=t>3V<>S zKq&yguw6iaoaFw;^1p%FU5@I8FB8@098xZ9zKNN`Od>O2CQi5Q1g6?RnlbH5LMr zI*kCFQI#G=`!dLitE51_CA{Z|Sqt5{;R>){ilIYayBcpzxfh^}7y;d~&JQwr(FJB- zpq}8^x3~UG;5da)0$Q1dzx5yDf+4L&W6o*$?v`U>vPT-+b0r60uPwqKqWZ+`v6zb@ z%AM#@yC%q9=55Fo1Ek+&|Fd> zibC5(HtW#Z$@zCDND%g))Bqg6K^7Q4eSKMlC15sS5&|*?tT<(s?uqeek9er<^UnJy zT~4M%(1#ox29AXH*`+aDmOrp8E7jvmHU;m~A}a?)R^vj_}xi>j=vJ z+AL(nFRbu9_)GjW_mB9Aszw9r^Zc7W#w?7ml)AGc(ZTJ?IH&^u#J0 zMp|OzuSB9My{^ZD+5T3U;e6#GfZBsPtQ~@#_I_>O^W)OGK>BJ D6}UKb literal 0 HcmV?d00001 diff --git a/Resources/chat_background.png b/Resources/chat_background.png new file mode 100644 index 0000000000000000000000000000000000000000..c438371b0f99158d7b243c4239a1491b3a060ba0 GIT binary patch literal 969 zcmeAS@N?(olHy`uVBq!ia0y~yU}^xeOF7tpi(P=vF< zBeIx*fm;}a85w5HkpK#^mw5WRvftt4&&^HED`9XhN=+zkyx`DpUX}0IFg*{(}$VRAI1FfmY1@J6-=B2Qa24vp(oB21bzv&{=#R zl?A}A=idahkg4GF4e5`~{9s=+GFqGlrU~u)j4Yr4_`wehJqHFZ2Vl%|IDj-a?EDF} z!#eHPX>qV7b=C)G(is@m+AuPMoWJKV6I``!1tcUTKK};R28qU?Vsj v7#PaRcJA4?^uGWwoxk2}T`yq^^3Lk`pM@*;XuX!`V*mnAS3j3^P6 Date: Thu, 13 Sep 2012 17:19:31 +0200 Subject: [PATCH 04/28] Add image in chat message --- Classes/ChatRoomViewController.h | 9 +- Classes/ChatRoomViewController.m | 41 +++- Classes/LinphoneUI/UIChatRoomCell.h | 3 +- Classes/LinphoneUI/UIChatRoomCell.m | 46 ++-- Classes/LinphoneUI/UIChatRoomCell.xib | 178 ++++++++++----- Classes/en.lproj/ChatRoomViewController.xib | 212 +++++++++++------ Classes/fr.lproj/ChatRoomViewController.xib | 211 +++++++++++------ Resources/chat_field.9.png | Bin 1801 -> 1553 bytes Resources/chat_field.9@2x.png | Bin 3047 -> 2510 bytes Resources/chat_send_default.png | Bin 5101 -> 2087 bytes Resources/chat_send_disabled.png | Bin 2879 -> 1954 bytes Resources/chat_send_over.png | Bin 4533 -> 1349 bytes linphone.ldb/Contents.plist | 17 +- .../{3 => 9}/ChatRoomViewController.xib | 216 ++++++++++++------ linphone.xcodeproj/project.pbxproj | 43 +++- 15 files changed, 659 insertions(+), 317 deletions(-) rename linphone.ldb/Resources/Classes/ChatRoomViewController/{3 => 9}/ChatRoomViewController.xib (86%) diff --git a/Classes/ChatRoomViewController.h b/Classes/ChatRoomViewController.h index a93f3275e..c1a10d0b7 100644 --- a/Classes/ChatRoomViewController.h +++ b/Classes/ChatRoomViewController.h @@ -22,11 +22,12 @@ #import "UIToggleButton.h" #import "UICompositeViewController.h" #import "ChatRoomTableViewController.h" +#import "HPGrowingTextView.h" #import "ChatModel.h" #include "linphonecore.h" -@interface ChatRoomViewController : UIViewController { +@interface ChatRoomViewController : UIViewController { @private LinphoneChatRoom *chatRoom; NSString *_remoteAddress; @@ -35,14 +36,16 @@ @property (nonatomic, retain) IBOutlet ChatRoomTableViewController* tableController; @property (nonatomic, retain) IBOutlet UIToggleButton *editButton; -@property (nonatomic, retain) IBOutlet UITextView* messageField; +@property (nonatomic, retain) IBOutlet HPGrowingTextView* messageField; @property (nonatomic, retain) IBOutlet UIButton* sendButton; @property (nonatomic, retain) IBOutlet UILabel *addressLabel; @property (nonatomic, retain) IBOutlet UIImageView *avatarImage; @property (nonatomic, retain) IBOutlet UIView *headerView; @property (nonatomic, retain) IBOutlet UIView *footerView; @property (nonatomic, retain) IBOutlet UIView *chatView; -@property (nonatomic, retain) IBOutlet UIImageView *fieldBackgroundImage; +@property (nonatomic, retain) IBOutlet UIView *messageView; +@property (nonatomic, retain) IBOutlet UIImageView *messageBackgroundImage; +@property (nonatomic, retain) IBOutlet UIImageView *footerBackgroundImage; @property (nonatomic, copy) NSString *remoteAddress; - (IBAction)onBackClick:(id)event; diff --git a/Classes/ChatRoomViewController.m b/Classes/ChatRoomViewController.m index 8fe55b620..399230f5f 100644 --- a/Classes/ChatRoomViewController.m +++ b/Classes/ChatRoomViewController.m @@ -34,7 +34,9 @@ @synthesize headerView; @synthesize footerView; @synthesize chatView; -@synthesize fieldBackgroundImage; +@synthesize messageView; +@synthesize messageBackgroundImage; +@synthesize footerBackgroundImage; #pragma mark - Lifecycle Functions @@ -58,7 +60,9 @@ [avatarImage release]; [headerView release]; [footerView release]; - [fieldBackgroundImage release]; + [messageView release]; + [messageBackgroundImage release]; + [footerBackgroundImage release]; [super dealloc]; } @@ -92,6 +96,13 @@ static UICompositeViewDescription *compositeDescription = nil; // Set selected+over background: IB lack ! [editButton setImage:[UIImage imageNamed:@"chat_ok_over.png"] forState:(UIControlStateHighlighted | UIControlStateSelected)]; + + messageField.minNumberOfLines = 1; + messageField.maxNumberOfLines = ([LinphoneManager runningOnIpad])?10:3; + messageField.delegate = self; + messageField.font = [UIFont systemFontOfSize:18.0f]; + messageField.contentInset = UIEdgeInsetsZero; + messageField.backgroundColor = [UIColor clearColor]; } @@ -118,8 +129,11 @@ static UICompositeViewDescription *compositeDescription = nil; [editButton setOff]; [[tableController tableView] reloadData]; - [fieldBackgroundImage setImage:[TUNinePatchCache imageOfSize:[fieldBackgroundImage bounds].size + [messageBackgroundImage setImage:[TUNinePatchCache imageOfSize:[messageBackgroundImage bounds].size forNinePatchNamed:@"chat_field"]]; + + [footerBackgroundImage setImage:[TUNinePatchCache imageOfSize:[footerBackgroundImage bounds].size + forNinePatchNamed:@"chat_background"]]; } - (void)viewWillDisappear:(BOOL)animated { @@ -278,12 +292,25 @@ static void message_status(LinphoneChatMessage* msg,LinphoneChatMessageState sta #pragma mark - UITextFieldDelegate Functions -- (BOOL)textFieldShouldReturn:(UITextField *)textField { - [textField resignFirstResponder]; - return YES; +- (void)growingTextView:(HPGrowingTextView *)growingTextView willChangeHeight:(float)height { + int diff = height - growingTextView.bounds.size.height; + + CGRect footerRect = [footerView frame]; + footerRect.origin.y -= diff; + footerRect.size.height += diff; + [footerView setFrame:footerRect]; + + CGRect tableRect = [tableController.view frame]; + tableRect.size.height -= diff; + [tableController.view setFrame:tableRect]; + + [messageBackgroundImage setImage:[TUNinePatchCache imageOfSize:[messageBackgroundImage bounds].size + forNinePatchNamed:@"chat_field"]]; + + [footerBackgroundImage setImage:[TUNinePatchCache imageOfSize:[footerBackgroundImage bounds].size + forNinePatchNamed:@"chat_background"]]; } - #pragma mark - Action Functions - (IBAction)onBackClick:(id)event { diff --git a/Classes/LinphoneUI/UIChatRoomCell.h b/Classes/LinphoneUI/UIChatRoomCell.h index bb76a3c5d..3350c8718 100644 --- a/Classes/LinphoneUI/UIChatRoomCell.h +++ b/Classes/LinphoneUI/UIChatRoomCell.h @@ -26,9 +26,10 @@ @property (nonatomic, retain) ChatModel *chat; @property (nonatomic, retain) IBOutlet UIView *innerView; -@property (nonatomic, retain) IBOutlet UIView *messageView; +@property (nonatomic, retain) IBOutlet UIView *bubbleView; @property (nonatomic, retain) IBOutlet UIImageView* backgroundImage; @property (nonatomic, retain) IBOutlet UILabel *messageLabel; +@property (nonatomic, retain) IBOutlet UIImageView *messageImageView; @property (nonatomic, retain) IBOutlet UIButton *deleteButton; @property (nonatomic, retain) IBOutlet UILabel *dateLabel; @property (nonatomic, retain) IBOutlet UIImageView* statusImage; diff --git a/Classes/LinphoneUI/UIChatRoomCell.m b/Classes/LinphoneUI/UIChatRoomCell.m index d432f37f8..e0bc54616 100644 --- a/Classes/LinphoneUI/UIChatRoomCell.m +++ b/Classes/LinphoneUI/UIChatRoomCell.m @@ -26,8 +26,9 @@ @implementation UIChatRoomCell @synthesize innerView; -@synthesize messageView; +@synthesize bubbleView; @synthesize backgroundImage; +@synthesize messageImageView; @synthesize messageLabel; @synthesize deleteButton; @synthesize dateLabel; @@ -40,6 +41,8 @@ static const CGFloat CELL_MAX_WIDTH = 320.0f; static const CGFloat CELL_MESSAGE_X_MARGIN = 26.0f; static const CGFloat CELL_MESSAGE_Y_MARGIN = 36.0f; static const CGFloat CELL_FONT_SIZE = 17.0f; +static const CGFloat CELL_IMAGE_HEIGHT = 50.0f; +static const CGFloat CELL_IMAGE_WIDTH = 50.0f; static UIFont *CELL_FONT = nil; #pragma mark - Lifecycle Functions @@ -57,8 +60,9 @@ static UIFont *CELL_FONT = nil; - (void)dealloc { [backgroundImage release]; [innerView release]; - [messageView release]; + [bubbleView release]; [messageLabel release]; + [messageImageView release]; [deleteButton release]; [dateLabel release]; [statusImage release]; @@ -88,7 +92,16 @@ static UIFont *CELL_FONT = nil; [LinphoneLogger logc:LinphoneLoggerWarning format:"Cannot update chat room cell: null chat"]; return; } - [messageLabel setText:[chat message]]; + if(true/*Change when image will be supported */) { + [messageLabel setHidden:FALSE]; + [messageLabel setText:[chat message]]; + + [messageImageView setHidden:TRUE]; + } else { + [messageLabel setHidden:TRUE]; + + [messageImageView setHidden:FALSE]; + } // Date NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; @@ -131,16 +144,21 @@ static UIFont *CELL_FONT = nil; } } -+ (CGSize)viewSize:(NSString*)message width:(int)width { - if(CELL_FONT == nil) { - CELL_FONT = [UIFont systemFontOfSize:CELL_FONT_SIZE]; ++ (CGSize)viewSize:(ChatModel*)chat width:(int)width { + CGSize messageSize; + if(true/*Change when image will be supported */) { + if(CELL_FONT == nil) { + CELL_FONT = [UIFont systemFontOfSize:CELL_FONT_SIZE]; + } + messageSize = [[chat message] sizeWithFont: CELL_FONT + constrainedToSize: CGSizeMake(width - CELL_MESSAGE_X_MARGIN, 10000.0f) + lineBreakMode: UILineBreakModeTailTruncation]; + } else { + messageSize = CGSizeMake(CELL_IMAGE_WIDTH, CELL_IMAGE_HEIGHT); } - CGSize messageSize = [message sizeWithFont: CELL_FONT - constrainedToSize: CGSizeMake(width - CELL_MESSAGE_X_MARGIN, 10000.0f) - lineBreakMode: UILineBreakModeTailTruncation]; messageSize.height += CELL_MESSAGE_Y_MARGIN; if(messageSize.height < CELL_MIN_HEIGHT) - messageSize.height = CELL_MIN_HEIGHT; + messageSize.height = CELL_MIN_HEIGHT; messageSize.width += CELL_MESSAGE_X_MARGIN; if(messageSize.width < CELL_MIN_WIDTH) messageSize.width = CELL_MIN_WIDTH; @@ -148,7 +166,7 @@ static UIFont *CELL_FONT = nil; } + (CGFloat)height:(ChatModel*)chat width:(int)width { - return [UIChatRoomCell viewSize:[chat message] width:width].height; + return [UIChatRoomCell viewSize:chat width:width].height; } @@ -159,7 +177,7 @@ static UIFont *CELL_FONT = nil; if(chat != nil) { // Resize inner CGRect innerFrame; - innerFrame.size = [UIChatRoomCell viewSize:[chat message] width:[self frame].size.width]; + innerFrame.size = [UIChatRoomCell viewSize:chat width:[self frame].size.width]; if([[chat direction] intValue]) { // Inverted innerFrame.origin.x = 0.0f; innerFrame.origin.y = 0.0f; @@ -169,7 +187,7 @@ static UIFont *CELL_FONT = nil; } [innerView setFrame:innerFrame]; - CGRect messageFrame = [messageView frame]; + CGRect messageFrame = [bubbleView frame]; messageFrame.origin.y = ([innerView frame].size.height - messageFrame.size.height)/2; if([[chat direction] intValue]) { // Inverted [backgroundImage setImage:[TUNinePatchCache imageOfSize:[backgroundImage bounds].size @@ -180,7 +198,7 @@ static UIFont *CELL_FONT = nil; forNinePatchNamed:@"chat_bubble_outgoing"]]; messageFrame.origin.y -= 5; } - [messageView setFrame:messageFrame]; + [bubbleView setFrame:messageFrame]; } } diff --git a/Classes/LinphoneUI/UIChatRoomCell.xib b/Classes/LinphoneUI/UIChatRoomCell.xib index 647825af5..cda2cfccd 100644 --- a/Classes/LinphoneUI/UIChatRoomCell.xib +++ b/Classes/LinphoneUI/UIChatRoomCell.xib @@ -56,42 +56,68 @@ 274 - + 274 + + + + 274 + {294, 104} + + + + _NS:9 + 1 + NO + IBCocoaTouchFramework + + + + 274 + {294, 104} + + + + _NS:9 + + 3 + MCAwAA + + NO + YES + 7 + NO + IBCocoaTouchFramework + They who can give up essential liberty to obtain a little temporary safety, deserve neither liberty nor safety. + + 3 + MC4zMzMzMzMzMzMzAA + + + 0 + 10 + 0 + + 1 + 17 + + + Helvetica + 17 + 16 + + NO + + {294, 104} - + _NS:9 - - 3 - MCAwAA - - NO + YES - 7 - NO IBCocoaTouchFramework - They who can give up essential liberty to obtain a little temporary safety, deserve neither liberty nor safety. - - 3 - MC4zMzMzMzMzMzMzAA - - - 0 - 10 - 0 - - 1 - 17 - - - Helvetica - 17 - 16 - - NO @@ -133,7 +159,6 @@ {{284, 104}, {10, 10}} - _NS:9 NO IBCocoaTouchFramework @@ -182,7 +207,7 @@ {{13, 13}, {294, 114}} - + _NS:9 YES @@ -205,7 +230,6 @@ {100, 100} - _NS:9 IBCocoaTouchFramework @@ -216,7 +240,6 @@ {100, 100} - _NS:9 IBCocoaTouchFramework @@ -248,14 +271,6 @@ 13 - - - messageLabel - - - - 17 - deleteButton @@ -264,14 +279,6 @@ 19 - - - messageView - - - - 21 - dateLabel @@ -296,6 +303,30 @@ 27 + + + messageLabel + + + + 17 + + + + bubbleView + + + + 30 + + + + messageImageView + + + + 31 + onDeleteClick: @@ -357,19 +388,13 @@ 16 - + - messageView - - - 15 - - - messageLabel + bubbleView 18 @@ -389,6 +414,28 @@ status + + 29 + + + + + + + messageView + + + 28 + + + messageImageView + + + 15 + + + messageLabel + @@ -404,6 +451,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 com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin @@ -412,7 +461,7 @@ - 27 + 31 @@ -432,11 +481,12 @@ UIImageView + UIView UILabel UIButton UIView + UIImageView UILabel - UIView UIImageView @@ -444,6 +494,10 @@ backgroundImage UIImageView + + bubbleView + UIView + dateLabel UILabel @@ -456,14 +510,14 @@ innerView UIView + + messageImageView + UIImageView + messageLabel UILabel - - messageView - UIView - statusImage UIImageView diff --git a/Classes/en.lproj/ChatRoomViewController.xib b/Classes/en.lproj/ChatRoomViewController.xib index 5bae93e66..3bde993df 100644 --- a/Classes/en.lproj/ChatRoomViewController.xib +++ b/Classes/en.lproj/ChatRoomViewController.xib @@ -18,7 +18,6 @@ IBUITableView IBUITableViewController IBUITapGestureRecognizer - IBUITextView IBUIView @@ -158,13 +157,31 @@ 266 + + + 274 + {320, 59} + + + + _NS:9 + + 1 + MSAwLjI4MzE1ODM3MjYgMC4wNTY3ODY4OTE2MQA + + NO + IBCocoaTouchFramework + + NSImage + chat_background.png + + - 257 + 297 {{250, 0}, {70, 59}} - _NS:9 NO @@ -202,57 +219,50 @@ 16 - + - 258 + 274 + + + + 274 + {250, 59} + + + + _NS:9 + NO + IBCocoaTouchFramework + + NSImage + chat_field.png + + + + + 274 + {{10, 10}, {230, 39}} + + + + _NS:9 + + IBCocoaTouchFramework + + {250, 59} - + _NS:9 - NO + IBCocoaTouchFramework - - NSImage - chat_field.png - - - - - 258 - {{10, 10}, {230, 39}} - - - - _NS:9 - YES - YES - - Enter your message here - - IBCocoaTouchFramework - YES - NO - This is a message - - 2 - IBCocoaTouchFramework - - - 1 - 18 - - - Helvetica - 18 - 16 - {{0, 357}, {320, 59}} - + _NS:9 IBCocoaTouchFramework @@ -426,14 +436,6 @@ 44 - - - fieldBackgroundImage - - - - 48 - footerView @@ -458,13 +460,37 @@ 54 + + + footerBackgroundImage + + + + 67 + messageField - + - 57 + 64 + + + + messageBackgroundImage + + + + 69 + + + + messageView + + + + 70 @@ -650,37 +676,53 @@ 14 - - + + footerView - - 21 - - - fieldBackgroundImage - 15 sendButton - - 55 - - - messageField - 58 listTapGestureRecognizer + + 66 + + + footerBackgroundImage + + + 68 + + + + + + + messageView + + + 21 + + + messageBackgroundImage + + + 63 + + + messageField + @@ -703,9 +745,12 @@ com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin + HPGrowingTextView + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin @@ -716,7 +761,7 @@ - 62 + 70 @@ -765,10 +810,12 @@ UIImageView UIView UIToggleButton - UIImageView + UIImageView UIView UIView - UITextView + UIImageView + HPGrowingTextView + UIView UIButton ChatRoomTableViewController @@ -789,8 +836,8 @@ editButton UIToggleButton - - fieldBackgroundImage + + footerBackgroundImage UIImageView @@ -801,9 +848,17 @@ headerView UIView + + messageBackgroundImage + UIImageView + messageField - UITextView + HPGrowingTextView + + + messageView + UIView sendButton @@ -819,6 +874,14 @@ ./Classes/ChatRoomViewController.h + + HPGrowingTextView + UIView + + IBProjectSource + ./Classes/HPGrowingTextView.h + + UIToggleButton UIButton @@ -842,6 +905,7 @@ {131, 131} {320, 88} {320, 88} + {640, 117} {320, 88} {320, 88} {500, 117} diff --git a/Classes/fr.lproj/ChatRoomViewController.xib b/Classes/fr.lproj/ChatRoomViewController.xib index 4998f284e..29e39e959 100644 --- a/Classes/fr.lproj/ChatRoomViewController.xib +++ b/Classes/fr.lproj/ChatRoomViewController.xib @@ -18,7 +18,6 @@ IBUITapGestureRecognizer IBUITableViewController IBUITableView - IBUITextView IBUIButton @@ -153,9 +152,27 @@ 266 + + + 274 + {320, 59} + + + _NS:9 + + 1 + MSAwLjI4MzE1ODM3MjYgMC4wNTY3ODY4OTE2MQA + + NO + IBCocoaTouchFramework + + NSImage + chat_background.png + + - 257 + 297 {{250, 0}, {70, 59}} _NS:9 @@ -195,54 +212,52 @@ 16 - + - 258 + 274 + + + + 274 + {250, 59} + + + _NS:9 + NO + IBCocoaTouchFramework + + NSImage + chat_field.png + + + + + 274 + {{10, 10}, {230, 39}} + + + _NS:9 + + IBCocoaTouchFramework + + {250, 59} - + _NS:9 - NO - IBCocoaTouchFramework - - NSImage - chat_field.png - - - - - 258 - {{10, 10}, {230, 39}} - - - _NS:9 - YES - YES - - Entrez votre message ici + + 3 + MQA + + 2 + IBCocoaTouchFramework - YES - NO - This is a message - - 2 - IBCocoaTouchFramework - - - 1 - 18 - - - Helvetica - 18 - 16 - {{0, 357}, {320, 59}} - + _NS:9 IBCocoaTouchFramework @@ -409,14 +424,6 @@ 44 - - - fieldBackgroundImage - - - - 48 - footerView @@ -441,13 +448,37 @@ 54 + + + footerBackgroundImage + + + + 67 + messageField - + - 57 + 64 + + + + messageBackgroundImage + + + + 69 + + + + messageView + + + + 70 @@ -633,37 +664,53 @@ 14 - - + + footerView - - 21 - - - fieldBackgroundImage - 15 sendButton - - 55 - - - messageField - 58 listTapGestureRecognizer + + 66 + + + footerBackgroundImage + + + 68 + + + + + + + messageView + + + 21 + + + messageBackgroundImage + + + 63 + + + messageField + @@ -686,9 +733,12 @@ com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin + HPGrowingTextView + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin @@ -699,7 +749,7 @@ - 62 + 70 @@ -748,10 +798,12 @@ UIImageView UIView UIToggleButton - UIImageView + UIImageView UIView UIView - UITextView + UIImageView + HPGrowingTextView + UIView UIButton ChatRoomTableViewController @@ -772,8 +824,8 @@ editButton UIToggleButton - - fieldBackgroundImage + + footerBackgroundImage UIImageView @@ -784,9 +836,17 @@ headerView UIView + + messageBackgroundImage + UIImageView + messageField - UITextView + HPGrowingTextView + + + messageView + UIView sendButton @@ -802,6 +862,14 @@ ./Classes/ChatRoomViewController.h + + HPGrowingTextView + UIView + + IBProjectSource + ./Classes/HPGrowingTextView.h + + UIToggleButton UIButton @@ -825,6 +893,7 @@ {131, 131} {320, 88} {320, 88} + {640, 117} {320, 88} {320, 88} {500, 117} diff --git a/Resources/chat_field.9.png b/Resources/chat_field.9.png index 3303c1d284fa33feea759391fddbed2b1d8938e7..0b8b3e91f962dd11f8758dbdb04b174ced084cd5 100644 GIT binary patch delta 1536 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 diff --git a/Resources/chat_field.9@2x.png b/Resources/chat_field.9@2x.png index 614626e89f8d76a8a0f03afcb230095b4ae785fb..d852551142db93c3998176bbc4a2dc9c555b41c0 100644 GIT binary patch literal 2510 zcmZ9O2~<f{4}$_gx#)KuYp;aq4Oe5i(=aB%`_%7eyXlp$dr^OfQ?_7wi(PXKK1MA2g+o!VS`Nu4ZooXbh%#MF@F>H~aw6l3Cj z>yRzmZ_uaXma~R_rtZOm2Rp(}#@tw-+ynq+l`Ona>ANILuc&yRc^jS{xJYt{hbQ&N zr?+YPr>l00&H19i>1xsYxgQ+AAzeSd6WREBPA_Ji7C;TqWb!1bJcsCFf_E8`zv}6A zq4rF?`RJ9Zn;EAuvhK9u2R`8_@Vc8iIVD%a)Hg+nda&5+=Ycu zLe^Ov^m?uvB`8ls5Seu)#PYH`wqJ572RvI4mkVzyMG0J*v{7EW;@kec$JZLM#W*Uu zEp2J?34u4T8Wnb8lhi2(NoSZzHp{~39&c4ZGfNVPKk!sl1B7o)z_(4KL5}_;8f+1m7m4Cc*-j2#C-u<=4MbYmL&59T~ zr*OYst~(>CSwvt45o?ho&{X3@@e*(>q^crWc-^~S9(Epsnvm2__R=#q5%O`~m1OcE zlEHaGkNI^rdSt^kpj|Q+bV0q5J;34e;{t{3fLHZs!-UnP@%eo#vr)X;&N0Us*$gw2 ztt%$hMp~fhK-Hg)jMwsH0@fxM6S;#?>6u78o3Q=n{6^iC!YKEN){!SW=Q2Oh`ny9B zpe3@Fgk_N`NqMXW>O|{3;v-9*yQd~Uw3aPDi{TX)OCR;e`i{!Cws5b}yMT!3Qs=4^Z?&y;2^w`&pQG#?^V0zqJ zVl`72B2nnSIDe+nch8-k1vlHCngIEl&f8=yejFurj>Hq1&uuUQ+LoeH5|_!7{S*%e zGw>v7+ca*B!yltc_y+AXtsY5hL={Vrei)dlGaz1Y9(#2mOi+uh-R~ex zt3+MJKZ;u*q6#8+@*#Fm>n=7v*b67Isd313JEUrhno_3J1lO(yDPDTE%0}mqY0O~= zv*&Q!O`S6ep?|gMHL-h)A?re5oHo7H-7^e9*>k ze?jB?n3@e3`&G43I$cnC`c3`2*NKZbi#%`6AHOhHJ`5xRxkwe5R(VSkhle{7=w+e% zk%AY*gdtgP0_G|=UUm4NcfAme>s-Ew_-ew%d`-D$ho>8^LOw*1}z zZb^3n#FyDP=fu;**g$O6OoxBD2P1YhnbG@4Jyz$Nr#+jz z^6yUFrBghQ+rLwm#}8%U_;w9L9IY*Q=-HC~InodZ{dT~gGGf=Wdi9ZF@r)>K#ec!E z^FemP;{zp9+oJx6UmwGaANVY9NuZcx5nicW3dr12k|!6!b6IM_B%LdD(KuNw%3r@}j^Fw>eQ zzRAGNKOjJ3xv9b4WT=qC(w*A1{G#Y#F7Ltb$0$8HZvnXW%3mUCY{*(3)hfaau2u}D zd-L3HAI%(DTwGjE3(U4L!rC%fm2)PMkMsF`h1qkrPsH5#BfiWP&ih+hvS+Vv;qXj0 zwKQthYne{CyGJjM8YA`}CmO8u_xIx|+Hl>K$Mj)13xR$Be&Q2I}~-3V4Y2Mzp>*FT$a|J8pq(6^xY_;H_u1=F{nK($MI1hId9J&3?NC=gP5 W`3Cwn%iVD21>BB#I8_}DzVsL3=BS+j literal 3047 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 diff --git a/Resources/chat_send_default.png b/Resources/chat_send_default.png index 1bee48a2f35c00afa3662d87d143bce80cf9948a..c4f4dfd1fb1aa0b829762836545019c441ff7a8d 100644 GIT binary patch literal 2087 zcmaJ?c{CgN7FN$vTZ@LqP8UlX#@LE!s5UA=NJ(p{*n%LjC2FfQWooU~&>)u9Oxuxa z?1ZA$6r%}BtF@~V8BtX2Lt@f@-#PEyd%kOl|^k~;ANM}&$>fC5rH8V0u& zpOTO{c1*+Bu1inAG{7J>$he7>X%g;4AW;09xN#m9V}kVqn)#|_)>)+ge9r$3(?2GC z!zk656Mw8*o>qZOd7mRNgEQ0= zbYZU5-tuu3?&4`*lT7xmoW6R&&~oA3yEZj{n*~>mY^2682qH3>) zTmmQ}n3Tf&iYBfXT_I!8p!_PjhTc3(VePoM<7A{og~h-DN+=8^5;YCRKFZNg6+Xg9 z9Wb@%w_KGe#^O(j-p|h}zMEsPYP#-p&Hk8LxOGshd6Ra6S1Y5L_ik<*onYD5A_JrY zz<{H`FM9r*MYe&nsq(M(N;rXXUt#JWQi9IT=N*$sgAD;~m7^O~``1T;H%KNM?H6BN zCVuFJn<^jT!opvhDfOvZHBLlnG2WC56q=tUes>G)l3hlQOiTrrg!CskgiPGm`L$Nn z`Y8ZptnU%=MkW0yMVB~+D5#E(y5b6}uyN(QtfUkd+*D+8x%hur15AAyVbqG6MgXsd zPnDwpbaqrjxlh|!*SC4*gQZs>-S*0`%4wBJ?^5~LO3qFDq~ z-u0iDd&pFB(2#y zFIzE0zuH@uJS9-_pz-{QqK}KcDw|%XLqqM02sc-sp>wq48;s8X)fmwB2jYAodArnl zt!k;&i+(-92k8Z)o#_}s{+2!pecqxghyK!wO0LA4U!b90ZEp65^;f7|ZKWjWhxgs; zB$Fq09&=a6Uwp_9E4(%z{^E8psH_FY%qqAtwAQ>o_;pE48*dw(a?P{vr~$ z(mz-fuJe=@2xs_BE@U%M`q+ZCXCLkiQ|z*NH5#@N@)cev@A$>9%{n_hIoEGg8Iamr zIUG0ofz<{cV_mZ{;MM`@41TRXBB?(ba1{7J{J}@bU7GByT`Otkx?Kj8{G{xjx{5TbztMS$8I31&AyQ$nX*pi`hN>WtHhz0Zz3^WxCWHY%T zg-R+a0ZNw@L8T|IWqMvkgvOHHoDS9(oWnv3A>1og)znLkyt_$$?Ge~0H{DGOS-oGh z7-tYS@3(eywib%vAsQ(W*3+L3jhO4=iVAtS?7%66SR~o4?Cm70tU>!vtM^96X5OCI z@h8%1R2Pjlk^Wajx#{WKtL3C2&K3Zw*U{N&I4hqc3lNcFuJ3p6pitfxIq4$xdhjhB zZ##a!`{lJIzRdTqpn6zsX;){W9VFSrN={B@S6nIsnjX1(8L;o0M_ypLo`rji+SvRR zAJ81OGy~p(kK~=qfU15wZV+T~r`Bco_Ll|cQ*s$LHWUSALSN$r+x&Uk^24*piDw=L z_Y*9eTBIqXL&)c{aw}u)*RufTpgxl2XALiV2z;)GHctN75bI2ow%)Ro$F#OD;q5Jl z$Jtf_JjBQ5bl(ZTB3U;Fv>x}rr>T}tw*GClN~I z@w-w4%nX~0&_&o0yvtwY^}2$s0BvYZV>I_Xk=OD1vxce{3xB|v+wtq3Ego9-&{}Kl z=;0|d*EOKTlWE)WHGdBmh|C>;PRSb^m$m2q{@J?=p9p5IZ;cR&H_b(rf}~dj{Ws&m zW~qg7UN2#(3~rv^Kb%sT8(A@0@Q@HVAv$0PRcauV0zum>+EC2ui literal 5101 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 diff --git a/linphone.ldb/Contents.plist b/linphone.ldb/Contents.plist index 15280059c..dc3f49742 100644 --- a/linphone.ldb/Contents.plist +++ b/linphone.ldb/Contents.plist @@ -212,17 +212,17 @@ backup - 3 + 9 class BLWrapperHandle name - Classes/ChatRoomViewController/3/ChatRoomViewController.xib + Classes/ChatRoomViewController/9/ChatRoomViewController.xib change date - 2012-09-13T13:08:20Z + 2012-09-13T15:15:40Z changed values class @@ -232,7 +232,7 @@ flags 0 hash - c2184e590274d82e838a91d16b383b3d + 1d0ac99cbad123783bcb35b0d4031cdb name ChatRoomViewController.xib @@ -386,6 +386,9 @@ snapshots + + old objects + change date 2001-01-01T00:00:00Z @@ -435,16 +438,14 @@ - old objects - snapshots versions en - 3 + 9 fr - 3 + 9 diff --git a/linphone.ldb/Resources/Classes/ChatRoomViewController/3/ChatRoomViewController.xib b/linphone.ldb/Resources/Classes/ChatRoomViewController/9/ChatRoomViewController.xib similarity index 86% rename from linphone.ldb/Resources/Classes/ChatRoomViewController/3/ChatRoomViewController.xib rename to linphone.ldb/Resources/Classes/ChatRoomViewController/9/ChatRoomViewController.xib index 5bae93e66..7ab91d369 100644 --- a/linphone.ldb/Resources/Classes/ChatRoomViewController/3/ChatRoomViewController.xib +++ b/linphone.ldb/Resources/Classes/ChatRoomViewController/9/ChatRoomViewController.xib @@ -18,7 +18,6 @@ IBUITableView IBUITableViewController IBUITapGestureRecognizer - IBUITextView IBUIView @@ -158,13 +157,31 @@ 266 + + + 274 + {320, 59} + + + + _NS:9 + + 1 + MSAwLjI4MzE1ODM3MjYgMC4wNTY3ODY4OTE2MQA + + NO + IBCocoaTouchFramework + + NSImage + chat_background.png + + - 257 + 297 {{250, 0}, {70, 59}} - _NS:9 NO @@ -202,57 +219,56 @@ 16 - + - 258 + 274 + + + + 274 + {250, 59} + + + + _NS:9 + NO + IBCocoaTouchFramework + + NSImage + chat_field.png + + + + + 274 + {{10, 10}, {230, 39}} + + + + _NS:9 + + IBCocoaTouchFramework + + {250, 59} - + _NS:9 - NO - IBCocoaTouchFramework - - NSImage - chat_field.png - - - - - 258 - {{10, 10}, {230, 39}} - - - - _NS:9 - YES - YES - - Enter your message here + + 3 + MQA + + 2 + IBCocoaTouchFramework - YES - NO - This is a message - - 2 - IBCocoaTouchFramework - - - 1 - 18 - - - Helvetica - 18 - 16 - {{0, 357}, {320, 59}} - + _NS:9 IBCocoaTouchFramework @@ -426,14 +442,6 @@ 44 - - - fieldBackgroundImage - - - - 48 - footerView @@ -458,13 +466,37 @@ 54 + + + footerBackgroundImage + + + + 67 + messageField - + - 57 + 64 + + + + messageBackgroundImage + + + + 69 + + + + messageView + + + + 70 @@ -650,37 +682,53 @@ 14 - - + + footerView - - 21 - - - fieldBackgroundImage - 15 sendButton - - 55 - - - messageField - 58 listTapGestureRecognizer + + 66 + + + footerBackgroundImage + + + 68 + + + + + + + messageView + + + 21 + + + messageBackgroundImage + + + 63 + + + messageField + @@ -703,9 +751,12 @@ com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin + HPGrowingTextView + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin @@ -716,7 +767,7 @@ - 62 + 70 @@ -765,10 +816,12 @@ UIImageView UIView UIToggleButton - UIImageView + UIImageView UIView UIView - UITextView + UIImageView + HPGrowingTextView + UIView UIButton ChatRoomTableViewController @@ -789,8 +842,8 @@ editButton UIToggleButton - - fieldBackgroundImage + + footerBackgroundImage UIImageView @@ -801,9 +854,17 @@ headerView UIView + + messageBackgroundImage + UIImageView + messageField - UITextView + HPGrowingTextView + + + messageView + UIView sendButton @@ -819,6 +880,14 @@ ./Classes/ChatRoomViewController.h + + HPGrowingTextView + UIView + + IBProjectSource + ./Classes/HPGrowingTextView.h + + UIToggleButton UIButton @@ -842,6 +911,7 @@ {131, 131} {320, 88} {320, 88} + {640, 117} {320, 88} {320, 88} {500, 117} diff --git a/linphone.xcodeproj/project.pbxproj b/linphone.xcodeproj/project.pbxproj index 889b7ff35..60e1d94c3 100755 --- a/linphone.xcodeproj/project.pbxproj +++ b/linphone.xcodeproj/project.pbxproj @@ -377,7 +377,6 @@ D34BD65215C13DB60070C209 /* chat_default.png in Resources */ = {isa = PBXBuildFile; fileRef = D38327F11580FE3A00FA0D23 /* chat_default.png */; }; D34BD65315C13DB60070C209 /* chat_edit_default.png in Resources */ = {isa = PBXBuildFile; fileRef = D3EA53FF159852080037DC6B /* chat_edit_default.png */; }; D34BD65415C13DB60070C209 /* chat_edit_over.png in Resources */ = {isa = PBXBuildFile; fileRef = D3EA5400159852080037DC6B /* chat_edit_over.png */; }; - D34BD65515C13DB60070C209 /* chat_field.png in Resources */ = {isa = PBXBuildFile; fileRef = D3B9A3DA15A58C440096EA4E /* chat_field.png */; }; D34BD65615C13DB60070C209 /* chat_ok_default.png in Resources */ = {isa = PBXBuildFile; fileRef = D3B9A3DB15A58C440096EA4E /* chat_ok_default.png */; }; D34BD65715C13DB60070C209 /* chat_ok_over.png in Resources */ = {isa = PBXBuildFile; fileRef = D3B9A3DC15A58C440096EA4E /* chat_ok_over.png */; }; D34BD65815C13DB60070C209 /* chat_over.png in Resources */ = {isa = PBXBuildFile; fileRef = D38327FF158100E400FA0D23 /* chat_over.png */; }; @@ -968,7 +967,6 @@ D3ACB09C15C6D59500E15894 /* dialer_alt_back_default~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = D3ACB09915C6D59500E15894 /* dialer_alt_back_default~ipad.png */; }; D3ACB09D15C6D59500E15894 /* dialer_alt_back_over~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = D3ACB09A15C6D59500E15894 /* dialer_alt_back_over~ipad.png */; }; D3ACB09E15C6D59500E15894 /* dialer_alt_back_over~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = D3ACB09A15C6D59500E15894 /* dialer_alt_back_over~ipad.png */; }; - D3B9A3DF15A58C450096EA4E /* chat_field.png in Resources */ = {isa = PBXBuildFile; fileRef = D3B9A3DA15A58C440096EA4E /* chat_field.png */; }; D3B9A3E115A58C450096EA4E /* chat_ok_default.png in Resources */ = {isa = PBXBuildFile; fileRef = D3B9A3DB15A58C440096EA4E /* chat_ok_default.png */; }; D3B9A3E315A58C450096EA4E /* chat_ok_over.png in Resources */ = {isa = PBXBuildFile; fileRef = D3B9A3DC15A58C440096EA4E /* chat_ok_over.png */; }; D3B9A3E515A58C450096EA4E /* chat_send_default.png in Resources */ = {isa = PBXBuildFile; fileRef = D3B9A3DD15A58C440096EA4E /* chat_send_default.png */; }; @@ -1079,6 +1077,14 @@ D3ED3EA81587334E006C0DE4 /* HistoryTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D3ED3EA51587334C006C0DE4 /* HistoryTableViewController.m */; }; D3ED3EB81587392C006C0DE4 /* HistoryViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D3ED3EB615873929006C0DE4 /* HistoryViewController.m */; }; D3ED3EB91587392C006C0DE4 /* HistoryViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D3ED3EB615873929006C0DE4 /* HistoryViewController.m */; }; + D3ED40191602172200BF332B /* HPGrowingTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = D3ED40161602172200BF332B /* HPGrowingTextView.m */; }; + D3ED401A1602172200BF332B /* HPGrowingTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = D3ED40161602172200BF332B /* HPGrowingTextView.m */; }; + D3ED401B1602172200BF332B /* HPTextViewInternal.m in Sources */ = {isa = PBXBuildFile; fileRef = D3ED40181602172200BF332B /* HPTextViewInternal.m */; }; + D3ED401C1602172200BF332B /* HPTextViewInternal.m in Sources */ = {isa = PBXBuildFile; fileRef = D3ED40181602172200BF332B /* HPTextViewInternal.m */; }; + D3ED40241602257400BF332B /* chat_background.9.png in Resources */ = {isa = PBXBuildFile; fileRef = D3ED40221602257400BF332B /* chat_background.9.png */; }; + D3ED40251602257400BF332B /* chat_background.9.png in Resources */ = {isa = PBXBuildFile; fileRef = D3ED40221602257400BF332B /* chat_background.9.png */; }; + D3ED40261602257400BF332B /* chat_background.9@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = D3ED40231602257400BF332B /* chat_background.9@2x.png */; }; + D3ED40271602257400BF332B /* chat_background.9@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = D3ED40231602257400BF332B /* chat_background.9@2x.png */; }; D3F26BF115986B73005F9CAB /* IncomingCallViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D3F26BEF15986B71005F9CAB /* IncomingCallViewController.m */; }; D3F26BF215986B73005F9CAB /* IncomingCallViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D3F26BEF15986B71005F9CAB /* IncomingCallViewController.m */; }; D3F26BF715986DAD005F9CAB /* history_ok_default.png in Resources */ = {isa = PBXBuildFile; fileRef = D3F26BF515986DAD005F9CAB /* history_ok_default.png */; }; @@ -2013,6 +2019,13 @@ D3ED3EA51587334C006C0DE4 /* HistoryTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = HistoryTableViewController.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; D3ED3EB515873928006C0DE4 /* HistoryViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HistoryViewController.h; sourceTree = ""; }; D3ED3EB615873929006C0DE4 /* HistoryViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = HistoryViewController.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; + D3ED40151602172200BF332B /* HPGrowingTextView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HPGrowingTextView.h; sourceTree = ""; }; + D3ED40161602172200BF332B /* HPGrowingTextView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HPGrowingTextView.m; sourceTree = ""; }; + D3ED40171602172200BF332B /* HPTextViewInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HPTextViewInternal.h; sourceTree = ""; }; + D3ED40181602172200BF332B /* HPTextViewInternal.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HPTextViewInternal.m; sourceTree = ""; }; + D3ED401D1602223B00BF332B /* chat_background.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = chat_background.png; path = Resources/chat_background.png; sourceTree = ""; }; + D3ED40221602257400BF332B /* chat_background.9.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = chat_background.9.png; path = Resources/chat_background.9.png; sourceTree = ""; }; + D3ED40231602257400BF332B /* chat_background.9@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "chat_background.9@2x.png"; path = "Resources/chat_background.9@2x.png"; sourceTree = ""; }; D3F26BEE15986B71005F9CAB /* IncomingCallViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IncomingCallViewController.h; sourceTree = ""; }; D3F26BEF15986B71005F9CAB /* IncomingCallViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IncomingCallViewController.m; sourceTree = ""; }; D3F26BF515986DAD005F9CAB /* history_ok_default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = history_ok_default.png; path = Resources/history_ok_default.png; sourceTree = ""; }; @@ -2765,6 +2778,9 @@ D3EA5402159852080037DC6B /* chat_add_over.png */, D3F795DB15A5831C0077328B /* chat_back_default.png */, D3F795DC15A5831C0077328B /* chat_back_over.png */, + D3ED40221602257400BF332B /* chat_background.9.png */, + D3ED40231602257400BF332B /* chat_background.9@2x.png */, + D3ED401D1602223B00BF332B /* chat_background.png */, D389363715A6D53200A3A3AA /* chat_bubble_incoming.9.png */, D3A8BB7715A6CC3200F96BE5 /* chat_bubble_incoming.png */, D389363815A6D53200A3A3AA /* chat_bubble_outgoing.9.png */, @@ -3125,6 +3141,7 @@ D3807FB615C28940005BE9BC /* DCRoundSwitch */, D32B9DFA15A2F131000B6DEC /* FastAddressBook.h */, D32B9DFB15A2F131000B6DEC /* FastAddressBook.m */, + D3ED40141602172200BF332B /* GrowingTextView */, D3807FC715C2894A005BE9BC /* InAppSettingsKit */, D3B90E1115C2CB5700F64F8C /* NinePatch.xcodeproj */, D326483615887D5200930C67 /* OrderedDictionary.h */, @@ -3248,6 +3265,18 @@ name = Products; sourceTree = ""; }; + D3ED40141602172200BF332B /* GrowingTextView */ = { + isa = PBXGroup; + children = ( + D3ED40151602172200BF332B /* HPGrowingTextView.h */, + D3ED40161602172200BF332B /* HPGrowingTextView.m */, + D3ED40171602172200BF332B /* HPTextViewInternal.h */, + D3ED40181602172200BF332B /* HPTextViewInternal.m */, + ); + name = GrowingTextView; + path = Utils/GrowingTextView; + sourceTree = ""; + }; D3F7997E15BD31EC0018C273 /* TPMultiLayoutViewController */ = { isa = PBXGroup; children = ( @@ -3568,7 +3597,6 @@ D38187AD15FE340100C3EDCA /* ChatRoomViewController.xib in Resources */, D3F795DD15A5831C0077328B /* chat_back_default.png in Resources */, D3F795DF15A5831C0077328B /* chat_back_over.png in Resources */, - D3B9A3DF15A58C450096EA4E /* chat_field.png in Resources */, D3B9A3E115A58C450096EA4E /* chat_ok_default.png in Resources */, D3B9A3E315A58C450096EA4E /* chat_ok_over.png in Resources */, D3B9A3E515A58C450096EA4E /* chat_send_default.png in Resources */, @@ -3815,6 +3843,8 @@ D381884415FE447200C3EDCA /* ChatViewController.xib in Resources */, D381885415FE448400C3EDCA /* UICallBar.xib in Resources */, D381885615FE448400C3EDCA /* UICallBar~ipad.xib in Resources */, + D3ED40241602257400BF332B /* chat_background.9.png in Resources */, + D3ED40261602257400BF332B /* chat_background.9@2x.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -3907,7 +3937,6 @@ D34BD65215C13DB60070C209 /* chat_default.png in Resources */, D34BD65315C13DB60070C209 /* chat_edit_default.png in Resources */, D34BD65415C13DB60070C209 /* chat_edit_over.png in Resources */, - D34BD65515C13DB60070C209 /* chat_field.png in Resources */, D34BD65615C13DB60070C209 /* chat_ok_default.png in Resources */, D34BD65715C13DB60070C209 /* chat_ok_over.png in Resources */, D34BD65815C13DB60070C209 /* chat_over.png in Resources */, @@ -4264,6 +4293,8 @@ D381884515FE447200C3EDCA /* ChatViewController.xib in Resources */, D381885515FE448400C3EDCA /* UICallBar.xib in Resources */, D381885715FE448400C3EDCA /* UICallBar~ipad.xib in Resources */, + D3ED40251602257400BF332B /* chat_background.9.png in Resources */, + D3ED40271602257400BF332B /* chat_background.9@2x.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -4386,6 +4417,8 @@ D380800515C28A7A005BE9BC /* UILinphone.m in Sources */, D380801315C299D0005BE9BC /* ColorSpaceUtilites.m in Sources */, D378AB2A15DCDB4A0098505D /* ContactDetailsImagePickerController.m in Sources */, + D3ED40191602172200BF332B /* HPGrowingTextView.m in Sources */, + D3ED401B1602172200BF332B /* HPTextViewInternal.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -4476,6 +4509,8 @@ D380800615C28A7A005BE9BC /* UILinphone.m in Sources */, D380801415C299D0005BE9BC /* ColorSpaceUtilites.m in Sources */, D378AB2B15DCDB4A0098505D /* ContactDetailsImagePickerController.m in Sources */, + D3ED401A1602172200BF332B /* HPGrowingTextView.m in Sources */, + D3ED401C1602172200BF332B /* HPTextViewInternal.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; From 349592cf24afdc9b94faaa314b5763dbc3fd5f06 Mon Sep 17 00:00:00 2001 From: Yann Diorcet Date: Thu, 13 Sep 2012 17:23:02 +0200 Subject: [PATCH 05/28] Add CharRoomViewController(fr) synchronized xib --- Classes/fr.lproj/ChatRoomViewController.xib | 8 +------- linphone.ldb/Contents.plist | 12 ++++++------ .../{9 => 10}/ChatRoomViewController.xib | 8 +------- 3 files changed, 8 insertions(+), 20 deletions(-) rename linphone.ldb/Resources/Classes/ChatRoomViewController/{9 => 10}/ChatRoomViewController.xib (99%) diff --git a/Classes/fr.lproj/ChatRoomViewController.xib b/Classes/fr.lproj/ChatRoomViewController.xib index 29e39e959..00108b6b3 100644 --- a/Classes/fr.lproj/ChatRoomViewController.xib +++ b/Classes/fr.lproj/ChatRoomViewController.xib @@ -245,13 +245,7 @@ _NS:9 - - 3 - MQA - - 2 - - + IBCocoaTouchFramework diff --git a/linphone.ldb/Contents.plist b/linphone.ldb/Contents.plist index dc3f49742..f37155e1a 100644 --- a/linphone.ldb/Contents.plist +++ b/linphone.ldb/Contents.plist @@ -212,17 +212,17 @@ backup - 9 + 10 class BLWrapperHandle name - Classes/ChatRoomViewController/9/ChatRoomViewController.xib + Classes/ChatRoomViewController/10/ChatRoomViewController.xib change date - 2012-09-13T15:15:40Z + 2012-09-13T15:16:23Z changed values class @@ -232,7 +232,7 @@ flags 0 hash - 1d0ac99cbad123783bcb35b0d4031cdb + 17cff3d2e83eebab4ab29a3d6e6361ce name ChatRoomViewController.xib @@ -443,9 +443,9 @@ versions en - 9 + 10 fr - 9 + 10 diff --git a/linphone.ldb/Resources/Classes/ChatRoomViewController/9/ChatRoomViewController.xib b/linphone.ldb/Resources/Classes/ChatRoomViewController/10/ChatRoomViewController.xib similarity index 99% rename from linphone.ldb/Resources/Classes/ChatRoomViewController/9/ChatRoomViewController.xib rename to linphone.ldb/Resources/Classes/ChatRoomViewController/10/ChatRoomViewController.xib index 7ab91d369..3bde993df 100644 --- a/linphone.ldb/Resources/Classes/ChatRoomViewController/9/ChatRoomViewController.xib +++ b/linphone.ldb/Resources/Classes/ChatRoomViewController/10/ChatRoomViewController.xib @@ -255,13 +255,7 @@ _NS:9 - - 3 - MQA - - 2 - - + IBCocoaTouchFramework From 9912c46e356800117aa56cd15bbed1fe37ab1bff Mon Sep 17 00:00:00 2001 From: Yann Diorcet Date: Thu, 13 Sep 2012 17:39:40 +0200 Subject: [PATCH 06/28] Fix chat views --- Classes/ChatRoomViewController.m | 12 ++++++++++++ Classes/en.lproj/ChatViewController.xib | 5 ++--- Classes/fr.lproj/ChatViewController.xib | 4 ++-- linphone.ldb/Contents.plist | 12 ++++++------ .../{1 => 2}/ChatViewController.xib | 5 ++--- 5 files changed, 24 insertions(+), 14 deletions(-) rename linphone.ldb/Resources/Classes/ChatViewController/{1 => 2}/ChatViewController.xib (99%) diff --git a/Classes/ChatRoomViewController.m b/Classes/ChatRoomViewController.m index 399230f5f..b82d0215c 100644 --- a/Classes/ChatRoomViewController.m +++ b/Classes/ChatRoomViewController.m @@ -300,6 +300,11 @@ static void message_status(LinphoneChatMessage* msg,LinphoneChatMessageState sta footerRect.size.height += diff; [footerView setFrame:footerRect]; + // Always stay at bottom + CGPoint contentPt = [tableController.tableView contentOffset]; + contentPt.y += diff; + [tableController.tableView setContentOffset:contentPt animated:FALSE]; + CGRect tableRect = [tableController.view frame]; tableRect.size.height -= diff; [tableController.view setFrame:tableRect]; @@ -371,8 +376,15 @@ static void message_status(LinphoneChatMessage* msg,LinphoneChatMessageState sta { CGRect tableFrame = [tableController.view frame]; tableFrame.origin.y = [headerView frame].origin.y + [headerView frame].size.height; + double diff = tableFrame.size.height; tableFrame.size.height = [footerView frame].origin.y - tableFrame.origin.y; + diff = tableFrame.size.height - diff; [tableController.view setFrame:tableFrame]; + + // Always stay at bottom + CGPoint contentPt = [tableController.tableView contentOffset]; + contentPt.y -= diff; + [tableController.tableView setContentOffset:contentPt animated:FALSE]; } [UIView commitAnimations]; diff --git a/Classes/en.lproj/ChatViewController.xib b/Classes/en.lproj/ChatViewController.xib index 5a413935c..69cc378e4 100644 --- a/Classes/en.lproj/ChatViewController.xib +++ b/Classes/en.lproj/ChatViewController.xib @@ -61,7 +61,7 @@ - 292 + 289 {{160, 0}, {160, 44}} @@ -99,7 +99,7 @@ - 289 + 292 {160, 44} @@ -150,7 +150,6 @@ {{0, 74}, {320, 378}} - _NS:9 1 diff --git a/Classes/fr.lproj/ChatViewController.xib b/Classes/fr.lproj/ChatViewController.xib index e9f8e254d..c19606afd 100644 --- a/Classes/fr.lproj/ChatViewController.xib +++ b/Classes/fr.lproj/ChatViewController.xib @@ -60,7 +60,7 @@ - 292 + 289 {{160, 0}, {160, 44}} @@ -97,7 +97,7 @@ - 289 + 292 {160, 44} diff --git a/linphone.ldb/Contents.plist b/linphone.ldb/Contents.plist index f37155e1a..e446bc3c4 100644 --- a/linphone.ldb/Contents.plist +++ b/linphone.ldb/Contents.plist @@ -453,17 +453,17 @@ backup - 1 + 2 class BLWrapperHandle name - Classes/ChatViewController/1/ChatViewController.xib + Classes/ChatViewController/2/ChatViewController.xib change date - 2012-09-10T15:08:28Z + 2012-09-13T15:35:03Z changed values class @@ -473,7 +473,7 @@ flags 0 hash - 5899ee290abaa696222088258d0de490 + d02ecf8f1bacbfa8e5793231b6735940 name ChatViewController.xib @@ -587,9 +587,9 @@ versions en - 1 + 2 fr - 1 + 2 diff --git a/linphone.ldb/Resources/Classes/ChatViewController/1/ChatViewController.xib b/linphone.ldb/Resources/Classes/ChatViewController/2/ChatViewController.xib similarity index 99% rename from linphone.ldb/Resources/Classes/ChatViewController/1/ChatViewController.xib rename to linphone.ldb/Resources/Classes/ChatViewController/2/ChatViewController.xib index 5a413935c..69cc378e4 100644 --- a/linphone.ldb/Resources/Classes/ChatViewController/1/ChatViewController.xib +++ b/linphone.ldb/Resources/Classes/ChatViewController/2/ChatViewController.xib @@ -61,7 +61,7 @@ - 292 + 289 {{160, 0}, {160, 44}} @@ -99,7 +99,7 @@ - 289 + 292 {160, 44} @@ -150,7 +150,6 @@ {{0, 74}, {320, 378}} - _NS:9 1 From 6d4c6c6ffaf4087a9d032bf9f1c5febc3d797c4a Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Thu, 13 Sep 2012 17:54:48 +0200 Subject: [PATCH 07/28] 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 840942ca3aad081696d12d868c16e341b760080f Mon Sep 17 00:00:00 2001 From: Yann Diorcet Date: Thu, 13 Sep 2012 18:06:29 +0200 Subject: [PATCH 08/28] ChatRoom: Fix delete --- Classes/ChatRoomViewController.h | 2 ++ Classes/ChatRoomViewController.m | 12 ++++++++++++ Classes/LinphoneUI/UIChatRoomCell.m | 2 +- Classes/LinphoneUI/UIChatRoomCell.xib | 7 ++++--- Classes/en.lproj/ChatRoomViewController.xib | 15 ++++++++++++++- Classes/fr.lproj/ChatRoomViewController.xib | 15 ++++++++++++++- linphone.ldb/Contents.plist | 12 ++++++------ .../{10 => 11}/ChatRoomViewController.xib | 15 ++++++++++++++- 8 files changed, 67 insertions(+), 13 deletions(-) rename linphone.ldb/Resources/Classes/ChatRoomViewController/{10 => 11}/ChatRoomViewController.xib (98%) diff --git a/Classes/ChatRoomViewController.h b/Classes/ChatRoomViewController.h index c1a10d0b7..c83364ae2 100644 --- a/Classes/ChatRoomViewController.h +++ b/Classes/ChatRoomViewController.h @@ -46,6 +46,8 @@ @property (nonatomic, retain) IBOutlet UIView *messageView; @property (nonatomic, retain) IBOutlet UIImageView *messageBackgroundImage; @property (nonatomic, retain) IBOutlet UIImageView *footerBackgroundImage; +@property (nonatomic, retain) IBOutlet UITapGestureRecognizer *listTapGestureRecognizer; + @property (nonatomic, copy) NSString *remoteAddress; - (IBAction)onBackClick:(id)event; diff --git a/Classes/ChatRoomViewController.m b/Classes/ChatRoomViewController.m index b82d0215c..180017b5e 100644 --- a/Classes/ChatRoomViewController.m +++ b/Classes/ChatRoomViewController.m @@ -37,6 +37,7 @@ @synthesize messageView; @synthesize messageBackgroundImage; @synthesize footerBackgroundImage; +@synthesize listTapGestureRecognizer; #pragma mark - Lifecycle Functions @@ -63,6 +64,7 @@ [messageView release]; [messageBackgroundImage release]; [footerBackgroundImage release]; + [listTapGestureRecognizer release]; [super dealloc]; } @@ -292,6 +294,15 @@ static void message_status(LinphoneChatMessage* msg,LinphoneChatMessageState sta #pragma mark - UITextFieldDelegate Functions +- (BOOL)growingTextViewShouldBeginEditing:(HPGrowingTextView *)growingTextView { + if(editButton.selected) { + [tableController setEditing:FALSE animated:TRUE]; + [editButton setOff]; + [listTapGestureRecognizer setEnabled:TRUE]; + } + return TRUE; +} + - (void)growingTextView:(HPGrowingTextView *)growingTextView willChangeHeight:(float)height { int diff = height - growingTextView.bounds.size.height; @@ -323,6 +334,7 @@ static void message_status(LinphoneChatMessage* msg,LinphoneChatMessageState sta } - (IBAction)onEditClick:(id)event { + [listTapGestureRecognizer setEnabled:[tableController isEditing]]; [tableController setEditing:![tableController isEditing] animated:TRUE]; [messageField resignFirstResponder]; } diff --git a/Classes/LinphoneUI/UIChatRoomCell.m b/Classes/LinphoneUI/UIChatRoomCell.m index e0bc54616..0ccfcce18 100644 --- a/Classes/LinphoneUI/UIChatRoomCell.m +++ b/Classes/LinphoneUI/UIChatRoomCell.m @@ -205,7 +205,7 @@ static UIFont *CELL_FONT = nil; #pragma mark - Action Functions -- (IBAction)onDeleteClick: (id) event { +- (IBAction)onDeleteClick:(id)event { if(chat != NULL) { UIView *view = [self superview]; // Find TableViewCell diff --git a/Classes/LinphoneUI/UIChatRoomCell.xib b/Classes/LinphoneUI/UIChatRoomCell.xib index cda2cfccd..7710f22af 100644 --- a/Classes/LinphoneUI/UIChatRoomCell.xib +++ b/Classes/LinphoneUI/UIChatRoomCell.xib @@ -117,6 +117,7 @@ _NS:9 YES + NO IBCocoaTouchFramework @@ -334,7 +335,7 @@ 7 - 20 + 32 @@ -447,7 +448,7 @@ com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin - + com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin @@ -461,7 +462,7 @@ - 31 + 32 diff --git a/Classes/en.lproj/ChatRoomViewController.xib b/Classes/en.lproj/ChatRoomViewController.xib index 3bde993df..76a72edf1 100644 --- a/Classes/en.lproj/ChatRoomViewController.xib +++ b/Classes/en.lproj/ChatRoomViewController.xib @@ -492,6 +492,14 @@ 70 + + + listTapGestureRecognizer + + + + 71 + dataSource @@ -761,7 +769,7 @@ - 70 + 71 @@ -813,6 +821,7 @@ UIImageView UIView UIView + UITapGestureRecognizer UIImageView HPGrowingTextView UIView @@ -848,6 +857,10 @@ headerView UIView + + listTapGestureRecognizer + UITapGestureRecognizer + messageBackgroundImage UIImageView diff --git a/Classes/fr.lproj/ChatRoomViewController.xib b/Classes/fr.lproj/ChatRoomViewController.xib index 00108b6b3..d529292f6 100644 --- a/Classes/fr.lproj/ChatRoomViewController.xib +++ b/Classes/fr.lproj/ChatRoomViewController.xib @@ -474,6 +474,14 @@ 70 + + + listTapGestureRecognizer + + + + 71 + dataSource @@ -743,7 +751,7 @@ - 70 + 71 @@ -795,6 +803,7 @@ UIImageView UIView UIView + UITapGestureRecognizer UIImageView HPGrowingTextView UIView @@ -830,6 +839,10 @@ headerView UIView + + listTapGestureRecognizer + UITapGestureRecognizer + messageBackgroundImage UIImageView diff --git a/linphone.ldb/Contents.plist b/linphone.ldb/Contents.plist index e446bc3c4..70072ae50 100644 --- a/linphone.ldb/Contents.plist +++ b/linphone.ldb/Contents.plist @@ -212,17 +212,17 @@ backup - 10 + 11 class BLWrapperHandle name - Classes/ChatRoomViewController/10/ChatRoomViewController.xib + Classes/ChatRoomViewController/11/ChatRoomViewController.xib change date - 2012-09-13T15:16:23Z + 2012-09-13T16:01:39Z changed values class @@ -232,7 +232,7 @@ flags 0 hash - 17cff3d2e83eebab4ab29a3d6e6361ce + 1017e47ad2fcb46b91d384f53e88bb41 name ChatRoomViewController.xib @@ -443,9 +443,9 @@ versions en - 10 + 11 fr - 10 + 11 diff --git a/linphone.ldb/Resources/Classes/ChatRoomViewController/10/ChatRoomViewController.xib b/linphone.ldb/Resources/Classes/ChatRoomViewController/11/ChatRoomViewController.xib similarity index 98% rename from linphone.ldb/Resources/Classes/ChatRoomViewController/10/ChatRoomViewController.xib rename to linphone.ldb/Resources/Classes/ChatRoomViewController/11/ChatRoomViewController.xib index 3bde993df..76a72edf1 100644 --- a/linphone.ldb/Resources/Classes/ChatRoomViewController/10/ChatRoomViewController.xib +++ b/linphone.ldb/Resources/Classes/ChatRoomViewController/11/ChatRoomViewController.xib @@ -492,6 +492,14 @@ 70 + + + listTapGestureRecognizer + + + + 71 + dataSource @@ -761,7 +769,7 @@ - 70 + 71 @@ -813,6 +821,7 @@ UIImageView UIView UIView + UITapGestureRecognizer UIImageView HPGrowingTextView UIView @@ -848,6 +857,10 @@ headerView UIView + + listTapGestureRecognizer + UITapGestureRecognizer + messageBackgroundImage UIImageView From 5d75afcec8d824584255fce50ee933edcb01e045 Mon Sep 17 00:00:00 2001 From: Yann Diorcet Date: Fri, 14 Sep 2012 11:12:47 +0200 Subject: [PATCH 09/28] 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 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 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 10/28] 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 11/28] 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 12/28] 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 13/28] 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 14/28] 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 15/28] 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 16/28] 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 17/28] 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 18/28] 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 19/28] 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 20/28] 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 21/28] 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 22/28] 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 23/28] 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]; From 20ef4a246946d0d89a1522f8eb1802361d227176 Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Tue, 18 Sep 2012 10:32:00 +0200 Subject: [PATCH 24/28] xcode 4.6/ios6 support Conflicts: submodules/linphone --- README | 2 + submodules/build/Makefile | 10 +-- submodules/build/Makefile.ios6-beta | 81 ++++++++++++++++++++++++ submodules/build/builder-iphone-os.mk | 16 +++-- submodules/build/builders.d/libvpx.mk | 2 + submodules/build/builders.d/libvpx.patch | 37 +++++++++-- submodules/build/iphone-config.site | 13 ++-- submodules/linphone | 2 +- 8 files changed, 141 insertions(+), 22 deletions(-) create mode 100644 submodules/build/Makefile.ios6-beta diff --git a/README b/README index 7bb193edd..803267e04 100644 --- a/README +++ b/README @@ -52,6 +52,8 @@ BUILDING THE SDK $ cd submodules/build $ make all enable_gpl_third_parties=no +xcode 4.5i/ios6 beta do: + $ make -f Makefile.ios6-beta * ZRTP support You can enable ZRTP support in GPL mode only, by adding "enable_zrtp=yes" to the make command, for example: diff --git a/submodules/build/Makefile b/submodules/build/Makefile index 72b7b1d5e..276688bb4 100644 --- a/submodules/build/Makefile +++ b/submodules/build/Makefile @@ -54,28 +54,28 @@ endif LINPHONE_OPTIONS=enable_gpl_third_parties=$(enable_gpl_third_parties) enable_zrtp=$(enable_zrtp) build: - make -f builder-iphone-os.mk $(LINPHONE_OPTIONS) all \ + make -f builder-iphone-os.mk host=armv6-apple-darwin $(LINPHONE_OPTIONS) all \ && make -f builder-iphone-simulator.mk $(LINPHONE_OPTIONS) all \ && make -f builder-iphone-os.mk host=armv7-apple-darwin $(LINPHONE_OPTIONS) all \ && make -f builder-iphone-os.mk delivery-sdk ipa: build make -f builder-iphone-simulator.mk ipa \ - && make -f builder-iphone-os.mk ipa \ + && make -f builder-iphone-os.mk host=armv6-apple-darwin ipa \ && make -f builder-iphone-os.mk host=armv7-apple-darwin ipa clean: make -f builder-iphone-simulator.mk clean \ - && make -f builder-iphone-os.mk clean \ + && make -f builder-iphone-os.mk host=armv6-apple-darwin clean \ && make -f builder-iphone-os.mk host=armv7-apple-darwin clean clean-makefile: make -f builder-iphone-simulator.mk clean-makefile \ - && make -f builder-iphone-os.mk clean-makefile \ + && make -f builder-iphone-os.mk host=armv6-apple-darwin clean-makefile \ && make -f builder-iphone-os.mk host=armv7-apple-darwin clean-makefile veryclean: make -f builder-iphone-simulator.mk veryclean \ - && make -f builder-iphone-os.mk veryclean \ + && make -f builder-iphone-os.mk host=armv6-apple-darwin veryclean \ && make -f builder-iphone-os.mk host=armv7-apple-darwin veryclean diff --git a/submodules/build/Makefile.ios6-beta b/submodules/build/Makefile.ios6-beta new file mode 100644 index 000000000..bb1fd7a6c --- /dev/null +++ b/submodules/build/Makefile.ios6-beta @@ -0,0 +1,81 @@ +############################################################################ +# Makefile +# Copyright (C) 2009 Belledonne Communications,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. +# +############################################################################ +enable_gpl_third_parties=yes +enable_zrtp=no + +.NOTPARALLEL all: check_options build warning +ifeq ($(enable_gpl_third_parties)$(enable_zrtp),noyes) +check_options: + @echo "ZRTP is not available in non-gpl build." + @exit -1 +else +check_options: + +endif + +ifeq ($(enable_gpl_third_parties),yes) +warning: + @echo + @echo "*****************************************************************" + @echo "*****************************************************************" + @echo "*****CAUTION, this liblinphone SDK is built using GPL code ******" + @echo "*****To disable gpl code, use make enable_gpl_third_parties=no***" + @echo "*****************************************************************" + @echo "*****************************************************************" +else +warning: + @echo + @echo "*****************************************************************" + @echo "*****************************************************************" + @echo "*****linphone SDK without GPL code ******" + @echo "*****************************************************************" + @echo "*****************************************************************" +endif + +LINPHONE_OPTIONS=enable_gpl_third_parties=$(enable_gpl_third_parties) enable_zrtp=$(enable_zrtp) + +build: + make -f builder-iphone-simulator.mk $(LINPHONE_OPTIONS) all \ + && make -f builder-iphone-os.mk $(LINPHONE_OPTIONS) all \ + && make -f builder-iphone-os.mk host=armv7s-apple-darwin $(LINPHONE_OPTIONS) all \ + && make -f builder-iphone-os.mk delivery-sdk + +ipa: build + make -f builder-iphone-simulator.mk ipa \ + && make -f builder-iphone-os.mk ipa \ + && make -f builder-iphone-os.mk host=armv7s-apple-darwin ipa \ + +clean: + make -f builder-iphone-simulator.mk clean \ + && make -f builder-iphone-os.mk clean \ + && make -f builder-iphone-os.mk host=armv7s-apple-darwin clean \ + +clean-makefile: + make -f builder-iphone-simulator.mk clean-makefile \ + && make -f builder-iphone-os.mk clean-makefile \ + && make -f builder-iphone-os.mk host=armv7s-apple-darwin clean-makefile \ + +veryclean: + make -f builder-iphone-simulator.mk veryclean \ + && make -f builder-iphone-os.mk veryclean \ + && make -f builder-iphone-os.mk host=armv7s-apple-darwin veryclean \ + diff --git a/submodules/build/builder-iphone-os.mk b/submodules/build/builder-iphone-os.mk index 93c5571d1..48b54121a 100644 --- a/submodules/build/builder-iphone-os.mk +++ b/submodules/build/builder-iphone-os.mk @@ -20,7 +20,7 @@ # ############################################################################ -host?=armv6-apple-darwin +host?=armv7-apple-darwin config_site:=iphone-config.site library_mode:= --disable-shared --enable-static linphone_configure_controls= \ @@ -301,13 +301,17 @@ multi-arch: cp -rf $(prefix)/include $(prefix)/../apple-darwin/. ; \ cp -rf $(prefix)/share $(prefix)/../apple-darwin/. ; \ for archive in $$arm_archives ; do \ - i386_path=`echo $$archive | sed -e "s/armv6/i386/"` ;\ - armv7_path=`echo $$archive | sed -e "s/armv6/armv7/"` ;\ - destpath=`echo $$archive | sed -e "s/armv6-//"` ;\ + i386_path=`echo $$archive | sed -e "s/armv7/i386/"` ;\ + armv6_path=`echo $$archive | sed -e "s/armv7/armv6/"` ;\ + if test ! -f "$$armv6_path"; then \ + armv6_path= ; \ + fi; \ + armv7s_path=`echo $$archive | sed -e "s/armv7/armv7s/"` ;\ + destpath=`echo $$archive | sed -e "s/armv7-//"` ;\ if test -f "$$i386_path"; then \ - echo "Mixing $$archive and $$i386_path into $$destpath"; \ + echo "Mixing $$archive into $$destpath"; \ mkdir -p `dirname $$destpath` ; \ - lipo -create $$archive $$armv7_path $$i386_path -output $$destpath; \ + lipo -create $$archive $$armv7s_path $$armv6_path $$i386_path -output $$destpath; \ else \ echo "WARNING: archive `basename $$archive` exists in arm tree but does not exists in i386 tree."; \ fi \ diff --git a/submodules/build/builders.d/libvpx.mk b/submodules/build/builders.d/libvpx.mk index 13e0aa62b..8b65258a9 100644 --- a/submodules/build/builders.d/libvpx.mk +++ b/submodules/build/builders.d/libvpx.mk @@ -6,6 +6,8 @@ libvpx_configure_options=\ ifneq (,$(findstring armv6,$(host))) libvpx_configure_options+= --target=armv6-darwin-gcc --cpu=arm1176jzf-s +else ifneq (,$(findstring armv7s,$(host))) + libvpx_configure_options+= --target=armv7s-darwin-gcc --cpu=cortex-a8 else ifneq (,$(findstring armv7,$(host))) libvpx_configure_options+= --target=armv7-darwin-gcc --cpu=cortex-a8 else diff --git a/submodules/build/builders.d/libvpx.patch b/submodules/build/builders.d/libvpx.patch index 390ec4ecf..6d77453c3 100644 --- a/submodules/build/builders.d/libvpx.patch +++ b/submodules/build/builders.d/libvpx.patch @@ -1,5 +1,5 @@ diff --git a/build/make/configure.sh b/build/make/configure.sh -index 0426f92..24fa04e 100755 +index 0426f92..d1f4760 100755 --- a/build/make/configure.sh +++ b/build/make/configure.sh @@ -624,6 +624,9 @@ process_common_toolchain() { @@ -12,7 +12,7 @@ index 0426f92..24fa04e 100755 case ${toolchain} in *-darwin8-*) -@@ -743,6 +746,14 @@ process_common_toolchain() { +@@ -743,9 +746,17 @@ process_common_toolchain() { darwin*) SDK_PATH=/Developer/Platforms/iPhoneOS.platform/Developer TOOLCHAIN_PATH=${SDK_PATH}/usr/bin @@ -26,10 +26,17 @@ index 0426f92..24fa04e 100755 + fi CC=${TOOLCHAIN_PATH}/gcc AR=${TOOLCHAIN_PATH}/ar - LD=${TOOLCHAIN_PATH}/arm-apple-darwin10-llvm-gcc-4.2 -@@ -759,10 +770,10 @@ process_common_toolchain() { +- LD=${TOOLCHAIN_PATH}/arm-apple-darwin10-llvm-gcc-4.2 ++ LD=${TOOLCHAIN_PATH}/ld + AS=${TOOLCHAIN_PATH}/as + STRIP=${TOOLCHAIN_PATH}/strip + NM=${TOOLCHAIN_PATH}/nm +@@ -757,12 +768,12 @@ process_common_toolchain() { + ASFLAGS="-version -arch ${tgt_isa} -g" + add_cflags -arch ${tgt_isa} - add_ldflags -arch_only ${tgt_isa} +- add_ldflags -arch_only ${tgt_isa} ++ add_ldflags -arch ${tgt_isa} - add_cflags "-isysroot ${SDK_PATH}/SDKs/iPhoneOS5.0.sdk" + add_cflags "-isysroot $SDK_FULL_PATH" @@ -40,3 +47,23 @@ index 0426f92..24fa04e 100755 # Add the paths for the alternate libc for d in usr/include; do +diff --git a/configure b/configure +index 6f20c6b..4638ea2 100755 +--- a/configure ++++ b/configure +@@ -94,6 +94,7 @@ all_platforms="${all_platforms} iwmmxt-linux-gcc" + all_platforms="${all_platforms} iwmmxt2-linux-rvct" + all_platforms="${all_platforms} iwmmxt2-linux-gcc" + all_platforms="${all_platforms} armv7-darwin-gcc" #neon Cortex-A8 ++all_platforms="${all_platforms} armv7s-darwin-gcc" #neon Cortex-A8 + all_platforms="${all_platforms} armv7-linux-rvct" #neon Cortex-A8 + all_platforms="${all_platforms} armv7-linux-gcc" #neon Cortex-A8 + all_platforms="${all_platforms} armv7-none-rvct" #neon Cortex-A8 +@@ -198,6 +199,7 @@ ARCH_EXT_LIST=" + armv5te + armv6 + armv7 ++ armv7s + iwmmxt + iwmmxt2 + diff --git a/submodules/build/iphone-config.site b/submodules/build/iphone-config.site index 4256d17ed..ea15aad82 100644 --- a/submodules/build/iphone-config.site +++ b/submodules/build/iphone-config.site @@ -18,16 +18,20 @@ elif test "${host_alias}" = "armv7-apple-darwin" ; then PLATFORM=OS CMAKE_OPTS="-DCMAKE_SYSTEM_PROCESSOR=arm" MCPU="-mcpu=cortex-a8" +elif test "${host_alias}" = "armv7s-apple-darwin" ; then + ARCH=armv7s + PLATFORM=OS + CMAKE_OPTS="-DCMAKE_SYSTEM_PROCESSOR=arm" else echo "bad host ${host_alias} must be either i386-apple-darwin or armv6-apple-darwin" exit fi echo "Loading config.site for iPhone platform=${PLATFORM} version=${SDK_VERSION}" - +XCODE_ROOT=/Applications/Xcode.app #new path with Xcode 4.3: -if test -d /Applications/Xcode.app/Contents/Developer/Platforms/iPhone${PLATFORM}.platform/Developer/SDKs ; then - SDK_PATH_LIST=`ls -drt /Applications/Xcode.app/Contents/Developer/Platforms/iPhone${PLATFORM}.platform/Developer/SDKs/iPhone${PLATFORM}*` - SDK_BIN_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhone${PLATFORM}.platform/Developer/usr/bin +if test -d ${XCODE_ROOT}/Contents/Developer/Platforms/iPhone${PLATFORM}.platform/Developer/SDKs ; then + SDK_PATH_LIST=`ls -drt ${XCODE_ROOT}/Contents/Developer/Platforms/iPhone${PLATFORM}.platform/Developer/SDKs/iPhone${PLATFORM}*` + SDK_BIN_PATH=${XCODE_ROOT}/Contents/Developer/Platforms/iPhone${PLATFORM}.platform/Developer/usr/bin else SDK_PATH_LIST=`ls -drt /Developer/Platforms/iPhone${PLATFORM}.platform/Developer/SDKs/iPhone${PLATFORM}*` SDK_BIN_PATH=/Developer/Platforms/iPhone${PLATFORM}.platform/Developer/usr/bin @@ -44,5 +48,4 @@ AR=${SDK_BIN_PATH}/ar RANLIB=${SDK_BIN_PATH}/ranlib CPPFLAGS="-Dasm=__asm" -LDFLAGS="-Wl,-syslibroot,${SYSROOT_PATH} -framework CFNetwork" OBJCFLAGS="-x objective-c -fexceptions -gdwarf-2 -fobjc-abi-version=2 -fobjc-legacy-dispatch" diff --git a/submodules/linphone b/submodules/linphone index cb0fe631e..296b5671a 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit cb0fe631e18ad86f37739afeef5c2d6c60231421 +Subproject commit 296b5671ae42dbfbb28e1c30e8c79ecdbe60ebc5 From 8a50dae15ab1b7fe730daeab192e0da8d50acb44 Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Tue, 18 Sep 2012 15:04:47 +0200 Subject: [PATCH 25/28] fix build for xcode4.4 --- submodules/build/builder-iphone-os.mk | 3 +++ submodules/build/builders.d/libvpx.patch | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/submodules/build/builder-iphone-os.mk b/submodules/build/builder-iphone-os.mk index 48b54121a..35e345620 100644 --- a/submodules/build/builder-iphone-os.mk +++ b/submodules/build/builder-iphone-os.mk @@ -307,6 +307,9 @@ multi-arch: armv6_path= ; \ fi; \ armv7s_path=`echo $$archive | sed -e "s/armv7/armv7s/"` ;\ + if test ! -f "$$armv7s_path"; then \ + armv7s_path= ; \ + fi; \ destpath=`echo $$archive | sed -e "s/armv7-//"` ;\ if test -f "$$i386_path"; then \ echo "Mixing $$archive into $$destpath"; \ diff --git a/submodules/build/builders.d/libvpx.patch b/submodules/build/builders.d/libvpx.patch index 6d77453c3..d651ccfc8 100644 --- a/submodules/build/builders.d/libvpx.patch +++ b/submodules/build/builders.d/libvpx.patch @@ -1,5 +1,5 @@ diff --git a/build/make/configure.sh b/build/make/configure.sh -index 0426f92..d1f4760 100755 +index 0426f92..38fdcb2 100755 --- a/build/make/configure.sh +++ b/build/make/configure.sh @@ -624,6 +624,9 @@ process_common_toolchain() { @@ -27,7 +27,7 @@ index 0426f92..d1f4760 100755 CC=${TOOLCHAIN_PATH}/gcc AR=${TOOLCHAIN_PATH}/ar - LD=${TOOLCHAIN_PATH}/arm-apple-darwin10-llvm-gcc-4.2 -+ LD=${TOOLCHAIN_PATH}/ld ++ LD=${TOOLCHAIN_PATH}/gcc AS=${TOOLCHAIN_PATH}/as STRIP=${TOOLCHAIN_PATH}/strip NM=${TOOLCHAIN_PATH}/nm From 4accca8b3a4f6ae43268ba4d3e5e98a231021be7 Mon Sep 17 00:00:00 2001 From: Yann Diorcet Date: Tue, 18 Sep 2012 16:52:52 +0200 Subject: [PATCH 26/28] Add Image in chat --- Classes/ChatRoomTableViewController.h | 8 + Classes/ChatRoomTableViewController.m | 16 +- Classes/ChatRoomViewController.h | 7 +- Classes/ChatRoomViewController.m | 145 +++++++++++------ Classes/ImagePickerViewController.h | 12 +- Classes/ImagePickerViewController.m | 81 +++++++++- Classes/ImageSharing.h | 6 +- Classes/ImageSharing.m | 9 +- Classes/LinphoneManager.h | 3 + Classes/LinphoneManager.m | 10 +- Classes/LinphoneUI/UIChatRoomCell.h | 7 + Classes/LinphoneUI/UIChatRoomCell.m | 73 +++++++-- Classes/LinphoneUI/UIChatRoomCell.xib | 141 +++++++++++++--- Classes/LinphoneUI/UIContactDetailsHeader.m | 2 +- Classes/en.lproj/ChatRoomViewController.xib | 29 ++-- Classes/en.lproj/ImageViewController.xib | 3 +- Classes/fr.lproj/ChatRoomViewController.xib | 28 ++-- Classes/fr.lproj/ImageViewController.xib | 2 +- Resources/en.lproj/Localizable.strings | Bin 15680 -> 15502 bytes Resources/fr.lproj/Localizable.strings | Bin 16172 -> 16080 bytes linphone.ldb/Contents.plist | 153 ++++++++++-------- .../{15 => 16}/ChatRoomViewController.xib | 29 ++-- .../{3 => 4}/ImageViewController.xib | 3 +- .../Localizable/1/Localizable.strings | Bin 15680 -> 15502 bytes 24 files changed, 564 insertions(+), 203 deletions(-) rename linphone.ldb/Resources/Classes/ChatRoomViewController/{15 => 16}/ChatRoomViewController.xib (98%) rename linphone.ldb/Resources/Classes/ImageViewController/{3 => 4}/ImageViewController.xib (99%) diff --git a/Classes/ChatRoomTableViewController.h b/Classes/ChatRoomTableViewController.h index c29786f6b..aa91671ad 100644 --- a/Classes/ChatRoomTableViewController.h +++ b/Classes/ChatRoomTableViewController.h @@ -21,12 +21,20 @@ #import #import "ChatModel.h" +@protocol ChatRoomDelegate + +- (BOOL)chatRoomStartImageDownload:(NSURL*)url userInfo:(id)userInfo; +- (BOOL)chatRoomStartImageUpload:(UIImage*)image url:(NSURL*)url; + +@end + @interface ChatRoomTableViewController : UITableViewController { @private NSMutableArray *data; } @property (nonatomic, copy) NSString *remoteAddress; +@property (nonatomic, retain) id chatRoomDelegate; - (void)addChatEntry:(ChatModel*)chat; - (void)updateChatEntry:(ChatModel*)chat; diff --git a/Classes/ChatRoomTableViewController.m b/Classes/ChatRoomTableViewController.m index 608316be5..9dea07a78 100644 --- a/Classes/ChatRoomTableViewController.m +++ b/Classes/ChatRoomTableViewController.m @@ -21,15 +21,25 @@ #import "ChatRoomTableViewController.h" #import "UIChatRoomCell.h" #import "Utils.h" +#import "PhoneMainView.h" #import @implementation ChatRoomTableViewController @synthesize remoteAddress; +@synthesize chatRoomDelegate; +#pragma mark - Lifecycle Functions -#pragma mark - ViewController +- (void)dealloc { + [remoteAddress release]; + [chatRoomDelegate release]; + + [super dealloc]; +} + +#pragma mark - ViewController Functions - (void)viewDidLoad { [super viewDidLoad]; @@ -73,6 +83,7 @@ [self.tableView endUpdates]; [self scrollToLastUnread:true]; } + - (void)updateChatEntry:(ChatModel*)chat { if(data == nil) { [LinphoneLogger logc:LinphoneLoggerWarning format:"Cannot update entry: null data"]; @@ -86,6 +97,7 @@ [self.tableView reloadRowsAtIndexPaths:[NSArray arrayWithObject:[NSIndexPath indexPathForRow:index inSection:0]] withRowAnimation:FALSE];; //just reload return; } + - (void)scrollToLastUnread:(BOOL)animated { if(data == nil) { [LinphoneLogger logc:LinphoneLoggerWarning format:"Cannot add entry: null data"]; @@ -145,7 +157,7 @@ } [cell setChat:[data objectAtIndex:[indexPath row]]]; - + [cell setChatRoomDelegate:chatRoomDelegate]; return cell; } diff --git a/Classes/ChatRoomViewController.h b/Classes/ChatRoomViewController.h index 3abc96ce3..aeb721217 100644 --- a/Classes/ChatRoomViewController.h +++ b/Classes/ChatRoomViewController.h @@ -18,7 +18,6 @@ */ #import -#import #import "UIToggleButton.h" #import "UICompositeViewController.h" @@ -30,14 +29,11 @@ #include "linphonecore.h" -@interface ChatRoomViewController : UIViewController { - @private +@interface ChatRoomViewController : UIViewController { LinphoneChatRoom *chatRoom; ImageSharing *imageSharing; - ALAssetsLibrary *photoLibrary; } - @property (nonatomic, retain) IBOutlet ChatRoomTableViewController* tableController; @property (nonatomic, retain) IBOutlet UIToggleButton *editButton; @property (nonatomic, retain) IBOutlet HPGrowingTextView* messageField; @@ -50,6 +46,7 @@ @property (nonatomic, retain) IBOutlet UIView *messageView; @property (nonatomic, retain) IBOutlet UIImageView *messageBackgroundImage; @property (nonatomic, retain) IBOutlet UIImageView *footerBackgroundImage; +@property (nonatomic, retain) IBOutlet UIImageView *transferBackgroundImage; @property (nonatomic, retain) IBOutlet UITapGestureRecognizer *listTapGestureRecognizer; @property (nonatomic, copy) NSString *remoteAddress; diff --git a/Classes/ChatRoomViewController.m b/Classes/ChatRoomViewController.m index a8d863cee..4b7702131 100644 --- a/Classes/ChatRoomViewController.m +++ b/Classes/ChatRoomViewController.m @@ -22,7 +22,7 @@ #import "DTActionSheet.h" #import - +#import @implementation ChatRoomViewController @@ -39,6 +39,7 @@ @synthesize messageView; @synthesize messageBackgroundImage; @synthesize footerBackgroundImage; +@synthesize transferBackgroundImage; @synthesize listTapGestureRecognizer; @synthesize pictureButton; @synthesize imageTransferProgressBar; @@ -53,7 +54,6 @@ if (self != nil) { self->chatRoom = NULL; self->imageSharing = NULL; - self->photoLibrary = [[ALAssetsLibrary alloc] init]; } return self; } @@ -72,6 +72,7 @@ [messageView release]; [messageBackgroundImage release]; [footerBackgroundImage release]; + [transferBackgroundImage release]; [listTapGestureRecognizer release]; @@ -80,8 +81,6 @@ [imageTransferProgressBar release]; [cancelTransferButton release]; - [photoLibrary release]; - [super dealloc]; } @@ -110,6 +109,7 @@ static UICompositeViewDescription *compositeDescription = nil; - (void)viewDidLoad { [super viewDidLoad]; + [tableController setChatRoomDelegate:self]; // Set selected+over background: IB lack ! [editButton setImage:[UIImage imageNamed:@"chat_ok_over.png"] @@ -122,6 +122,7 @@ static UICompositeViewDescription *compositeDescription = nil; messageField.contentInset = UIEdgeInsetsZero; messageField.backgroundColor = [UIColor clearColor]; [sendButton setEnabled:FALSE]; + [listTapGestureRecognizer setEnabled:FALSE]; } @@ -150,9 +151,11 @@ static UICompositeViewDescription *compositeDescription = nil; [messageBackgroundImage setImage:[TUNinePatchCache imageOfSize:[messageBackgroundImage bounds].size forNinePatchNamed:@"chat_field"]]; - [footerBackgroundImage setImage:[TUNinePatchCache imageOfSize:[footerBackgroundImage bounds].size forNinePatchNamed:@"chat_background"]]; + [transferBackgroundImage setImage:[TUNinePatchCache imageOfSize:[transferBackgroundImage bounds].size + forNinePatchNamed:@"chat_background"]]; + BOOL fileSharingEnabled = [[LinphoneManager instance] lpConfigStringForKey:@"file_upload_url_preference"] != NULL && [[[LinphoneManager instance] lpConfigStringForKey:@"file_upload_url_preference"] length]>0; @@ -273,7 +276,7 @@ static void message_status(LinphoneChatMessage* msg,LinphoneChatMessageState sta [thiz.tableController updateChatEntry:chat]; } -- (BOOL)sendMessage:(NSString *)message withExterlBodyUrl:(NSString*) url{ +- (BOOL)sendMessage:(NSString *)message withExterlBodyUrl:(NSURL*)externalUrl withInternalUrl:(NSURL*)internalUrl { if(![LinphoneManager isLcReady]) { [LinphoneLogger logc:LinphoneLoggerWarning format:"Cannot send message: Linphone core not ready"]; return FALSE; @@ -290,7 +293,11 @@ static void message_status(LinphoneChatMessage* msg,LinphoneChatMessageState sta ChatModel *chat = [[ChatModel alloc] init]; [chat setRemoteContact:remoteAddress]; [chat setLocalContact:@""]; - [chat setMessage:message]; + if(internalUrl == nil) { + [chat setMessage:message]; + } else { + [chat setMessage:[internalUrl absoluteString]]; + } [chat setDirection:[NSNumber numberWithInt:0]]; [chat setTime:[NSDate date]]; [chat setRead:[NSNumber numberWithInt:1]]; @@ -301,9 +308,9 @@ static void message_status(LinphoneChatMessage* msg,LinphoneChatMessageState sta LinphoneChatMessage* msg = linphone_chat_room_create_message(chatRoom, [message UTF8String]); linphone_chat_message_set_user_data(msg, chat); - if (url) { - linphone_chat_message_set_external_body_url(msg, [url UTF8String]); - } + if(externalUrl) { + linphone_chat_message_set_external_body_url(msg, [[externalUrl absoluteString] UTF8String]); + } linphone_chat_room_send_message2(chatRoom, msg, message_status, self); return TRUE; } @@ -329,19 +336,6 @@ static void message_status(LinphoneChatMessage* msg,LinphoneChatMessageState sta } ms_free(fromStr); } - - if ([[notif userInfo] objectForKey:@"external_body_url"]) { - 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:^(){ - imageSharing = [ImageSharing imageSharingDownload:[NSURL URLWithString:pendingFileUrl] delegate:self]; - [footerView setHidden:TRUE]; - [transferView setHidden:FALSE]; - }]; - [sheet addCancelButtonWithTitle:NSLocalizedString(@"Ignore",nil)]; - [sheet showInView:[PhoneMainView instance].view]; - } } else { [LinphoneLogger logc:LinphoneLoggerWarning format:"Invalid textReceivedEvent"]; } @@ -354,8 +348,13 @@ static void message_status(LinphoneChatMessage* msg,LinphoneChatMessageState sta if(editButton.selected) { [tableController setEditing:FALSE animated:TRUE]; [editButton setOff]; - [listTapGestureRecognizer setEnabled:TRUE]; } + [listTapGestureRecognizer setEnabled:TRUE]; + return TRUE; +} + +- (BOOL)growingTextViewShouldEndEditing:(HPGrowingTextView *)growingTextView { + [listTapGestureRecognizer setEnabled:FALSE]; return TRUE; } @@ -391,13 +390,12 @@ static void message_status(LinphoneChatMessage* msg,LinphoneChatMessageState sta } - (IBAction)onEditClick:(id)event { - [listTapGestureRecognizer setEnabled:[tableController isEditing]]; [tableController setEditing:![tableController isEditing] animated:TRUE]; [messageField resignFirstResponder]; } - (IBAction)onSendClick:(id)event { - if([self sendMessage:[messageField text] withExterlBodyUrl:nil]) { + if([self sendMessage:[messageField text] withExterlBodyUrl:nil withInternalUrl:nil]) { [messageField setText:@""]; [self onMessageChange:nil]; } @@ -428,7 +426,7 @@ static void message_status(LinphoneChatMessage* msg,LinphoneChatMessageState sta // Displays a control that allows the user to choose picture or // movie capture, if both are available: - controller.mediaTypes = [UIImagePickerController availableMediaTypesForSourceType:type]; + controller.mediaTypes = [NSArray arrayWithObject:(NSString *)kUTTypeImage]; // Hides the controls for moving & scaling pictures, or for // trimming movies. To instead show the controls, use YES. @@ -445,6 +443,30 @@ static void message_status(LinphoneChatMessage* msg,LinphoneChatMessageState sta } +#pragma mark ChatRoomDelegate + +- (BOOL)chatRoomStartImageDownload:(NSURL*)url userInfo:(id)userInfo { + if(imageSharing == nil) { + imageSharing = [ImageSharing imageSharingDownload:url delegate:self userInfo:userInfo]; + [footerView setHidden:TRUE]; + [transferView setHidden:FALSE]; + return TRUE; + } + return FALSE; +} + +- (BOOL)chatRoomStartImageUpload:(UIImage*)image url:(NSURL*)url{ + if(imageSharing == nil) { + NSString *urlString = [[LinphoneManager instance] lpConfigStringForKey:@"file_upload_url_preference"]; + imageSharing = [ImageSharing imageSharingUpload:[NSURL URLWithString:urlString] image:image delegate:self userInfo:url]; + [footerView setHidden:TRUE]; + [transferView setHidden:FALSE]; + return TRUE; + } + return FALSE; +} + + #pragma mark ImageSharingDelegate - (void)imageSharingProgress:(ImageSharing*)aimageSharing progress:(float)progress { @@ -486,7 +508,9 @@ static void message_status(LinphoneChatMessage* msg,LinphoneChatMessageState sta } - (void)imageSharingUploadDone:(ImageSharing*)aimageSharing url:(NSURL*)url{ - [self sendMessage:NSLocalizedString(@"Image sent", nil) withExterlBodyUrl:[url absoluteString]]; + NSURL *imageURL = [aimageSharing userInfo]; + + [self sendMessage:nil withExterlBodyUrl:url withInternalUrl:imageURL]; [footerView setHidden:FALSE]; [transferView setHidden:TRUE]; @@ -497,30 +521,59 @@ static void message_status(LinphoneChatMessage* msg,LinphoneChatMessageState sta [footerView setHidden:FALSE]; [transferView setHidden:TRUE]; - [photoLibrary 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]; - } - }]; + ChatModel *chat = (ChatModel *)[imageSharing userInfo]; + [[LinphoneManager instance].photoLibrary writeImageToSavedPhotosAlbum:image.CGImage + metadata:nil + completionBlock:^(NSURL *assetURL, NSError *error){ + if (error) { + [LinphoneLogger log:LinphoneLoggerError format:@"Cannot save image data downloaded [%@]", [error localizedDescription]]; + + UIAlertView* errorAlert = [UIAlertView alloc]; + [errorAlert initWithTitle:NSLocalizedString(@"Transfer error", nil) + message:NSLocalizedString(@"Cannot write image to photo library", nil) + delegate:nil + cancelButtonTitle:NSLocalizedString(@"Ok",nil) + otherButtonTitles:nil ,nil]; + [errorAlert show]; + [errorAlert release]; + return; + } + [LinphoneLogger log:LinphoneLoggerLog format:@"Image saved to [%@]", [assetURL absoluteString]]; + [chat setMessage:[assetURL absoluteString]]; + [chat update]; + [tableController updateChatEntry:chat]; + }]; imageSharing = NULL; } #pragma mark ImagePickerDelegate -- (void)imagePickerDelegateImage:(UIImage*)image { - 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]; +- (void)imagePickerDelegateImage:(UIImage*)image info:(NSDictionary *)info { + NSURL *url = [info valueForKey:UIImagePickerControllerReferenceURL]; + if(url != nil) { + [self chatRoomStartImageUpload:image url:url]; + } else { + [[LinphoneManager instance].photoLibrary writeImageToSavedPhotosAlbum:image.CGImage + metadata:nil + completionBlock:^(NSURL *assetURL, NSError *error){ + if (error) { + [LinphoneLogger log:LinphoneLoggerError format:@"Cannot save image data downloaded [%@]", [error localizedDescription]]; + + UIAlertView* errorAlert = [UIAlertView alloc]; + [errorAlert initWithTitle:NSLocalizedString(@"Transfer error", nil) + message:NSLocalizedString(@"Cannot write image to photo library", nil) + delegate:nil + cancelButtonTitle:NSLocalizedString(@"Ok",nil) + otherButtonTitles:nil ,nil]; + [errorAlert show]; + [errorAlert release]; + return; + } + [LinphoneLogger log:LinphoneLoggerLog format:@"Image saved to [%@]", [assetURL absoluteString]]; + [self chatRoomStartImageUpload:image url:assetURL]; + }]; + } } diff --git a/Classes/ImagePickerViewController.h b/Classes/ImagePickerViewController.h index 4acdebf21..fd15af4bc 100644 --- a/Classes/ImagePickerViewController.h +++ b/Classes/ImagePickerViewController.h @@ -21,14 +21,20 @@ @protocol ImagePickerDelegate -- (void)imagePickerDelegateImage:(UIImage*)image; +- (void)imagePickerDelegateImage:(UIImage*)image info:(NSDictionary *)info; @end -@interface ImagePickerViewController : UIImagePickerController { +@interface ImagePickerViewController : UIViewController { + @private + UIImagePickerController *pickerController; + UIPopoverController *popoverController; } -@property (nonatomic, retain) id imagePickerDelegate; +@property(nonatomic, retain) id imagePickerDelegate; +@property(nonatomic) UIImagePickerControllerSourceType sourceType; +@property(nonatomic,copy) NSArray *mediaTypes; +@property(nonatomic) BOOL allowsEditing; + (void)promptSelectSource:(void (^)(UIImagePickerControllerSourceType))block; diff --git a/Classes/ImagePickerViewController.m b/Classes/ImagePickerViewController.m index 46be9914b..c31e48906 100644 --- a/Classes/ImagePickerViewController.m +++ b/Classes/ImagePickerViewController.m @@ -24,6 +24,30 @@ @implementation ImagePickerViewController @synthesize imagePickerDelegate; +@synthesize sourceType; +@synthesize mediaTypes; +@synthesize allowsEditing; + + +#pragma mark - Lifecycle Functions + +- (id)init { + self = [super init]; + if (self != nil) { + pickerController = [[UIImagePickerController alloc] init]; + if([LinphoneManager runningOnIpad]) { + popoverController = [[UIPopoverController alloc] initWithContentViewController:pickerController]; + } + } + return self; +} + +- (void)dealloc { + [pickerController release]; + [popoverController release]; + + [super dealloc]; +} #pragma mark - UICompositeViewDelegate Functions @@ -50,7 +74,55 @@ static UICompositeViewDescription *compositeDescription = nil; - (void)viewDidLoad { [super viewDidLoad]; - [self setDelegate:self]; + + [self.view setAutoresizingMask: UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight]; + if(popoverController == nil) { + [pickerController.view setFrame:[self.view bounds]]; + [self.view addSubview:[pickerController view]]; + } else { + [popoverController setDelegate:self]; + } + [pickerController setDelegate:self]; +} + +- (void)viewDidAppear:(BOOL)animated { + [super viewDidAppear:animated]; + if(popoverController != nil) { + [popoverController presentPopoverFromRect:CGRectZero inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:FALSE]; + } +} + +- (void)viewWillDisappear:(BOOL)animated { + [super viewWillDisappear:animated]; + if(popoverController != nil) { + [popoverController dismissPopoverAnimated: NO]; + } +} + +#pragma mark - Property Functions + +- (BOOL)allowsEditing { + return pickerController.allowsEditing; +} + +- (void)setAllowsEditing:(BOOL)aallowsEditing { + pickerController.allowsEditing = aallowsEditing; +} + +- (UIImagePickerControllerSourceType)sourceType { + return pickerController.sourceType; +} + +- (void)setSourceType:(UIImagePickerControllerSourceType)asourceType { + pickerController.sourceType = asourceType; +} + +- (NSArray *)mediaTypes { + return pickerController.mediaTypes; +} + +- (void)setMediaTypes:(NSArray *)amediaTypes { + pickerController.mediaTypes = amediaTypes; } @@ -88,7 +160,7 @@ static UICompositeViewDescription *compositeDescription = nil; image = [info objectForKey:UIImagePickerControllerOriginalImage]; } if(image != nil && imagePickerDelegate != nil) { - [imagePickerDelegate imagePickerDelegateImage:image]; + [imagePickerDelegate imagePickerDelegateImage:image info:info]; } [self dismiss]; } @@ -97,4 +169,9 @@ static UICompositeViewDescription *compositeDescription = nil; [self dismiss]; } +- (BOOL)popoverControllerShouldDismissPopover:(UIPopoverController *)apopoverController { + [self dismiss]; + return TRUE; +} + @end diff --git a/Classes/ImageSharing.h b/Classes/ImageSharing.h index 13cf22fc0..5949cc8a6 100644 --- a/Classes/ImageSharing.h +++ b/Classes/ImageSharing.h @@ -38,11 +38,13 @@ int statusCode; } -+ (id)imageSharingUpload:(NSURL*)url image:(UIImage*)image delegate:(id)delegate; -+ (id)imageSharingDownload:(NSURL*)url delegate:(id)delegate; ++ (id)imageSharingUpload:(NSURL*)url image:(UIImage*)image delegate:(id)delegate userInfo:(id)userInfo; ++ (id)imageSharingDownload:(NSURL*)url delegate:(id)delegate userInfo:(id)userInfo; - (void)cancel; +@property (nonatomic, retain) id userInfo; + @property (nonatomic, readonly) BOOL upload; @property (nonatomic, readonly) NSMutableData* data; @property (nonatomic, readonly) NSURLConnection* connection; diff --git a/Classes/ImageSharing.m b/Classes/ImageSharing.m index b0aee4b06..403addd20 100644 --- a/Classes/ImageSharing.m +++ b/Classes/ImageSharing.m @@ -26,13 +26,14 @@ @synthesize connection; @synthesize data; @synthesize upload; - +@synthesize userInfo; #pragma mark - Lifecycle Functions -+ (id)imageSharingUpload:(NSURL*)url image:(UIImage*)image delegate:(id)delegate { ++ (id)imageSharingUpload:(NSURL*)url image:(UIImage*)image delegate:(id)delegate userInfo:(id)auserInfo{ ImageSharing *imgs = [[ImageSharing alloc] init]; if(imgs != nil) { + imgs.userInfo = auserInfo; imgs->upload = TRUE; imgs->delegate = [delegate retain]; imgs->data = [[NSMutableData alloc] init]; @@ -44,9 +45,10 @@ return imgs; } -+ (id)imageSharingDownload:(NSURL*)url delegate:(id)delegate { ++ (id)imageSharingDownload:(NSURL*)url delegate:(id)delegate userInfo:(id)auserInfo{ ImageSharing *imgs = [[ImageSharing alloc] init]; if(imgs != nil) { + imgs.userInfo = auserInfo; imgs->upload = FALSE; imgs->delegate = [delegate retain]; imgs->data = [[NSMutableData alloc] init]; @@ -62,6 +64,7 @@ [connection release]; [data release]; [delegate release]; + [userInfo release]; [super dealloc]; } diff --git a/Classes/LinphoneManager.h b/Classes/LinphoneManager.h index 799d4bba0..7ba9318ce 100644 --- a/Classes/LinphoneManager.h +++ b/Classes/LinphoneManager.h @@ -21,6 +21,8 @@ #import #import #import +#import + #import #import "IASKSettingsReader.h" @@ -140,6 +142,7 @@ typedef struct _LinphoneManagerSounds { @property (readonly) LinphoneManagerSounds sounds; @property (readonly) NSMutableArray *logs; @property (nonatomic, assign) BOOL speakerEnabled; +@property (readonly) ALAssetsLibrary *photoLibrary; @end diff --git a/Classes/LinphoneManager.m b/Classes/LinphoneManager.m index db073f120..f376f9956 100644 --- a/Classes/LinphoneManager.m +++ b/Classes/LinphoneManager.m @@ -87,6 +87,7 @@ extern void libmsbcg729_init(); @synthesize sounds; @synthesize logs; @synthesize speakerEnabled; +@synthesize photoLibrary; struct codec_name_pref_table{ const char *name; @@ -218,6 +219,7 @@ struct codec_name_pref_table codec_pref_table[]={ [self openDatabase]; [self copyDefaultSettings]; lastRemoteNotificationTime=0; + photoLibrary = [[ALAssetsLibrary alloc] init]; } return self; } @@ -239,6 +241,7 @@ struct codec_name_pref_table codec_pref_table[]={ [LinphoneLogger logc:LinphoneLoggerError format:"cannot un register route change handler [%ld]", lStatus]; } + [photoLibrary release]; [super dealloc]; } @@ -433,7 +436,7 @@ static void linphone_iphone_registration_state(LinphoneCore *lc, LinphoneProxyCo [chat setLocalContact:@""]; [chat setRemoteContact:[NSString stringWithUTF8String:fromStr]]; if (linphone_chat_message_get_external_body_url(msg)) { - [chat setMessage:NSLocalizedString(@"Incoming file",nil)]; + [chat setMessage:[NSString stringWithUTF8String:linphone_chat_message_get_external_body_url(msg)]]; } else { [chat setMessage:[NSString stringWithUTF8String:linphone_chat_message_get_text(msg)]]; } @@ -443,17 +446,12 @@ static void linphone_iphone_registration_state(LinphoneCore *lc, LinphoneProxyCo [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: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]; diff --git a/Classes/LinphoneUI/UIChatRoomCell.h b/Classes/LinphoneUI/UIChatRoomCell.h index 3350c8718..94a6303b1 100644 --- a/Classes/LinphoneUI/UIChatRoomCell.h +++ b/Classes/LinphoneUI/UIChatRoomCell.h @@ -20,6 +20,8 @@ #import #import "ChatModel.h" +#import "ChatRoomTableViewController.h" + @interface UIChatRoomCell : UITableViewCell { } @@ -33,10 +35,15 @@ @property (nonatomic, retain) IBOutlet UIButton *deleteButton; @property (nonatomic, retain) IBOutlet UILabel *dateLabel; @property (nonatomic, retain) IBOutlet UIImageView* statusImage; +@property (nonatomic, retain) IBOutlet UIButton* downloadButton; + - (id)initWithIdentifier:(NSString*)identifier; + (CGFloat)height:(ChatModel*)chat width:(int)width; +@property (nonatomic, retain) id chatRoomDelegate; - (IBAction)onDeleteClick:(id)event; +- (IBAction)onDownloadClick:(id)event; +- (IBAction)onImageClick:(id)event; @end diff --git a/Classes/LinphoneUI/UIChatRoomCell.m b/Classes/LinphoneUI/UIChatRoomCell.m index 0ccfcce18..22862ed2e 100644 --- a/Classes/LinphoneUI/UIChatRoomCell.m +++ b/Classes/LinphoneUI/UIChatRoomCell.m @@ -19,7 +19,11 @@ #import "UIChatRoomCell.h" #import "Utils.h" +#import "LinphoneManager.h" +#import "PhoneMainView.h" +#import +#import #import #include "linphonecore.h" @@ -34,6 +38,8 @@ @synthesize dateLabel; @synthesize chat; @synthesize statusImage; +@synthesize downloadButton; +@synthesize chatRoomDelegate; static const CGFloat CELL_MIN_HEIGHT = 40.0f; static const CGFloat CELL_MIN_WIDTH = 150.0f; @@ -58,6 +64,7 @@ static UIFont *CELL_FONT = nil; } - (void)dealloc { + [chatRoomDelegate release]; [backgroundImage release]; [innerView release]; [bubbleView release]; @@ -67,6 +74,7 @@ static UIFont *CELL_FONT = nil; [dateLabel release]; [statusImage release]; [chat release]; + [downloadButton release]; [super dealloc]; } @@ -92,15 +100,39 @@ static UIFont *CELL_FONT = nil; [LinphoneLogger logc:LinphoneLoggerWarning format:"Cannot update chat room cell: null chat"]; return; } - if(true/*Change when image will be supported */) { + + if([UIChatRoomCell isExternalImage:[chat message]]) { + [messageLabel setHidden:TRUE]; + + [messageImageView setImage:nil]; + [messageImageView setHidden:TRUE]; + + [downloadButton setHidden:FALSE]; + } else if([UIChatRoomCell isInternalImage:[chat message]]) { + [messageLabel setHidden:TRUE]; + + [[LinphoneManager instance].photoLibrary assetForURL:[NSURL URLWithString:[chat message]] resultBlock:^(ALAsset *asset) { + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, (unsigned long)NULL), ^(void) { + ALAssetRepresentation* representation = [asset defaultRepresentation]; + UIImage *image = [UIImage imageWithCGImage:[representation fullResolutionImage]]; + dispatch_async(dispatch_get_main_queue(), ^{ + [messageImageView setImage:image]; + }); + }); + } failureBlock:^(NSError *error) { + [LinphoneLogger log:LinphoneLoggerError format:@"Can't read image"]; + }]; + + [messageImageView setHidden:FALSE]; + [downloadButton setHidden:TRUE]; + } else { [messageLabel setHidden:FALSE]; [messageLabel setText:[chat message]]; + [messageImageView setImage:nil]; [messageImageView setHidden:TRUE]; - } else { - [messageLabel setHidden:TRUE]; - [messageImageView setHidden:FALSE]; + [downloadButton setHidden:TRUE]; } // Date @@ -112,16 +144,16 @@ static UIFont *CELL_FONT = nil; [dateLabel setText:[dateFormatter stringFromDate:[chat time]]]; [dateFormatter release]; if ([chat.state intValue] == LinphoneChatMessageStateInProgress) { - [statusImage setImage:[UIImage imageNamed:@"chat_message_inprogress.png"] ]; - statusImage.hidden=FALSE; + [statusImage setImage:[UIImage imageNamed:@"chat_message_inprogress.png"]]; + statusImage.hidden = FALSE; } else if ([chat.state intValue] == LinphoneChatMessageStateDelivered) { - [statusImage setImage:[UIImage imageNamed:@"chat_message_delivered.png"] ]; - statusImage.hidden=FALSE; + [statusImage setImage:[UIImage imageNamed:@"chat_message_delivered.png"]]; + statusImage.hidden = FALSE; } else if ([chat.state intValue] == LinphoneChatMessageStateNotDelivered) { [statusImage setImage:[UIImage imageNamed:@"chat_message_not_delivered.png"]]; - statusImage.hidden=FALSE; + statusImage.hidden = FALSE; } else { - statusImage.hidden=TRUE; + statusImage.hidden = TRUE; } } @@ -144,9 +176,17 @@ static UIFont *CELL_FONT = nil; } } ++ (BOOL)isExternalImage:(NSString *)message { + return [message hasPrefix:@"http:"] || [message hasPrefix:@"https:"]; +} + ++ (BOOL)isInternalImage:(NSString *)message { + return [message hasPrefix:@"assets-library:"]; +} + + (CGSize)viewSize:(ChatModel*)chat width:(int)width { CGSize messageSize; - if(true/*Change when image will be supported */) { + if(!([UIChatRoomCell isExternalImage:[chat message]] || [UIChatRoomCell isInternalImage:[chat message]])) { if(CELL_FONT == nil) { CELL_FONT = [UIFont systemFontOfSize:CELL_FONT_SIZE]; } @@ -218,4 +258,15 @@ static UIFont *CELL_FONT = nil; } } +- (IBAction)onDownloadClick:(id)event { + [chatRoomDelegate chatRoomStartImageDownload:[NSURL URLWithString:chat.message] userInfo:chat]; +} + +- (IBAction)onImageClick:(id)event { + ImageViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:[ImageViewController compositeViewDescription] push:TRUE], ImageViewController); + if(controller != nil) { + [controller setImage:messageImageView.image]; + } +} + @end diff --git a/Classes/LinphoneUI/UIChatRoomCell.xib b/Classes/LinphoneUI/UIChatRoomCell.xib index 7710f22af..1faf62b94 100644 --- a/Classes/LinphoneUI/UIChatRoomCell.xib +++ b/Classes/LinphoneUI/UIChatRoomCell.xib @@ -15,6 +15,7 @@ IBUIButton IBUIImageView IBUILabel + IBUITapGestureRecognizer IBUIView @@ -69,7 +70,7 @@ _NS:9 1 - NO + IBCocoaTouchFramework @@ -78,7 +79,7 @@ {294, 104} - + _NS:9 3 @@ -109,6 +110,41 @@ NO + + + 301 + {{81, 33}, {132, 37}} + + + + _NS:9 + NO + IBCocoaTouchFramework + 0 + 0 + Download image + + 3 + MQA + + + 1 + MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + + + 3 + MC41AA + + + 2 + 15 + + + Helvetica-Bold + 15 + 16 + + {294, 104} @@ -117,7 +153,6 @@ _NS:9 YES - NO IBCocoaTouchFramework @@ -135,10 +170,7 @@ NO IBCocoaTouchFramework 09/09/2009 at 09:09 - - 3 - MC41AA - + 0 8 @@ -194,15 +226,8 @@ NSImage list_delete_default.png - - 2 - 15 - - - Helvetica-Bold - 15 - 16 - + + {{13, 13}, {294, 114}} @@ -245,6 +270,7 @@ IBCocoaTouchFramework + @@ -328,6 +354,14 @@ 31 + + + downloadButton + + + + 34 + onDeleteClick: @@ -337,12 +371,39 @@ 32 + + + gestureRecognizers + + + NSArray + YES + + 41 + + + + onDownloadClick: + + + 7 + + 39 + + + + onImageClick: + + + + 42 + 0 - + @@ -421,6 +482,7 @@ + messageView @@ -428,6 +490,7 @@ 28 + messageImageView @@ -437,6 +500,17 @@ messageLabel + + 33 + + + downloadButton + + + 40 + + + @@ -455,6 +529,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 com.apple.InterfaceBuilder.IBCocoaTouchPlugin @@ -462,29 +538,38 @@ - 32 + 42 UIChatRoomCell UITableViewCell - - onDeleteClick: - id - - - onDeleteClick: - + + id + id + id + + + onDeleteClick: id - + + onDownloadClick: + id + + + onImageClick: + id + + UIImageView UIView UILabel UIButton + UIButton UIView UIImageView UILabel @@ -507,6 +592,10 @@ deleteButton UIButton + + downloadButton + UIButton + innerView UIView diff --git a/Classes/LinphoneUI/UIContactDetailsHeader.m b/Classes/LinphoneUI/UIContactDetailsHeader.m index 3a2544958..96a1a95e9 100644 --- a/Classes/LinphoneUI/UIContactDetailsHeader.m +++ b/Classes/LinphoneUI/UIContactDetailsHeader.m @@ -264,7 +264,7 @@ #pragma mark - ContactDetailsImagePickerDelegate Functions -- (void)imagePickerDelegateImage:(UIImage*)image { +- (void)imagePickerDelegateImage:(UIImage*)image info:(NSDictionary *)info{ NSError* error = NULL; if(!ABPersonRemoveImageData(contact, (CFErrorRef*)error)) { [LinphoneLogger log:LinphoneLoggerLog format:@"Can't add entry: %@", [error localizedDescription]]; diff --git a/Classes/en.lproj/ChatRoomViewController.xib b/Classes/en.lproj/ChatRoomViewController.xib index dfb378fa5..1972001d5 100644 --- a/Classes/en.lproj/ChatRoomViewController.xib +++ b/Classes/en.lproj/ChatRoomViewController.xib @@ -156,7 +156,7 @@ - -2147483356 + -2147483382 @@ -166,10 +166,7 @@ _NS:9 - - 1 - MSAwLjI4MzE1ODM3MjYgMC4wNTY3ODY4OTE2MQA - + NO IBCocoaTouchFramework @@ -179,7 +176,7 @@ - 292 + 297 {{250, 0}, {70, 59}} @@ -214,7 +211,7 @@ - 292 + 298 {{20, 25}, {213, 9}} @@ -274,6 +271,7 @@ {{250, 0}, {70, 59}} + _NS:9 NO @@ -639,6 +637,14 @@ 86 + + + transferBackgroundImage + + + + 88 + dataSource @@ -930,7 +936,7 @@ 83 - footerBackgroundImage + transfertBackgroundImage @@ -976,7 +982,7 @@ - 87 + 88 @@ -1047,6 +1053,7 @@ UIButton UIButton ChatRoomTableViewController + UIImageView UIView @@ -1114,6 +1121,10 @@ tableController ChatRoomTableViewController + + transferBackgroundImage + UIImageView + transferView UIView diff --git a/Classes/en.lproj/ImageViewController.xib b/Classes/en.lproj/ImageViewController.xib index 0e9bb3507..7e003d3c6 100644 --- a/Classes/en.lproj/ImageViewController.xib +++ b/Classes/en.lproj/ImageViewController.xib @@ -42,7 +42,6 @@ {{0, 44}, {320, 416}} - _NS:9 3 @@ -58,7 +57,7 @@ - 292 + 290 {320, 44} diff --git a/Classes/fr.lproj/ChatRoomViewController.xib b/Classes/fr.lproj/ChatRoomViewController.xib index effff9788..a07b5d6da 100644 --- a/Classes/fr.lproj/ChatRoomViewController.xib +++ b/Classes/fr.lproj/ChatRoomViewController.xib @@ -151,7 +151,7 @@ - -2147483356 + -2147483382 @@ -160,10 +160,7 @@ _NS:9 - - 1 - MSAwLjI4MzE1ODM3MjYgMC4wNTY3ODY4OTE2MQA - + NO IBCocoaTouchFramework @@ -173,7 +170,7 @@ - 292 + 297 {{250, 0}, {70, 59}} @@ -207,7 +204,7 @@ - 292 + 298 {{20, 25}, {213, 9}} @@ -615,6 +612,14 @@ 86 + + + transferBackgroundImage + + + + 88 + dataSource @@ -906,7 +911,7 @@ 83 - footerBackgroundImage + transfertBackgroundImage @@ -952,7 +957,7 @@ - 87 + 88 @@ -1023,6 +1028,7 @@ UIButton UIButton ChatRoomTableViewController + UIImageView UIView @@ -1090,6 +1096,10 @@ tableController ChatRoomTableViewController + + transferBackgroundImage + UIImageView + transferView UIView diff --git a/Classes/fr.lproj/ImageViewController.xib b/Classes/fr.lproj/ImageViewController.xib index 2cd6fe824..071b3cda5 100644 --- a/Classes/fr.lproj/ImageViewController.xib +++ b/Classes/fr.lproj/ImageViewController.xib @@ -56,7 +56,7 @@ - 292 + 290 {320, 44} diff --git a/Resources/en.lproj/Localizable.strings b/Resources/en.lproj/Localizable.strings index 77e98c0aebfadcfe5429948995256911fe4b7664..d1ab447f8b2aa74569ea31a4e87ceb1964227673 100644 GIT binary patch delta 112 zcmX?5)mORUDgWfv+&t3d3`Go?3?&Sy3<^Lxmm!fM9n3Ca$e(;hPF>R(D3S++`9L)a h4ER;cPxh1#n_Mfvv-v&$D!$E&o9v delta 124 zcmeCHJW#daDgWeLL9Wer1y=D*j+Wz_{9lekR)L|Ip@boyp@<=sA%#H!%vNBi1d5b0 s6iwz4P@lY7Mu-TNF#@HVo8?2;CkqNFF$PRd5Gb51ugSOhvD#`;0OrRc$p8QV diff --git a/Resources/fr.lproj/Localizable.strings b/Resources/fr.lproj/Localizable.strings index 4afcd5a69212f0f77d901698fe28ad2f97fa0ba2..065a3917454298f960d0283f0304588d3bee423a 100644 GIT binary patch delta 126 zcmZ2eccFH}CV|NwJUsH{3`Go?3?&Sy3<^Lxmm!fM9n3Ca$OnoPOt#lhp8SSaf>C|) zMuJp+iSRAQOr=3u^2a0|1s-9D@J= diff --git a/linphone.ldb/Contents.plist b/linphone.ldb/Contents.plist index fe6bc31b8..6a88a91eb 100644 --- a/linphone.ldb/Contents.plist +++ b/linphone.ldb/Contents.plist @@ -212,17 +212,17 @@ backup - 15 + 16 class BLWrapperHandle name - Classes/ChatRoomViewController/15/ChatRoomViewController.xib + Classes/ChatRoomViewController/16/ChatRoomViewController.xib change date - 2012-09-14T14:45:49Z + 2012-09-18T13:03:28Z changed values class @@ -232,7 +232,7 @@ flags 0 hash - 1f8683826a86cb2ad7e55cc5c9dcafaf + fb9acb898a88e8d219dfd663e9b8eb19 name ChatRoomViewController.xib @@ -568,9 +568,9 @@ versions en - 15 + 16 fr - 15 + 16 @@ -4281,17 +4281,17 @@ backup - 3 + 4 class BLWrapperHandle name - Classes/ImageViewController/3/ImageViewController.xib + Classes/ImageViewController/4/ImageViewController.xib change date - 2012-09-14T13:00:17Z + 2012-09-18T12:55:28Z changed values class @@ -4301,7 +4301,7 @@ flags 0 hash - 724a8c5069c0fbde9b1e56ef37a42cba + cf8736251f03474edd9a8c46b942ae63 name ImageViewController.xib @@ -4340,9 +4340,9 @@ versions en - 3 + 4 fr - 3 + 4 @@ -7354,7 +7354,7 @@ change date - 2012-09-14T11:57:58Z + 2012-09-18T14:20:34Z changed values class @@ -7364,7 +7364,7 @@ flags 0 hash - dcecc0eedf9132813ef8a938d07d7917 + 9801969515d6fafb3f05d8b036f9e80d name Localizable.strings @@ -7898,6 +7898,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 + Cannot write image to photo library + localizations + + en + Cannot write image to photo library + fr + Impossible d'enregistrer l'image dans l'album photo + + snapshots + + change date 2001-01-01T00:00:00Z @@ -8373,31 +8398,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 - 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 @@ -8721,31 +8721,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 - Photo library - localizations - - en - Photo library - fr - Photos - - snapshots - - change date 2001-01-01T00:00:00Z @@ -9661,6 +9636,56 @@ 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 + 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 + changed values + + class + BLStringKeyObject + comment + No comment provided by engineer. + errors + + flags + 0 + key + Photo library + localizations + + en + Photo library + fr + Photos + + snapshots + + plist file diff --git a/linphone.ldb/Resources/Classes/ChatRoomViewController/15/ChatRoomViewController.xib b/linphone.ldb/Resources/Classes/ChatRoomViewController/16/ChatRoomViewController.xib similarity index 98% rename from linphone.ldb/Resources/Classes/ChatRoomViewController/15/ChatRoomViewController.xib rename to linphone.ldb/Resources/Classes/ChatRoomViewController/16/ChatRoomViewController.xib index dfb378fa5..1972001d5 100644 --- a/linphone.ldb/Resources/Classes/ChatRoomViewController/15/ChatRoomViewController.xib +++ b/linphone.ldb/Resources/Classes/ChatRoomViewController/16/ChatRoomViewController.xib @@ -156,7 +156,7 @@ - -2147483356 + -2147483382 @@ -166,10 +166,7 @@ _NS:9 - - 1 - MSAwLjI4MzE1ODM3MjYgMC4wNTY3ODY4OTE2MQA - + NO IBCocoaTouchFramework @@ -179,7 +176,7 @@ - 292 + 297 {{250, 0}, {70, 59}} @@ -214,7 +211,7 @@ - 292 + 298 {{20, 25}, {213, 9}} @@ -274,6 +271,7 @@ {{250, 0}, {70, 59}} + _NS:9 NO @@ -639,6 +637,14 @@ 86 + + + transferBackgroundImage + + + + 88 + dataSource @@ -930,7 +936,7 @@ 83 - footerBackgroundImage + transfertBackgroundImage @@ -976,7 +982,7 @@ - 87 + 88 @@ -1047,6 +1053,7 @@ UIButton UIButton ChatRoomTableViewController + UIImageView UIView @@ -1114,6 +1121,10 @@ tableController ChatRoomTableViewController + + transferBackgroundImage + UIImageView + transferView UIView diff --git a/linphone.ldb/Resources/Classes/ImageViewController/3/ImageViewController.xib b/linphone.ldb/Resources/Classes/ImageViewController/4/ImageViewController.xib similarity index 99% rename from linphone.ldb/Resources/Classes/ImageViewController/3/ImageViewController.xib rename to linphone.ldb/Resources/Classes/ImageViewController/4/ImageViewController.xib index 0e9bb3507..7e003d3c6 100644 --- a/linphone.ldb/Resources/Classes/ImageViewController/3/ImageViewController.xib +++ b/linphone.ldb/Resources/Classes/ImageViewController/4/ImageViewController.xib @@ -42,7 +42,6 @@ {{0, 44}, {320, 416}} - _NS:9 3 @@ -58,7 +57,7 @@ - 292 + 290 {320, 44} diff --git a/linphone.ldb/Resources/Resources/Localizable/1/Localizable.strings b/linphone.ldb/Resources/Resources/Localizable/1/Localizable.strings index 77e98c0aebfadcfe5429948995256911fe4b7664..d1ab447f8b2aa74569ea31a4e87ceb1964227673 100644 GIT binary patch delta 112 zcmX?5)mORUDgWfv+&t3d3`Go?3?&Sy3<^Lxmm!fM9n3Ca$e(;hPF>R(D3S++`9L)a h4ER;cPxh1#n_Mfvv-v&$D!$E&o9v delta 124 zcmeCHJW#daDgWeLL9Wer1y=D*j+Wz_{9lekR)L|Ip@boyp@<=sA%#H!%vNBi1d5b0 s6iwz4P@lY7Mu-TNF#@HVo8?2;CkqNFF$PRd5Gb51ugSOhvD#`;0OrRc$p8QV From e7d3c6a0d9335ed3bd338888d8504faf0d12ff07 Mon Sep 17 00:00:00 2001 From: Yann Diorcet Date: Tue, 18 Sep 2012 17:27:34 +0200 Subject: [PATCH 27/28] Add settings for wizard Fix xibs --- Classes/ChatRoomViewController.m | 8 +- Classes/LinphoneCoreSettingsStore.m | 8 +- Classes/LinphoneUI/UIChatRoomCell.m | 4 +- Classes/SettingsViewController.m | 2 +- Classes/WizardViewController.m | 21 +++ Classes/en.lproj/ImageViewController.xib | 20 ++- Classes/fr.lproj/ImageViewController.xib | 19 ++- Resources/image_back_default.png | Bin 0 -> 2613 bytes Resources/image_back_over.png | Bin 0 -> 2345 bytes Resources/linphonerc-factory | 3 + Resources/linphonerc-factory~ipad | 3 + Settings/InAppSettings.bundle/Advanced.plist | 2 +- Settings/InAppSettings.bundle/Network.plist | 8 +- .../en.lproj/Network.strings | 16 +- .../fr.lproj/Network.strings | 16 +- linphone.ldb/Contents.plist | 137 +++++++++++++++--- .../{4 => 6}/ImageViewController.xib | 20 ++- .../Network/1/Network.strings | 16 +- linphone.xcodeproj/project.pbxproj | 12 ++ 19 files changed, 234 insertions(+), 81 deletions(-) create mode 100644 Resources/image_back_default.png create mode 100644 Resources/image_back_over.png rename linphone.ldb/Resources/Classes/ImageViewController/{4 => 6}/ImageViewController.xib (94%) diff --git a/Classes/ChatRoomViewController.m b/Classes/ChatRoomViewController.m index 4b7702131..7e113f581 100644 --- a/Classes/ChatRoomViewController.m +++ b/Classes/ChatRoomViewController.m @@ -156,8 +156,8 @@ static UICompositeViewDescription *compositeDescription = nil; [transferBackgroundImage setImage:[TUNinePatchCache imageOfSize:[transferBackgroundImage bounds].size forNinePatchNamed:@"chat_background"]]; - BOOL fileSharingEnabled = [[LinphoneManager instance] lpConfigStringForKey:@"file_upload_url_preference"] != NULL - && [[[LinphoneManager instance] lpConfigStringForKey:@"file_upload_url_preference"] length]>0; + BOOL fileSharingEnabled = [[LinphoneManager instance] lpConfigStringForKey:@"sharing_server_preference"] != NULL + && [[[LinphoneManager instance] lpConfigStringForKey:@"sharing_server_preference"] length]>0; CGRect pictureFrame = pictureButton.frame; CGRect messageframe = messageView.frame; @@ -457,7 +457,7 @@ static void message_status(LinphoneChatMessage* msg,LinphoneChatMessageState sta - (BOOL)chatRoomStartImageUpload:(UIImage*)image url:(NSURL*)url{ if(imageSharing == nil) { - NSString *urlString = [[LinphoneManager instance] lpConfigStringForKey:@"file_upload_url_preference"]; + NSString *urlString = [[LinphoneManager instance] lpConfigStringForKey:@"sharing_server_preference"]; imageSharing = [ImageSharing imageSharingUpload:[NSURL URLWithString:urlString] image:image delegate:self userInfo:url]; [footerView setHidden:TRUE]; [transferView setHidden:FALSE]; @@ -615,6 +615,8 @@ static void message_status(LinphoneChatMessage* msg,LinphoneChatMessageState sta // Always stay at bottom CGPoint contentPt = [tableController.tableView contentOffset]; contentPt.y -= diff; + if(contentPt.y + tableFrame.size.height > tableController.tableView.contentSize.height) + contentPt.y += diff; [tableController.tableView setContentOffset:contentPt animated:FALSE]; } diff --git a/Classes/LinphoneCoreSettingsStore.m b/Classes/LinphoneCoreSettingsStore.m index b3e21bddd..853dd5d19 100644 --- a/Classes/LinphoneCoreSettingsStore.m +++ b/Classes/LinphoneCoreSettingsStore.m @@ -194,7 +194,7 @@ 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, "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, "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, "sharing_server_preference", NULL) forKey:@"sharing_server_preference"]; /*keep this one also in the standardUserDefaults so that it can be read before starting liblinphone*/ BOOL start_at_boot = TRUE; @@ -448,7 +448,7 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args); NSString* stun_server = [self stringForKey:@"stun_preference"]; if ([stun_server length] > 0){ - linphone_core_set_stun_server(lc,[stun_server cStringUsingEncoding:[NSString defaultCStringEncoding]]); + linphone_core_set_stun_server(lc, [stun_server UTF8String]); BOOL ice_preference = [self boolForKey:@"ice_preference"]; if(ice_preference) { linphone_core_set_firewall_policy(lc, LinphonePolicyUseIce); @@ -512,8 +512,8 @@ 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), 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"]; + NSString* sharing_server = [self stringForKey:@"sharing_server_preference"]; + [[LinphoneManager instance] lpConfigSetString:sharing_server forKey:@"sharing_server_preference"]; diff --git a/Classes/LinphoneUI/UIChatRoomCell.m b/Classes/LinphoneUI/UIChatRoomCell.m index 22862ed2e..8b9ac0d82 100644 --- a/Classes/LinphoneUI/UIChatRoomCell.m +++ b/Classes/LinphoneUI/UIChatRoomCell.m @@ -47,8 +47,8 @@ static const CGFloat CELL_MAX_WIDTH = 320.0f; static const CGFloat CELL_MESSAGE_X_MARGIN = 26.0f; static const CGFloat CELL_MESSAGE_Y_MARGIN = 36.0f; static const CGFloat CELL_FONT_SIZE = 17.0f; -static const CGFloat CELL_IMAGE_HEIGHT = 50.0f; -static const CGFloat CELL_IMAGE_WIDTH = 50.0f; +static const CGFloat CELL_IMAGE_HEIGHT = 100.0f; +static const CGFloat CELL_IMAGE_WIDTH = 100.0f; static UIFont *CELL_FONT = nil; #pragma mark - Lifecycle Functions diff --git a/Classes/SettingsViewController.m b/Classes/SettingsViewController.m index ec63fea7e..a2629cdd5 100644 --- a/Classes/SettingsViewController.m +++ b/Classes/SettingsViewController.m @@ -394,7 +394,6 @@ static UICompositeViewDescription *compositeDescription = nil; settingsController.showDoneButton = FALSE; settingsController.delegate = self; settingsController.showCreditsFooter = FALSE; - settingsController.hiddenKeys = [self findHiddenKeys]; settingsController.settingsStore = settingsStore; [navigationController.view setBackgroundColor:[UIColor clearColor]]; @@ -417,6 +416,7 @@ static UICompositeViewDescription *compositeDescription = nil; [super viewWillAppear:animated]; [settingsStore transformLinphoneCoreToKeys]; // Sync settings with linphone core settings + settingsController.hiddenKeys = [self findHiddenKeys]; [settingsController.tableView reloadData]; // Set observer diff --git a/Classes/WizardViewController.m b/Classes/WizardViewController.m index ba97c98a1..f68b5de17 100644 --- a/Classes/WizardViewController.m +++ b/Classes/WizardViewController.m @@ -283,6 +283,27 @@ static UICompositeViewDescription *compositeDescription = nil; [LinphoneLogger logc:LinphoneLoggerError format:"cannot set transport"]; } } + + NSString* sharing_server = [[LinphoneManager instance] lpConfigStringForKey:@"sharing_server" forSection:@"wizard"]; + [[LinphoneManager instance] lpConfigSetString:sharing_server forKey:@"sharing_server_preference"]; + + BOOL ice = [[LinphoneManager instance] lpConfigBoolForKey:@"ice" forSection:@"wizard"]; + [[LinphoneManager instance] lpConfigSetBool:ice forKey:@"ice_preference"]; + + NSString* stun = [[LinphoneManager instance] lpConfigStringForKey:@"stun" forSection:@"wizard"]; + [[LinphoneManager instance] lpConfigSetString:stun forKey:@"stun_preference"]; + + if ([stun length] > 0){ + linphone_core_set_stun_server(lc, [stun UTF8String]); + if(ice) { + linphone_core_set_firewall_policy(lc, LinphonePolicyUseIce); + } else { + linphone_core_set_firewall_policy(lc, LinphonePolicyUseStun); + } + } else { + linphone_core_set_stun_server(lc, NULL); + linphone_core_set_firewall_policy(lc, LinphonePolicyNoFirewall); + } } - (void)addProxyConfig:(NSString*)username password:(NSString*)password domain:(NSString*)domain server:(NSString*)server { diff --git a/Classes/en.lproj/ImageViewController.xib b/Classes/en.lproj/ImageViewController.xib index 7e003d3c6..6db298265 100644 --- a/Classes/en.lproj/ImageViewController.xib +++ b/Classes/en.lproj/ImageViewController.xib @@ -42,12 +42,13 @@ {{0, 44}, {320, 416}} + _NS:9 3 MCAwAA - 4 + 1 NO IBCocoaTouchFramework @@ -73,7 +74,7 @@ 292 - {80, 44} + {160, 44} @@ -85,6 +86,8 @@ IBCocoaTouchFramework 0 0 + NO + NO 3 MQA @@ -97,13 +100,13 @@ 3 MC41AA - + NSImage - chat_back_default.png + image_back_over.png NSImage - chat_back_over.png + image_back_default.png 2 @@ -218,11 +221,13 @@ 7 + backButton 6 + background @@ -236,6 +241,7 @@ com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin + @@ -289,8 +295,8 @@ YES 3 - {320, 88} - {320, 88} + {320, 88} + {320, 88} {5, 117} 1498 diff --git a/Classes/fr.lproj/ImageViewController.xib b/Classes/fr.lproj/ImageViewController.xib index 071b3cda5..ad5e29808 100644 --- a/Classes/fr.lproj/ImageViewController.xib +++ b/Classes/fr.lproj/ImageViewController.xib @@ -46,7 +46,7 @@ 3 MCAwAA - 4 + 1 NO IBCocoaTouchFramework @@ -71,7 +71,7 @@ 292 - {80, 44} + {160, 44} _NS:9 @@ -82,6 +82,8 @@ IBCocoaTouchFramework 0 0 + NO + NO 3 MQA @@ -94,13 +96,13 @@ 3 MC41AA - + NSImage - chat_back_default.png + image_back_over.png NSImage - chat_back_over.png + image_back_default.png 2 @@ -212,11 +214,13 @@ 7 + backButton 6 + background @@ -230,6 +234,7 @@ com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin + @@ -283,8 +288,8 @@ YES 3 - {320, 88} - {320, 88} + {320, 88} + {320, 88} {5, 117} 933 diff --git a/Resources/image_back_default.png b/Resources/image_back_default.png new file mode 100644 index 0000000000000000000000000000000000000000..60412bd95fd36b2c7fedbb86d83d9e7680b1cba9 GIT binary patch literal 2613 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 P00000NkvXXu0mjfIX+xA literal 0 HcmV?d00001 diff --git a/Resources/linphonerc-factory b/Resources/linphonerc-factory index a38a81b51..3d7bde8c8 100644 --- a/Resources/linphonerc-factory +++ b/Resources/linphonerc-factory @@ -40,4 +40,7 @@ username_length=4 expires=600 push_notification=1 transport=tls +sharing_server=https://www.linphone.org:444/upload.php +ice=1 +stun=stun.linphone.org diff --git a/Resources/linphonerc-factory~ipad b/Resources/linphonerc-factory~ipad index 845a67bba..655493f65 100644 --- a/Resources/linphonerc-factory~ipad +++ b/Resources/linphonerc-factory~ipad @@ -40,3 +40,6 @@ username_length=4 expires=600 push_notification=1 transport=tls +sharing_server=https://www.linphone.org:444/upload.php +ice=1 +stun=stun.linphone.org diff --git a/Settings/InAppSettings.bundle/Advanced.plist b/Settings/InAppSettings.bundle/Advanced.plist index 9edd14072..1a87b88a5 100644 --- a/Settings/InAppSettings.bundle/Advanced.plist +++ b/Settings/InAppSettings.bundle/Advanced.plist @@ -174,7 +174,7 @@ Title Sharing server Key - file_upload_url_preference + sharing_server_preference IASKTextAlignment IASKUITextAlignmentRight diff --git a/Settings/InAppSettings.bundle/Network.plist b/Settings/InAppSettings.bundle/Network.plist index 8d8e1a082..1bc2d7cf5 100644 --- a/Settings/InAppSettings.bundle/Network.plist +++ b/Settings/InAppSettings.bundle/Network.plist @@ -18,7 +18,7 @@ Key stun_preference Title - Stun server + Stun Server Type PSTextFieldSpecifier AutocapitalizationType @@ -113,9 +113,9 @@ Transport Titles - udp - tcp - tls + UDP + TCP + TLS Type PSMultiValueSpecifier diff --git a/Settings/InAppSettings.bundle/en.lproj/Network.strings b/Settings/InAppSettings.bundle/en.lproj/Network.strings index 481b7d438..299b28fbd 100644 --- a/Settings/InAppSettings.bundle/en.lproj/Network.strings +++ b/Settings/InAppSettings.bundle/en.lproj/Network.strings @@ -1,8 +1,8 @@ /* Wifi only */ "Wifi only" = "Wifi only"; -/* Stun server */ -"Stun server" = "Stun server"; +/* Stun Server */ +"Stun Server" = "Stun Server"; /* ICE */ "ICE" = "ICE"; @@ -31,14 +31,14 @@ /* Transport */ "Transport" = "Transport"; -/* udp */ -"udp" = "udp"; +/* UDP */ +"UDP" = "UDP"; -/* tcp */ -"tcp" = "tcp"; +/* TCP */ +"TCP" = "TCP"; -/* tls */ -"tls" = "tls"; +/* TLS */ +"TLS" = "TLS"; /* None */ "None" = "None"; diff --git a/Settings/InAppSettings.bundle/fr.lproj/Network.strings b/Settings/InAppSettings.bundle/fr.lproj/Network.strings index 95cd15fb4..e8b26e761 100644 --- a/Settings/InAppSettings.bundle/fr.lproj/Network.strings +++ b/Settings/InAppSettings.bundle/fr.lproj/Network.strings @@ -1,8 +1,8 @@ /* Wifi only */ "Wifi only" = "Uniquement Wifi"; -/* Stun server */ -"Stun server" = "Serveur Stun"; +/* Stun Server */ +"Stun Server" = "Serveur Stun"; /* ICE */ "ICE" = "ICE"; @@ -31,14 +31,14 @@ /* Transport */ "Transport" = "Transport"; -/* udp */ -"udp" = "udp"; +/* UDP */ +"UDP" = "UDP"; -/* tcp */ -"tcp" = "tcp"; +/* TCP */ +"TCP" = "TCP"; -/* tls */ -"tls" = "tls"; +/* TLS */ +"TLS" = "TLS"; /* None */ "None" = "Aucun"; diff --git a/linphone.ldb/Contents.plist b/linphone.ldb/Contents.plist index 6a88a91eb..febee5e56 100644 --- a/linphone.ldb/Contents.plist +++ b/linphone.ldb/Contents.plist @@ -4281,17 +4281,17 @@ backup - 4 + 6 class BLWrapperHandle name - Classes/ImageViewController/4/ImageViewController.xib + Classes/ImageViewController/6/ImageViewController.xib change date - 2012-09-18T12:55:28Z + 2012-09-18T15:26:33Z changed values class @@ -4301,7 +4301,7 @@ flags 0 hash - cf8736251f03474edd9a8c46b942ae63 + b3e155c6a9c76213208e70d8dc9bd3df name ImageViewController.xib @@ -4340,9 +4340,9 @@ versions en - 4 + 6 fr - 4 + 6 @@ -11500,7 +11500,7 @@ Raison: %2$s change date - 2012-09-18T09:18:41Z + 2012-09-18T15:13:17Z changed values class @@ -11510,7 +11510,7 @@ Raison: %2$s flags 0 hash - 3c3bd8331f174699330a8cffb2875fa5 + f5919fdebddf11e613578ee7ff05f05e name Network.strings @@ -11549,17 +11549,17 @@ Raison: %2$s class BLStringKeyObject comment - Stun server + Stun Server errors flags 0 key - Stun server + Stun Server localizations en - Stun server + Stun Server fr Serveur Stun @@ -11774,17 +11774,17 @@ Raison: %2$s class BLStringKeyObject comment - udp + UDP errors flags 2 key - udp + UDP localizations en - udp + UDP snapshots @@ -11797,17 +11797,17 @@ Raison: %2$s class BLStringKeyObject comment - tcp + TCP errors flags 2 key - tcp + TCP localizations en - tcp + TCP snapshots @@ -11820,17 +11820,17 @@ Raison: %2$s class BLStringKeyObject comment - tls + TLS errors flags 2 key - tls + TLS localizations en - tls + TLS snapshots @@ -11908,7 +11908,102 @@ Raison: %2$s old objects - + + + 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 + Stun server + errors + + flags + 0 + key + Stun server + localizations + + en + Stun server + fr + Serveur Stun + + snapshots + + + plist file snapshots diff --git a/linphone.ldb/Resources/Classes/ImageViewController/4/ImageViewController.xib b/linphone.ldb/Resources/Classes/ImageViewController/6/ImageViewController.xib similarity index 94% rename from linphone.ldb/Resources/Classes/ImageViewController/4/ImageViewController.xib rename to linphone.ldb/Resources/Classes/ImageViewController/6/ImageViewController.xib index 7e003d3c6..6db298265 100644 --- a/linphone.ldb/Resources/Classes/ImageViewController/4/ImageViewController.xib +++ b/linphone.ldb/Resources/Classes/ImageViewController/6/ImageViewController.xib @@ -42,12 +42,13 @@ {{0, 44}, {320, 416}} + _NS:9 3 MCAwAA - 4 + 1 NO IBCocoaTouchFramework @@ -73,7 +74,7 @@ 292 - {80, 44} + {160, 44} @@ -85,6 +86,8 @@ IBCocoaTouchFramework 0 0 + NO + NO 3 MQA @@ -97,13 +100,13 @@ 3 MC41AA - + NSImage - chat_back_default.png + image_back_over.png NSImage - chat_back_over.png + image_back_default.png 2 @@ -218,11 +221,13 @@ 7 + backButton 6 + background @@ -236,6 +241,7 @@ com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin + @@ -289,8 +295,8 @@ YES 3 - {320, 88} - {320, 88} + {320, 88} + {320, 88} {5, 117} 1498 diff --git a/linphone.ldb/Resources/InAppSettings.bundle/Network/1/Network.strings b/linphone.ldb/Resources/InAppSettings.bundle/Network/1/Network.strings index 481b7d438..299b28fbd 100644 --- a/linphone.ldb/Resources/InAppSettings.bundle/Network/1/Network.strings +++ b/linphone.ldb/Resources/InAppSettings.bundle/Network/1/Network.strings @@ -1,8 +1,8 @@ /* Wifi only */ "Wifi only" = "Wifi only"; -/* Stun server */ -"Stun server" = "Stun server"; +/* Stun Server */ +"Stun Server" = "Stun Server"; /* ICE */ "ICE" = "ICE"; @@ -31,14 +31,14 @@ /* Transport */ "Transport" = "Transport"; -/* udp */ -"udp" = "udp"; +/* UDP */ +"UDP" = "UDP"; -/* tcp */ -"tcp" = "tcp"; +/* TCP */ +"TCP" = "TCP"; -/* tls */ -"tls" = "tls"; +/* TLS */ +"TLS" = "TLS"; /* None */ "None" = "None"; diff --git a/linphone.xcodeproj/project.pbxproj b/linphone.xcodeproj/project.pbxproj index c7a5532b8..46ef8db41 100755 --- a/linphone.xcodeproj/project.pbxproj +++ b/linphone.xcodeproj/project.pbxproj @@ -783,6 +783,10 @@ D3832801158100E400FA0D23 /* history_over.png in Resources */ = {isa = PBXBuildFile; fileRef = D38327FD158100E400FA0D23 /* history_over.png */; }; D3832802158100E400FA0D23 /* settings_over.png in Resources */ = {isa = PBXBuildFile; fileRef = D38327FE158100E400FA0D23 /* settings_over.png */; }; D3832803158100E400FA0D23 /* chat_over.png in Resources */ = {isa = PBXBuildFile; fileRef = D38327FF158100E400FA0D23 /* chat_over.png */; }; + D3866C281608CA1600830F95 /* image_back_default.png in Resources */ = {isa = PBXBuildFile; fileRef = D3866C261608CA1600830F95 /* image_back_default.png */; }; + D3866C291608CA1600830F95 /* image_back_default.png in Resources */ = {isa = PBXBuildFile; fileRef = D3866C261608CA1600830F95 /* image_back_default.png */; }; + D3866C2A1608CA1600830F95 /* image_back_over.png in Resources */ = {isa = PBXBuildFile; fileRef = D3866C271608CA1600830F95 /* image_back_over.png */; }; + D3866C2B1608CA1600830F95 /* image_back_over.png in Resources */ = {isa = PBXBuildFile; fileRef = D3866C271608CA1600830F95 /* image_back_over.png */; }; D389363915A6D53200A3A3AA /* chat_bubble_incoming.9.png in Resources */ = {isa = PBXBuildFile; fileRef = D389363715A6D53200A3A3AA /* chat_bubble_incoming.9.png */; }; 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 */; }; @@ -1821,6 +1825,8 @@ D38327FD158100E400FA0D23 /* history_over.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = history_over.png; path = Resources/history_over.png; sourceTree = ""; }; D38327FE158100E400FA0D23 /* settings_over.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = settings_over.png; path = Resources/settings_over.png; sourceTree = ""; }; D38327FF158100E400FA0D23 /* chat_over.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = chat_over.png; path = Resources/chat_over.png; sourceTree = ""; }; + D3866C261608CA1600830F95 /* image_back_default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = image_back_default.png; path = Resources/image_back_default.png; sourceTree = ""; }; + D3866C271608CA1600830F95 /* image_back_over.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = image_back_over.png; path = Resources/image_back_over.png; sourceTree = ""; }; D389363715A6D53200A3A3AA /* chat_bubble_incoming.9.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = chat_bubble_incoming.9.png; path = Resources/chat_bubble_incoming.9.png; sourceTree = ""; }; 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 = ""; }; @@ -2929,6 +2935,8 @@ D3A74E8615C69392001500B9 /* history_selected_landscape~ipad.png */, D3A74E8715C69392001500B9 /* history_selected~ipad.png */, D3C714B2159DB84400705B8E /* hold.wav */, + D3866C261608CA1600830F95 /* image_back_default.png */, + D3866C271608CA1600830F95 /* image_back_over.png */, D3432A5C158A4446001C6B0B /* led_connected.png */, D3432A70158A45AF001C6B0B /* led_disconnected.png */, D3432A5D158A4446001C6B0B /* led_error.png */, @@ -3885,6 +3893,8 @@ D3ED40241602257400BF332B /* chat_background.9.png in Resources */, D3ED40261602257400BF332B /* chat_background.9@2x.png in Resources */, D3998D0416031937009DD22C /* background_alt.png in Resources */, + D3866C281608CA1600830F95 /* image_back_default.png in Resources */, + D3866C2A1608CA1600830F95 /* image_back_over.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -4337,6 +4347,8 @@ D3ED40251602257400BF332B /* chat_background.9.png in Resources */, D3ED40271602257400BF332B /* chat_background.9@2x.png in Resources */, D3998D0516031937009DD22C /* background_alt.png in Resources */, + D3866C291608CA1600830F95 /* image_back_default.png in Resources */, + D3866C2B1608CA1600830F95 /* image_back_over.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; From 29ea5d04fb0c93d6470485cd3825b38df268ac01 Mon Sep 17 00:00:00 2001 From: Yann Diorcet Date: Tue, 18 Sep 2012 17:49:53 +0200 Subject: [PATCH 28/28] Fix Chat room --- Classes/LinphoneUI/UIChatCell.m | 6 +++++- Classes/LinphoneUI/UIChatRoomCell.m | 15 ++++----------- Classes/Model/ChatModel.h | 3 +++ Classes/Model/ChatModel.m | 9 +++++++++ Classes/en.lproj/ChatRoomViewController.xib | 6 +----- Classes/fr.lproj/ChatRoomViewController.xib | 5 +---- linphone.ldb/Contents.plist | 12 ++++++------ .../{16 => 17}/ChatRoomViewController.xib | 6 +----- 8 files changed, 30 insertions(+), 32 deletions(-) rename linphone.ldb/Resources/Classes/ChatRoomViewController/{16 => 17}/ChatRoomViewController.xib (99%) diff --git a/Classes/LinphoneUI/UIChatCell.m b/Classes/LinphoneUI/UIChatCell.m index 3e1057014..04b1e63c7 100644 --- a/Classes/LinphoneUI/UIChatCell.m +++ b/Classes/LinphoneUI/UIChatCell.m @@ -110,7 +110,11 @@ [avatarImage setImage:image]; // Message - [chatContentLabel setText:[chat message]]; + if([chat isExternalImage] || [chat isInternalImage]) { + [chatContentLabel setText:@""]; + } else { + [chatContentLabel setText:[chat message]]; + } linphone_address_destroy(linphoneAddress); } diff --git a/Classes/LinphoneUI/UIChatRoomCell.m b/Classes/LinphoneUI/UIChatRoomCell.m index 8b9ac0d82..1ea21b7fc 100644 --- a/Classes/LinphoneUI/UIChatRoomCell.m +++ b/Classes/LinphoneUI/UIChatRoomCell.m @@ -59,6 +59,7 @@ static UIFont *CELL_FONT = nil; owner:self options:nil]; [self addSubview:innerView]; + [deleteButton setAlpha:0.0f]; } return self; } @@ -101,14 +102,14 @@ static UIFont *CELL_FONT = nil; return; } - if([UIChatRoomCell isExternalImage:[chat message]]) { + if([chat isExternalImage]) { [messageLabel setHidden:TRUE]; [messageImageView setImage:nil]; [messageImageView setHidden:TRUE]; [downloadButton setHidden:FALSE]; - } else if([UIChatRoomCell isInternalImage:[chat message]]) { + } else if([chat isInternalImage]) { [messageLabel setHidden:TRUE]; [[LinphoneManager instance].photoLibrary assetForURL:[NSURL URLWithString:[chat message]] resultBlock:^(ALAsset *asset) { @@ -176,17 +177,9 @@ static UIFont *CELL_FONT = nil; } } -+ (BOOL)isExternalImage:(NSString *)message { - return [message hasPrefix:@"http:"] || [message hasPrefix:@"https:"]; -} - -+ (BOOL)isInternalImage:(NSString *)message { - return [message hasPrefix:@"assets-library:"]; -} - + (CGSize)viewSize:(ChatModel*)chat width:(int)width { CGSize messageSize; - if(!([UIChatRoomCell isExternalImage:[chat message]] || [UIChatRoomCell isInternalImage:[chat message]])) { + if(!([chat isExternalImage] || [chat isInternalImage])) { if(CELL_FONT == nil) { CELL_FONT = [UIFont systemFontOfSize:CELL_FONT_SIZE]; } diff --git a/Classes/Model/ChatModel.h b/Classes/Model/ChatModel.h index f8607fe9b..90d9b566e 100644 --- a/Classes/Model/ChatModel.h +++ b/Classes/Model/ChatModel.h @@ -41,6 +41,9 @@ @property (copy) NSNumber *read; @property (copy) NSNumber *state; +- (BOOL)isExternalImage; +- (BOOL)isInternalImage; + - (void)create; + (ChatModel*)read:(NSNumber*)id; - (void)update; diff --git a/Classes/Model/ChatModel.m b/Classes/Model/ChatModel.m index 291149373..b952df9de 100644 --- a/Classes/Model/ChatModel.m +++ b/Classes/Model/ChatModel.m @@ -61,6 +61,15 @@ } +- (BOOL)isExternalImage { + return [message hasPrefix:@"http:"] || [message hasPrefix:@"https:"]; +} + +- (BOOL)isInternalImage { + return [message hasPrefix:@"assets-library:"]; +} + + #pragma mark - CRUD Functions - (void)create { diff --git a/Classes/en.lproj/ChatRoomViewController.xib b/Classes/en.lproj/ChatRoomViewController.xib index 1972001d5..b121e1665 100644 --- a/Classes/en.lproj/ChatRoomViewController.xib +++ b/Classes/en.lproj/ChatRoomViewController.xib @@ -246,10 +246,7 @@ _NS:9 - - 1 - MSAwLjI4MzE1ODM3MjYgMC4wNTY3ODY4OTE2MQA - + NO IBCocoaTouchFramework @@ -271,7 +268,6 @@ {{250, 0}, {70, 59}} - _NS:9 NO diff --git a/Classes/fr.lproj/ChatRoomViewController.xib b/Classes/fr.lproj/ChatRoomViewController.xib index a07b5d6da..43ba72799 100644 --- a/Classes/fr.lproj/ChatRoomViewController.xib +++ b/Classes/fr.lproj/ChatRoomViewController.xib @@ -236,10 +236,7 @@ _NS:9 - - 1 - MSAwLjI4MzE1ODM3MjYgMC4wNTY3ODY4OTE2MQA - + NO IBCocoaTouchFramework diff --git a/linphone.ldb/Contents.plist b/linphone.ldb/Contents.plist index febee5e56..a624c3930 100644 --- a/linphone.ldb/Contents.plist +++ b/linphone.ldb/Contents.plist @@ -212,17 +212,17 @@ backup - 16 + 17 class BLWrapperHandle name - Classes/ChatRoomViewController/16/ChatRoomViewController.xib + Classes/ChatRoomViewController/17/ChatRoomViewController.xib change date - 2012-09-18T13:03:28Z + 2012-09-18T15:40:57Z changed values class @@ -232,7 +232,7 @@ flags 0 hash - fb9acb898a88e8d219dfd663e9b8eb19 + 0d54842000213c11a77cc9d1e2698245 name ChatRoomViewController.xib @@ -568,9 +568,9 @@ versions en - 16 + 17 fr - 16 + 17 diff --git a/linphone.ldb/Resources/Classes/ChatRoomViewController/16/ChatRoomViewController.xib b/linphone.ldb/Resources/Classes/ChatRoomViewController/17/ChatRoomViewController.xib similarity index 99% rename from linphone.ldb/Resources/Classes/ChatRoomViewController/16/ChatRoomViewController.xib rename to linphone.ldb/Resources/Classes/ChatRoomViewController/17/ChatRoomViewController.xib index 1972001d5..b121e1665 100644 --- a/linphone.ldb/Resources/Classes/ChatRoomViewController/16/ChatRoomViewController.xib +++ b/linphone.ldb/Resources/Classes/ChatRoomViewController/17/ChatRoomViewController.xib @@ -246,10 +246,7 @@ _NS:9 - - 1 - MSAwLjI4MzE1ODM3MjYgMC4wNTY3ODY4OTE2MQA - + NO IBCocoaTouchFramework @@ -271,7 +268,6 @@ {{250, 0}, {70, 59}} - _NS:9 NO