Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
e91c0ed1
Commit
e91c0ed1
authored
Aug 02, 2015
by
David Fuhrmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macosx: Convert VLCSimplePrefs to NSWindowController subclass
parent
a493185e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
30 deletions
+28
-30
modules/gui/macosx/intf.m
modules/gui/macosx/intf.m
+0
-4
modules/gui/macosx/simple_prefs.h
modules/gui/macosx/simple_prefs.h
+1
-2
modules/gui/macosx/simple_prefs.m
modules/gui/macosx/simple_prefs.m
+27
-24
No files found.
modules/gui/macosx/intf.m
View file @
e91c0ed1
...
...
@@ -142,7 +142,6 @@ static int ShowController(vlc_object_t *p_this, const char *psz_variable,
BOOL
nib_main_loaded
;
/* main nibfile */
BOOL
nib_about_loaded
;
/* about nibfile */
BOOL
nib_prefs_loaded
;
/* preferences xibfile */
BOOL
nib_sprefs_loaded
;
/* simple preferences xibfile */
BOOL
nib_coredialogs_loaded
;
/* CoreDialogs nibfile */
BOOL
b_active_videoplayback
;
...
...
@@ -549,9 +548,6 @@ static int ShowController(vlc_object_t *p_this, const char *psz_variable,
if
(
!
_sprefs
)
_sprefs
=
[[
VLCSimplePrefs
alloc
]
init
];
if
(
!
nib_sprefs_loaded
)
nib_sprefs_loaded
=
[
NSBundle
loadNibNamed
:
@"SimplePreferences"
owner
:
_sprefs
];
return
_sprefs
;
}
...
...
modules/gui/macosx/simple_prefs.h
View file @
e91c0ed1
...
...
@@ -25,7 +25,7 @@
#import "intf.h"
#import <vlc_common.h>
@interface
VLCSimplePrefs
:
NS
Object
@interface
VLCSimplePrefs
:
NS
WindowController
@property
(
readwrite
,
weak
)
IBOutlet
NSPopUpButton
*
audio_dolbyPopup
;
@property
(
readwrite
,
weak
)
IBOutlet
NSTextField
*
audio_dolbyLabel
;
...
...
@@ -141,7 +141,6 @@
@property
(
readwrite
,
weak
)
IBOutlet
NSBox
*
controlsBox
;
@property
(
readwrite
,
weak
)
IBOutlet
NSButton
*
resetButton
;
@property
(
readwrite
,
weak
)
IBOutlet
NSButton
*
saveButton
;
@property
(
readwrite
,
weak
)
IBOutlet
NSWindow
*
window
;
@property
(
readwrite
,
weak
)
IBOutlet
NSButton
*
video_blackCheckbox
;
@property
(
readwrite
,
weak
)
IBOutlet
NSPopUpButton
*
video_devicePopup
;
...
...
modules/gui/macosx/simple_prefs.m
View file @
e91c0ed1
...
...
@@ -207,12 +207,15 @@ static NSString* VLCHotkeysSettingToolbarIdentifier = @"Hotkeys Settings Item Id
-
(
id
)
init
{
self
=
[
super
init
];
p_intf
=
VLCIntf
;
self
=
[
super
initWithWindowNibName
:
@"SimplePreferences"
];
if
(
self
)
{
p_intf
=
VLCIntf
;
}
return
self
;
}
-
(
void
)
awakeFromNib
-
(
void
)
windowDidLoad
{
[
self
initStrings
];
...
...
@@ -233,10 +236,10 @@ static NSString* VLCHotkeysSettingToolbarIdentifier = @"Hotkeys Settings Item Id
[
toolbar
setDisplayMode
:
NSToolbarDisplayModeIconAndLabel
];
[
toolbar
setSizeMode
:
NSToolbarSizeModeRegular
];
[
toolbar
setDelegate
:
self
];
[
_
window
setToolbar
:
toolbar
];
[
self
.
window
setToolbar
:
toolbar
];
[
_
window
setCollectionBehavior
:
NSWindowCollectionBehaviorFullScreenAuxiliary
];
[
_
window
setHidesOnDeactivate
:
YES
];
[
self
.
window
setCollectionBehavior
:
NSWindowCollectionBehaviorFullScreenAuxiliary
];
[
self
.
window
setHidesOnDeactivate
:
YES
];
[
_hotkeys_listbox
setTarget
:
self
];
[
_hotkeys_listbox
setDoubleAction
:
@selector
(
hotkeyTableDoubleClick
:)];
...
...
@@ -422,7 +425,7 @@ create_toolbar_item(NSString *itemIdent, NSString *name, NSString *desc, NSStrin
[
_cancelButton
setTitle
:
_NS
(
"Cancel"
)];
[
_resetButton
setTitle
:
_NS
(
"Reset All"
)];
[
_saveButton
setTitle
:
_NS
(
"Save"
)];
[
_
window
setTitle
:
_NS
(
"Preferences"
)];
[
self
.
window
setTitle
:
_NS
(
"Preferences"
)];
}
/* TODO: move this part to core */
...
...
@@ -802,20 +805,20 @@ static inline char * __config_GetLabel(vlc_object_t *p_this, const char *psz_nam
-
(
void
)
showSimplePrefs
{
/* we want to show the interface settings, if no category was chosen */
if
([[
_
window
toolbar
]
selectedItemIdentifier
]
==
nil
)
{
[[
_
window
toolbar
]
setSelectedItemIdentifier
:
VLCIntfSettingToolbarIdentifier
];
if
([[
self
.
window
toolbar
]
selectedItemIdentifier
]
==
nil
)
{
[[
self
.
window
toolbar
]
setSelectedItemIdentifier
:
VLCIntfSettingToolbarIdentifier
];
[
self
showInterfaceSettings
];
}
[
self
resetControls
];
[
_
window
center
];
[
_
window
makeKeyAndOrderFront
:
self
];
[
self
.
window
center
];
[
self
.
window
makeKeyAndOrderFront
:
self
];
}
-
(
void
)
showSimplePrefsWithLevel
:(
NSInteger
)
i_window_level
{
[
_
window
setLevel
:
i_window_level
];
[
self
.
window
setLevel
:
i_window_level
];
[
self
showSimplePrefs
];
}
...
...
@@ -823,14 +826,14 @@ static inline char * __config_GetLabel(vlc_object_t *p_this, const char *psz_nam
{
if
(
sender
==
_cancelButton
)
{
[[
NSFontPanel
sharedFontPanel
]
close
];
[
_
window
orderOut
:
sender
];
[
self
.
window
orderOut
:
sender
];
}
else
if
(
sender
==
_saveButton
)
{
[
self
saveChangedSettings
];
[[
NSFontPanel
sharedFontPanel
]
close
];
[
_
window
orderOut
:
sender
];
[
self
.
window
orderOut
:
sender
];
}
else
if
(
sender
==
_showAllButton
)
{
[
_
window
orderOut
:
self
];
[[[
VLCMain
sharedInstance
]
preferences
]
showPrefsWithLevel
:[
_
window
level
]];
[
self
.
window
orderOut
:
self
];
[[[
VLCMain
sharedInstance
]
preferences
]
showPrefsWithLevel
:[
self
.
window
level
]];
}
else
msg_Warn
(
p_intf
,
"unknown buttonAction sender"
);
}
...
...
@@ -1089,7 +1092,7 @@ static inline void save_string_list(intf_thread_t * p_intf, id object, const cha
-
(
void
)
showSettingsForCategory
:(
id
)
new_categoryView
{
NSRect
win_rect
,
view_rect
,
oldView_rect
;
win_rect
=
[
_
window
frame
];
win_rect
=
[
self
.
window
frame
];
view_rect
=
[
new_categoryView
frame
];
if
(
_currentlyShownCategoryView
==
new_categoryView
)
...
...
@@ -1110,11 +1113,11 @@ static inline void save_string_list(intf_thread_t * p_intf, id object, const cha
view_rect
.
size
.
height
)];
[
new_categoryView
setAutoresizesSubviews
:
YES
];
if
(
_currentlyShownCategoryView
)
{
[[[
_
window
contentView
]
animator
]
replaceSubview
:
_currentlyShownCategoryView
with
:
new_categoryView
];
[[
_
window
animator
]
setFrame
:
win_rect
display
:
YES
];
[[[
self
.
window
contentView
]
animator
]
replaceSubview
:
_currentlyShownCategoryView
with
:
new_categoryView
];
[[
self
.
window
animator
]
setFrame
:
win_rect
display
:
YES
];
}
else
{
[[
_
window
contentView
]
addSubview
:
new_categoryView
];
[
_
window
setFrame
:
win_rect
display
:
YES
animate
:
NO
];
[[
self
.
window
contentView
]
addSubview
:
new_categoryView
];
[
self
.
window
setFrame
:
win_rect
display
:
YES
animate
:
NO
];
}
/* keep our current category for further reference */
...
...
@@ -1199,7 +1202,7 @@ static inline void save_string_list(intf_thread_t * p_intf, id object, const cha
[
_selectFolderPanel
setMessage
:
_NS
(
"Choose the folder to save your video snapshots to."
)];
[
_selectFolderPanel
setCanCreateDirectories
:
YES
];
[
_selectFolderPanel
setPrompt
:
_NS
(
"Choose"
)];
[
_selectFolderPanel
beginSheetModalForWindow
:
_
window
completionHandler
:
^
(
NSInteger
returnCode
)
{
[
_selectFolderPanel
beginSheetModalForWindow
:
self
.
window
completionHandler
:
^
(
NSInteger
returnCode
)
{
if
(
returnCode
==
NSOKButton
)
{
[
_video_snap_folderTextField
setStringValue
:
[[
_selectFolderPanel
URL
]
path
]];
...
...
@@ -1299,7 +1302,7 @@ static inline void save_string_list(intf_thread_t * p_intf, id object, const cha
[
_selectFolderPanel
setMessage
:
_NS
(
"Choose the directory or filename where the records will be stored."
)];
[
_selectFolderPanel
setCanCreateDirectories
:
YES
];
[
_selectFolderPanel
setPrompt
:
_NS
(
"Choose"
)];
[
_selectFolderPanel
beginSheetModalForWindow
:
_
window
completionHandler
:
^
(
NSInteger
returnCode
)
{
[
_selectFolderPanel
beginSheetModalForWindow
:
self
.
window
completionHandler
:
^
(
NSInteger
returnCode
)
{
if
(
returnCode
==
NSOKButton
)
{
[
_input_recordTextField
setStringValue
:
[[
_selectFolderPanel
URL
]
path
]];
...
...
@@ -1381,7 +1384,7 @@ static inline void save_string_list(intf_thread_t * p_intf, id object, const cha
#undef fillUrlHandlerPopup
[
NSApp
beginSheet
:
_urlhandler_win
modalForWindow
:
_
window
modalDelegate
:
self
didEndSelector
:
NULL
contextInfo
:
nil
];
[
NSApp
beginSheet
:
_urlhandler_win
modalForWindow
:
self
.
window
modalDelegate
:
self
didEndSelector
:
NULL
contextInfo
:
nil
];
}
else
{
[
_urlhandler_win
orderOut
:
sender
];
[
NSApp
endSheet
:
_urlhandler_win
];
...
...
Write
Preview
Markdown
is supported
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