Merge pull request #2596 from VladiMihaylenko/vm-master

[ios] Fixed bug and cherry picks.
This commit is contained in:
Alex Zolotarev 2016-03-29 13:19:12 +04:00
commit 589b0217ac
5 changed files with 24 additions and 22 deletions

View file

@ -18,21 +18,21 @@ extern NSString * const kMap2GoogleLoginSegue;
- (IBAction)facebookTap
{
[Statistics logEvent:kStatEditorAuthRequets withParameters:@{kStatValue : kStatFacebook}];
[Statistics logEvent:kStatEditorAuthRequets withParameters:@{kStatValue : kStatFacebook, kStatFrom : kStatEdit}];
[self close];
[self.alertController.ownerViewController performSegueWithIdentifier:kMap2FBLoginSegue sender:nil];
}
- (IBAction)googleTap
{
[Statistics logEvent:kStatEditorAuthRequets withParameters:@{kStatValue : kStatGoogle}];
[Statistics logEvent:kStatEditorAuthRequets withParameters:@{kStatValue : kStatGoogle, kStatFrom : kStatEdit}];
[self close];
[self.alertController.ownerViewController performSegueWithIdentifier:kMap2GoogleLoginSegue sender:nil];
}
- (IBAction)osmTap
{
[Statistics logEvent:kStatEditorAuthRequets withParameters:@{kStatValue : kStatOSM}];
[Statistics logEvent:kStatEditorAuthRequets withParameters:@{kStatValue : kStatOSM, kStatFrom : kStatEdit}];
[self close];
[self.alertController.ownerViewController performSegueWithIdentifier:kMap2OsmLoginSegue sender:nil];
}
@ -40,7 +40,7 @@ extern NSString * const kMap2GoogleLoginSegue;
- (IBAction)signUpTap
{
[self close];
[Statistics logEvent:kStatEditorRegRequest];
[Statistics logEvent:kStatEditorRegRequest withParameters:@{kStatFrom : kStatEdit}];
NSURL * url = [NSURL URLWithString:@(osm::OsmOAuth::ServerAuth().GetRegistrationURL().c_str())];
[[UIApplication sharedApplication] openURL:url];
}

View file

