[vlc-devel] commit: macosx: The vlc update API can only handle a destination directory. (Derk-Jan Hartman )

git version control git at videolan.org
Tue Sep 30 14:53:23 CEST 2008


vlc | branch: master | Derk-Jan Hartman <hartman at videolan.org> | Tue Sep 30 14:44:34 2008 +0200| [a1d6761564190bc968f3d58e205d245ee5e95972] | committer: Derk-Jan Hartman 

macosx: The vlc update API can only handle a destination directory.

We now account for this and use an "OpenPanel" instead of a "SavePanel".

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

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

diff --git a/modules/gui/macosx/update.m b/modules/gui/macosx/update.m
index 7c964f5..5b50feb 100644
--- a/modules/gui/macosx/update.m
+++ b/modules/gui/macosx/update.m
@@ -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];
 }




More information about the vlc-devel mailing list