Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
VideoLAN
VLC-iOS
Commits
1d1442e4
Commit
1d1442e4
authored
Oct 21, 2015
by
Felix Paul Kühne
Browse files
ATV cloud services: add login checker for Dropbox
parent
b8f723de
Changes
3
Hide whitespace changes
Inline
Side-by-side
VLC for Apple TV/VLCCloudServicesTVViewController.h
View file @
1d1442e4
...
...
@@ -13,4 +13,6 @@
@interface
VLCCloudServicesTVViewController
:
UIViewController
-
(
IBAction
)
dropbox
:(
id
)
sender
;
@end
VLC for Apple TV/VLCCloudServicesTVViewController.m
View file @
1d1442e4
...
...
@@ -10,6 +10,8 @@
*****************************************************************************/
#import "VLCCloudServicesTVViewController.h"
#import <DropboxTVSDK/DropboxSDK.h>
#import "VLCDropboxController.h"
@interface
VLCCloudServicesTVViewController
()
...
...
@@ -27,4 +29,27 @@
return
@"Cloud Services"
;
}
-
(
void
)
dropbox
:(
id
)
sender
{
if
(
!
[[
VLCDropboxController
sharedInstance
]
isAuthorized
])
{
UIAlertController
*
alert
=
[
UIAlertController
alertControllerWithTitle
:
@"Login failure"
message:
@"To use Dropbox, you need to login to iCloud with the same ID to both this Apple TV and an iOS device.
\n
Afterwards, login to Dropbox using the VLC app on your iOS device and try again."
preferredStyle:
UIAlertControllerStyleAlert
];
UIAlertAction
*
defaultAction
=
[
UIAlertAction
actionWithTitle
:
NSLocalizedString
(
@"BUTTON_OK"
,
nil
)
style:
UIAlertActionStyleDestructive
handler:
^
(
UIAlertAction
*
action
)
{
}];
UIAlertAction
*
cancelAction
=
[
UIAlertAction
actionWithTitle
:
NSLocalizedString
(
@"BUTTON_RETRY"
,
nil
)
style:
UIAlertActionStyleDefault
handler:
^
(
UIAlertAction
*
action
)
{
[
self
dropbox
:
nil
];
}];
[
alert
addAction
:
defaultAction
];
[
alert
addAction
:
cancelAction
];
[
self
presentViewController
:
alert
animated
:
YES
completion
:
nil
];
}
}
@end
VLC for Apple TV/VLCCloudServicesTVViewController.xib
View file @
1d1442e4
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document
type=
"com.apple.InterfaceBuilder.AppleTV.XIB"
version=
"3.0"
toolsVersion=
"9058"
systemVersion=
"1
4F1017
"
targetRuntime=
"AppleTV"
propertyAccessControl=
"none"
useAutolayout=
"YES"
>
<document
type=
"com.apple.InterfaceBuilder.AppleTV.XIB"
version=
"3.0"
toolsVersion=
"9058"
systemVersion=
"1
5A284
"
targetRuntime=
"AppleTV"
propertyAccessControl=
"none"
useAutolayout=
"YES"
>
<dependencies>
<plugIn
identifier=
"com.apple.InterfaceBuilder.IBCocoaTouchPlugin"
version=
"9048"
/>
</dependencies>
...
...
@@ -16,27 +16,35 @@
<subviews>
<label
opaque=
"NO"
userInteractionEnabled=
"NO"
contentMode=
"left"
horizontalHuggingPriority=
"251"
verticalHuggingPriority=
"251"
text=
"Cloud Services"
textAlignment=
"natural"
lineBreakMode=
"tailTruncation"
baselineAdjustment=
"alignBaselines"
adjustsFontSizeToFit=
"NO"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"B3D-nr-ofx"
>
<rect
key=
"frame"
x=
"714"
y=
"26"
width=
"493"
height=
"91"
/>
<animations/>
<fontDescription
key=
"fontDescription"
style=
"UICTFontTextStyleTitle1"
/>
<color
key=
"textColor"
red=
"0.0"
green=
"0.0"
blue=
"0.0"
alpha=
"1"
colorSpace=
"calibratedRGB"
/>
<nil
key=
"highlightedColor"
/>
</label>
<button
opaque=
"NO"
contentMode=
"scaleToFill"
contentHorizontalAlignment=
"center"
contentVerticalAlignment=
"center"
buttonType=
"roundedRect"
lineBreakMode=
"middleTruncation"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"hdP-Dp-Mn0"
>
<rect
key=
"frame"
x=
"810"
y=
"329"
width=
"301"
height=
"86"
/>
<animations/>
<inset
key=
"contentEdgeInsets"
minX=
"40"
minY=
"20"
maxX=
"40"
maxY=
"20"
/>
<state
key=
"normal"
title=
"Dropbox"
/>
<connections>
<action
selector=
"dropbox:"
destination=
"-1"
eventType=
"primaryActionTriggered"
id=
"CbH-po-vKw"
/>
</connections>
</button>
<button
opaque=
"NO"
contentMode=
"scaleToFill"
contentHorizontalAlignment=
"center"
contentVerticalAlignment=
"center"
buttonType=
"roundedRect"
lineBreakMode=
"middleTruncation"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"uaI-5Z-SJq"
>
<rect
key=
"frame"
x=
"810"
y=
"445"
width=
"301"
height=
"86"
/>
<animations/>
<inset
key=
"contentEdgeInsets"
minX=
"40"
minY=
"20"
maxX=
"40"
maxY=
"20"
/>
<state
key=
"normal"
title=
"Google Drive"
/>
</button>
<button
opaque=
"NO"
contentMode=
"scaleToFill"
contentHorizontalAlignment=
"center"
contentVerticalAlignment=
"center"
buttonType=
"roundedRect"
lineBreakMode=
"middleTruncation"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"HPy-k8-PTt"
>
<rect
key=
"frame"
x=
"810"
y=
"561"
width=
"301"
height=
"86"
/>
<animations/>
<inset
key=
"contentEdgeInsets"
minX=
"40"
minY=
"20"
maxX=
"40"
maxY=
"20"
/>
<state
key=
"normal"
title=
"Box"
/>
</button>
<button
opaque=
"NO"
contentMode=
"scaleToFill"
contentHorizontalAlignment=
"center"
contentVerticalAlignment=
"center"
buttonType=
"roundedRect"
lineBreakMode=
"middleTruncation"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"gFm-4V-QFs"
>
<rect
key=
"frame"
x=
"810"
y=
"677"
width=
"301"
height=
"86"
/>
<animations/>
<inset
key=
"contentEdgeInsets"
minX=
"40"
minY=
"20"
maxX=
"40"
maxY=
"20"
/>
<state
key=
"normal"
title=
"OneDrive"
/>
</button>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment