diff --git a/iphone/Maps/Categories/UIKitCategories.m b/iphone/Maps/Categories/UIKitCategories.m index f60f902c4a..f07c2ec7a3 100644 --- a/iphone/Maps/Categories/UIKitCategories.m +++ b/iphone/Maps/Categories/UIKitCategories.m @@ -10,14 +10,9 @@ - (void)performAfterDelay:(NSTimeInterval)delay block:(void (^)(void))block { -#warning Переписать - - [self performSelector:@selector(fireBlockAfterDelay:) withObject:[block copy] afterDelay:delay]; -} - -- (void)fireBlockAfterDelay:(void (^)(void))block -{ - block(); + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delay * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + block(); + }); } @end diff --git a/iphone/Maps/Classes/MWMAlertDownloaderManager.h b/iphone/Maps/Classes/MWMAlertDownloaderManager.h new file mode 100644 index 0000000000..e338c508b0 --- /dev/null +++ b/iphone/Maps/Classes/MWMAlertDownloaderManager.h @@ -0,0 +1,21 @@ +// +// MWMMapsDownloaderDelegate.h +// Maps +// +// Created by v.mikhaylenko on 07.03.15. +// Copyright (c) 2015 MapsWithMe. All rights reserved. +// + +#import +#import "MWMAlertViewControllerDelegate.h" + +#include "../../../std/vector.hpp" +#include "../../../map/country_status_display.hpp" + + +@interface MWMAlertDownloaderManager : NSObject + +- (instancetype)initWithMapsIndexes:(const vector&)indexes; +@property (nonatomic, copy) NSString *countryName; +@property (nonatomic, assign) NSUInteger size; +@end diff --git a/iphone/Maps/Classes/MWMAlertDownloaderManager.mm b/iphone/Maps/Classes/MWMAlertDownloaderManager.mm new file mode 100644 index 0000000000..36f79c6f3c --- /dev/null +++ b/iphone/Maps/Classes/MWMAlertDownloaderManager.mm @@ -0,0 +1,32 @@ +// +// MWMMapsDownloaderDelegate.m +// Maps +// +// Created by v.mikhaylenko on 07.03.15. +// Copyright (c) 2015 MapsWithMe. All rights reserved. +// + +#import "MWMAlertDownloaderManager.h" +#include "Framework.h" + +@implementation MWMAlertDownloaderManager { + vector _indexes; +} + + +- (instancetype)initWithMapsIndexes:(const vector &)indexes { + self = [super init]; + if (self) { + _indexes = indexes; + self.countryName = [NSString stringWithUTF8String:GetFramework().GetCountryTree().GetActiveMapLayout().GetFormatedCountryName(_indexes[0]).c_str()]; + self.size = GetFramework().GetCountryTree().GetActiveMapLayout().GetCountrySize(_indexes[0], storage::TMapOptions::EMapWithCarRouting).second/(1024 * 1024); + } + return self; +} + +- (void)downloadMaps { + GetFramework().GetCountryTree().GetActiveMapLayout().DownloadMap(_indexes[0], storage::TMapOptions::EMapWithCarRouting); +} + + +@end diff --git a/iphone/Maps/Classes/MWMAlertEntity.h b/iphone/Maps/Classes/MWMAlertEntity.h index 7b907d0d83..106db29392 100644 --- a/iphone/Maps/Classes/MWMAlertEntity.h +++ b/iphone/Maps/Classes/MWMAlertEntity.h @@ -7,11 +7,21 @@ // #import +#include "../../../std/vector.hpp" +#include "../../../map/country_status_display.hpp" + +typedef NS_ENUM(NSUInteger, MWMAlertEntityType) { + MWMAlertEntityTypeDownloader +}; @interface MWMAlertEntity : NSObject + @property (nonatomic, copy) NSString *title; @property (nonatomic, copy) NSString *message; @property (nonatomic, copy) NSString *contry; @property (nonatomic, copy) NSString *location; -@property (nonatomic, copy) NSString *size; +@property (nonatomic, assign) NSUInteger size; + ++ (instancetype)entityWithType:(MWMAlertEntityType)type; + @end diff --git a/iphone/Maps/Classes/MWMAlertEntity.mm b/iphone/Maps/Classes/MWMAlertEntity.mm index 6317a5cd96..42355c149a 100644 --- a/iphone/Maps/Classes/MWMAlertEntity.mm +++ b/iphone/Maps/Classes/MWMAlertEntity.mm @@ -7,7 +7,9 @@ // #import "MWMAlertEntity.h" -#include +#include +#include "../../../map/country_status_display.hpp" +#include @interface MWMAlertEntity () @@ -16,16 +18,22 @@ @implementation MWMAlertEntity -- (instancetype)initWithCallbackString:(const std::string &)string { - self = [super init]; - if (self) { - [self processCallbackString:string]; ++ (instancetype)entityWithType:(MWMAlertEntityType)type { + MWMAlertEntity *entity = [[MWMAlertEntity alloc] init]; + switch (type) { + case MWMAlertEntityTypeDownloader: + [self setupEntityDownloaderAlert:entity]; + break; } - return self; + return entity; } -- (void)processCallbackString:(const std::string &)string { - ++ (void)setupEntityDownloaderAlert:(MWMAlertEntity *)entity { + entity.title = @"Download all maps along your route"; + entity.message = @"Creating routes between regions is only possible when all the maps are downloaded and updates"; + entity.location = @"Chammpagne"; } + + @end diff --git a/iphone/Maps/Classes/MWMAlertViewController.h b/iphone/Maps/Classes/MWMAlertViewController.h index 44e47c55c9..6d8a50c250 100644 --- a/iphone/Maps/Classes/MWMAlertViewController.h +++ b/iphone/Maps/Classes/MWMAlertViewController.h @@ -8,9 +8,15 @@ #import #import "MWMAlert.h" +@protocol MWMAlertViewControllerDelegate; @interface MWMAlertViewController : UIViewController + +@property (nonatomic, weak) id delegate; +@property (nonatomic, weak, readonly) UIViewController *ownerViewController; + - (instancetype)initWithViewController:(UIViewController *)viewController; - (void)presentAlertWithType:(MWMAlertType)type; - (void)close; + @end diff --git a/iphone/Maps/Classes/MWMAlertViewController.m b/iphone/Maps/Classes/MWMAlertViewController.mm similarity index 74% rename from iphone/Maps/Classes/MWMAlertViewController.m rename to iphone/Maps/Classes/MWMAlertViewController.mm index ad98ad8fc6..4f298390d5 100644 --- a/iphone/Maps/Classes/MWMAlertViewController.m +++ b/iphone/Maps/Classes/MWMAlertViewController.mm @@ -9,11 +9,12 @@ #import "MWMAlertViewController.h" #import "MWMDownloadAllMapsAlert.h" #import "MWMAlertEntity.h" +#import "MWMAlertViewControllerDelegate.h" static NSString * const kAlertControllerNibIdentifier = @"MWMAlertViewController"; @interface MWMAlertViewController () -@property (nonatomic, weak) UIViewController *ownerViewController; +@property (nonatomic, weak, readwrite) UIViewController *ownerViewController; @end @implementation MWMAlertViewController @@ -36,13 +37,9 @@ static NSString * const kAlertControllerNibIdentifier = @"MWMAlertViewController - (void)presentAlertWithType:(MWMAlertType)type { MWMAlert *alert = [MWMAlert alertWithType:type]; alert.alertController = self; - MWMAlertEntity *entity = [[MWMAlertEntity alloc] init]; - entity.title = @"Download all maps"; - entity.message = @"hihihihihihihihihi hihihihihi hihihihihih ihihihihihihi hihihihih ihihihihih ihihihihihihihihi hihihihihihihihi hihihihihihihi hihihihihihihi hihihihihihi hihihihihi hihihihihi hihihihihi hihihihihi"; - entity.contry = @"adbsgndlkgndklsnfkldsnglfdksjnglkdfsgjn"; - entity.location = @"dkjsgnkdsnjglkdsng"; - entity.size = @"1000"; - + MWMAlertEntity *entity = [MWMAlertEntity entityWithType:MWMAlertEntityTypeDownloader]; + entity.contry = self.delegate.countryName; + entity.size = self.delegate.size; [alert configureWithEntity:entity]; [self.view addSubview:alert]; alert.center = self.view.center; diff --git a/iphone/Maps/Classes/MWMAlertViewControllerDelegate.h b/iphone/Maps/Classes/MWMAlertViewControllerDelegate.h new file mode 100644 index 0000000000..208705cb40 --- /dev/null +++ b/iphone/Maps/Classes/MWMAlertViewControllerDelegate.h @@ -0,0 +1,17 @@ +// +// MWMAlertViewControllerDelegate.h +// Maps +// +// Created by v.mikhaylenko on 07.03.15. +// Copyright (c) 2015 MapsWithMe. All rights reserved. +// + +#import + +@protocol MWMAlertViewControllerDelegate + +@required +- (void)downloadMaps; +@property (nonatomic, copy) NSString *countryName; +@property (nonatomic, assign) NSUInteger size; +@end diff --git a/iphone/Maps/Classes/MWMDownloadAllMapsAlert.m b/iphone/Maps/Classes/MWMDownloadAllMapsAlert.mm similarity index 87% rename from iphone/Maps/Classes/MWMDownloadAllMapsAlert.m rename to iphone/Maps/Classes/MWMDownloadAllMapsAlert.mm index 812d474564..7feb345727 100644 --- a/iphone/Maps/Classes/MWMDownloadAllMapsAlert.m +++ b/iphone/Maps/Classes/MWMDownloadAllMapsAlert.mm @@ -10,6 +10,8 @@ #import "MWMAlertViewController.h" #import "MWMAlertEntity.h" #import "UIKitCategories.h" +#import "MWMAlertViewControllerDelegate.h" +#import "ActiveMapsVC.h" @interface MWMDownloadAllMapsAlert () @property (nonatomic, weak) IBOutlet UILabel *titleLabel; @@ -34,7 +36,7 @@ - (void)configureWithEntity:(MWMAlertEntity *)entity { self.titleLabel.text = entity.title; self.messageLabel.text = entity.message; - self.sizeLabel.text = entity.size; + self.sizeLabel.text = [NSString stringWithFormat:@"%@ MB",@(entity.size)]; self.locationLabel.text = entity.location; self.countryLabel.text = entity.contry; [self configureViewSize]; @@ -52,7 +54,7 @@ - (void)configureSpecsViewSize { const CGFloat topSpecsViewOffset = 12.; const CGFloat bottonSpecsViewOffset = 10.; - const CGFloat middleSpecsViewOffset = 15.; + const CGFloat middleSpecsViewOffset = 10.; const CGFloat specsViewHeight = topSpecsViewOffset + bottonSpecsViewOffset + middleSpecsViewOffset + self.countryLabel.frame.size.height + self.locationLabel.frame.size.height; [self.specsView setHeight:specsViewHeight]; [self.locationLabel setMinY:topSpecsViewOffset]; @@ -79,7 +81,11 @@ } - (IBAction)downloadButtonTap:(id)sender { + [self.alertController.delegate downloadMaps]; [self.alertController close]; + ActiveMapsVC *activeMapsViewController = [[ActiveMapsVC alloc] init]; + [self.alertController.ownerViewController.navigationController pushViewController:activeMapsViewController animated:YES]; + } @end diff --git a/iphone/Maps/Classes/MWMDownloaderController.h b/iphone/Maps/Classes/MWMDownloaderController.h new file mode 100644 index 0000000000..12823fcbd8 --- /dev/null +++ b/iphone/Maps/Classes/MWMDownloaderController.h @@ -0,0 +1,15 @@ +// +// MWMDownloaderController.h +// Maps +// +// Created by v.mikhaylenko on 07.03.15. +// Copyright (c) 2015 MapsWithMe. All rights reserved. +// + +#import + +@interface MWMDownloaderController : UIViewController +- (instancetype)initWithViewController:(UIViewController *)viewController; +- (void)present; +- (void)close; +@end diff --git a/iphone/Maps/Classes/MWMDownloaderController.m b/iphone/Maps/Classes/MWMDownloaderController.m new file mode 100644 index 0000000000..e151e11fe0 --- /dev/null +++ b/iphone/Maps/Classes/MWMDownloaderController.m @@ -0,0 +1,33 @@ +// +// MWMDownloaderController.m +// Maps +// +// Created by v.mikhaylenko on 07.03.15. +// Copyright (c) 2015 MapsWithMe. All rights reserved. +// + +#import "MWMDownloaderController.h" + +@interface MWMDownloaderController () +@property (nonatomic, weak) UIViewController *ownerViewController; +@end + +@implementation MWMDownloaderController + +- (instancetype)initWithViewController:(UIViewController *)viewController { + self = [super init]; + if (self) { + self.ownerViewController = viewController; + } + return self; +} + +- (void)present { + +} + +- (void)close { + +} + +@end diff --git a/iphone/Maps/Classes/MWMDownloaderViewController.xib b/iphone/Maps/Classes/MWMDownloaderViewController.xib new file mode 100644 index 0000000000..7a7ba28b43 --- /dev/null +++ b/iphone/Maps/Classes/MWMDownloaderViewController.xib @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/iphone/Maps/Classes/MapViewController.mm b/iphone/Maps/Classes/MapViewController.mm index 7b035448a3..2958e8310b 100644 --- a/iphone/Maps/Classes/MapViewController.mm +++ b/iphone/Maps/Classes/MapViewController.mm @@ -16,6 +16,7 @@ #import "CountryTreeVC.h" #import "Reachability.h" #import "MWMAlertViewController.h" +#import "MWMAlertDownloaderManager.h" #import "../../Common/CustomAlertView.h" @@ -80,6 +81,7 @@ @property (nonatomic) ContainerView * containerView; @property (nonatomic) UIImageView * apiBar; @property (nonatomic) UILabel * apiTitleLabel; +@property (nonatomic, strong) MWMAlertDownloaderManager *downloaderManager; @end @@ -149,7 +151,7 @@ if (res.IsValid()) { - NSMutableDictionary *routeInfo = [NSMutableDictionary new]; + NSMutableDictionary *routeInfo = [NSMutableDictionary dictionary]; routeInfo[@"timeToTarget"] = @(res.m_time); routeInfo[@"targetDistance"] = [NSString stringWithUTF8String:res.m_distToTarget.c_str()]; routeInfo[@"targetMetrics"] = [NSString stringWithUTF8String:res.m_targetUnitsSuffix.c_str()]; @@ -740,39 +742,41 @@ f.SetRouteBuildingListener([self, &f](routing::IRouter::ResultCode code, vector const & absentCountries) { [self.containerView.placePage showBuildingRoutingActivity:NO]; - if (code == routing::IRouter::ResultCode::NoError) - { - f.GetBalloonManager().RemovePin(); - f.GetBalloonManager().Dismiss(); - [self.containerView.placePage setState:PlacePageStateHidden animated:YES withCallback:YES]; - [self.searchView setState:SearchViewStateHidden animated:YES withCallback:YES]; - [self performAfterDelay:0.3 block:^{ - [self.routeView setState:RouteViewStateInfo animated:YES]; - [self updateRoutingInfo]; - }]; - - bool isDisclaimerApproved = false; - (void)Settings::Get("IsDisclaimerApproved", isDisclaimerApproved); - if (!isDisclaimerApproved) - { - NSString * title; - NSString * message; - if (SYSTEM_VERSION_IS_LESS_THAN(@"7.0")) - message = L(@"routing_disclaimer"); - else - title = L(@"routing_disclaimer"); - UIAlertView * alert = [[UIAlertView alloc] initWithTitle:title message:message delegate:self cancelButtonTitle:L(@"cancel") otherButtonTitles:L(@"ok"), nil]; - alert.tag = ALERT_VIEW_ROUTING_DISCLAIMER; - [alert show]; + + switch (code) { + case routing::IRouter::ResultCode::NoError: { + f.GetBalloonManager().RemovePin(); + f.GetBalloonManager().Dismiss(); + [self.containerView.placePage setState:PlacePageStateHidden animated:YES withCallback:YES]; + [self.searchView setState:SearchViewStateHidden animated:YES withCallback:YES]; + [self performAfterDelay:0.3 block:^{ + [self.routeView setState:RouteViewStateInfo animated:YES]; + [self updateRoutingInfo]; + }]; + + bool isDisclaimerApproved = false; + (void)Settings::Get("IsDisclaimerApproved", isDisclaimerApproved); + if (!isDisclaimerApproved) + { + NSString * title; + NSString * message; + if (SYSTEM_VERSION_IS_LESS_THAN(@"7.0")) + message = L(@"routing_disclaimer"); + else + title = L(@"routing_disclaimer"); + UIAlertView * alert = [[UIAlertView alloc] initWithTitle:title message:message delegate:self cancelButtonTitle:L(@"cancel") otherButtonTitles:L(@"ok"), nil]; + alert.tag = ALERT_VIEW_ROUTING_DISCLAIMER; + [alert show]; + } + break; } - } - else - { -// TODO -// if (openDownloader) -// [self showDownloaderDialogWithMessageID:message]; -// else -// [self showDialogWithMessageID:message]; + + case routing::IRouter::ResultCode::RouteFileNotExist: { + [self showDownloaderDialogWithCountries:absentCountries]; + break; + } + default: + break; } }); } @@ -800,15 +804,11 @@ [[[UIAlertView alloc] initWithTitle:[NSString stringWithUTF8String:message.c_str()] message:nil delegate:self cancelButtonTitle:L(@"ok") otherButtonTitles:nil] show]; } -- (void)showDownloaderDialogWithMessageID:(string const &)message -{ - +- (void)showDownloaderDialogWithCountries:(vector const &)countries { MWMAlertViewController *alert = [[MWMAlertViewController alloc] initWithViewController:self]; + self.downloaderManager = [[MWMAlertDownloaderManager alloc] initWithMapsIndexes:countries]; + alert.delegate = self.downloaderManager; [alert presentAlertWithType:MWMAlertTypeDownloadAllMaps]; - -// UIAlertView * alertView = [[UIAlertView alloc] initWithTitle:[NSString stringWithUTF8String:message.c_str()] message:nil delegate:self cancelButtonTitle:L(@"cancel") otherButtonTitles:L(@"ok"), nil]; -// alertView.tag = ALERT_VIEW_DOWNLOADER; -// [alertView show]; } #pragma mark - Getters diff --git a/iphone/Maps/Classes/MapsAppDelegate.mm b/iphone/Maps/Classes/MapsAppDelegate.mm index beec3da5fd..dc1863bcc5 100644 --- a/iphone/Maps/Classes/MapsAppDelegate.mm +++ b/iphone/Maps/Classes/MapsAppDelegate.mm @@ -400,8 +400,6 @@ void InitLocalizedStrings() [UIApplication sharedApplication].applicationIconBadgeNumber = [[notification userInfo][@"OutOfDate"] integerValue]; } -#warning Переделать - - (UIWindow *)window { return self->m_window; } diff --git a/iphone/Maps/Maps.xcodeproj/project.pbxproj b/iphone/Maps/Maps.xcodeproj/project.pbxproj index c98a19aa10..2435c75911 100644 --- a/iphone/Maps/Maps.xcodeproj/project.pbxproj +++ b/iphone/Maps/Maps.xcodeproj/project.pbxproj @@ -117,11 +117,14 @@ EEFE7C1412F8C9E1006AF8C3 /* fonts_blacklist.txt in Resources */ = {isa = PBXBuildFile; fileRef = EEFE7C1212F8C9E1006AF8C3 /* fonts_blacklist.txt */; }; EEFE7C1512F8C9E1006AF8C3 /* fonts_whitelist.txt in Resources */ = {isa = PBXBuildFile; fileRef = EEFE7C1312F8C9E1006AF8C3 /* fonts_whitelist.txt */; }; F6A85A151AA9AB23003667A2 /* MWMAlertEntity.mm in Sources */ = {isa = PBXBuildFile; fileRef = F6A85A141AA9AB23003667A2 /* MWMAlertEntity.mm */; }; + F6A85A201AAB1175003667A2 /* MWMAlertDownloaderManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = F6A85A1F1AAB1175003667A2 /* MWMAlertDownloaderManager.mm */; }; + F6A85A241AAB44AD003667A2 /* MWMDownloaderController.m in Sources */ = {isa = PBXBuildFile; fileRef = F6A85A231AAB44AD003667A2 /* MWMDownloaderController.m */; }; + F6A85A271AAB4559003667A2 /* MWMDownloaderViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = F6A85A261AAB4559003667A2 /* MWMDownloaderViewController.xib */; }; F6DBF9A01AA75B6D00F2EC2C /* MWMDownloadAllMapsAlert.xib in Resources */ = {isa = PBXBuildFile; fileRef = F6DBF99F1AA75B6D00F2EC2C /* MWMDownloadAllMapsAlert.xib */; }; - F6DBF9AC1AA847ED00F2EC2C /* MWMAlertViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F6DBF9AA1AA847ED00F2EC2C /* MWMAlertViewController.m */; }; + F6DBF9AC1AA847ED00F2EC2C /* MWMAlertViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = F6DBF9AA1AA847ED00F2EC2C /* MWMAlertViewController.mm */; }; F6DBF9AD1AA847ED00F2EC2C /* MWMAlertViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = F6DBF9AB1AA847ED00F2EC2C /* MWMAlertViewController.xib */; }; F6DBF9B01AA85E3500F2EC2C /* MWMAlert.m in Sources */ = {isa = PBXBuildFile; fileRef = F6DBF9AF1AA85E3500F2EC2C /* MWMAlert.m */; }; - F6DBF9B31AA8611A00F2EC2C /* MWMDownloadAllMapsAlert.m in Sources */ = {isa = PBXBuildFile; fileRef = F6DBF9B21AA8611A00F2EC2C /* MWMDownloadAllMapsAlert.m */; }; + F6DBF9B31AA8611A00F2EC2C /* MWMDownloadAllMapsAlert.mm in Sources */ = {isa = PBXBuildFile; fileRef = F6DBF9B21AA8611A00F2EC2C /* MWMDownloadAllMapsAlert.mm */; }; F6DBF9B61AA8779300F2EC2C /* CALayer+RuntimeAttributes.m in Sources */ = {isa = PBXBuildFile; fileRef = F6DBF9B51AA8779300F2EC2C /* CALayer+RuntimeAttributes.m */; }; F785EB4016386FC4003A38A8 /* BookmarkCell.mm in Sources */ = {isa = PBXBuildFile; fileRef = F785EB3F16386FC4003A38A8 /* BookmarkCell.mm */; }; F7B90CD31521E6D200C054EE /* CustomNavigationView.mm in Sources */ = {isa = PBXBuildFile; fileRef = F7B90CD21521E6D100C054EE /* CustomNavigationView.mm */; }; @@ -372,16 +375,22 @@ EED10A4411F78D120095FAD4 /* MapViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = MapViewController.mm; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; EEFE7C1212F8C9E1006AF8C3 /* fonts_blacklist.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = fonts_blacklist.txt; path = ../../data/fonts_blacklist.txt; sourceTree = ""; }; EEFE7C1312F8C9E1006AF8C3 /* fonts_whitelist.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = fonts_whitelist.txt; path = ../../data/fonts_whitelist.txt; sourceTree = ""; }; - F6A85A131AA9AB23003667A2 /* MWMAlertEntity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMAlertEntity.h; sourceTree = ""; }; + F6A85A131AA9AB23003667A2 /* MWMAlertEntity.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = MWMAlertEntity.h; sourceTree = ""; }; F6A85A141AA9AB23003667A2 /* MWMAlertEntity.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMAlertEntity.mm; sourceTree = ""; }; + F6A85A1E1AAB1175003667A2 /* MWMAlertDownloaderManager.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = MWMAlertDownloaderManager.h; sourceTree = ""; }; + F6A85A1F1AAB1175003667A2 /* MWMAlertDownloaderManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMAlertDownloaderManager.mm; sourceTree = ""; }; + F6A85A211AAB1408003667A2 /* MWMAlertViewControllerDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMAlertViewControllerDelegate.h; sourceTree = ""; }; + F6A85A221AAB44AD003667A2 /* MWMDownloaderController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMDownloaderController.h; sourceTree = ""; }; + F6A85A231AAB44AD003667A2 /* MWMDownloaderController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MWMDownloaderController.m; sourceTree = ""; }; + F6A85A261AAB4559003667A2 /* MWMDownloaderViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MWMDownloaderViewController.xib; sourceTree = ""; }; F6DBF99F1AA75B6D00F2EC2C /* MWMDownloadAllMapsAlert.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MWMDownloadAllMapsAlert.xib; sourceTree = ""; }; F6DBF9A91AA847ED00F2EC2C /* MWMAlertViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMAlertViewController.h; sourceTree = ""; }; - F6DBF9AA1AA847ED00F2EC2C /* MWMAlertViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MWMAlertViewController.m; sourceTree = ""; }; + F6DBF9AA1AA847ED00F2EC2C /* MWMAlertViewController.mm */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; path = MWMAlertViewController.mm; sourceTree = ""; }; F6DBF9AB1AA847ED00F2EC2C /* MWMAlertViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MWMAlertViewController.xib; sourceTree = ""; }; F6DBF9AE1AA85E3500F2EC2C /* MWMAlert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMAlert.h; sourceTree = ""; }; F6DBF9AF1AA85E3500F2EC2C /* MWMAlert.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MWMAlert.m; sourceTree = ""; }; F6DBF9B11AA8611A00F2EC2C /* MWMDownloadAllMapsAlert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMDownloadAllMapsAlert.h; sourceTree = ""; }; - F6DBF9B21AA8611A00F2EC2C /* MWMDownloadAllMapsAlert.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MWMDownloadAllMapsAlert.m; sourceTree = ""; }; + F6DBF9B21AA8611A00F2EC2C /* MWMDownloadAllMapsAlert.mm */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; path = MWMDownloadAllMapsAlert.mm; sourceTree = ""; }; F6DBF9B41AA8779300F2EC2C /* CALayer+RuntimeAttributes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "CALayer+RuntimeAttributes.h"; sourceTree = ""; }; F6DBF9B51AA8779300F2EC2C /* CALayer+RuntimeAttributes.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "CALayer+RuntimeAttributes.m"; sourceTree = ""; }; F785EB3E16386FC4003A38A8 /* BookmarkCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BookmarkCell.h; path = Bookmarks/BookmarkCell.h; sourceTree = SOURCE_ROOT; }; @@ -509,6 +518,7 @@ 080E96DDFE201D6D7F000001 /* Classes */ = { isa = PBXGroup; children = ( + F6A85A251AAB44BB003667A2 /* DownloaderController */, F6DBF99E1AA75AA700F2EC2C /* Custom Alert */, 97B4E9271851DAB300BEC5D7 /* Custom Views */, FA4135DF120A25B90062D5B4 /* Settings */, @@ -826,7 +836,7 @@ isa = PBXGroup; children = ( F6DBF9B11AA8611A00F2EC2C /* MWMDownloadAllMapsAlert.h */, - F6DBF9B21AA8611A00F2EC2C /* MWMDownloadAllMapsAlert.m */, + F6DBF9B21AA8611A00F2EC2C /* MWMDownloadAllMapsAlert.mm */, F6DBF99F1AA75B6D00F2EC2C /* MWMDownloadAllMapsAlert.xib */, ); name = DownloadAllMaps; @@ -841,16 +851,29 @@ name = Entity; sourceTree = ""; }; + F6A85A251AAB44BB003667A2 /* DownloaderController */ = { + isa = PBXGroup; + children = ( + F6A85A221AAB44AD003667A2 /* MWMDownloaderController.h */, + F6A85A231AAB44AD003667A2 /* MWMDownloaderController.m */, + F6A85A261AAB4559003667A2 /* MWMDownloaderViewController.xib */, + ); + name = DownloaderController; + sourceTree = ""; + }; F6DBF99E1AA75AA700F2EC2C /* Custom Alert */ = { isa = PBXGroup; children = ( + F6A85A211AAB1408003667A2 /* MWMAlertViewControllerDelegate.h */, F6DBF9A91AA847ED00F2EC2C /* MWMAlertViewController.h */, - F6DBF9AA1AA847ED00F2EC2C /* MWMAlertViewController.m */, + F6DBF9AA1AA847ED00F2EC2C /* MWMAlertViewController.mm */, F6DBF9AB1AA847ED00F2EC2C /* MWMAlertViewController.xib */, F6DBF9AE1AA85E3500F2EC2C /* MWMAlert.h */, F6DBF9AF1AA85E3500F2EC2C /* MWMAlert.m */, F6A85A161AA9CAAD003667A2 /* DownloadAllMaps */, F6A85A1D1AA9CCF7003667A2 /* Entity */, + F6A85A1E1AAB1175003667A2 /* MWMAlertDownloaderManager.h */, + F6A85A1F1AAB1175003667A2 /* MWMAlertDownloaderManager.mm */, ); name = "Custom Alert"; sourceTree = ""; @@ -1151,6 +1174,7 @@ F7E7BA331672328F00B4492E /* police@2x.png in Resources */, F7E7BA341672328F00B4492E /* post.png in Resources */, F7E7BA351672328F00B4492E /* post@2x.png in Resources */, + F6A85A271AAB4559003667A2 /* MWMDownloaderViewController.xib in Resources */, F7E7BA361672328F00B4492E /* shop.png in Resources */, F7E7BA371672328F00B4492E /* shop@2x.png in Resources */, F7E7BA381672328F00B4492E /* toilet.png in Resources */, @@ -1220,6 +1244,7 @@ 977E26BE19E31BBE00BA2219 /* CountryTreeVC.mm in Sources */, 97A0EEFC192F3B43009B2779 /* BottomMenuCell.mm in Sources */, 97D092B9190AA69700FF645B /* SmallCompassView.mm in Sources */, + F6A85A241AAB44AD003667A2 /* MWMDownloaderController.m in Sources */, 97A8001418B2140A000C07A2 /* SearchResultCell.m in Sources */, 97F0817E19AF72590098FB0B /* BadgeView.m in Sources */, 97A8002718B2741C000C07A2 /* SearchCell.m in Sources */, @@ -1239,7 +1264,7 @@ FA36B80D15403A4F004560CC /* BookmarksVC.mm in Sources */, A32B6D4D1A14980500E54A65 /* iosOGLContextFactory.mm in Sources */, 9769D6EF1912BF3000CA6158 /* ContainerView.mm in Sources */, - F6DBF9AC1AA847ED00F2EC2C /* MWMAlertViewController.m in Sources */, + F6DBF9AC1AA847ED00F2EC2C /* MWMAlertViewController.mm in Sources */, FAF457E715597D4600DCCC49 /* Framework.cpp in Sources */, 97CC93BB19599F4700369B42 /* SearchSuggestCell.m in Sources */, FA054612155C465E001F4E37 /* SelectSetVC.mm in Sources */, @@ -1253,6 +1278,7 @@ 97C98522186AE3CF00AF7E9E /* AppInfo.mm in Sources */, 978F9242183B660F000D6C7C /* SelectableCell.m in Sources */, CB252D6F16FF82C9001E41E9 /* Statistics.mm in Sources */, + F6A85A201AAB1175003667A2 /* MWMAlertDownloaderManager.mm in Sources */, 978F9244183B660F000D6C7C /* SwitchCell.m in Sources */, EDB811A3175E1A9C00E36BF2 /* TwoButtonsView.m in Sources */, 97508423199522D300A7457D /* SettingsAndMoreVC.mm in Sources */, @@ -1260,7 +1286,7 @@ 9773DB8F198652E600C4A9E9 /* PlacePageBookmarkDescriptionCell.m in Sources */, 97ABBA4518C8DF620079333C /* PlacePageView.mm in Sources */, 97F61794183E7445009919E2 /* LinkCell.m in Sources */, - F6DBF9B31AA8611A00F2EC2C /* MWMDownloadAllMapsAlert.m in Sources */, + F6DBF9B31AA8611A00F2EC2C /* MWMDownloadAllMapsAlert.mm in Sources */, 976D86EC19C8697700C920EF /* ProgressView.m in Sources */, 97D092B1190A681F00FF645B /* PlacePageInfoCell.mm in Sources */, B0FBFA271A515AFD0086819E /* ViewController.m in Sources */, diff --git a/map/framework.cpp b/map/framework.cpp index f064ec0dac..de44bc6c8b 100644 --- a/map/framework.cpp +++ b/map/framework.cpp @@ -2141,7 +2141,7 @@ void Framework::MatchLocationToRoute(location::GpsInfo & location, location::Rou void Framework::CallRouteBuilded(IRouter::ResultCode code, vector const & absentFiles) { if (code == IRouter::Cancelled) - return; + return; m_routingCallback(code, absentFiles); } diff --git a/storage/index.hpp b/storage/index.hpp index 28ff44ae74..8c0a9eab9d 100644 --- a/storage/index.hpp +++ b/storage/index.hpp @@ -23,7 +23,7 @@ namespace storage m_country == other.m_country && m_region == other.m_region); } - + bool operator!=(TIndex const & other) const { return !(*this == other);