No functional changes. Some more can't be replaced yet, as we still support 10.5
[openPanel setCanChooseFiles: YES];
[openPanel setCanChooseDirectories: NO];
[openPanel setAllowsMultipleSelection: YES];
- i_returnValue = [openPanel runModalForDirectory: [NSString stringWithUTF8String: path] file: nil types: [NSArray arrayWithObjects: @"cdg",@"@idx",@"srt",@"sub",@"utf",@"ass",@"ssa",@"aqt",@"jss",@"psb",@"rt",@"smi",@"txt",@"smil", nil]];
+ [openPanel setAllowedFileTypes: [NSArray arrayWithObjects: @"cdg",@"@idx",@"srt",@"sub",@"utf",@"ass",@"ssa",@"aqt",@"jss",@"psb",@"rt",@"smi",@"txt",@"smil", nil]];
+ [openPanel setDirectoryURL:[NSURL fileURLWithPath:[[NSString stringWithUTF8String:path] stringByExpandingTildeInPath]]];
+ i_returnValue = [openPanel runModal];
free( path );
if( i_returnValue == NSOKButton )
NSUInteger c = 0;
if( !p_input ) return;
- c = [[openPanel filenames] count];
+ c = [[openPanel URLs] count];
- for (int i = 0; i < [[openPanel filenames] count] ; i++)
+ for (int i = 0; i < c ; i++)
{
- msg_Dbg( VLCIntf, "loading subs from %s", [[[openPanel filenames] objectAtIndex: i] UTF8String] );
- if( input_AddSubtitle( p_input, [[[openPanel filenames] objectAtIndex: i] UTF8String], TRUE ) )
+ msg_Dbg( VLCIntf, "loading subs from %s", [[[[openPanel URLs] objectAtIndex: i] path] UTF8String] );
+ if( input_AddSubtitle( p_input, [[[[openPanel URLs] objectAtIndex: i] path] UTF8String], TRUE ) )
msg_Warn( VLCIntf, "unable to load subtitles from '%s'",
- [[[openPanel filenames] objectAtIndex: i] UTF8String] );
+ [[[[openPanel URLs] objectAtIndex: i] path] UTF8String] );
}
}
}
static void * ManageThread( void *user_data );
-static unsigned int VLCModifiersToCocoa( unsigned int i_key );
-
static void updateProgressPanel (void *, const char *, float);
static bool checkProgressPanel (void *);
static void destroyProgressPanel (void *);
if( [o_usedHotkeys indexOfObject: tempString] != NSNotFound || [o_usedHotkeys indexOfObject: tempStringPlus] != NSNotFound )
{
- var_Set( p_intf->p_libvlc, "key-pressed", val );
+ var_SetInteger( p_intf->p_libvlc, "key-pressed", val.i_int );
return YES;
}
[saveFolderPanel setCanChooseFiles: YES];
[saveFolderPanel setCanSelectHiddenExtension: NO];
[saveFolderPanel setCanCreateDirectories: YES];
- [saveFolderPanel setRequiredFileType: @"rtfd"];
+ [saveFolderPanel setAllowedFileTypes: [NSArray arrayWithObject:@"rtfd"]];
[saveFolderPanel beginSheetForDirectory:nil file: [NSString stringWithFormat: _NS("VLC Debug Log (%s).rtfd"), VERSION_MESSAGE] modalForWindow: o_msgs_panel modalDelegate:self didEndSelector:@selector(saveDebugLogAsRTF:returnCode:contextInfo:) contextInfo:nil];
}
BOOL b_returned;
if( returnCode == NSOKButton )
{
- b_returned = [o_messages writeRTFDToFile: [sheet filename] atomically: YES];
+ b_returned = [o_messages writeRTFDToFile: [[sheet URL] path] atomically: YES];
if(! b_returned )
msg_Warn( p_intf, "Error while saving the debug log" );
}
o_open_panel = [NSOpenPanel openPanel];
[o_open_panel setCanChooseFiles: YES];
[o_open_panel setCanChooseDirectories: NO];
- if( [o_open_panel runModalForDirectory: nil file: nil types: nil] == NSOKButton )
+ if( [o_open_panel runModal] == NSOKButton )
{
if( o_file_slave_path )
[o_file_slave_path release];
- o_file_slave_path = [[o_open_panel filenames] objectAtIndex: 0];
+ o_file_slave_path = [[[o_open_panel URLs] objectAtIndex: 0] path];
[o_file_slave_path retain];
}
else
{
if (returnCode == NSFileHandlingPanelOKButton)
{
- NSString *o_filename = [[sheet filenames] objectAtIndex: 0];
+ NSString *o_filename = [[[sheet URLs] objectAtIndex: 0] path];
[o_file_path setStringValue: o_filename];
[self openFilePathChanged: nil];
}
[o_open_panel setTitle: _NS("Open VIDEO_TS Directory")];
[o_open_panel setPrompt: _NS("Open")];
- if( [o_open_panel runModalForDirectory: nil
- file: nil types: nil] == NSOKButton )
+ if( [o_open_panel runModal] == NSOKButton )
{
- NSString *o_dirname = [[o_open_panel filenames] objectAtIndex: 0];
+ NSString *o_dirname = [[[o_open_panel URLs] objectAtIndex: 0] path];
[o_disc_videots_folder setStringValue: o_dirname];
[self openDiscInfoChanged: nil];
}
[o_open_panel setTitle: _NS("Open File")];
[o_open_panel setPrompt: _NS("Open")];
- if( [o_open_panel runModalForDirectory: nil
- file: nil types: nil] == NSOKButton )
+ if( [o_open_panel runModal] == NSOKButton )
{
NSArray *o_array = [NSArray array];
- NSArray *o_values = [[o_open_panel filenames]
+ NSArray *o_values = [[o_open_panel URLs]
sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)];
for( i = 0; i < (int)[o_values count]; i++)
{
NSDictionary *o_dic;
- char *psz_uri = make_URI([[o_values objectAtIndex:i] UTF8String], "file");
+ char *psz_uri = make_URI([[[o_values objectAtIndex:i] path] UTF8String], "file");
if( !psz_uri )
continue;
[o_open_panel setTitle: _NS("Open File")];
[o_open_panel setPrompt: _NS("Open")];
- if( [o_open_panel runModalForDirectory: nil
- file: nil types: nil] == NSOKButton )
+ if( [o_open_panel runModal] == NSOKButton )
{
- NSString *o_filename = [[o_open_panel filenames] objectAtIndex: 0];
+ NSString *o_filename = [[[o_open_panel URLs] objectAtIndex: 0] path];
[o_file_sub_path setStringValue: o_filename];
}
}
if( [o_save_panel runModalForDirectory: nil
file: o_name] == NSOKButton )
{
- NSString *o_filename = [o_save_panel filename];
+ NSString *o_filename = [[o_save_panel URL] path];
[o_file_field setStringValue: o_filename];
[self outputInfoChanged: nil];
}
if( [o_save_panel runModalForDirectory: nil
file: o_name] == NSOKButton )
{
- NSString *o_filename = [o_save_panel filename];
+ NSString *o_filename = [[o_save_panel URL] path];
if( [o_save_accessory_popup indexOfSelectedItem] == 0 )
{
{
if( i_return_code == NSOKButton )
{
- NSString *o_path = [[o_sheet filenames] objectAtIndex: 0];
+ NSString *o_path = [[[o_sheet URLs] objectAtIndex: 0] path];
[o_textfield setStringValue: o_path];
}
}
{
if( contextInfo == o_video_snap_folder_btn )
{
- [o_video_snap_folder_fld setStringValue: [o_selectFolderPanel filename]];
+ [o_video_snap_folder_fld setStringValue: [[o_selectFolderPanel URL] path]];
b_videoSettingChanged = YES;
}
}
/* check whether the extension is hidden or not.
* if not, remove it
* we need the casting to make GCC4 happy */
- if( [[[NSFileManager defaultManager] fileAttributesAtPath:
+ if( [[[NSFileManager defaultManager] attributesOfItemAtPath:
[[o_userSelections objectForKey:@"pathToStrm"]
- objectAtIndex: x] traverseLink: NO] objectForKey:
+ objectAtIndex: x] error:nil] objectForKey:
NSFileExtensionHidden] )
fileNameToUse = [NSString stringWithString:
[[NSFileManager defaultManager] displayNameAtPath:
{
if (returnCode == NSOKButton)
{
- [o_t2_fld_pathToNewStrm setStringValue: [@"file://"
- stringByAppendingString: [sheet filename]]];
+ [o_t2_fld_pathToNewStrm setStringValue: [[sheet URL] absoluteString]];
}
}
[[o_userSelections objectForKey:@"encapFormat"] intValue]]
objectAtIndex:0];
if( theEncapFormat != @"ps" )
- [saveFilePanel setRequiredFileType: theEncapFormat];
+ [saveFilePanel setAllowedFileTypes: [NSArray arrayWithObject:theEncapFormat]];
else
- [saveFilePanel setRequiredFileType: @"mpg"];
+ [saveFilePanel setAllowedFileTypes: [NSArray arrayWithObject:@"mpg"]];
[saveFilePanel setCanSelectHiddenExtension: YES];
[saveFilePanel setCanCreateDirectories: YES];
* selected a folder */
if( [[o_userSelections objectForKey:@"pathToStrm"] count] > 1 )
[o_t7_fld_filePath setStringValue: [NSString stringWithFormat:
- @"%@/", [sheet filename]]];
+ @"%@/", [[sheet URL] path]]];
else
- [o_t7_fld_filePath setStringValue:[sheet filename]];
+ [o_t7_fld_filePath setStringValue:[[sheet URL] path]];
}
[sheet release];
}