Commit f95bf194 authored by Felix Paul Kühne's avatar Felix Paul Kühne

Settings: add OneDrive logout

parent 31d58972
......@@ -426,6 +426,14 @@
<key>Type</key>
<string>IASKButtonSpecifier</string>
</dict>
<dict>
<key>Key</key>
<string>UnlinkOneDrive</string>
<key>Title</key>
<string>SETTINGS_UNLINK_ONEDRIVE</string>
<key>Type</key>
<string>IASKButtonSpecifier</string>
</dict>
<dict>
<key>Type</key>
<string>PSMultiValueSpecifier</string>
......
B/* A single strings file, whose title is specified in your preferences schema. The strings files provide the localized content to display to the user for each of your preferences. */
......
B"CHOOSE_AUDIO_TRACK"="Choose Audio Track";
......
......@@ -20,6 +20,7 @@
#import "PAPasscodeViewController.h"
#import <DropboxSDK/DropboxSDK.h>
#import "VLCGoogleDriveController.h"
#import "VLCOneDriveController.h"
@interface VLCSettingsController ()<PAPasscodeViewControllerDelegate, IASKSettingsDelegate>
{
......@@ -66,12 +67,14 @@
- (void) filterCloudStorageCellsWithAnimation:(BOOL)shouldAnimate
{
NSMutableSet * hideKeys = [[NSMutableSet alloc] init];
if (![[DBSession sharedSession] isLinked]) {
if (![[DBSession sharedSession] isLinked])
[hideKeys addObject:@"UnlinkDropbox"];
}
if (![[VLCGoogleDriveController sharedInstance] isAuthorized]) {
if (![[VLCGoogleDriveController sharedInstance] isAuthorized])
[hideKeys addObject:@"UnlinkGoogleDrive"];
}
if (![[VLCOneDriveController sharedInstance] activeSession])
[hideKeys addObject:@"UnlinkOneDrive"];
[self.viewController setHiddenKeys:hideKeys animated:shouldAnimate];
}
......@@ -90,6 +93,9 @@
} else if ([_currentUnlinkSpecifier isEqualToString:@"UnlinkGoogleDrive"]) {
_currentCloudName = @"Google Drive";
_currentUnlinkDialogTitle = NSLocalizedString(@"SETTINGS_UNLINK_GOOGLEDRIVE", nil);
} else if ([_currentUnlinkSpecifier isEqualToString:@"UnlinkOneDrive"]) {
_currentCloudName = @"OneDrive";
_currentUnlinkDialogTitle = NSLocalizedString(@"SETTINGS_UNLINK_ONEDRIVE", nil);
}
UIAlertView *alert = [[UIAlertView alloc]
......@@ -108,6 +114,8 @@
[[DBSession sharedSession] unlinkAll];
else if ([_currentUnlinkSpecifier isEqualToString:@"UnlinkGoogleDrive"])
[[VLCGoogleDriveController sharedInstance] logout];
else if ([_currentUnlinkSpecifier isEqualToString:@"UnlinkOneDrive"])
[[VLCOneDriveController sharedInstance] logout];
_currentUnlinkSpecifier = nil;
UIAlertView *alert = [[UIAlertView alloc]
......
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