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
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
...
@@ -503,20 +503,23 @@ static inline char * __config_GetLabel(vlc_object_t *p_this, const char *psz_nam
/* serious problem, if no item found */
/* serious problem, if no item found */
assert
(
p_item
);
assert
(
p_item
);
for
(
int
i
=
0
;
i
<
p_item
->
list_count
;
i
++
)
{
int64_t
*
values
;
NSMenuItem
*
mi
;
char
**
texts
;
if
(
p_item
->
list_text
!=
NULL
)
ssize_t
count
=
config_GetIntChoices
(
VLC_OBJECT
(
VLCIntf
),
name
,
&
values
,
&
texts
);
mi
=
[[
NSMenuItem
alloc
]
initWithTitle
:
_NS
(
p_item
->
list_text
[
i
])
action
:
NULL
keyEquivalent
:
@""
];
for
(
ssize_t
i
=
0
;
i
<
count
;
i
++
)
{
else
if
(
p_item
->
list
.
i
[
i
])
NSMenuItem
*
mi
=
[[
NSMenuItem
alloc
]
initWithTitle
:
toNSStr
(
texts
[
i
])
action
:
NULL
keyEquivalent
:
@""
];
mi
=
[[
NSMenuItem
alloc
]
initWithTitle
:
[
NSString
stringWithFormat
:
@"%d"
,
p_item
->
list
.
i
[
i
]]
action
:
NULL
keyEquivalent
:
@""
];
[
mi
setRepresentedObject
:[
NSNumber
numberWithInt
:
values
[
i
]]];
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
]]];
[[
object
menu
]
addItem
:
[
mi
autorelease
]];
[[
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
]];
[
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
-
(
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
...
@@ -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
)
static
inline
void
save_int_list
(
intf_thread_t
*
p_intf
,
id
object
,
const
char
*
name
)
{
{
NSNumber
*
p_valueobject
;
NSNumber
*
p_valueobject
;
module_config_t
*
p_item
;
p_item
=
config_FindConfig
(
VLC_OBJECT
(
p_intf
),
name
);
p_valueobject
=
(
NSNumber
*
)[[
object
selectedItem
]
representedObject
];
p_valueobject
=
(
NSNumber
*
)[[
object
selectedItem
]
representedObject
];
assert
([
p_valueobject
isKindOfClass
:[
NSNumber
class
]]);
assert
([
p_valueobject
isKindOfClass
:[
NSNumber
class
]]);
if
(
p_valueobject
)
config_PutInt
(
p_intf
,
name
,
[
p_valueobject
intValue
]);
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