@ -192,7 +192,7 @@ using namespace osm_auth_ios;
{
[self performOnlineAction:^
{
[Statistics logEvent:kStatEditorAuthRequets withParameters:@{kStatValue : kStatGoogle}];
[Statistics logEvent:kStatEditorAuthRequets withParameters:@{kStatValue : kStatGoogle, kStatFrom : kStatProfile}];
[self performSegueWithIdentifier:kWebViewAuthSegue sender:self.loginGoogleButton];
}];
}
@ -201,7 +201,7 @@ using namespace osm_auth_ios;
{
[self performOnlineAction:^
{
[Statistics logEvent:kStatEditorAuthRequets withParameters:@{kStatValue : kStatFacebook}];
[Statistics logEvent:kStatEditorAuthRequets withParameters:@{kStatValue : kStatFacebook, kStatFrom : kStatProfile}];
[self performSegueWithIdentifier:kWebViewAuthSegue sender:self.loginFacebookButton];
}];
}
@ -210,7 +210,7 @@ using namespace osm_auth_ios;
{
[self performOnlineAction:^
{
[Statistics logEvent:kStatEditorAuthRequets withParameters:@{kStatValue : kStatOSM}];
[Statistics logEvent:kStatEditorAuthRequets withParameters:@{kStatValue : kStatOSM, kStatFrom : kStatProfile}];
[self performSegueWithIdentifier:kOSMAuthSegue sender:self.loginOSMButton];
}];
}
@ -219,14 +219,14 @@ using namespace osm_auth_ios;
{
[self performOnlineAction:^
{
[Statistics logEvent:kStatEditorRegRequest];
[Statistics logEvent:kStatEditorRegRequest withParameters:@{kStatFrom : kStatProfile}];
OsmOAuth const auth = OsmOAuth::ServerAuth();
NSURL * url = [NSURL URLWithString:@(auth.GetRegistrationURL().c_str())];
[[UIApplication sharedApplication] openURL:url];
}];
}
- (IBAction)logout
- (IBAction)logout:(UIButton *)sender
{
self.actionSheetFunctor = [self]
{
@ -234,7 +234,7 @@ using namespace osm_auth_ios;
AuthorizationStoreCredentials({});
[self cancel];
};
[self showWarningActionSheetWithActionTitle:L(@"logout")];
[self showWarningActionSheetWithActionTitle:L(@"logout") sourceView:sender];
}
- (IBAction)cancel
@ -242,7 +242,7 @@ using namespace osm_auth_ios;
[self.navigationController popViewControllerAnimated:YES];
}
- (IBAction)localChangesAction
- (IBAction)localChangesAction:(UIButton *)sender
{
self.actionSheetFunctor = [self]
{
@ -250,12 +250,12 @@ using namespace osm_auth_ios;
[self configChanges];
[self configEmptyProfile];
};
[self showWarningActionSheetWithActionTitle:L(@"delete")];
[self showWarningActionSheetWithActionTitle:L(@"delete") sourceView:sender];
}
#pragma mark - ActionSheet
- (void)showWarningActionSheetWithActionTitle:(NSString *)title
- (void)showWarningActionSheetWithActionTitle:(NSString *)title sourceView:(UIView *)view
{
NSString * cancel = L(@"cancel");
if (isIOS7)
@ -273,6 +273,12 @@ using namespace osm_auth_ios;
}];
[alertController addAction:cancelAction];
[alertController addAction:commonAction];
if (IPAD)
{
UIPopoverPresentationController * popPresenter = [alertController popoverPresentationController];
popPresenter.sourceView = view;
}
[self presentViewController:alertController animated:YES completion:nil];
}
}

View file

@ -18,13 +18,8 @@ namespace
- (void)viewDidLoad
{
[super viewDidLoad];
[self configNavBar];
}
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
self.placeDoesntExistCell.accessoryType = UITableViewCellAccessoryNone;
[self configNavBar];
}
- (void)configNavBar

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10116" systemVersion="15D21" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="Wns-nH-AQU">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10116" systemVersion="15E65" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="Wns-nH-AQU">
<dependencies>
<deployment version="2048" identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
@ -1941,7 +1941,7 @@
<userDefinedRuntimeAttribute type="string" keyPath="coloringName" value="MWMGray"/>
</userDefinedRuntimeAttributes>
<connections>
<action selector="localChangesAction" destination="iZ6-Zi-bkZ" eventType="touchUpInside" id="Ycj-6E-vDD"/>
<action selector="localChangesAction:" destination="iZ6-Zi-bkZ" eventType="touchUpInside" id="4Gi-vX-ESJ"/>
</connections>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Changes: 4" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="6t0-ph-htV">
@ -2253,7 +2253,7 @@
<userDefinedRuntimeAttribute type="string" keyPath="layer.borderColorName" value="whitePrimaryText"/>
</userDefinedRuntimeAttributes>
<connections>
<action selector="logout" destination="iZ6-Zi-bkZ" eventType="touchUpInside" id="BCT-mT-JzT"/>
<action selector="logout:" destination="iZ6-Zi-bkZ" eventType="touchUpInside" id="FcC-iH-0c0"/>
</connections>
</button>
</subviews>

View file

@ -141,6 +141,7 @@ static NSString * const kStatPlacePage = @"Place page";
static NSString * const kStatPointToPoint = @"Point to point";
static NSString * const kStatPortrait = @"Portrait";
static NSString * const kStatProblem = @"Problem";
static NSString * const kStatProfile = @"Profile";
static NSString * const kStatProgress = @"Progress";
static NSString * const kStatPushReceived = @"Push received";
static NSString * const kStatRate = @"Rate";