Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorv.mikhaylenko <v.mikhaylenko@corp.mail.ru>2015-08-06 12:59:36 +0300
committerAlex Zolotarev <alex@maps.me>2015-09-23 02:59:23 +0300
commit41f620a777fe5d791a9266e332f05af41e9ded1c (patch)
tree179994fa90b9968c7a97dbb445c303cec9171240 /iphone/Maps/Classes/CustomAlert
parent92c03787210495bd2dc78f23118475a68dfee294 (diff)
[ios] FileToOld dialog.
Diffstat (limited to 'iphone/Maps/Classes/CustomAlert')
-rw-r--r--iphone/Maps/Classes/CustomAlert/AlertController/MWMAlertViewController.h5
-rw-r--r--iphone/Maps/Classes/CustomAlert/AlertController/MWMAlertViewController.mm11
-rw-r--r--iphone/Maps/Classes/CustomAlert/BaseAlert/MWMAlert.h5
-rw-r--r--iphone/Maps/Classes/CustomAlert/BaseAlert/MWMAlert.mm11
-rw-r--r--iphone/Maps/Classes/CustomAlert/DownloadTransitMapsAlert/MWMDownloadTransitMapAlert.h6
-rw-r--r--iphone/Maps/Classes/CustomAlert/DownloadTransitMapsAlert/MWMDownloadTransitMapAlert.mm34
6 files changed, 41 insertions, 31 deletions
diff --git a/iphone/Maps/Classes/CustomAlert/AlertController/MWMAlertViewController.h b/iphone/Maps/Classes/CustomAlert/AlertController/MWMAlertViewController.h
index 7923215910..2f4ef7a94e 100644
--- a/iphone/Maps/Classes/CustomAlert/AlertController/MWMAlertViewController.h
+++ b/iphone/Maps/Classes/CustomAlert/AlertController/MWMAlertViewController.h
@@ -20,8 +20,9 @@ typedef void (^CloseAlertCompletion)();
- (nonnull instancetype)initWithViewController:(nonnull UIViewController *)viewController;
- (void)presentAlert:(routing::IRouter::ResultCode)type;
-- (void)presentDownloaderAlertWithCountries:(vector<storage::TIndex> const &)countries routes:(vector<storage::TIndex> const &)routes;
-- (void)presentCrossCountryAlertWithCountries:(vector<storage::TIndex> const &)countries routes:(vector<storage::TIndex> const &)routes;
+- (void)presentDownloaderAlertWithCountries:(vector<storage::TIndex> const &)countries
+ routes:(vector<storage::TIndex> const &)routes
+ code:(routing::IRouter::ResultCode)code;
- (void)presentRateAlert;
- (void)presentFacebookAlert;
- (void)presentFeedbackAlertWithStarsCount:(NSUInteger)starsCount;
diff --git a/iphone/Maps/Classes/CustomAlert/AlertController/MWMAlertViewController.mm b/iphone/Maps/Classes/CustomAlert/AlertController/MWMAlertViewController.mm
index debe681673..f0df31c4e5 100644
--- a/iphone/Maps/Classes/CustomAlert/AlertController/MWMAlertViewController.mm
+++ b/iphone/Maps/Classes/CustomAlert/AlertController/MWMAlertViewController.mm
@@ -103,14 +103,11 @@ static NSString * const kAlertControllerNibIdentifier = @"MWMAlertViewController
[self displayAlert:[MWMAlert feedbackAlertWithStarsCount:starsCount]];
}
-- (void)presentCrossCountryAlertWithCountries:(vector<storage::TIndex> const &)countries routes:(vector<storage::TIndex> const &)routes
+- (void)presentDownloaderAlertWithCountries:(vector<storage::TIndex> const &)countries
+ routes:(vector<storage::TIndex> const &)routes
+ code:(routing::IRouter::ResultCode)code
{
- [self displayAlert:[MWMAlert crossCountryAlertWithCountries:countries routes:routes]];
-}
-
-- (void)presentDownloaderAlertWithCountries:(vector<storage::TIndex> const &)countries routes:(vector<storage::TIndex> const &)routes
-{
- [self displayAlert:[MWMAlert downloaderAlertWithAbsentCountries:countries routes:routes]];
+ [self displayAlert:[MWMAlert downloaderAlertWithAbsentCountries:countries routes:routes code:code]];
}
- (void)presentRoutingDisclaimerAlert
diff --git a/iphone/Maps/Classes/CustomAlert/BaseAlert/MWMAlert.h b/iphone/Maps/Classes/CustomAlert/BaseAlert/MWMAlert.h
index 58a2d0486b..7fa8490de0 100644
--- a/iphone/Maps/Classes/CustomAlert/BaseAlert/MWMAlert.h
+++ b/iphone/Maps/Classes/CustomAlert/BaseAlert/MWMAlert.h
@@ -19,8 +19,9 @@ typedef void (^RightButtonAction)();
@property (weak, nonatomic) MWMAlertViewController * alertController;
+ (MWMAlert *)alert:(routing::IRouter::ResultCode)type;
-+ (MWMAlert *)downloaderAlertWithAbsentCountries:(vector<storage::TIndex> const &)countries routes:(vector<storage::TIndex> const &)routes;
-+ (MWMAlert *)crossCountryAlertWithCountries:(vector<storage::TIndex> const &)countries routes:(vector<storage::TIndex> const &)routes;
++ (MWMAlert *)downloaderAlertWithAbsentCountries:(vector<storage::TIndex> const &)countries
+ routes:(vector<storage::TIndex> const &)routes
+ code:(routing::IRouter::ResultCode)code;
+ (MWMAlert *)rateAlert;
+ (MWMAlert *)feedbackAlertWithStarsCount:(NSUInteger)starsCount;
+ (MWMAlert *)facebookAlert;
diff --git a/iphone/Maps/Classes/CustomAlert/BaseAlert/MWMAlert.mm b/iphone/Maps/Classes/CustomAlert/BaseAlert/MWMAlert.mm
index 6a22079826..0c1f27f99c 100644
--- a/iphone/Maps/Classes/CustomAlert/BaseAlert/MWMAlert.mm
+++ b/iphone/Maps/Classes/CustomAlert/BaseAlert/MWMAlert.mm
@@ -63,14 +63,11 @@
return [MWMFeedbackAlert alertWithStarsCount:starsCount];
}
-+ (MWMAlert *)crossCountryAlertWithCountries:(vector<storage::TIndex> const &)countries routes:(vector<storage::TIndex> const &)routes
++ (MWMAlert *)downloaderAlertWithAbsentCountries:(vector<storage::TIndex> const &)countries
+ routes:(vector<storage::TIndex> const &)routes
+ code:(routing::IRouter::ResultCode)code
{
- return [MWMDownloadTransitMapAlert crossCountryAlertWithMaps:countries routes:routes];
-}
-
-+ (MWMAlert *)downloaderAlertWithAbsentCountries:(vector<storage::TIndex> const &)countries routes:(vector<storage::TIndex> const &)routes
-{
- return [MWMDownloadTransitMapAlert downloaderAlertWithMaps:countries routes:routes];
+ return [MWMDownloadTransitMapAlert downloaderAlertWithMaps:countries routes:routes code:code];
}
+ (MWMAlert *)alert:(routing::IRouter::ResultCode)type
diff --git a/iphone/Maps/Classes/CustomAlert/DownloadTransitMapsAlert/MWMDownloadTransitMapAlert.h b/iphone/Maps/Classes/CustomAlert/DownloadTransitMapsAlert/MWMDownloadTransitMapAlert.h
index e5c7e7b501..c4f6237e06 100644
--- a/iphone/Maps/Classes/CustomAlert/DownloadTransitMapsAlert/MWMDownloadTransitMapAlert.h
+++ b/iphone/Maps/Classes/CustomAlert/DownloadTransitMapsAlert/MWMDownloadTransitMapAlert.h
@@ -12,8 +12,10 @@
#include "std/vector.hpp"
@interface MWMDownloadTransitMapAlert : MWMAlert
-+ (instancetype)crossCountryAlertWithMaps:(vector<storage::TIndex> const &)maps routes:(vector<storage::TIndex> const &)routes;
-+ (instancetype)downloaderAlertWithMaps:(vector<storage::TIndex> const &)maps routes:(vector<storage::TIndex> const &)routes;
+
++ (instancetype)downloaderAlertWithMaps:(vector<storage::TIndex> const &)maps
+ routes:(vector<storage::TIndex> const &)routes
+ code:(routing::IRouter::ResultCode)code;
- (void)showDownloadDetail:(UIButton *)sender;
@end
diff --git a/iphone/Maps/Classes/CustomAlert/DownloadTransitMapsAlert/MWMDownloadTransitMapAlert.mm b/iphone/Maps/Classes/CustomAlert/DownloadTransitMapsAlert/MWMDownloadTransitMapAlert.mm
index 09625d9bd9..97357d696d 100644
--- a/iphone/Maps/Classes/CustomAlert/DownloadTransitMapsAlert/MWMDownloadTransitMapAlert.mm
+++ b/iphone/Maps/Classes/CustomAlert/DownloadTransitMapsAlert/MWMDownloadTransitMapAlert.mm
@@ -91,19 +91,31 @@ static CGFloat const kMinimumOffset = 20.;
@implementation MWMDownloadTransitMapAlert
-+ (instancetype)crossCountryAlertWithMaps:(vector<storage::TIndex> const &)maps routes:(vector<storage::TIndex> const &)routes
++ (instancetype)downloaderAlertWithMaps:(vector<storage::TIndex> const &)maps
+ routes:(vector<storage::TIndex> const &)routes
+ code:(routing::IRouter::ResultCode)code
{
MWMDownloadTransitMapAlert * alert = [self alertWithMaps:maps routes:routes];
- alert.titleLabel.localizedText = @"dialog_routing_download_and_build_cross_route";
- alert.messageLabel.localizedText = @"dialog_routing_download_cross_route";
- return alert;
-}
-
-+ (instancetype)downloaderAlertWithMaps:(vector<storage::TIndex> const &)maps routes:(vector<storage::TIndex> const &)routes
-{
- MWMDownloadTransitMapAlert * alert = [self alertWithMaps:maps routes:routes];
- alert.titleLabel.localizedText = @"dialog_routing_download_files";
- alert.messageLabel.localizedText = @"dialog_routing_download_and_update_all";
+ switch (code)
+ {
+ case routing::IRouter::InconsistentMWMandRoute:
+ case routing::IRouter::RouteNotFound:
+ case routing::IRouter::RouteFileNotExist:
+ alert.titleLabel.localizedText = @"dialog_routing_download_files";
+ alert.messageLabel.localizedText = @"dialog_routing_download_and_update_all";
+ break;
+ case routing::IRouter::FileTooOld:
+ alert.titleLabel.localizedText = @"dialog_routing_download_files";
+ alert.messageLabel.localizedText = @"dialog_routing_download_and_update_maps";
+ break;
+ case routing::IRouter::NeedMoreMaps:
+ alert.titleLabel.localizedText = @"dialog_routing_download_and_build_cross_route";
+ alert.messageLabel.localizedText = @"dialog_routing_download_cross_route";
+ break;
+ default:
+ NSAssert(false, @"Incorrect code!");
+ break;
+ }
return alert;
}