forked from organicmaps/organicmaps
[ios] Disabled migration controller back button on migration.
This commit is contained in:
parent
8b326b45f8
commit
8bb8f935d0
1 changed files with 10 additions and 5 deletions
|
@ -34,13 +34,12 @@ using namespace storage;
|
|||
|
||||
- (void)checkState
|
||||
{
|
||||
MWMMigrationView * mv = static_cast<MWMMigrationView *>(self.view);
|
||||
if (!GetFramework().IsEnoughSpaceForMigrate())
|
||||
mv.state = MWMMigrationViewState::ErrorNoSpace;
|
||||
[self setState:MWMMigrationViewState::ErrorNoSpace];
|
||||
else if (!Platform::IsConnected())
|
||||
mv.state = MWMMigrationViewState::ErrorNoConnection;
|
||||
[self setState:MWMMigrationViewState::ErrorNoConnection];
|
||||
else
|
||||
mv.state = MWMMigrationViewState::Default;
|
||||
[self setState:MWMMigrationViewState::Default];
|
||||
}
|
||||
|
||||
- (void)performLimitedMigration:(BOOL)limited
|
||||
|
@ -79,7 +78,7 @@ using namespace storage;
|
|||
auto onProgressChanged = [](TCountryId const & countryId, TLocalAndRemoteSize const & progress){};
|
||||
|
||||
if (f.PreMigrate(position, onStatusChanged, onProgressChanged))
|
||||
static_cast<MWMMigrationView *>(self.view).state = MWMMigrationViewState::Processing;
|
||||
[self setState:MWMMigrationViewState::Processing];
|
||||
else
|
||||
migrate();
|
||||
}
|
||||
|
@ -106,6 +105,12 @@ using namespace storage;
|
|||
}
|
||||
}
|
||||
|
||||
- (void)setState:(MWMMigrationViewState)state
|
||||
{
|
||||
static_cast<MWMMigrationView *>(self.view).state = state;
|
||||
self.navigationItem.leftBarButtonItem.enabled = (state != MWMMigrationViewState::Processing);
|
||||
}
|
||||
|
||||
#pragma mark - Segue
|
||||
|
||||
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
|
||||
|
|
Loading…
Add table
Reference in a new issue