Commit 83d5c975 authored by David Fuhrmann's avatar David Fuhrmann

macosx: simplify creation of latency popup menu

parent ee12bb07
...@@ -704,30 +704,19 @@ static inline char * __config_GetLabel(vlc_object_t *p_this, const char *psz_nam ...@@ -704,30 +704,19 @@ static inline char * __config_GetLabel(vlc_object_t *p_this, const char *psz_nam
[self setupButton:_input_mkv_preload_dirCheckbox forBoolValue: "mkv-preload-local-dir"]; [self setupButton:_input_mkv_preload_dirCheckbox forBoolValue: "mkv-preload-local-dir"];
/* do not trust translators to do the correct thing,
* so re-build the menu in an unorthodox way (#15106) */
[_input_cachelevelPopup removeAllItems]; [_input_cachelevelPopup removeAllItems];
NSArray *plainTitles = @[@"Custom", @"Lowest latency", @"Low latency", @"Normal", @"High latency", @"Higher latency"]; NSMenuItem *item = [[_input_cachelevelPopup menu] addItemWithTitle:_NS("Custom") action:nil keyEquivalent:@""];
NSMenuItem *workerItem; [item setTag: 0];
[_input_cachelevelPopup addItemsWithTitles: plainTitles]; item = [[_input_cachelevelPopup menu] addItemWithTitle:_NS("Lowest Latency") action:nil keyEquivalent:@""];
workerItem = [_input_cachelevelPopup itemAtIndex: 0]; [item setTag: 100];
[workerItem setTag: 0]; item = [[_input_cachelevelPopup menu] addItemWithTitle:_NS("Low Latency") action:nil keyEquivalent:@""];
[workerItem setTitle:_NS("Custom")]; [item setTag: 200];
workerItem = [_input_cachelevelPopup itemAtIndex: 1]; item = [[_input_cachelevelPopup menu] addItemWithTitle:_NS("Normal") action:nil keyEquivalent:@""];
[workerItem setTag: 100]; [item setTag: 300];
[workerItem setTitle:_NS("Lowest Latency")]; item = [[_input_cachelevelPopup menu] addItemWithTitle:_NS("Higher Latency") action:nil keyEquivalent:@""];
workerItem = [_input_cachelevelPopup itemAtIndex: 2]; [item setTag: 500];
[workerItem setTag: 200]; item = [[_input_cachelevelPopup menu] addItemWithTitle:_NS("Highest Latency") action:nil keyEquivalent:@""];
[workerItem setTitle:_NS("Low Latency")]; [item setTag: 1000];
workerItem = [_input_cachelevelPopup itemAtIndex: 3];
[workerItem setTag: 300];
[workerItem setTitle:_NS("Normal")];
workerItem = [_input_cachelevelPopup itemAtIndex: 4];
[workerItem setTag: 500];
[workerItem setTitle:_NS("Higher Latency")];
workerItem = [_input_cachelevelPopup itemAtIndex: 5];
[workerItem setTag: 1000];
[workerItem setTitle:_NS("Highest Latency")];
#define TestCaC(name, factor) \ #define TestCaC(name, factor) \
cache_equal = cache_equal && \ cache_equal = cache_equal && \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment