From 18103091cd8b1a56bf44c9390f7314e06ce9c9e4 Mon Sep 17 00:00:00 2001 From: Yann Diorcet Date: Mon, 1 Oct 2012 17:13:38 +0200 Subject: [PATCH] Update liphone submodule Update about view --- Classes/AboutViewController.h | 3 +- Classes/AboutViewController.m | 67 +++++++++++ Classes/AboutViewController.xib | 171 +++++++++++++++++++++++++---- Resources/licenses.html | 81 ++++++++++++++ linphone.xcodeproj/project.pbxproj | 6 + submodules/linphone | 2 +- 6 files changed, 308 insertions(+), 22 deletions(-) create mode 100644 Resources/licenses.html diff --git a/Classes/AboutViewController.h b/Classes/AboutViewController.h index 92be76175..a486efbd1 100644 --- a/Classes/AboutViewController.h +++ b/Classes/AboutViewController.h @@ -21,13 +21,14 @@ #import "UICompositeViewController.h" -@interface AboutViewController : UIViewController { +@interface AboutViewController : UIViewController { } @property (nonatomic, retain) IBOutlet UILabel *linphoneIphoneVersionLabel; @property (nonatomic, retain) IBOutlet UILabel *linphoneCoreVersionLabel; @property (nonatomic, retain) IBOutlet UIView *contentView; @property (nonatomic, retain) IBOutlet UILabel *linkLabel; +@property (nonatomic, retain) IBOutlet UIWebView *licensesView; @property (nonatomic, retain) IBOutlet UITapGestureRecognizer *linkTapGestureRecognizer; - (IBAction)onLinkTap:(id)sender; diff --git a/Classes/AboutViewController.m b/Classes/AboutViewController.m index a83a5f934..1e2b5dddc 100644 --- a/Classes/AboutViewController.m +++ b/Classes/AboutViewController.m @@ -29,6 +29,7 @@ @synthesize contentView; @synthesize linkTapGestureRecognizer; @synthesize linkLabel; +@synthesize licensesView; #pragma mark - Lifecycle Functions @@ -47,6 +48,7 @@ [contentView release]; [linkTapGestureRecognizer release]; [linkLabel release]; + [licensesView release]; [super dealloc]; } @@ -70,6 +72,15 @@ if([LinphoneManager runningOnIpad]) { [LinphoneUtils adjustFontSize:self.view mult:2.22f]; } + + [AboutViewController removeBackground:licensesView]; + + // Create a request to the resource + NSURLRequest* request = [NSURLRequest requestWithURL:[NSURL fileURLWithPath:[LinphoneManager bundleFile:@"licenses.html"]]] ; + // Load the resource using the request + [licensesView setDelegate:self]; + [licensesView loadRequest:request]; + [[AboutViewController defaultScrollView:licensesView] setScrollEnabled:FALSE]; } @@ -93,10 +104,66 @@ static UICompositeViewDescription *compositeDescription = nil; } +#pragma mark - + ++ (void)removeBackground:(UIView *)view { + for (UIView *subview in [view subviews]) { + [subview setOpaque:NO]; + [subview setBackgroundColor:[UIColor clearColor]]; + } + [view setOpaque:NO]; + [view setBackgroundColor:[UIColor clearColor]]; +} + ++ (UIScrollView *)defaultScrollView:(UIWebView *)webView { + UIScrollView *scrollView = nil; + + if ([[UIDevice currentDevice].systemVersion doubleValue] >= 5.0) { + return webView.scrollView; + } else { + for (UIView *subview in [webView subviews]) { + if ([subview isKindOfClass:[UIScrollView class]]) { + scrollView = (UIScrollView *)subview; + } + } + } + return scrollView; +} + + #pragma mark - Action Functions - (IBAction)onLinkTap:(id)sender { [[UIApplication sharedApplication] openURL:[NSURL URLWithString:linkLabel.text]]; } + +#pragma mark - UIWebViewDelegate Functions + +- (void)webViewDidFinishLoad:(UIWebView *)webView { + CGSize size = [webView sizeThatFits:CGSizeMake(self.view.bounds.size.width, 10000.0f)]; + float diff = size.height - webView.bounds.size.height; + + UIScrollView *scrollView = (UIScrollView *)self.view; + CGRect contentFrame = [contentView bounds]; + contentFrame.size.height += diff; + [contentView setAutoresizesSubviews:FALSE]; + [contentView setFrame:contentFrame]; + [contentView setAutoresizesSubviews:TRUE]; + [scrollView setContentSize:contentFrame.size]; + CGRect licensesViewFrame = [licensesView frame]; + licensesViewFrame.size.height += diff; + [licensesView setFrame:licensesViewFrame]; +} + +- (BOOL)webView:(UIWebView *)inWeb shouldStartLoadWithRequest:(NSURLRequest *)inRequest navigationType:(UIWebViewNavigationType)inType { + if (inType == UIWebViewNavigationTypeLinkClicked) { + [[UIApplication sharedApplication] openURL:[inRequest URL]]; + return NO; + } + + return YES; +} + + @end diff --git a/Classes/AboutViewController.xib b/Classes/AboutViewController.xib index ed5d7e7d4..7c0a4570c 100644 --- a/Classes/AboutViewController.xib +++ b/Classes/AboutViewController.xib @@ -17,6 +17,7 @@ IBUILabel IBUIScrollView IBUIView + IBUIWebView YES @@ -38,15 +39,25 @@ - 268 + 292 {320, 460} + + _NS:9 YES YES IBCocoaTouchFramework + 0.0 + 10 + 0.0 + 0.0 YES NO + 0.0 + 10 + 0.0 + 0.0 @@ -58,6 +69,7 @@ 311 {{124, 20}, {72, 72}} + _NS:9 1 @@ -70,9 +82,10 @@ - 319 - {{20, 100}, {280, 50}} + 314 + {{10, 100}, {300, 50}} + _NS:9 NO @@ -101,9 +114,10 @@ - 319 - {{20, 200}, {280, 44}} + 314 + {{10, 200}, {300, 44}} + NO YES @@ -129,9 +143,10 @@ - 319 - {{20, 150}, {280, 21}} + 314 + {{10, 150}, {300, 21}} + _NS:9 NO @@ -157,9 +172,10 @@ - 319 - {{20, 172}, {280, 21}} + 314 + {{10, 172}, {300, 21}} + _NS:9 NO @@ -178,15 +194,17 @@ - 319 - {{20, 300}, {280, 21}} + 314 + {{10, 300}, {300, 21}} + + NO YES 7 NO IBCocoaTouchFramework - © 2010 Belledonne Communications + © 2010-2012 Belledonne Communications 1 MCAwIDAAA @@ -201,9 +219,10 @@ - 319 - {{20, 244}, {280, 36}} + 314 + {{10, 244}, {300, 36}} + _NS:9 NO @@ -219,11 +238,23 @@ NO - 280 + 300 + + + + 314 + {{10, 380}, {300, 210}} + + + + _NS:9 + IBCocoaTouchFramework + 2 - {320, 341} + {320, 600} + _NS:9 @@ -276,6 +307,14 @@ 68 + + + licensesView + + + + 70 + @@ -316,9 +355,10 @@ - + + @@ -326,7 +366,7 @@ 61 - licenceLabel + licenseLabel 58 @@ -364,6 +404,12 @@ linphoneCoreVersionLabel + + 69 + + + licenseView + @@ -383,6 +429,7 @@ 62.IBPluginDependency 65.IBPluginDependency 66.IBPluginDependency + 69.IBPluginDependency YES @@ -399,6 +446,7 @@ com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin @@ -413,9 +461,92 @@ - 68 + 70 + + + + YES + + AboutViewController + UIViewController + + onLinkTap: + id + + + onLinkTap: + + onLinkTap: + id + + + + YES + + YES + contentView + licensesView + linkLabel + linkTapGestureRecognizer + linphoneCoreVersionLabel + linphoneIphoneVersionLabel + + + YES + UIView + UIWebView + UILabel + UITapGestureRecognizer + UILabel + UILabel + + + + YES + + YES + contentView + licensesView + linkLabel + linkTapGestureRecognizer + linphoneCoreVersionLabel + linphoneIphoneVersionLabel + + + YES + + contentView + UIView + + + licensesView + UIWebView + + + linkLabel + UILabel + + + linkTapGestureRecognizer + UITapGestureRecognizer + + + linphoneCoreVersionLabel + UILabel + + + linphoneIphoneVersionLabel + UILabel + + + + + IBProjectSource + ./Classes/AboutViewController.h + + + - 0 IBCocoaTouchFramework diff --git a/Resources/licenses.html b/Resources/licenses.html new file mode 100644 index 000000000..e2ed49572 --- /dev/null +++ b/Resources/licenses.html @@ -0,0 +1,81 @@ + + +
+

Third party softwares

+ +

CAAnimationBlocks

+ +

Xissburg
+http://xissburg.com

+ +

ColorConverter

+ +

Matteo Alessani
+http://www.extendi.it

+ +

DCRoundSwitch

+ +

Patrick Richards
+http://domesticcat.com.au
+MIT license

+ +

DTFoundation

+ +

Oliver Drobnik
+http://www.cocoanetics.com
+BSD license

+ +

HPGrowingTextView

+ +

Hans Pinckaers
+http://hanspinckaers.com
+MIT license

+ +

InAppSettingsKit

+ +

Luc Vandal, Edovia Inc., Ortwin Gentz, FutureTap GmbH
+http://www.inappsettingskit.com/
+BSD license

+ +

NinePatch

+ +

Tortuga 22, Inc.
+http://www.tortuga22.com
+Apache license

+ +

OrderedDictionary

+ +

Matt Gallagher
+http://cocoawithlove.com

+ +

TPMultiLayoutViewController

+ +

Michael Tyson
+http://atastypixel.com
+MIT license

+ +

UACellBackgroundView

+ +

Matt Coneybeare
+http://code.coneybeare.net

+ +

XMLRPC

+ +

Eric Czarny
+http://divisiblebyzero.com/
+MIT license

+ +

Graphics

