Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
ddb643bf
Commit
ddb643bf
authored
Jan 20, 2014
by
David Fuhrmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macosx: simple prefs: use config_GetIntChoices for int list
parent
4e6bc174
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
13 deletions
+14
-13
modules/gui/macosx/simple_prefs.m
modules/gui/macosx/simple_prefs.m
+14
-13
No files found.
modules/gui/macosx/simple_prefs.m
View file @
ddb643bf
...
...
@@ -503,20 +503,23 @@ static inline char * __config_GetLabel(vlc_object_t *p_this, const char *psz_nam
/* serious problem, if no item found */
assert
(
p_item
);
for
(
int
i
=
0
;
i
<
p_item
->
list_count
;
i
++
)
{
NSMenuItem
*
mi
;
if
(
p_item
->
list_text
!=
NULL
)
mi
=
[[
NSMenuItem
alloc
]
initWithTitle
:
_NS
(
p_item
->
list_text
[
i
])
action
:
NULL
keyEquivalent
:
@""
];
else
if
(
p_item
->
list
.
i
[
i
])
mi
=
[[
NSMenuItem
alloc
]
initWithTitle
:
[
NSString
stringWithFormat
:
@"%d"
,
p_item
->
list
.
i
[
i
]]
action
:
NULL
keyEquivalent
:
@""
];
else
msg_Err
(
p_intf
,
"item %d of pref %s failed to be created"
,
i
,
name
);
[
mi
setRepresentedObject
:[
NSNumber
numberWithInt
:
p_item
->
list
.
i
[
i
]]];
int64_t
*
values
;
char
**
texts
;
ssize_t
count
=
config_GetIntChoices
(
VLC_OBJECT
(
VLCIntf
),
name
,
&
values
,
&
texts
);
for
(
ssize_t
i
=
0
;
i
<
count
;
i
++
)
{
NSMenuItem
*
mi
=
[[
NSMenuItem
alloc
]
initWithTitle
:
toNSStr
(
texts
[
i
])
action
:
NULL
keyEquivalent
:
@""
];
[
mi
setRepresentedObject
:[
NSNumber
numberWithInt
:
values
[
i
]]];
[[
object
menu
]
addItem
:
[
mi
autorelease
]];
if
(
p_item
->
value
.
i
==
p_item
->
list
.
i
[
i
])
if
(
p_item
->
value
.
i
==
values
[
i
])
[
object
selectItem
:[
object
lastItem
]];
free
(
texts
[
i
]);
}
[
object
setToolTip
:
_NS
(
p_item
->
psz_longtext
)];
free
(
texts
);
if
(
p_item
->
psz_longtext
)
[
object
setToolTip
:
_NS
(
p_item
->
psz_longtext
)];
}
-
(
void
)
setupButton
:
(
NSButton
*
)
object
forBoolValue
:
(
const
char
*
)
name
...
...
@@ -869,8 +872,6 @@ static inline char * __config_GetLabel(vlc_object_t *p_this, const char *psz_nam
static
inline
void
save_int_list
(
intf_thread_t
*
p_intf
,
id
object
,
const
char
*
name
)
{
NSNumber
*
p_valueobject
;
module_config_t
*
p_item
;
p_item
=
config_FindConfig
(
VLC_OBJECT
(
p_intf
),
name
);
p_valueobject
=
(
NSNumber
*
)[[
object
selectedItem
]
representedObject
];
assert
([
p_valueobject
isKindOfClass
:[
NSNumber
class
]]);
if
(
p_valueobject
)
config_PutInt
(
p_intf
,
name
,
[
p_valueobject
intValue
]);
...
...
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