Commit 5d4068bc authored by Steven Kabbes's avatar Steven Kabbes Committed by Felix Paul Kühne
Browse files

Settings: Hide unlink settings when cloud storage not linked


Signed-off-by: Felix Paul Kühne's avatarFelix Paul Kühne <fkuehne@videolan.org>
parent 6e75d877
......@@ -337,6 +337,7 @@
self.settingsViewController.showCreditsFooter = NO;
viewController = self.settingsController.viewController;
[self.settingsController willShow];
} else if (itemIndex == 1)
viewController = [[VLCAboutViewController alloc] init];
} else {
......
......@@ -16,4 +16,7 @@
@property (nonatomic, retain) IASKAppSettingsViewController *viewController;
// this should be called when the this view controller is about to become in focus
- (void)willShow;
@end
......@@ -45,6 +45,11 @@
[[NSNotificationCenter defaultCenter] removeObserver:self];
}
- (void)willShow
{
[self filterCloudStorageCellsWithAnimation:NO];
}
- (void)settingDidChange:(NSNotification*)notification
{
if ([notification.object isEqual:kVLCSettingPasscodeOnKey]) {
......@@ -58,6 +63,18 @@
}
}
- (void) filterCloudStorageCellsWithAnimation:(BOOL)shouldAnimate
{
NSMutableSet * hideKeys = [[NSMutableSet alloc] init];
if (![[DBSession sharedSession] isLinked]) {
[hideKeys addObject:@"UnlinkDropbox"];
}
if (![[VLCGoogleDriveController sharedInstance] isAuthorized]) {
[hideKeys addObject:@"UnlinkGoogleDrive"];
}
[self.viewController setHiddenKeys:hideKeys animated:shouldAnimate];
}
- (void)settingsViewControllerDidEnd:(IASKAppSettingsViewController*)sender
{
[[(VLCAppDelegate*)[UIApplication sharedApplication].delegate revealController] toggleSidebar:![(VLCAppDelegate*)[UIApplication sharedApplication].delegate revealController].sidebarShowing duration:kGHRevealSidebarDefaultAnimationDuration];
......@@ -100,6 +117,7 @@
cancelButtonTitle:NSLocalizedString(@"BUTTON_DONE", @"")
otherButtonTitles:nil];
[alert show];
[self filterCloudStorageCellsWithAnimation:YES];
_currentUnlinkDialogTitle = nil;
_currentCloudName = nil;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment