From 462d6d04c76065ae23cb01d0a572f7c763c10ac5 Mon Sep 17 00:00:00 2001 From: Derk-Jan Hartman Date: Thu, 2 Oct 2008 16:53:25 +0200 Subject: [PATCH] macosx: allow to specify where you want the download to be save and how it should be called. --- modules/gui/macosx/update.m | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) 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]; } -- 2.39.2