From fd9a110c8ff155644c5d876e888814b61eda74a0 Mon Sep 17 00:00:00 2001 From: QuentinArguillere Date: Wed, 2 Feb 2022 16:15:27 +0100 Subject: [PATCH] [WIP] Add information screen when logging through a non-linphone sip account to inform that several features will be missing --- Classes/AssistantView.h | 4 ++ Classes/AssistantView.m | 23 +++++++++ Classes/Base.lproj/AssistantViewScreens.xib | 56 +++++++++++++++++++-- 3 files changed, 79 insertions(+), 4 deletions(-) diff --git a/Classes/AssistantView.h b/Classes/AssistantView.h index 2d0371953..70a7e006f 100644 --- a/Classes/AssistantView.h +++ b/Classes/AssistantView.h @@ -49,6 +49,7 @@ @property(nonatomic, strong) IBOutlet UIView *createAccountActivateEmailView; @property(nonatomic, strong) IBOutlet UIView *linphoneLoginView; @property(nonatomic, strong) IBOutlet UIView *loginView; +@property(nonatomic, strong) IBOutlet UIView *linphoneSpecificFeatureWarningView; @property(nonatomic, strong) IBOutlet UIView *remoteProvisioningLoginView; @property(strong, nonatomic) IBOutlet UIView *remoteProvisioningView; @property (strong, nonatomic) IBOutlet UIView *createAccountActivateSMSView; @@ -57,6 +58,7 @@ @property(nonatomic, strong) IBOutlet UIImageView *welcomeLogoImage; @property(nonatomic, strong) IBOutlet UIButton *gotoCreateAccountButton; @property(nonatomic, strong) IBOutlet UIButton *gotoLinphoneLoginButton; +@property(nonatomic, strong) IBOutlet UIView *gotoLinphoneSpecificFeatureWarningButton; @property(nonatomic, strong) IBOutlet UIButton *gotoLoginButton; @property(nonatomic, strong) IBOutlet UIButton *gotoRemoteProvisioningButton; @property (weak, nonatomic) IBOutlet UILabel *phoneLabel; @@ -64,6 +66,8 @@ @property (weak, nonatomic) IBOutlet UILabel *activationTitle; @property (weak, nonatomic) IBOutlet UILabel *activationEmailText; @property (weak, nonatomic) IBOutlet UILabel *activationSMSText; +@property (weak, nonatomic) IBOutlet UILabel *linphoneSpecificFeatureWarningText; +@property (weak, nonatomic) IBOutlet UILabel *linphoneSpecificFeatureWarningContactLink; @property (weak, nonatomic) IBOutlet UILabel *accountLabel; @property (weak, nonatomic) IBOutlet UIButton *qrCodeButton; diff --git a/Classes/AssistantView.m b/Classes/AssistantView.m index b6b5b65db..a1ea5ce54 100644 --- a/Classes/AssistantView.m +++ b/Classes/AssistantView.m @@ -91,6 +91,22 @@ static UICompositeViewDescription *compositeDescription = nil; #pragma mark - ViewController Functions +- (IBAction)onContactTap { + NSString *url = @"https://www.linphone.org/contact"; + if (![UIApplication.sharedApplication openURL:[NSURL URLWithString:url]]) { + LOGE(@"Failed to open %@, invalid URL", url); + } +} + +- (void)viewDidLoad { + [super viewDidLoad]; + UITapGestureRecognizer *tapGestureRecognizer = + [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onContactTap)]; + tapGestureRecognizer.numberOfTapsRequired = 1; + [_linphoneSpecificFeatureWarningContactLink addGestureRecognizer:tapGestureRecognizer]; + _linphoneSpecificFeatureWarningContactLink.userInteractionEnabled = YES; +} + - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; @@ -1388,6 +1404,13 @@ void assistant_is_account_linked(LinphoneAccountCreator *creator, LinphoneAccoun }); } +- (IBAction)onGoToNonLinphoneInfoPage:(id)sender { + ONCLICKBUTTON(sender, 100, { + nextView = _linphoneSpecificFeatureWarningView; + [self changeView:nextView back:FALSE animation:TRUE]; + }); +} + - (IBAction)onGotoRemoteProvisioningClick:(id)sender { ONCLICKBUTTON(sender, 100, { nextView = _remoteProvisioningView; diff --git a/Classes/Base.lproj/AssistantViewScreens.xib b/Classes/Base.lproj/AssistantViewScreens.xib index 847755544..8d7a06be5 100644 --- a/Classes/Base.lproj/AssistantViewScreens.xib +++ b/Classes/Base.lproj/AssistantViewScreens.xib @@ -1,9 +1,9 @@ - + - + @@ -22,11 +22,15 @@ - + + + + + @@ -156,7 +160,7 @@ - + + + + + + + + + + + + + + + +