]> git.sesse.net Git - vlc/commitdiff
macosx: allow to specify where you want the download to be save and how it should...
authorDerk-Jan Hartman <hartman@videolan.org>
Thu, 2 Oct 2008 14:53:25 +0000 (16:53 +0200)
committerDerk-Jan Hartman <hartman@videolan.org>
Thu, 2 Oct 2008 14:53:25 +0000 (16:53 +0200)
modules/gui/macosx/update.m

index 3d296d2ec4453c2fbabed2ce9c091363f6f81749..561298fe8c917454c462a752d18ba213cf211cec 100644 (file)
@@ -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];
 }