From 9bd5716371ef1c7d3b3f98e9b6b277050dbfcffc Mon Sep 17 00:00:00 2001 From: Gautier Pelloux-Prayer Date: Mon, 8 Feb 2016 10:44:51 +0100 Subject: [PATCH] assistant: apply transport for external accounts --- Classes/AssistantView.h | 2 -- Classes/AssistantView.m | 24 +++++++++++++-------- Classes/Base.lproj/AssistantViewScreens.xib | 5 +---- submodules/linphone | 2 +- 4 files changed, 17 insertions(+), 16 deletions(-) diff --git a/Classes/AssistantView.h b/Classes/AssistantView.h index 2ee58224c..fc9d42873 100644 --- a/Classes/AssistantView.h +++ b/Classes/AssistantView.h @@ -70,6 +70,4 @@ - (IBAction)onRemoteProvisioningLoginClick:(id)sender; - (IBAction)onRemoteProvisioningDownloadClick:(id)sender; -- (IBAction)onTransportChange:(id)sender; - @end diff --git a/Classes/AssistantView.m b/Classes/AssistantView.m index daa9e9877..23ca6ebde 100644 --- a/Classes/AssistantView.m +++ b/Classes/AssistantView.m @@ -225,6 +225,16 @@ static UICompositeViewDescription *compositeDescription = nil; } } + // set transport + UISegmentedControl *transports = (UISegmentedControl *)[self findView:ViewElement_Transport + inView:self.contentView + ofType:UISegmentedControl.class]; + if (transports) { + NSString *type = [transports titleForSegmentAtIndex:[transports selectedSegmentIndex]]; + linphone_account_creator_set_transport(account_creator, + linphone_transport_parse(type.lowercaseString.UTF8String)); + } + new_config = linphone_account_creator_configure(account_creator); if (new_config) { @@ -477,9 +487,11 @@ static UICompositeViewDescription *compositeDescription = nil; UIAssistantTextField *displayName = [self findTextField:ViewElement_DisplayName]; [displayName showError:[AssistantView errorForStatus:LinphoneAccountCreatorDisplayNameInvalid] when:^BOOL(NSString *inputEntry) { - LinphoneAccountCreatorStatus s = - linphone_account_creator_set_display_name(account_creator, inputEntry.UTF8String); - displayName.errorLabel.text = [AssistantView errorForStatus:s]; + LinphoneAccountCreatorStatus s = LinphoneAccountCreatorOK; + if (inputEntry.length > 0) { + s = linphone_account_creator_set_display_name(account_creator, inputEntry.UTF8String); + displayName.errorLabel.text = [AssistantView errorForStatus:s]; + } return s != LinphoneAccountCreatorOK; }]; @@ -728,12 +740,6 @@ void assistant_validation_tested(LinphoneAccountCreator *creator, LinphoneAccoun [self resetLiblinphone]; } -- (IBAction)onTransportChange:(id)sender { - UISegmentedControl *transports = sender; - NSString *type = [transports titleForSegmentAtIndex:[transports selectedSegmentIndex]]; - linphone_account_creator_set_transport(account_creator, linphone_transport_parse(type.lowercaseString.UTF8String)); -} - - (IBAction)onBackClick:(id)sender { if ([historyViews count] > 0) { UIView *view = [historyViews lastObject]; diff --git a/Classes/Base.lproj/AssistantViewScreens.xib b/Classes/Base.lproj/AssistantViewScreens.xib index 42b5e62eb..78f78f123 100644 --- a/Classes/Base.lproj/AssistantViewScreens.xib +++ b/Classes/Base.lproj/AssistantViewScreens.xib @@ -1,5 +1,5 @@ - + @@ -577,9 +577,6 @@ Once it is done, come back here and click on the button. - - -