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
4e6bc174
Commit
4e6bc174
authored
Jan 20, 2014
by
David Fuhrmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macosx: advanced prefs: use config_GetIntChoices for int list
parent
b76584c1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
19 deletions
+23
-19
modules/gui/macosx/prefs_widgets.m
modules/gui/macosx/prefs_widgets.m
+23
-19
No files found.
modules/gui/macosx/prefs_widgets.m
View file @
4e6bc174
...
@@ -1446,17 +1446,7 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \
...
@@ -1446,17 +1446,7 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \
[
o_popup
setAutoresizingMask
:
NSViewWidthSizable
];
[
o_popup
setAutoresizingMask
:
NSViewWidthSizable
];
/* add items */
/* add items */
for
(
int
i_index
=
0
;
i_index
<
p_item
->
list_count
;
i_index
++
)
{
[
self
resetValues
];
NSString
*
o_text
;
if
(
p_item
->
list_text
&&
p_item
->
list_text
[
i_index
])
o_text
=
_NS
((
char
*
)
p_item
->
list_text
[
i_index
]);
else
o_text
=
[
NSString
stringWithFormat
:
@"%i"
,
p_item
->
list
.
i
[
i_index
]];
[
o_popup
addItemWithTitle
:
o_text
];
if
(
p_item
->
value
.
i
==
p_item
->
list
.
i
[
i_index
])
[
o_popup
selectItemAtIndex
:
i_index
];
}
[
self
addSubview
:
o_popup
];
[
self
addSubview
:
o_popup
];
}
}
...
@@ -1485,19 +1475,33 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \
...
@@ -1485,19 +1475,33 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \
-
(
int
)
intValue
-
(
int
)
intValue
{
{
if
([
o_popup
indexOfSelectedItem
]
>=
0
)
NSNumber
*
p_valueobject
=
(
NSNumber
*
)[[
o_popup
selectedItem
]
representedObject
];
return
p_item
->
list
.
i
[[
o_popup
indexOfSelectedItem
]];
if
(
p_valueobject
)
{
else
assert
([
p_valueobject
isKindOfClass
:[
NSNumber
class
]]);
return
[
o_popup
intValue
];
return
[
p_valueobject
intValue
];
}
else
return
0
;
}
}
-
(
void
)
resetValues
-
(
void
)
resetValues
{
{
for
(
int
i_index
=
0
;
i_index
<
p_item
->
list_count
;
i_index
++
)
{
[
o_popup
removeAllItems
];
if
(
config_GetInt
(
VLCIntf
,
p_item
->
psz_name
)
==
p_item
->
list
.
i
[
i_index
])
[
o_popup
selectItemAtIndex
:
i_index
];
int
i_current_selection
=
config_GetInt
(
VLCIntf
,
p_item
->
psz_name
);
}
int64_t
*
values
;
char
**
texts
;
ssize_t
count
=
config_GetIntChoices
(
VLC_OBJECT
(
VLCIntf
),
p_item
->
psz_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
]]];
[[
o_popup
menu
]
addItem
:
[
mi
autorelease
]];
if
(
i_current_selection
==
values
[
i
])
[
o_popup
selectItem
:[
o_popup
lastItem
]];
free
(
texts
[
i
]);
}
free
(
texts
);
}
}
@end
@end
...
...
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