]> git.sesse.net Git - vlc/commitdiff
macosx: The vlc update API can only handle a destination directory.
authorDerk-Jan Hartman <hartman@videolan.org>
Tue, 30 Sep 2008 12:44:34 +0000 (14:44 +0200)
committerDerk-Jan Hartman <hartman@videolan.org>
Tue, 30 Sep 2008 12:56:53 +0000 (14:56 +0200)
We now account for this and use an "OpenPanel" instead of a "SavePanel".

modules/gui/macosx/update.m

index 7c964f5471af76faaaac621002d08e41fdbe7442..5b50feb2c978d212f51b53f7449940934a7e54ce 100644 (file)
@@ -137,14 +137,14 @@ static VLCUpdate *_o_sharedInstance = nil;
 {
     /* provide a save dialogue */
     SEL sel = @selector(getLocationForSaving:returnCode:contextInfo:);
-    NSSavePanel * saveFilePanel = [[NSSavePanel alloc] init];
+    NSOpenPanel * saveFilePanel = [[NSOpenPanel alloc] init];
 
-    [saveFilePanel setRequiredFileType: @"dmg"];
-    [saveFilePanel setCanSelectHiddenExtension: YES];
+    [saveFilePanel setCanChooseFiles: NO];
+    [saveFilePanel setCanChooseDirectories: YES];
     [saveFilePanel setCanCreateDirectories: YES];
     update_release_t *p_release = update_GetRelease( p_u );
     assert( p_release );
-    [saveFilePanel beginSheetForDirectory:nil file:
+    [saveFilePanel beginSheetForDirectory:@"~/Downloads" file:
         [[[NSString stringWithUTF8String: p_release->psz_url] componentsSeparatedByString:@"/"] lastObject]
                            modalForWindow: o_update_window 
                             modalDelegate:self
@@ -152,14 +152,14 @@ static VLCUpdate *_o_sharedInstance = nil;
                               contextInfo:nil];
 }
 
-- (void)getLocationForSaving: (NSSavePanel *)sheet 
+- (void)getLocationForSaving: (NSOpenPanel *)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 filename]];
+        [NSThread detachNewThreadSelector:@selector(performDownload:) toTarget:self withObject:[sheet directory]];
     }
     [sheet release];
 }