Sketch out the backup restore view.

pull/1/head
Matthew Chen 7 years ago
parent 332f202a52
commit 03f598a130

@ -383,33 +383,28 @@ NSString *const kProfileView_LastPresentedDate = @"kProfileView_LastPresentedDat
} }
// Show an activity indicator to block the UI during the profile upload. // Show an activity indicator to block the UI during the profile upload.
UIAlertController *alertController = [UIAlertController [ModalActivityIndicatorViewController
alertControllerWithTitle:NSLocalizedString(@"PROFILE_VIEW_SAVING", presentFromViewController:self
@"Alert title that indicates the user's profile view is being saved.") canCancel:NO
message:nil backgroundBlock:^(ModalActivityIndicatorViewController *modalActivityIndicator) {
preferredStyle:UIAlertControllerStyleAlert];
[self presentViewController:alertController
animated:YES
completion:^{
[OWSProfileManager.sharedManager updateLocalProfileName:normalizedProfileName [OWSProfileManager.sharedManager updateLocalProfileName:normalizedProfileName
avatarImage:self.avatar avatarImage:self.avatar
success:^{ success:^{
[alertController dismissViewControllerAnimated:NO dispatch_async(dispatch_get_main_queue(), ^{
completion:^{ [modalActivityIndicator dismissWithCompletion:^{
[weakSelf updateProfileCompleted]; [weakSelf updateProfileCompleted];
}]; }];
});
} }
failure:^{ failure:^{
[alertController dispatch_async(dispatch_get_main_queue(), ^{
dismissViewControllerAnimated:NO [modalActivityIndicator dismissWithCompletion:^{
completion:^{ [OWSAlerts showErrorAlertWithMessage:NSLocalizedString(
[OWSAlerts showErrorAlertWithMessage:
NSLocalizedString(
@"PROFILE_VIEW_ERROR_UPDATE_FAILED", @"PROFILE_VIEW_ERROR_UPDATE_FAILED",
@"Error message shown when a " @"Error message shown when a "
@"profile update fails.")]; @"profile update fails.")];
}]; }];
});
}]; }];
}]; }];
} }
@ -450,6 +445,7 @@ NSString *const kProfileView_LastPresentedDate = @"kProfileView_LastPresentedDat
- (void)showHomeView - (void)showHomeView
{ {
OWSAssertIsOnMainThread();
OWSLogVerbose(@""); OWSLogVerbose(@"");
[SignalApp.sharedApp showHomeView]; [SignalApp.sharedApp showHomeView];
@ -457,6 +453,7 @@ NSString *const kProfileView_LastPresentedDate = @"kProfileView_LastPresentedDat
- (void)showBackupRestoreView - (void)showBackupRestoreView
{ {
OWSAssertIsOnMainThread();
OWSLogVerbose(@""); OWSLogVerbose(@"");
BackupRestoreViewController *restoreView = [BackupRestoreViewController new]; BackupRestoreViewController *restoreView = [BackupRestoreViewController new];

@ -14,6 +14,8 @@ public class BackupRestoreViewController: OWSTableViewController {
} }
override public func loadView() { override public func loadView() {
super.loadView()
navigationItem.title = NSLocalizedString("SETTINGS_BACKUP", comment: "Label for the backup view in app settings.") navigationItem.title = NSLocalizedString("SETTINGS_BACKUP", comment: "Label for the backup view in app settings.")
navigationItem.leftBarButtonItem = UIBarButtonItem(barButtonSystemItem: .cancel, target: self, action: #selector(didPressCancelButton)) navigationItem.leftBarButtonItem = UIBarButtonItem(barButtonSystemItem: .cancel, target: self, action: #selector(didPressCancelButton))

Loading…
Cancel
Save