From: Derk-Jan Hartman Date: Thu, 2 Oct 2008 14:53:25 +0000 (+0200) Subject: macosx: allow to specify where you want the download to be save and how it should... X-Git-Tag: 1.0.0-pre1~2733 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=462d6d04c76065ae23cb01d0a572f7c763c10ac5;p=vlc macosx: allow to specify where you want the download to be save and how it should be called. --- diff --git a/modules/gui/macosx/update.m b/modules/gui/macosx/update.m index 3d296d2ec4..561298fe8c 100644 --- a/modules/gui/macosx/update.m +++ b/modules/gui/macosx/update.m @@ -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]; }