diff --git a/Classes/ChatRoomViewController.m b/Classes/ChatRoomViewController.m index a776b2622..f2cdc2df4 100644 --- a/Classes/ChatRoomViewController.m +++ b/Classes/ChatRoomViewController.m @@ -393,7 +393,7 @@ static void message_status(LinphoneChatMessage* msg,LinphoneChatMessageState sta [self saveAndSend:[UIImage imageWithData:data] url:url]; }]; } - [sheet addCancelButtonWithTitle:NSLocalizedString(@"Cancel", nil)]; + [sheet addCancelButtonWithTitle:NSLocalizedString(@"Cancel", nil) block:nil]; dispatch_async(dispatch_get_main_queue(), ^{ [waitView setHidden:TRUE]; [sheet showInView:[PhoneMainView instance].view]; @@ -549,7 +549,7 @@ static void message_status(LinphoneChatMessage* msg,LinphoneChatMessageState sta block(UIImagePickerControllerSourceTypePhotoLibrary); }]; } - [sheet addCancelButtonWithTitle:NSLocalizedString(@"Cancel",nil)]; + [sheet addCancelButtonWithTitle:NSLocalizedString(@"Cancel",nil) block:nil]; [sheet showInView:[PhoneMainView instance].view]; } diff --git a/Classes/InCallViewController.m b/Classes/InCallViewController.m index 41eb4ab11..fe54143e8 100644 --- a/Classes/InCallViewController.m +++ b/Classes/InCallViewController.m @@ -491,13 +491,17 @@ static void hideSpinner(LinphoneCall* call, void* user_data) { linphone_call_params_destroy(paramsCopy); [timer invalidate]; }]; - [sheet addDestructiveButtonWithTitle:NSLocalizedString(@"Decline", nil) block:^() { + DTActionSheetBlock cancelBlock = ^() { [LinphoneLogger logc:LinphoneLoggerLog format:"User declined video proposal"]; LinphoneCallParams* paramsCopy = linphone_call_params_copy(linphone_call_get_current_params(call)); linphone_core_accept_call_update([LinphoneManager getLc], call, paramsCopy); linphone_call_params_destroy(paramsCopy); [timer invalidate]; - }]; + }; + [sheet addDestructiveButtonWithTitle:NSLocalizedString(@"Decline", nil) block:cancelBlock]; + if([LinphoneManager runningOnIpad]) { + [sheet addCancelButtonWithTitle:NSLocalizedString(@"Decline", nil) block:cancelBlock]; + } [sheet showInView:[PhoneMainView instance].view]; } diff --git a/Classes/LinphoneUI/UIContactDetailsHeader.m b/Classes/LinphoneUI/UIContactDetailsHeader.m index f9db45aa5..71538cffa 100644 --- a/Classes/LinphoneUI/UIContactDetailsHeader.m +++ b/Classes/LinphoneUI/UIContactDetailsHeader.m @@ -281,7 +281,7 @@ [self update]; }]; } - [sheet addCancelButtonWithTitle:NSLocalizedString(@"Cancel",nil)]; + [sheet addCancelButtonWithTitle:NSLocalizedString(@"Cancel",nil) block:nil]; [sheet showInView:[PhoneMainView instance].view]; } diff --git a/Classes/PhoneMainView.m b/Classes/PhoneMainView.m index 128e7bb79..88f4b0324 100644 --- a/Classes/PhoneMainView.m +++ b/Classes/PhoneMainView.m @@ -583,7 +583,7 @@ static PhoneMainView* phoneMainViewInstance=nil; if (level <= 0.2f && !callData->batteryWarningShown) { [LinphoneLogger log:LinphoneLoggerLog format:@"Battery warning"]; DTActionSheet *sheet = [[[DTActionSheet alloc] initWithTitle:NSLocalizedString(@"Battery is running low. Stop video ?",nil)] autorelease]; - [sheet addCancelButtonWithTitle:NSLocalizedString(@"Continue video", nil)]; + [sheet addCancelButtonWithTitle:NSLocalizedString(@"Continue video", nil) block:nil]; [sheet addDestructiveButtonWithTitle:NSLocalizedString(@"Stop video", nil) block:^() { LinphoneCallParams* paramsCopy = linphone_call_params_copy(linphone_call_get_current_params(call)); // stop video diff --git a/Classes/Utils/DTFoundation/DTActionSheet.h b/Classes/Utils/DTFoundation/DTActionSheet.h index 2c2a8b23d..71ab47650 100755 --- a/Classes/Utils/DTFoundation/DTActionSheet.h +++ b/Classes/Utils/DTFoundation/DTActionSheet.h @@ -42,8 +42,9 @@ typedef void (^DTActionSheetBlock)(void); 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. + @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)addCancelButtonWithTitle:(NSString *)title; +- (NSInteger)addCancelButtonWithTitle:(NSString *)title block:(DTActionSheetBlock)block; @end diff --git a/Classes/Utils/DTFoundation/DTActionSheet.m b/Classes/Utils/DTFoundation/DTActionSheet.m index eeb2161bc..070d974de 100755 --- a/Classes/Utils/DTFoundation/DTActionSheet.m +++ b/Classes/Utils/DTFoundation/DTActionSheet.m @@ -74,9 +74,9 @@ return retIndex; } -- (NSInteger)addCancelButtonWithTitle:(NSString *)title +- (NSInteger)addCancelButtonWithTitle:(NSString *)title block:(DTActionSheetBlock)block { - NSInteger retIndex = [self addButtonWithTitle:title]; + NSInteger retIndex = [self addButtonWithTitle:title block:block]; [self setCancelButtonIndex:retIndex]; return retIndex; diff --git a/linphone.xcodeproj/project.pbxproj b/linphone.xcodeproj/project.pbxproj index 79dcf85cd..47d44ea1f 100755 --- a/linphone.xcodeproj/project.pbxproj +++ b/linphone.xcodeproj/project.pbxproj @@ -5673,7 +5673,7 @@ isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(ARCHS_STANDARD_32_BIT)"; - CODE_SIGN_IDENTITY = "iPhone Developer: jehan monnier (E8MYPN2NXL)"; + CODE_SIGN_IDENTITY = "iPhone Developer"; GCC_THUMB_SUPPORT = NO; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; GCC_WARN_ABOUT_RETURN_TYPE = YES; @@ -5681,7 +5681,7 @@ HEADER_SEARCH_PATHS = ""; IPHONEOS_DEPLOYMENT_TARGET = 4.3; LIBRARY_SEARCH_PATHS = ""; - PROVISIONING_PROFILE = "2AC0DC11-4546-47B6-8B8A-453CCA80903C"; + PROVISIONING_PROFILE = ""; SDKROOT = iphoneos; STANDARD_C_PLUS_PLUS_LIBRARY_TYPE = dynamic; TARGETED_DEVICE_FAMILY = "1,2";