Commit 462d6d04 authored by Derk-Jan Hartman's avatar Derk-Jan Hartman

macosx: allow to specify where you want the download to be save and how it should be called.

parent 97f83156
......@@ -137,13 +137,11 @@ static VLCUpdate *_o_sharedInstance = nil;
{
/* provide a save dialogue */
SEL sel = @selector(getLocationForSaving:returnCode:contextInfo:);
NSOpenPanel * saveFilePanel = [[NSOpenPanel alloc] init];
NSSavePanel * saveFilePanel = [[NSSavePanel alloc] init];
[saveFilePanel setCanChooseFiles: NO];
[saveFilePanel setCanChooseDirectories: YES];
[saveFilePanel setRequiredFileType: @"dmg"];
[saveFilePanel setCanSelectHiddenExtension: YES];
[saveFilePanel setCanCreateDirectories: YES];
[saveFilePanel setPrompt: _NS("Save" )];
[saveFilePanel setNameFieldLabel: _NS("Save As:" )];
update_release_t *p_release = update_GetRelease( p_u );
assert( p_release );
[saveFilePanel beginSheetForDirectory:@"~/Downloads" file:
......@@ -154,14 +152,14 @@ static VLCUpdate *_o_sharedInstance = nil;
contextInfo:nil];
}
- (void)getLocationForSaving: (NSOpenPanel *)sheet
- (void)getLocationForSaving: (NSSavePanel *)sheet
returnCode: (int)returnCode
contextInfo: (void *)contextInfo
{
if( returnCode == NSOKButton )
{
/* perform download and pass the selected path */
[NSThread detachNewThreadSelector:@selector(performDownload:) toTarget:self withObject:[sheet directory]];
[NSThread detachNewThreadSelector:@selector(performDownload:) toTarget:self withObject:[sheet filename]];
}
[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