Commit ced48b31 authored by Brendon Justin's avatar Brendon Justin Committed by Jean-Baptiste Kempf

macosx: Add extensions menu entry

Adds an entry to the 'VLC' menu for extensions, which is then auto-populated.
Signed-off-by: default avatarFelix Paul Kühne <fkuehne@videolan.org>
parent efa2f96d
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -41,11 +41,15 @@ ...@@ -41,11 +41,15 @@
id o_trackSynchronization; /* VLCTrackSynchronization */ id o_trackSynchronization; /* VLCTrackSynchronization */
id o_bookmarks; /* VLCBookmarks */ id o_bookmarks; /* VLCBookmarks */
id o_extMgr; /* Extensions Manager */
/* main menu */ /* main menu */
IBOutlet NSMenuItem * o_mi_about; IBOutlet NSMenuItem * o_mi_about;
IBOutlet NSMenuItem * o_mi_prefs; IBOutlet NSMenuItem * o_mi_prefs;
IBOutlet NSMenuItem * o_mi_checkForUpdate; IBOutlet NSMenuItem * o_mi_checkForUpdate;
IBOutlet NSMenuItem * o_mi_extensions;
IBOutlet NSMenu * o_mu_extensions;
IBOutlet NSMenuItem * o_mi_add_intf; IBOutlet NSMenuItem * o_mi_add_intf;
IBOutlet NSMenu * o_mu_add_intf; IBOutlet NSMenu * o_mu_add_intf;
IBOutlet NSMenuItem * o_mi_services; IBOutlet NSMenuItem * o_mi_services;
...@@ -196,6 +200,7 @@ ...@@ -196,6 +200,7 @@
- (void)refreshVoutDeviceMenu:(NSNotification *)o_notification; - (void)refreshVoutDeviceMenu:(NSNotification *)o_notification;
- (void)setSubmenusEnabled:(BOOL)b_enabled; - (void)setSubmenusEnabled:(BOOL)b_enabled;
- (void)setRateControlsEnabled:(BOOL)b_enabled; - (void)setRateControlsEnabled:(BOOL)b_enabled;
- (void)setupExtensionsMenu;
- (IBAction)intfOpenFile:(id)sender; - (IBAction)intfOpenFile:(id)sender;
- (IBAction)intfOpenFileGeneric:(id)sender; - (IBAction)intfOpenFileGeneric:(id)sender;
......
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
#import "VideoView.h" #import "VideoView.h"
#import "CoreInteraction.h" #import "CoreInteraction.h"
#import "MainWindow.h" #import "MainWindow.h"
#import "ExtensionsManager.h"
@implementation VLCMainMenu @implementation VLCMainMenu
static VLCMainMenu *_o_sharedInstance = nil; static VLCMainMenu *_o_sharedInstance = nil;
...@@ -83,6 +84,8 @@ static VLCMainMenu *_o_sharedInstance = nil; ...@@ -83,6 +84,8 @@ static VLCMainMenu *_o_sharedInstance = nil;
if (b_nib_tracksynchro_loaded) if (b_nib_tracksynchro_loaded)
[o_trackSynchronization release]; [o_trackSynchronization release];
[o_extMgr release];
[super dealloc]; [super dealloc];
} }
...@@ -108,6 +111,10 @@ static VLCMainMenu *_o_sharedInstance = nil; ...@@ -108,6 +111,10 @@ static VLCMainMenu *_o_sharedInstance = nil;
because VLCMain is the owner */ because VLCMain is the owner */
if( b_mainMenu_setup ) return; if( b_mainMenu_setup ) return;
/* Get ExtensionsManager */
o_extMgr = [ExtensionsManager getInstance:p_intf];
[o_extMgr retain];
[self initStrings]; [self initStrings];
key = config_GetPsz( p_intf, "key-quit" ); key = config_GetPsz( p_intf, "key-quit" );
...@@ -218,6 +225,8 @@ static VLCMainMenu *_o_sharedInstance = nil; ...@@ -218,6 +225,8 @@ static VLCMainMenu *_o_sharedInstance = nil;
[self setupVarMenuItem: o_mi_add_intf target: (vlc_object_t *)p_intf [self setupVarMenuItem: o_mi_add_intf target: (vlc_object_t *)p_intf
var: "intf-add" selector: @selector(toggleVar:)]; var: "intf-add" selector: @selector(toggleVar:)];
[self setupExtensionsMenu];
} }
- (void)initStrings - (void)initStrings
...@@ -251,6 +260,8 @@ static VLCMainMenu *_o_sharedInstance = nil; ...@@ -251,6 +260,8 @@ static VLCMainMenu *_o_sharedInstance = nil;
[o_mi_clear setTitle: _NS("Clear")]; [o_mi_clear setTitle: _NS("Clear")];
[o_mi_select_all setTitle: _NS("Select All")]; [o_mi_select_all setTitle: _NS("Select All")];
[o_mu_extensions setTitle: _NS("Extensions")];
[o_mu_controls setTitle: _NS("Playback")]; [o_mu_controls setTitle: _NS("Playback")];
[o_mi_play setTitle: _NS("Play")]; [o_mi_play setTitle: _NS("Play")];
[o_mi_stop setTitle: _NS("Stop")]; [o_mi_stop setTitle: _NS("Stop")];
...@@ -548,6 +559,29 @@ static VLCMainMenu *_o_sharedInstance = nil; ...@@ -548,6 +559,29 @@ static VLCMainMenu *_o_sharedInstance = nil;
[o_pool release]; [o_pool release];
} }
#pragma mark -
#pragma mark Extensions
- (void)setupExtensionsMenu
{
/* Load extensions if needed */
// TODO: Implement preference for autoloading extensions on mac
// if( !var_InheritBool( p_intf, "qt-autoload-extensions")
// && ![o_extMgr isLoaded] )
// {
// return;
// }
if( ![o_extMgr isLoaded] && ![o_extMgr cannotLoad] )
{
[o_extMgr loadExtensions];
}
/* Let the ExtensionsManager itself build the menu */
[o_extMgr buildMenu:o_mu_extensions];
}
#pragma mark - #pragma mark -
#pragma mark Playback #pragma mark Playback
- (IBAction)toggleRecord:(id)sender - (IBAction)toggleRecord:(id)sender
......
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