+ +

Kerosine

+ +

http://www.kerosine.fr

+ +

Utilitary softwares

+ +

Localization Suite

+ +

http://www.loc-suite.org

+
+ + diff --git a/linphone.xcodeproj/project.pbxproj b/linphone.xcodeproj/project.pbxproj index f32a22d72..4f3273d6d 100755 --- a/linphone.xcodeproj/project.pbxproj +++ b/linphone.xcodeproj/project.pbxproj @@ -703,6 +703,8 @@ D37DC7191594AF3F00B2A5EB /* MessageUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D37DC7171594AF3400B2A5EB /* MessageUI.framework */; }; D37E3ECD1619C27A0087659A /* CAAnimation+Blocks.m in Sources */ = {isa = PBXBuildFile; fileRef = D37E3ECC1619C27A0087659A /* CAAnimation+Blocks.m */; }; D37E3ECE1619C27A0087659A /* CAAnimation+Blocks.m in Sources */ = {isa = PBXBuildFile; fileRef = D37E3ECC1619C27A0087659A /* CAAnimation+Blocks.m */; }; + D37E3ED01619DCC50087659A /* licenses.html in Resources */ = {isa = PBXBuildFile; fileRef = D37E3ECF1619DCC50087659A /* licenses.html */; }; + D37E3ED11619DCC50087659A /* licenses.html in Resources */ = {isa = PBXBuildFile; fileRef = D37E3ECF1619DCC50087659A /* licenses.html */; }; 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 */; }; @@ -1846,6 +1848,7 @@ D37DC7171594AF3400B2A5EB /* MessageUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MessageUI.framework; path = System/Library/Frameworks/MessageUI.framework; sourceTree = SDKROOT; }; D37E3ECB1619C27A0087659A /* CAAnimation+Blocks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "CAAnimation+Blocks.h"; sourceTree = ""; }; D37E3ECC1619C27A0087659A /* CAAnimation+Blocks.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "CAAnimation+Blocks.m"; sourceTree = ""; }; + D37E3ECF1619DCC50087659A /* licenses.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = licenses.html; path = Resources/licenses.html; sourceTree = ""; }; 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 = ""; }; @@ -3141,6 +3144,7 @@ D3432A70158A45AF001C6B0B /* led_disconnected.png */, D3432A5D158A4446001C6B0B /* led_error.png */, D3432A6F158A45AF001C6B0B /* led_inprogress.png */, + D37E3ECF1619DCC50087659A /* licenses.html */, 225CB2F911ABB76400628906 /* linphone-banner.png */, 8D1107310486CEB800E47090 /* linphone-Info.plist */, 22058C70116E305000B08DDD /* linphone_icon_57.png */, @@ -4176,6 +4180,7 @@ D3D52A871614495300DEB00A /* decline_default~ipad.png in Resources */, D3D52A891614495300DEB00A /* decline_over_landscape~ipad.png in Resources */, D3D52A8B1614495300DEB00A /* decline_over~ipad.png in Resources */, + D37E3ED01619DCC50087659A /* licenses.html in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -4677,6 +4682,7 @@ D3D52A881614495300DEB00A /* decline_default~ipad.png in Resources */, D3D52A8A1614495300DEB00A /* decline_over_landscape~ipad.png in Resources */, D3D52A8C1614495300DEB00A /* decline_over~ipad.png in Resources */, + D37E3ED11619DCC50087659A /* licenses.html in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/submodules/linphone b/submodules/linphone index 4cd61b605..c6235d70a 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit 4cd61b605d7e848ca735b6fb649b18a4cbfe3e7a +Subproject commit c6235d70a0b49c015ca1551d2946370b69b4882d