[vlc-devel] commit: macosx: allow to specify where you want the download to be save and how it should be called . (Derk-Jan Hartman )

git version control git at videolan.org
Thu Oct 2 21:40:12 CEST 2008


vlc | branch: master | Derk-Jan Hartman <hartman at videolan.org> | Thu Oct  2 16:53:25 2008 +0200| [462d6d04c76065ae23cb01d0a572f7c763c10ac5] | committer: Derk-Jan Hartman 

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

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=462d6d04c76065ae23cb01d0a572f7c763c10ac5
---

 modules/gui/macosx/update.m |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/modules/gui/macosx/update.m b/modules/gui/macosx/update.m
index 3d296d2..561298f 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];
 }




More information about the vlc-devel mailing list