VLCCloudServicesTVViewController.m 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. /*****************************************************************************
  2. * VLC for iOS
  3. *****************************************************************************
  4. * Copyright (c) 2015 VideoLAN. All rights reserved.
  5. * $Id$
  6. *
  7. * Authors: Felix Paul Kühne <fkuehne # videolan.org>
  8. *
  9. * Refer to the COPYING file of the official project for license.
  10. *****************************************************************************/
  11. #import "VLCCloudServicesTVViewController.h"
  12. #import "VLCDropboxController.h"
  13. #import "VLCDropboxCollectionViewController.h"
  14. #import "VLCPlayerDisplayController.h"
  15. //#import "VLCOneDriveController.h"
  16. //#import "VLCOneDriveCollectionViewController.h"
  17. #import "VLCBoxCollectionViewController.h"
  18. #import "VLCBoxController.h"
  19. #import "MetaDataFetcherKit.h"
  20. @interface VLCCloudServicesTVViewController ()
  21. {
  22. // VLCOneDriveController *_oneDriveController;
  23. VLCBoxController *_boxController;
  24. }
  25. @end
  26. @implementation VLCCloudServicesTVViewController
  27. - (void)viewDidLoad {
  28. [super viewDidLoad];
  29. self.helpLabel.text = NSLocalizedString(@"CLOUD_LOGIN_LONG", nil);
  30. [self.helpLabel sizeToFit];
  31. NSNotificationCenter *center = [NSNotificationCenter defaultCenter];
  32. // [center addObserver:self selector:@selector(oneDriveSessionUpdated:) name:VLCOneDriveControllerSessionUpdated object:nil];
  33. [center addObserver:self selector:@selector(boxSessionUpdated:) name:VLCBoxControllerSessionUpdated object:nil];
  34. if (![kVLCfortvOSMovieDBKey isEqualToString:@""]) {
  35. MDFMovieDBSessionManager *movieDBSessionManager = [MDFMovieDBSessionManager sharedInstance];
  36. movieDBSessionManager.apiKey = kVLCfortvOSMovieDBKey;
  37. [movieDBSessionManager fetchProperties];
  38. }
  39. // _oneDriveController = [VLCOneDriveController sharedInstance];
  40. _boxController = [VLCBoxController sharedInstance];
  41. [_boxController startSession];
  42. self.dropboxButton.enabled = self.gDriveButton.enabled = NO;
  43. // [self oneDriveSessionUpdated:nil];
  44. [self boxSessionUpdated:nil];
  45. [self performSelector:@selector(updateDropbox) withObject:nil afterDelay:0.1];
  46. }
  47. - (NSString *)title
  48. {
  49. return NSLocalizedString(@"CLOUD_SERVICES", nil);
  50. }
  51. - (IBAction)dropbox:(id)sender
  52. {
  53. VLCDropboxCollectionViewController *targetViewController = [[VLCDropboxCollectionViewController alloc] initWithNibName:@"VLCRemoteBrowsingCollectionViewController" bundle:nil];
  54. [self.navigationController pushViewController:targetViewController animated:YES];
  55. }
  56. - (void)updateDropbox
  57. {
  58. self.dropboxButton.enabled = [[VLCDropboxController sharedInstance] restoreFromSharedCredentials];
  59. }
  60. //- (void)oneDriveSessionUpdated:(NSNotification *)aNotification
  61. //{
  62. // self.oneDriveButton.enabled = _oneDriveController.activeSession;
  63. //}
  64. - (void)boxSessionUpdated:(NSNotification *)aNotification
  65. {
  66. self.boxButton.enabled = YES;
  67. }
  68. //- (IBAction)onedrive:(id)sender
  69. //{
  70. // VLCOneDriveCollectionViewController *targetViewController = [[VLCOneDriveCollectionViewController alloc] initWithOneDriveObject:nil];
  71. // [self.navigationController pushViewController:targetViewController animated:YES];
  72. //}
  73. - (IBAction)box:(id)sender
  74. {
  75. VLCBoxCollectionViewController *targetViewController = [[VLCBoxCollectionViewController alloc] initWithPath:@""];
  76. [self.navigationController pushViewController:targetViewController animated:YES];
  77. }
  78. - (IBAction)gdrive:(id)sender
  79. {
  80. // TODO
  81. }
  82. @end