Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
VideoLAN
VLC-iOS
Commits
efd3f9d9
Commit
efd3f9d9
authored
May 20, 2013
by
Felix Paul Kühne
Browse files
settings view controller: refactor code
parent
5fbd35fc
Changes
3
Hide whitespace changes
Inline
Side-by-side
AspenProject/VLCSettingsViewController.h
View file @
efd3f9d9
...
...
@@ -17,8 +17,7 @@
@property
(
nonatomic
,
strong
)
IBOutlet
UISwitch
*
audioPlaybackInBackgroundSwitch
;
@property
(
nonatomic
,
strong
)
IBOutlet
UILabel
*
audioPlaybackInBackgroundLabel
;
-
(
IBAction
)
togglePasscodeLockSetting
:(
id
)
sender
;
-
(
IBAction
)
toggleAudioInBackGroundSetting
:(
id
)
sender
;
-
(
IBAction
)
toggleSetting
:(
id
)
sender
;
-
(
IBAction
)
dismiss
:(
id
)
sender
;
...
...
AspenProject/VLCSettingsViewController.m
View file @
efd3f9d9
...
...
@@ -37,28 +37,27 @@
[
super
viewWillAppear
:
animated
];
}
-
(
IBAction
)
toggle
PasscodeLock
Setting
:(
id
)
sender
-
(
IBAction
)
toggleSetting
:(
id
)
sender
{
if
(
self
.
passcodeLockSwitch
.
on
)
{
VLCAppDelegate
*
appDelegate
=
[
UIApplication
sharedApplication
].
delegate
;
if
(
UI_USER_INTERFACE_IDIOM
()
==
UIUserInterfaceIdiomPad
)
{
CGRect
frame
=
self
.
view
.
frame
;
frame
.
size
.
height
-=
44
.;
appDelegate
.
playlistViewController
.
passcodeLockViewController
.
view
.
frame
=
frame
;
NSUserDefaults
*
defaults
=
[
NSUserDefaults
standardUserDefaults
];
if
(
sender
==
self
.
passcodeLockSwitch
)
{
if
(
self
.
passcodeLockSwitch
.
on
)
{
VLCAppDelegate
*
appDelegate
=
[
UIApplication
sharedApplication
].
delegate
;
if
(
UI_USER_INTERFACE_IDIOM
()
==
UIUserInterfaceIdiomPad
)
{
CGRect
frame
=
self
.
view
.
frame
;
frame
.
size
.
height
-=
44
.;
appDelegate
.
playlistViewController
.
passcodeLockViewController
.
view
.
frame
=
frame
;
}
[
self
.
view
addSubview
:
appDelegate
.
playlistViewController
.
passcodeLockViewController
.
view
];
[
appDelegate
.
playlistViewController
.
passcodeLockViewController
resetPasscode
];
}
else
{
[
defaults
setObject
:
@0
forKey
:
kVLCSettingPasscodeOnKey
];
}
[
self
.
view
addSubview
:
appDelegate
.
playlistViewController
.
passcodeLockViewController
.
view
];
[
appDelegate
.
playlistViewController
.
passcodeLockViewController
resetPasscode
];
}
else
{
NSUserDefaults
*
defaults
=
[
NSUserDefaults
standardUserDefaults
];
[
defaults
setObject
:
@0
forKey
:
kVLCSettingPasscodeOnKey
];
[
defaults
synchronize
];
}
else
if
(
sender
==
self
.
audioPlaybackInBackgroundSwitch
)
{
[
defaults
setObject
:
@
(
self
.
audioPlaybackInBackgroundSwitch
.
on
)
forKey
:
kVLCSettingContinueAudioInBackgroundKey
];
}
}
-
(
IBAction
)
toggleAudioInBackGroundSetting
:(
id
)
sender
{
NSUserDefaults
*
defaults
=
[
NSUserDefaults
standardUserDefaults
];
[
defaults
setObject
:
@
(
self
.
audioPlaybackInBackgroundSwitch
.
on
)
forKey
:
kVLCSettingContinueAudioInBackgroundKey
];
[
defaults
synchronize
];
}
...
...
Resources/VLCSettingsViewController.xib
View file @
efd3f9d9
...
...
@@ -82,17 +82,17 @@
<bool
key=
"IBUIUserInteractionEnabled"
>
NO
</bool>
<string
key=
"targetRuntimeIdentifier"
>
IBCocoaTouchFramework
</string>
<string
key=
"IBUIText"
>
Passcode Lock
</string>
<object
class=
"NSColor"
key=
"IBUITextColor"
id=
"
3337412
4"
>
<object
class=
"NSColor"
key=
"IBUITextColor"
id=
"
82789089
4"
>
<int
key=
"NSColorSpace"
>
3
</int>
<bytes
key=
"NSWhite"
>
MC42NjY2NjY2NjY3AA
</bytes>
</object>
<nil
key=
"IBUIHighlightedColor"
/>
<int
key=
"IBUIBaselineAdjustment"
>
0
</int>
<object
class=
"IBUIFontDescription"
key=
"IBUIFontDescription"
id=
"
210361183
"
>
<object
class=
"IBUIFontDescription"
key=
"IBUIFontDescription"
id=
"
954619706
"
>
<int
key=
"type"
>
1
</int>
<double
key=
"pointSize"
>
17
</double>
</object>
<object
class=
"NSFont"
key=
"IBUIFont"
id=
"
96540695
5"
>
<object
class=
"NSFont"
key=
"IBUIFont"
id=
"
44445703
5"
>
<string
key=
"NSName"
>
Helvetica
</string>
<double
key=
"NSSize"
>
17
</double>
<int
key=
"NSfFlags"
>
16
</int>
...
...
@@ -105,20 +105,20 @@
<string
key=
"NSFrame"
>
{{428, 72}, {94, 27}}
</string>
<reference
key=
"NSSuperview"
ref=
"1058981638"
/>
<reference
key=
"NSWindow"
/>
<reference
key=
"NSNextKeyView"
ref=
"
76469752
"
/>
<reference
key=
"NSNextKeyView"
ref=
"
607504973
"
/>
<string
key=
"NSReuseIdentifierKey"
>
_NS:9
</string>
<bool
key=
"IBUIOpaque"
>
NO
</bool>
<string
key=
"targetRuntimeIdentifier"
>
IBCocoaTouchFramework
</string>
<int
key=
"IBUIContentHorizontalAlignment"
>
0
</int>
<int
key=
"IBUIContentVerticalAlignment"
>
0
</int>
</object>
<object
class=
"IBUILabel"
id=
"
76469752
"
>
<object
class=
"IBUILabel"
id=
"
607504973
"
>
<reference
key=
"NSNextResponder"
ref=
"1058981638"
/>
<int
key=
"NSvFlags"
>
290
</int>
<string
key=
"NSFrame"
>
{{20, 116}, {415, 42}}
</string>
<reference
key=
"NSSuperview"
ref=
"1058981638"
/>
<reference
key=
"NSWindow"
/>
<reference
key=
"NSNextKeyView"
ref=
"
115965713
"
/>
<reference
key=
"NSNextKeyView"
ref=
"
857139100
"
/>
<string
key=
"NSReuseIdentifierKey"
>
_NS:9
</string>
<bool
key=
"IBUIOpaque"
>
NO
</bool>
<bool
key=
"IBUIClipsSubviews"
>
YES
</bool>
...
...
@@ -126,17 +126,17 @@
<bool
key=
"IBUIUserInteractionEnabled"
>
NO
</bool>
<string
key=
"targetRuntimeIdentifier"
>
IBCocoaTouchFramework
</string>
<string
key=
"IBUIText"
>
Continue audio playback in background
</string>
<reference
key=
"IBUITextColor"
ref=
"
3337412
4"
/>
<reference
key=
"IBUITextColor"
ref=
"
82789089
4"
/>
<nil
key=
"IBUIHighlightedColor"
/>
<int
key=
"IBUIBaselineAdjustment"
>
0
</int>
<int
key=
"IBUINumberOfLines"
>
2
</int>
<int
key=
"IBUILineBreakMode"
>
0
</int>
<reference
key=
"IBUIFontDescription"
ref=
"
210361183
"
/>
<reference
key=
"IBUIFont"
ref=
"
96540695
5"
/>
<reference
key=
"IBUIFontDescription"
ref=
"
954619706
"
/>
<reference
key=
"IBUIFont"
ref=
"
44445703
5"
/>
<bool
key=
"IBUIAdjustsFontSizeToFit"
>
NO
</bool>
<double
key=
"preferredMaxLayoutWidth"
>
415
</double>
</object>
<object
class=
"IBUISwitch"
id=
"
115965713
"
>
<object
class=
"IBUISwitch"
id=
"
857139100
"
>
<reference
key=
"NSNextResponder"
ref=
"1058981638"
/>
<int
key=
"NSvFlags"
>
289
</int>
<string
key=
"NSFrame"
>
{{428, 123}, {94, 27}}
</string>
...
...
@@ -204,7 +204,7 @@
<object
class=
"IBCocoaTouchOutletConnection"
key=
"connection"
>
<string
key=
"label"
>
audioPlaybackInBackgroundLabel
</string>
<reference
key=
"source"
ref=
"372490531"
/>
<reference
key=
"destination"
ref=
"
76469752
"
/>
<reference
key=
"destination"
ref=
"
607504973
"
/>
</object>
<int
key=
"connectionID"
>
42
</int>
</object>
...
...
@@ -212,7 +212,7 @@
<object
class=
"IBCocoaTouchOutletConnection"
key=
"connection"
>
<string
key=
"label"
>
audioPlaybackInBackgroundSwitch
</string>
<reference
key=
"source"
ref=
"372490531"
/>
<reference
key=
"destination"
ref=
"
115965713
"
/>
<reference
key=
"destination"
ref=
"
857139100
"
/>
</object>
<int
key=
"connectionID"
>
43
</int>
</object>
...
...
@@ -226,21 +226,21 @@
</object>
<object
class=
"IBConnectionRecord"
>
<object
class=
"IBCocoaTouchEventConnection"
key=
"connection"
>
<string
key=
"label"
>
toggle
PasscodeLock
Setting:
</string>
<string
key=
"label"
>
toggleSetting:
</string>
<reference
key=
"source"
ref=
"268284080"
/>
<reference
key=
"destination"
ref=
"372490531"
/>
<int
key=
"IBEventType"
>
13
</int>
</object>
<int
key=
"connectionID"
>
3
6
</int>
<int
key=
"connectionID"
>
4
6
</int>
</object>
<object
class=
"IBConnectionRecord"
>
<object
class=
"IBCocoaTouchEventConnection"
key=
"connection"
>
<string
key=
"label"
>
toggle
AudioInBackGround
Setting:
</string>
<reference
key=
"source"
ref=
"
115965713
"
/>
<string
key=
"label"
>
toggleSetting:
</string>
<reference
key=
"source"
ref=
"
857139100
"
/>
<reference
key=
"destination"
ref=
"372490531"
/>
<int
key=
"IBEventType"
>
13
</int>
</object>
<int
key=
"connectionID"
>
4
4
</int>
<int
key=
"connectionID"
>
4
5
</int>
</object>
</array>
<object
class=
"IBMutableOrderedSet"
key=
"objectRecords"
>
...
...
@@ -269,8 +269,8 @@
<reference
ref=
"222768752"
/>
<reference
ref=
"890162779"
/>
<reference
ref=
"268284080"
/>
<reference
ref=
"
76469752
"
/>
<reference
ref=
"
115965713
"
/>
<reference
ref=
"
607504973
"
/>
<reference
ref=
"
857139100
"
/>
</array>
<reference
key=
"parent"
ref=
"0"
/>
</object>
...
...
@@ -307,12 +307,12 @@
</object>
<object
class=
"IBObjectRecord"
>
<int
key=
"objectID"
>
39
</int>
<reference
key=
"object"
ref=
"
76469752
"
/>
<reference
key=
"object"
ref=
"
607504973
"
/>
<reference
key=
"parent"
ref=
"1058981638"
/>
</object>
<object
class=
"IBObjectRecord"
>
<int
key=
"objectID"
>
40
</int>
<reference
key=
"object"
ref=
"
115965713
"
/>
<reference
key=
"object"
ref=
"
857139100
"
/>
<reference
key=
"parent"
ref=
"1058981638"
/>
</object>
</array>
...
...
@@ -335,7 +335,7 @@
<nil
key=
"activeLocalization"
/>
<dictionary
class=
"NSMutableDictionary"
key=
"localizations"
/>
<nil
key=
"sourceID"
/>
<int
key=
"maxID"
>
4
4
</int>
<int
key=
"maxID"
>
4
6
</int>
</object>
<object
class=
"IBClassDescriber"
key=
"IBDocument.Classes"
>
<array
class=
"NSMutableArray"
key=
"referencedPartialClassDescriptions"
>
...
...
@@ -344,20 +344,15 @@
<string
key=
"superclassName"
>
UIViewController
</string>
<dictionary
class=
"NSMutableDictionary"
key=
"actions"
>
<string
key=
"dismiss:"
>
id
</string>
<string
key=
"toggleAudioInBackGroundSetting:"
>
id
</string>
<string
key=
"togglePasscodeLockSetting:"
>
id
</string>
<string
key=
"toggleSetting:"
>
id
</string>
</dictionary>
<dictionary
class=
"NSMutableDictionary"
key=
"actionInfosByName"
>
<object
class=
"IBActionInfo"
key=
"dismiss:"
>
<string
key=
"name"
>
dismiss:
</string>
<string
key=
"candidateClassName"
>
id
</string>
</object>
<object
class=
"IBActionInfo"
key=
"toggleAudioInBackGroundSetting:"
>
<string
key=
"name"
>
toggleAudioInBackGroundSetting:
</string>
<string
key=
"candidateClassName"
>
id
</string>
</object>
<object
class=
"IBActionInfo"
key=
"togglePasscodeLockSetting:"
>
<string
key=
"name"
>
togglePasscodeLockSetting:
</string>
<object
class=
"IBActionInfo"
key=
"toggleSetting:"
>
<string
key=
"name"
>
toggleSetting:
</string>
<string
key=
"candidateClassName"
>
id
</string>
</object>
</dictionary>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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