macosx: create new classes for all controls bar related code
[vlc.git] / modules / gui / macosx / MainMenu.m
index 62cf145..68d69b7 100644 (file)
@@ -41,6 +41,7 @@
 #import "VideoView.h"
 #import "CoreInteraction.h"
 #import "MainWindow.h"
+#import "ControlsBar.h"
 #import "ExtensionsManager.h"
 #import "ConvertAndSave.h"
 
@@ -118,6 +119,15 @@ static VLCMainMenu *_o_sharedInstance = nil;
                                              selector: @selector(applicationWillFinishLaunching:)
                                                  name: NSApplicationWillFinishLaunchingNotification
                                                object: nil];
+
+    /* check whether the user runs OSX with a RTL language */
+    NSArray* languages = [NSLocale preferredLanguages];
+    NSString* preferredLanguage = [languages objectAtIndex:0];
+
+    if ([NSLocale characterDirectionForLanguage:preferredLanguage] == NSLocaleLanguageDirectionRightToLeft) {
+        msg_Dbg(VLCIntf, "adapting interface since '%s' is a RTL language", [preferredLanguage UTF8String]);
+        [o_mi_rate_fld setAlignment: NSLeftTextAlignment];
+    }
 }
 
 - (void)applicationWillFinishLaunching:(NSNotification *)o_notification
@@ -373,7 +383,7 @@ static VLCMainMenu *_o_sharedInstance = nil;
     [o_mi_player setTitle: _NS("Player...")];
     [o_mi_controller setTitle: _NS("Main Window...")];
     [o_mi_audioeffects setTitle: _NS("Audio Effects...")];
-    [o_mi_videoeffects setTitle: _NS("Video Filters...")];
+    [o_mi_videoeffects setTitle: _NS("Video Effects...")];
     [o_mi_bookmarks setTitle: _NS("Bookmarks...")];
     [o_mi_playlist setTitle: _NS("Playlist...")];
     [o_mi_info setTitle: _NS("Media Information...")];
@@ -624,7 +634,7 @@ static VLCMainMenu *_o_sharedInstance = nil;
 {
     BOOL b_value = !config_GetInt(VLCIntf, "macosx-show-playback-buttons");
     config_PutInt(VLCIntf, "macosx-show-playback-buttons", b_value);
-    [[[VLCMain sharedInstance] mainWindow] toggleJumpButtons];
+    [[[[VLCMain sharedInstance] mainWindow] controlsBar] toggleJumpButtons];
     [o_mi_toggleJumpButtons setState: b_value];
 }
 
@@ -632,7 +642,7 @@ static VLCMainMenu *_o_sharedInstance = nil;
 {
     BOOL b_value = !config_GetInt(VLCIntf, "macosx-show-playmode-buttons");
     config_PutInt(VLCIntf, "macosx-show-playmode-buttons", b_value);
-    [[[VLCMain sharedInstance] mainWindow] togglePlaymodeButtons];
+    [[[[VLCMain sharedInstance] mainWindow] controlsBar] togglePlaymodeButtons];
     [o_mi_togglePlaymodeButtons setState: b_value];
 }