Commit a1d67615 authored by Derk-Jan Hartman's avatar Derk-Jan Hartman

macosx: The vlc update API can only handle a destination directory.

We now account for this and use an "OpenPanel" instead of a "SavePanel".
parent d0102803
...@@ -137,14 +137,14 @@ static VLCUpdate *_o_sharedInstance = nil; ...@@ -137,14 +137,14 @@ static VLCUpdate *_o_sharedInstance = nil;
{ {
/* provide a save dialogue */ /* provide a save dialogue */
SEL sel = @selector(getLocationForSaving:returnCode:contextInfo:); SEL sel = @selector(getLocationForSaving:returnCode:contextInfo:);
NSSavePanel * saveFilePanel = [[NSSavePanel alloc] init]; NSOpenPanel * saveFilePanel = [[NSOpenPanel alloc] init];
[saveFilePanel setRequiredFileType: @"dmg"]; [saveFilePanel setCanChooseFiles: NO];
[saveFilePanel setCanSelectHiddenExtension: YES]; [saveFilePanel setCanChooseDirectories: YES];
[saveFilePanel setCanCreateDirectories: YES]; [saveFilePanel setCanCreateDirectories: YES];
update_release_t *p_release = update_GetRelease( p_u ); update_release_t *p_release = update_GetRelease( p_u );
assert( p_release ); assert( p_release );
[saveFilePanel beginSheetForDirectory:nil file: [saveFilePanel beginSheetForDirectory:@"~/Downloads" file:
[[[NSString stringWithUTF8String: p_release->psz_url] componentsSeparatedByString:@"/"] lastObject] [[[NSString stringWithUTF8String: p_release->psz_url] componentsSeparatedByString:@"/"] lastObject]
modalForWindow: o_update_window modalForWindow: o_update_window
modalDelegate:self modalDelegate:self
...@@ -152,14 +152,14 @@ static VLCUpdate *_o_sharedInstance = nil; ...@@ -152,14 +152,14 @@ static VLCUpdate *_o_sharedInstance = nil;
contextInfo:nil]; contextInfo:nil];
} }
- (void)getLocationForSaving: (NSSavePanel *)sheet - (void)getLocationForSaving: (NSOpenPanel *)sheet
returnCode: (int)returnCode returnCode: (int)returnCode
contextInfo: (void *)contextInfo contextInfo: (void *)contextInfo
{ {
if( returnCode == NSOKButton ) if( returnCode == NSOKButton )
{ {
/* perform download and pass the selected path */ /* perform download and pass the selected path */
[NSThread detachNewThreadSelector:@selector(performDownload:) toTarget:self withObject:[sheet filename]]; [NSThread detachNewThreadSelector:@selector(performDownload:) toTarget:self withObject:[sheet directory]];
} }
[sheet release]; [sheet release];
} }
......
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