mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-24 22:58:13 +00:00
Fix tap on button in Wizard
Add check on external/linphone.org account
This commit is contained in:
parent
db28d3cc7d
commit
fe5b67bac5
6 changed files with 116 additions and 9 deletions
|
|
@ -21,7 +21,7 @@
|
|||
#import <XMLRPCConnectionDelegate.h>
|
||||
#import "UICompositeViewController.h"
|
||||
|
||||
@interface WizardViewController : TPMultiLayoutViewController <UITextFieldDelegate, UICompositeViewDelegate, XMLRPCConnectionDelegate> {
|
||||
@interface WizardViewController : TPMultiLayoutViewController <UITextFieldDelegate, UICompositeViewDelegate, XMLRPCConnectionDelegate, UIGestureRecognizerDelegate> {
|
||||
@private
|
||||
UITextField *activeTextField;
|
||||
UIView *currentView;
|
||||
|
|
|
|||
|
|
@ -154,6 +154,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
[super viewDidLoad];
|
||||
|
||||
[viewTapGestureRecognizer setCancelsTouchesInView:FALSE];
|
||||
[viewTapGestureRecognizer setDelegate:self];
|
||||
[contentView addGestureRecognizer:viewTapGestureRecognizer];
|
||||
|
||||
if([LinphoneManager runningOnIpad]) {
|
||||
|
|
@ -490,20 +491,59 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
}
|
||||
|
||||
- (IBAction)onSignInExternalClick:(id)sender {
|
||||
[self.waitView setHidden:false];
|
||||
NSString *username = [WizardViewController findTextField:ViewElement_Username view:contentView].text;
|
||||
NSString *password = [WizardViewController findTextField:ViewElement_Password view:contentView].text;
|
||||
NSString *domain = [WizardViewController findTextField:ViewElement_Domain view:contentView].text;
|
||||
[self addProxyConfig:username password:password domain:domain server:nil];
|
||||
|
||||
|
||||
NSMutableString *errors = [NSMutableString string];
|
||||
if ([username length] == 0) {
|
||||
|
||||
[errors appendString:[NSString stringWithFormat:NSLocalizedString(@"Please enter a username.\n", nil)]];
|
||||
}
|
||||
|
||||
if ([domain length] == 0) {
|
||||
[errors appendString:[NSString stringWithFormat:NSLocalizedString(@"Please enter a domain.\n", nil)]];
|
||||
}
|
||||
|
||||
if([errors length]) {
|
||||
UIAlertView* errorView = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Check error(s)",nil)
|
||||
message:[errors substringWithRange:NSMakeRange(0, [errors length] - 1)]
|
||||
delegate:nil
|
||||
cancelButtonTitle:NSLocalizedString(@"Continue",nil)
|
||||
otherButtonTitles:nil,nil];
|
||||
[errorView show];
|
||||
[errorView release];
|
||||
} else {
|
||||
[self.waitView setHidden:false];
|
||||
[self addProxyConfig:username password:password domain:domain server:nil];
|
||||
}
|
||||
}
|
||||
|
||||
- (IBAction)onSignInClick:(id)sender {
|
||||
[self.waitView setHidden:false];
|
||||
NSString *username = [WizardViewController findTextField:ViewElement_Username view:contentView].text;
|
||||
NSString *password = [WizardViewController findTextField:ViewElement_Password view:contentView].text;
|
||||
[self addProxyConfig:username password:password
|
||||
domain:[[LinphoneManager instance] lpConfigStringForKey:@"domain" forSection:@"wizard"]
|
||||
server:[[LinphoneManager instance] lpConfigStringForKey:@"proxy" forSection:@"wizard"]];
|
||||
|
||||
NSMutableString *errors = [NSMutableString string];
|
||||
if ([username length] == 0) {
|
||||
|
||||
[errors appendString:[NSString stringWithFormat:NSLocalizedString(@"Please enter a username.\n", nil)]];
|
||||
}
|
||||
|
||||
if([errors length]) {
|
||||
UIAlertView* errorView = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Check error(s)",nil)
|
||||
message:[errors substringWithRange:NSMakeRange(0, [errors length] - 1)]
|
||||
delegate:nil
|
||||
cancelButtonTitle:NSLocalizedString(@"Continue",nil)
|
||||
otherButtonTitles:nil,nil];
|
||||
[errorView show];
|
||||
[errorView release];
|
||||
} else {
|
||||
[self.waitView setHidden:false];
|
||||
[self addProxyConfig:username password:password
|
||||
domain:[[LinphoneManager instance] lpConfigStringForKey:@"domain" forSection:@"wizard"]
|
||||
server:[[LinphoneManager instance] lpConfigStringForKey:@"proxy" forSection:@"wizard"]];
|
||||
}
|
||||
}
|
||||
|
||||
- (IBAction)onRegisterClick:(id)sender {
|
||||
|
|
@ -732,4 +772,15 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
view.autoresizingMask = [[attributes objectForKey:@"autoresizingMask"] integerValue];
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - UIGestureRecognizerDelegate Functions
|
||||
|
||||
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch {
|
||||
if ([touch.view isKindOfClass:[UIButton class]]) { //Avoid tap gesture on Button
|
||||
[LinphoneUtils findAndResignFirstResponder:currentView];
|
||||
return NO;
|
||||
}
|
||||
return YES;
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
|
|
@ -11997,7 +11997,7 @@
|
|||
</dict>
|
||||
</dict>
|
||||
<key>change date</key>
|
||||
<date>2012-09-27T16:22:23Z</date>
|
||||
<date>2012-09-28T08:39:17Z</date>
|
||||
<key>changed values</key>
|
||||
<array/>
|
||||
<key>class</key>
|
||||
|
|
@ -12007,7 +12007,7 @@
|
|||
<key>flags</key>
|
||||
<integer>0</integer>
|
||||
<key>hash</key>
|
||||
<string>6b28bbe0cc4362b29f1a00eec7d9ad2d
|
||||
<string>974d882db652398dc5678a38298fec69
|
||||
</string>
|
||||
<key>name</key>
|
||||
<string>Localizable.strings</string>
|
||||
|
|
@ -13589,6 +13589,62 @@ La cause était: %2$@</string>
|
|||
<key>snapshots</key>
|
||||
<dict/>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>change date</key>
|
||||
<date>2001-01-01T00:00:00Z</date>
|
||||
<key>changed values</key>
|
||||
<array/>
|
||||
<key>class</key>
|
||||
<string>BLStringKeyObject</string>
|
||||
<key>comment</key>
|
||||
<string>No comment provided by engineer.</string>
|
||||
<key>errors</key>
|
||||
<array/>
|
||||
<key>flags</key>
|
||||
<integer>0</integer>
|
||||
<key>key</key>
|
||||
<string>Please enter a doamin.
|
||||
</string>
|
||||
<key>localizations</key>
|
||||
<dict>
|
||||
<key>en</key>
|
||||
<string>Please enter a domain.
|
||||
</string>
|
||||
<key>fr</key>
|
||||
<string>Entrez un nom de domaine.
|
||||
</string>
|
||||
</dict>
|
||||
<key>snapshots</key>
|
||||
<dict/>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>change date</key>
|
||||
<date>2001-01-01T00:00:00Z</date>
|
||||
<key>changed values</key>
|
||||
<array/>
|
||||
<key>class</key>
|
||||
<string>BLStringKeyObject</string>
|
||||
<key>comment</key>
|
||||
<string>No comment provided by engineer.</string>
|
||||
<key>errors</key>
|
||||
<array/>
|
||||
<key>flags</key>
|
||||
<integer>0</integer>
|
||||
<key>key</key>
|
||||
<string>Please enter a username.
|
||||
</string>
|
||||
<key>localizations</key>
|
||||
<dict>
|
||||
<key>en</key>
|
||||
<string>Please enter a username.
|
||||
</string>
|
||||
<key>fr</key>
|
||||
<string>Entrez un nom d'utilisateur.
|
||||
</string>
|
||||
</dict>
|
||||
<key>snapshots</key>
|
||||
<dict/>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>change date</key>
|
||||
<date>2001-01-01T00:00:00Z</date>
|
||||
|
|
|
|||
Binary file not shown.
Loading…
Add table
Reference in a new issue