[vlc-commits] macosx: simplify creation of latency popup menu

David Fuhrmann git at videolan.org
Sun Jul 26 22:18:53 CEST 2015


vlc | branch: master | David Fuhrmann <dfuhrmann at videolan.org> | Sun Jul 26 22:18:04 2015 +0200| [83d5c9754878b38d51b8b2d243d88a3539ad3525] | committer: David Fuhrmann

macosx: simplify creation of latency popup menu

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=83d5c9754878b38d51b8b2d243d88a3539ad3525
---

 modules/gui/macosx/simple_prefs.m |   35 ++++++++++++-----------------------
 1 file changed, 12 insertions(+), 23 deletions(-)

diff --git a/modules/gui/macosx/simple_prefs.m b/modules/gui/macosx/simple_prefs.m
index 4bb36bb..b0f2913 100644
--- a/modules/gui/macosx/simple_prefs.m
+++ b/modules/gui/macosx/simple_prefs.m
@@ -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"];
 
-    /* do not trust translators to do the correct thing,
-     * so re-build the menu in an unorthodox way (#15106) */
     [_input_cachelevelPopup removeAllItems];
-    NSArray *plainTitles = @[@"Custom", @"Lowest latency", @"Low latency", @"Normal", @"High latency", @"Higher latency"];
-    NSMenuItem *workerItem;
-    [_input_cachelevelPopup addItemsWithTitles: plainTitles];
-    workerItem = [_input_cachelevelPopup itemAtIndex: 0];
-    [workerItem setTag: 0];
-    [workerItem setTitle:_NS("Custom")];
-    workerItem = [_input_cachelevelPopup itemAtIndex: 1];
-    [workerItem setTag: 100];
-    [workerItem setTitle:_NS("Lowest Latency")];
-    workerItem = [_input_cachelevelPopup itemAtIndex: 2];
-    [workerItem setTag: 200];
-    [workerItem setTitle:_NS("Low Latency")];
-    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")];
+    NSMenuItem *item = [[_input_cachelevelPopup menu] addItemWithTitle:_NS("Custom") action:nil keyEquivalent:@""];
+    [item setTag: 0];
+    item = [[_input_cachelevelPopup menu] addItemWithTitle:_NS("Lowest Latency") action:nil keyEquivalent:@""];
+    [item setTag: 100];
+    item = [[_input_cachelevelPopup menu] addItemWithTitle:_NS("Low Latency") action:nil keyEquivalent:@""];
+    [item setTag: 200];
+    item = [[_input_cachelevelPopup menu] addItemWithTitle:_NS("Normal") action:nil keyEquivalent:@""];
+    [item setTag: 300];
+    item = [[_input_cachelevelPopup menu] addItemWithTitle:_NS("Higher Latency") action:nil keyEquivalent:@""];
+    [item setTag: 500];
+    item = [[_input_cachelevelPopup menu] addItemWithTitle:_NS("Highest Latency") action:nil keyEquivalent:@""];
+    [item setTag: 1000];
 
     #define TestCaC(name, factor) \
     cache_equal = cache_equal && \



More information about the vlc-commits mailing list