forked from organicmaps/organicmaps
[MAPSME-1200] [ios] Fixed retry download.
This commit is contained in:
parent
71e7508675
commit
54828b8da6
8 changed files with 21 additions and 14 deletions
|
@ -14,12 +14,13 @@ static CGFloat const kDividerTopConstant = -8.;
|
|||
|
||||
@interface MWMDefaultAlert ()
|
||||
|
||||
@property (weak, nonatomic) IBOutlet UILabel * messageLabel;
|
||||
@property (weak, nonatomic) IBOutlet UIButton * rightButton;
|
||||
@property (weak, nonatomic) IBOutlet UIButton * leftButton;
|
||||
@property (weak, nonatomic) IBOutlet UILabel * titleLabel;
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint * rightButtonWidth;
|
||||
@property (copy, nonatomic) TMWMVoidBlock leftButtonAction;
|
||||
@property(weak, nonatomic) IBOutlet UILabel * messageLabel;
|
||||
@property(weak, nonatomic) IBOutlet UIButton * rightButton;
|
||||
@property(weak, nonatomic) IBOutlet UIButton * leftButton;
|
||||
@property(weak, nonatomic) IBOutlet UILabel * titleLabel;
|
||||
@property(weak, nonatomic) IBOutlet NSLayoutConstraint * rightButtonWidth;
|
||||
@property(copy, nonatomic) TMWMVoidBlock leftButtonAction;
|
||||
@property(copy, nonatomic, readwrite) TMWMVoidBlock rightButtonAction;
|
||||
@property(weak, nonatomic) IBOutlet NSLayoutConstraint * dividerTop;
|
||||
|
||||
@property(copy, nonatomic) NSString * statisticsEvent;
|
||||
|
|
|
@ -9,6 +9,6 @@
|
|||
rightButtonAction:(nullable TMWMVoidBlock)action
|
||||
statisticsEvent:(nonnull NSString *)statisticsEvent;
|
||||
|
||||
@property(copy, nonatomic, nullable) TMWMVoidBlock rightButtonAction;
|
||||
@property(copy, nonatomic, readonly, nullable) TMWMVoidBlock rightButtonAction;
|
||||
|
||||
@end
|
||||
|
|
|
@ -769,7 +769,7 @@ using namespace storage;
|
|||
[MWMStorage downloadNode:countryId alertController:avc onSuccess:nil];
|
||||
break;
|
||||
case NodeStatus::Undefined:
|
||||
case NodeStatus::Error: [MWMStorage retryDownloadNode:countryId]; break;
|
||||
case NodeStatus::Error: [MWMStorage retryDownloadNode:countryId alertController:avc]; break;
|
||||
case NodeStatus::OnDiskOutOfDate: [MWMStorage updateNode:countryId alertController:avc]; break;
|
||||
case NodeStatus::Downloading:
|
||||
case NodeStatus::InQueue: [MWMStorage cancelDownloadNode:countryId]; break;
|
||||
|
|
|
@ -76,7 +76,7 @@
|
|||
case NodeStatus::NotDownloaded:
|
||||
case NodeStatus::Partly: [MWMStorage downloadNode:countryId alertController:avc onSuccess:nil]; break;
|
||||
case NodeStatus::Undefined:
|
||||
case NodeStatus::Error: [MWMStorage retryDownloadNode:countryId]; break;
|
||||
case NodeStatus::Error: [MWMStorage retryDownloadNode:countryId alertController:avc]; break;
|
||||
case NodeStatus::OnDiskOutOfDate: [MWMStorage updateNode:countryId alertController:avc]; break;
|
||||
case NodeStatus::Downloading:
|
||||
case NodeStatus::InQueue: [MWMStorage cancelDownloadNode:countryId]; break;
|
||||
|
|
|
@ -673,7 +673,7 @@ using namespace mwm;
|
|||
kStatScenario : kStatDownload
|
||||
}];
|
||||
self.skipCountryEventProcessing = YES;
|
||||
[MWMStorage retryDownloadNode:countryId];
|
||||
[MWMStorage retryDownloadNode:countryId alertController:self.alertController];
|
||||
self.skipCountryEventProcessing = NO;
|
||||
[self processCountryEvent:countryId];
|
||||
}
|
||||
|
|
|
@ -5,7 +5,8 @@
|
|||
@interface MWMStorage : NSObject
|
||||
|
||||
+ (void)downloadNode:(storage::TCountryId const &)countryId alertController:(MWMAlertViewController *)alertController onSuccess:(TMWMVoidBlock)onSuccess;
|
||||
+ (void)retryDownloadNode:(storage::TCountryId const &)countryId;
|
||||
+ (void)retryDownloadNode:(storage::TCountryId const &)countryId
|
||||
alertController:(MWMAlertViewController *)alertController;
|
||||
+ (void)updateNode:(storage::TCountryId const &)countryId alertController:(MWMAlertViewController *)alertController;
|
||||
+ (void)deleteNode:(storage::TCountryId const &)countryId alertController:(MWMAlertViewController *)alertController;
|
||||
+ (void)cancelDownloadNode:(storage::TCountryId const &)countryId;
|
||||
|
|
|
@ -31,8 +31,12 @@ using namespace storage;
|
|||
}
|
||||
|
||||
+ (void)retryDownloadNode:(TCountryId const &)countryId
|
||||
alertController:(MWMAlertViewController *)alertController
|
||||
{
|
||||
GetFramework().GetStorage().RetryDownloadNode(countryId);
|
||||
[self checkConnectionAndPerformAction:[countryId] {
|
||||
GetFramework().GetStorage().RetryDownloadNode(countryId);
|
||||
}
|
||||
alertController:alertController];
|
||||
}
|
||||
|
||||
+ (void)updateNode:(TCountryId const &)countryId
|
||||
|
|
|
@ -203,7 +203,8 @@ using namespace storage;
|
|||
kStatScenario : kStatDownload
|
||||
}];
|
||||
[self showInQueue];
|
||||
[MWMStorage retryDownloadNode:self->m_countryId];
|
||||
[MWMStorage retryDownloadNode:self->m_countryId
|
||||
alertController:self.controller.alertController];
|
||||
};
|
||||
auto const cancelBlock = ^{
|
||||
[Statistics logEvent:kStatDownloaderDownloadCancel withParameters:@{kStatFrom : kStatMap}];
|
||||
|
@ -292,7 +293,7 @@ using namespace storage;
|
|||
kStatScenario : kStatDownload
|
||||
}];
|
||||
[self showInQueue];
|
||||
[MWMStorage retryDownloadNode:m_countryId];
|
||||
[MWMStorage retryDownloadNode:m_countryId alertController:self.controller.alertController];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue