Commit 640b974d authored by David Fuhrmann's avatar David Fuhrmann

macosx: avoid unnecessarily early loading of open panel nib

Loading the open nib can take some significant time, due to audio/
video devices enumeration.

refs #12123
parent 91d08e51
......@@ -273,8 +273,10 @@
- (IBAction)openSpecialMediaFolder:(id)sender;
- (IBAction)dvdreadOptionChanged:(id)sender;
- (IBAction)vcdOptionChanged:(id)sender;
- (NSString *)getVolumeTypeFromMountPath:(NSString *)mountPath;
- (NSString *)getBSDNodeFromMountPath:(NSString *)mountPath;
// static helper functions
+ (NSString *)getVolumeTypeFromMountPath:(NSString *)mountPath;
+ (NSString *)getBSDNodeFromMountPath:(NSString *)mountPath;
- (void)openNet;
- (IBAction)openNetModeChanged:(id)sender;
......
......@@ -825,7 +825,7 @@ static VLCOpen *_o_sharedMainInstance = nil;
[[[o_tabview tabViewItemAtIndex: [o_tabview indexOfTabViewItemWithIdentifier:@"optical"]] view] displayIfNeeded];
}
- (NSString *) getBSDNodeFromMountPath:(NSString *)mountPath
+ (NSString *) getBSDNodeFromMountPath:(NSString *)mountPath
{
OSStatus err;
FSRef ref;
......@@ -860,7 +860,7 @@ static VLCOpen *_o_sharedMainInstance = nil;
return @"";
}
- (NSString *)getVolumeTypeFromMountPath:(NSString *)mountPath
+ (NSString *)getVolumeTypeFromMountPath:(NSString *)mountPath
{
OSStatus err;
FSRef ref;
......@@ -1003,7 +1003,7 @@ out:
- (NSDictionary *)scanPath:(NSString *)o_path
{
NSString *o_type = [self getVolumeTypeFromMountPath:o_path];
NSString *o_type = [VLCOpen getVolumeTypeFromMountPath:o_path];
NSImage *o_image = [[NSWorkspace sharedWorkspace] iconForFile: o_path];
NSString *o_device_path;
......@@ -1020,7 +1020,7 @@ out:
[o_type isEqualToString: kVLCMediaUnknown])
o_device_path = o_path;
else
o_device_path = [self getBSDNodeFromMountPath:o_path];
o_device_path = [VLCOpen getBSDNodeFromMountPath:o_path];
return [NSDictionary dictionaryWithObjectsAndKeys: o_path, @"path",
o_device_path, @"devicePath",
......
......@@ -1066,21 +1066,20 @@
if ([[NSFileManager defaultManager] fileExistsAtPath:o_path isDirectory:&b_dir] && b_dir &&
[[NSWorkspace sharedWorkspace] getFileSystemInfoForPath:o_path isRemovable: &b_rem
isWritable:&b_writable isUnmountable:NULL description:NULL type:NULL] && b_rem && !b_writable && [o_nsurl isFileURL]) {
id o_vlc_open = [[VLCMain sharedInstance] open];
NSString *diskType = [o_vlc_open getVolumeTypeFromMountPath: o_path];
NSString *diskType = [VLCOpen getVolumeTypeFromMountPath: o_path];
msg_Dbg(p_intf, "detected optical media of type %s in the file input", [diskType UTF8String]);
if ([diskType isEqualToString: kVLCMediaDVD])
o_uri = [NSString stringWithFormat: @"dvdnav://%@", [o_vlc_open getBSDNodeFromMountPath: o_path]];
o_uri = [NSString stringWithFormat: @"dvdnav://%@", [VLCOpen getBSDNodeFromMountPath: o_path]];
else if ([diskType isEqualToString: kVLCMediaVideoTSFolder])
o_uri = [NSString stringWithFormat: @"dvdnav://%@", o_path];
else if ([diskType isEqualToString: kVLCMediaAudioCD])
o_uri = [NSString stringWithFormat: @"cdda://%@", [o_vlc_open getBSDNodeFromMountPath: o_path]];
o_uri = [NSString stringWithFormat: @"cdda://%@", [VLCOpen getBSDNodeFromMountPath: o_path]];
else if ([diskType isEqualToString: kVLCMediaVCD])
o_uri = [NSString stringWithFormat: @"vcd://%@#0:0", [o_vlc_open getBSDNodeFromMountPath: o_path]];
o_uri = [NSString stringWithFormat: @"vcd://%@#0:0", [VLCOpen getBSDNodeFromMountPath: o_path]];
else if ([diskType isEqualToString: kVLCMediaSVCD])
o_uri = [NSString stringWithFormat: @"vcd://%@@0:0", [o_vlc_open getBSDNodeFromMountPath: o_path]];
o_uri = [NSString stringWithFormat: @"vcd://%@@0:0", [VLCOpen getBSDNodeFromMountPath: o_path]];
else if ([diskType isEqualToString: kVLCMediaBD] || [diskType isEqualToString: kVLCMediaBDMVFolder])
o_uri = [NSString stringWithFormat: @"bluray://%@", o_path];
else
......
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