Commit c361066f authored by Felix Paul Kühne's avatar Felix Paul Kühne

* controls.m: call openFileGeneric via VLCMain and not directly from VLCOpen

* controls.h: removed "o_open"
* intf.*, open.*: make sure the open-nib is loaded only once, don't load it at launch time but dynamic and do it in VLCMain, so VLCOpen does not know about it anymore
* MainMenu.nib: we don't need instances of VLCOpen and VLCOutput anymore
parent 0830f18b
......@@ -36,12 +36,7 @@
};
CLASS = VLCControls;
LANGUAGE = ObjC;
OUTLETS = {
"o_btn_fullscreen" = id;
"o_main" = id;
"o_open" = id;
"o_volumeslider" = id;
};
OUTLETS = {"o_btn_fullscreen" = id; "o_main" = id; "o_volumeslider" = id; };
SUPERCLASS = NSObject;
},
{
......@@ -232,7 +227,6 @@
"o_mu_videotrack" = id;
"o_mu_visual" = id;
"o_mu_window" = id;
"o_open" = id;
"o_playlist" = id;
"o_scrollfield" = id;
"o_timefield" = id;
......@@ -242,20 +236,8 @@
};
SUPERCLASS = NSObject;
},
{
ACTIONS = {};
CLASS = VLCOpen;
LANGUAGE = ObjC;
OUTLETS = {};
SUPERCLASS = NSObject;
},
{
ACTIONS = {};
CLASS = VLCOutput;
LANGUAGE = ObjC;
OUTLETS = {};
SUPERCLASS = NSObject;
},
{CLASS = VLCOpen; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{CLASS = VLCOutput; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{
ACTIONS = {
deleteItem = id;
......
......@@ -28,7 +28,6 @@
*****************************************************************************/
@interface VLCControls : NSObject
{
IBOutlet id o_open;
IBOutlet id o_main;
IBOutlet id o_btn_fullscreen;
......
......@@ -54,7 +54,7 @@
{
vlc_mutex_unlock( &p_playlist->object_lock );
vlc_object_release( p_playlist );
[o_open openFileGeneric];
[o_main intfOpenFileGeneric: (id)sender];
}
else
{
......
......@@ -84,6 +84,7 @@ struct intf_sys_t
id o_prefs; /* VLCPrefs */
id o_about; /* VLAboutBox */
id o_open; /* VLCOpen */
BOOL nib_open_loaded; /* reference to the open-nib */
IBOutlet id o_window; /* main window */
IBOutlet id o_scrollfield; /* info field */
......
......@@ -294,6 +294,7 @@ static VLCMain *_o_sharedMainInstance = nil;
o_about = [[VLAboutBox alloc] init];
o_prefs = [[VLCPrefs alloc] init];
o_open = [[VLCOpen alloc] init];
return _o_sharedMainInstance;
}
......@@ -377,10 +378,6 @@ static VLCMain *_o_sharedMainInstance = nil;
[self setSubmenusEnabled: FALSE];
[self manageVolumeSlider];
/* let's load the open and sout-option dialogues and init the related classes */
o_open = [[VLCOpen alloc] init];
[o_open getReady];
p_playlist = (playlist_t *) vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if( p_playlist )
......@@ -1290,22 +1287,50 @@ static VLCMain *_o_sharedMainInstance = nil;
- (IBAction)intfOpenFile:(id)sender
{
if (!nib_open_loaded)
{
nib_open_loaded = [NSBundle loadNibNamed:@"Open" owner:self];
[o_open awakeFromNib];
[o_open openFile];
} else {
[o_open openFile];
}
}
- (IBAction)intfOpenFileGeneric:(id)sender
{
if (!nib_open_loaded)
{
nib_open_loaded = [NSBundle loadNibNamed:@"Open" owner:self];
[o_open awakeFromNib];
[o_open openFileGeneric];
} else {
[o_open openFileGeneric];
}
}
- (IBAction)intfOpenDisc:(id)sender
{
if (!nib_open_loaded)
{
nib_open_loaded = [NSBundle loadNibNamed:@"Open" owner:self];
[o_open awakeFromNib];
[o_open openDisc];
} else {
[o_open openDisc];
}
}
- (IBAction)intfOpenNet:(id)sender
{
if (!nib_open_loaded)
{
nib_open_loaded = [NSBundle loadNibNamed:@"Open" owner:self];
[o_open awakeFromNib];
[o_open openNet];
} else {
[o_open openNet];
}
}
- (IBAction)viewAbout:(id)sender
......
......@@ -132,6 +132,4 @@ NSArray *GetEjectableMediaOfClass( const char *psz_class );
- (IBAction)panelOk:(id)sender;
- (void)openFile;
- (void)getReady;
@end
......@@ -147,11 +147,6 @@ static VLCOpen *_o_sharedMainInstance = nil;
return _o_sharedMainInstance;
}
- (void)getReady
{
[NSBundle loadNibNamed:@"Open" owner:self];
}
- (void)awakeFromNib
{
intf_thread_t * p_intf = VLCIntf;
......
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