From 30d52391c78edab7e6cdeb54fce999d1245e19bc Mon Sep 17 00:00:00 2001 From: Pierre-Eric Pelloux-Prayer Date: Tue, 17 Apr 2012 16:08:46 +0200 Subject: [PATCH] Transfer: go directly to dialer if only 1 call --- Classes/IncallViewController.m | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/Classes/IncallViewController.m b/Classes/IncallViewController.m index 0d1e28ee4..7fdd2fa4f 100644 --- a/Classes/IncallViewController.m +++ b/Classes/IncallViewController.m @@ -124,20 +124,19 @@ void addAnimationFadeTransition(UIView* view, float duration) { -(void) orientationChanged: (NSNotification*) notif { int oldLinphoneOrientation = linphone_core_get_device_rotation([LinphoneManager getLc]); UIDeviceOrientation orientation = [UIDevice currentDevice].orientation; + int newRotation = 0; switch (orientation) { - case UIInterfaceOrientationPortrait: - linphone_core_set_device_rotation([LinphoneManager getLc], 0); - break; case UIInterfaceOrientationLandscapeRight: - linphone_core_set_device_rotation([LinphoneManager getLc], 270); + newRotation = 270; break; case UIInterfaceOrientationLandscapeLeft: - linphone_core_set_device_rotation([LinphoneManager getLc], 90); + newRotation = 90; break; default: - break; + newRotation = 0; } - if (oldLinphoneOrientation != linphone_core_get_device_rotation([LinphoneManager getLc])) { + if (oldLinphoneOrientation != newRotation) { + linphone_core_set_device_rotation([LinphoneManager getLc], newRotation); linphone_core_set_native_video_window_id([LinphoneManager getLc],(unsigned long)videoView); LinphoneCall* call = linphone_core_get_current_call([LinphoneManager getLc]); @@ -561,11 +560,19 @@ void addAnimationFadeTransition(UIView* view, float duration) { calls = calls->next; } - visibleActionSheet.actionSheetStyle = UIActionSheetStyleDefault; - if ([LinphoneManager runningOnIpad]) - [visibleActionSheet showFromRect:transfer.bounds inView:transfer animated:NO]; - else - [visibleActionSheet showInView:self.view]; + if (visibleActionSheet.numberOfButtons == ([LinphoneManager runningOnIpad] ? 1 : 2)) { + [visibleActionSheet release]; + visibleActionSheet = nil; + + [UICallButton enableTransforMode:YES]; + [[LinphoneManager instance] displayDialer]; + } else { + visibleActionSheet.actionSheetStyle = UIActionSheetStyleDefault; + if ([LinphoneManager runningOnIpad]) + [visibleActionSheet showFromRect:transfer.bounds inView:transfer animated:NO]; + else + [visibleActionSheet showInView:self.view]; + } } -(void) addCallPressed {