VLCCloudServicesTVViewController.m 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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. MDFMovieDBSessionManager *movieDBSessionManager = [MDFMovieDBSessionManager sharedInstance];
  35. movieDBSessionManager.apiKey = kVLCfortvOSMovieDBKey;
  36. [movieDBSessionManager fetchProperties];
  37. // _oneDriveController = [VLCOneDriveController sharedInstance];
  38. _boxController = [VLCBoxController sharedInstance];
  39. [_boxController startSession];
  40. self.dropboxButton.enabled = self.gDriveButton.enabled = NO;
  41. // [self oneDriveSessionUpdated:nil];
  42. [self boxSessionUpdated:nil];
  43. [self performSelector:@selector(updateDropbox) withObject:nil afterDelay:0.1];
  44. }
  45. - (NSString *)title
  46. {
  47. return NSLocalizedString(@"CLOUD_SERVICES", nil);
  48. }
  49. - (IBAction)dropbox:(id)sender
  50. {
  51. VLCDropboxCollectionViewController *targetViewController = [[VLCDropboxCollectionViewController alloc] initWithNibName:@"VLCRemoteBrowsingCollectionViewController" bundle:nil];
  52. [self.navigationController pushViewController:targetViewController animated:YES];
  53. }
  54. - (void)updateDropbox
  55. {
  56. self.dropboxButton.enabled = [[VLCDropboxController sharedInstance] restoreFromSharedCredentials];
  57. }
  58. //- (void)oneDriveSessionUpdated:(NSNotification *)aNotification
  59. //{
  60. // self.oneDriveButton.enabled = _oneDriveController.activeSession;
  61. //}
  62. - (void)boxSessionUpdated:(NSNotification *)aNotification
  63. {
  64. self.boxButton.enabled = YES;
  65. }
  66. //- (IBAction)onedrive:(id)sender
  67. //{
  68. // VLCOneDriveCollectionViewController *targetViewController = [[VLCOneDriveCollectionViewController alloc] initWithOneDriveObject:nil];
  69. // [self.navigationController pushViewController:targetViewController animated:YES];
  70. //}
  71. - (IBAction)box:(id)sender
  72. {
  73. VLCBoxCollectionViewController *targetViewController = [[VLCBoxCollectionViewController alloc] initWithPath:@""];
  74. [self.navigationController pushViewController:targetViewController animated:YES];
  75. }
  76. - (IBAction)gdrive:(id)sender
  77. {
  78. // TODO
  79. }
  80. @end