Commit dacaa81b authored by Felix Paul Kühne's avatar Felix Paul Kühne

* download the updated versions through VLC and not through your default browser

* removed a crasher from interaction.m

Note: the progress-window used to show the progress is quite hacky at the moment and will be replaced through a good implementation once the interaction-core is finished.
parent e1db82bc
......@@ -2,7 +2,7 @@
* interaction.h: Mac OS X interaction dialogs
*****************************************************************************
* Copyright (C) 2005-2006 the VideoLAN team
* $Id:$
* $Id$
*
* Authors: Derk-Jan Hartman <hartman at videolan dot org>
* Felix Kühne <fkuehne at videolan dot org>
......@@ -225,14 +225,13 @@
{
[o_prog_bar setDoubleValue: \
(double)(p_dialog->pp_widgets[i]->val.f_float)];
if( [o_prog_bar doubleValue] == 100.0 )
{
/* we are done, let's hide */
[self hideDialog];
return;
}
[o_prog_description setStringValue: [NSString stringWithUTF8String:\
p_dialog->pp_widgets[i]->val.psz_string]];
}
}
}
......
......@@ -37,6 +37,7 @@
NSString * o_hashOfOurBinary;
NSString * o_urlOfBinary;
NSNumber * o_indexOfOurBinary;
update_t * p_u;
intf_thread_t * p_intf;
}
......
......@@ -76,6 +76,8 @@ static VLCUpdate *_o_sharedInstance = nil;
[o_hashOfOurBinary release];
if( o_urlOfBinary )
[o_urlOfBinary release];
if( o_indexOfOurBinary )
[o_indexOfOurBinary release];
[super dealloc];
}
......@@ -106,19 +108,17 @@ static VLCUpdate *_o_sharedInstance = nil;
- (IBAction)download:(id)sender
{
/* enable the following once full notification support is available
* provide a save dialogue *
/* provide a save dialogue */
SEL sel = @selector(getLocationForSaving:returnCode:contextInfo:);
NSSavePanel * saveFilePanel = [[NSSavePanel alloc] init];
[saveFilePanel setRequiredFileType: @"dmg"];
[saveFilePanel setCanSelectHiddenExtension: YES];
[saveFilePanel setCanCreateDirectories: YES];
[saveFilePanel beginSheetForDirectory:nil file:nil modalForWindow: \
o_update_window modalDelegate:self didEndSelector:sel contextInfo:nil];*/
/* delete this afterwards */
[self performDownload: @""];
[saveFilePanel beginSheetForDirectory:nil file: \
[[o_urlOfBinary componentsSeparatedByString:@"/"] lastObject] \
modalForWindow: o_update_window modalDelegate:self didEndSelector:sel \
contextInfo:nil];
}
- (void)getLocationForSaving: (NSSavePanel *)sheet returnCode: \
......@@ -175,9 +175,10 @@ static VLCUpdate *_o_sharedInstance = nil;
else if( p_uit->file.i_type == UPDATE_FILE_TYPE_BINARY )
{
msg_Dbg( p_intf, "binary found, version = %s" \
", hash=%s, size=%i", p_uit->release.psz_version, \
p_uit->file.psz_md5, (int)((p_uit->file.l_size \
/ 1024) / 1024) );
", hash=%s, size=%i MB, position in release file list=%i",\
p_uit->release.psz_version, p_uit->file.psz_md5, \
(int)((p_uit->file.l_size / 1024) / 1024), \
p_uit->i_f);
[o_fld_currentVersionAndSize setStringValue: \
[NSString stringWithFormat: \
@"The current release is %s (%i MB to download).", \
......@@ -197,6 +198,14 @@ static VLCUpdate *_o_sharedInstance = nil;
o_hashOfOurBinary = [[NSString alloc] \
initWithUTF8String: p_uit->file.psz_md5];
}
if( p_uit->i_f )
{
if( o_indexOfOurBinary )
[o_indexOfOurBinary release];
o_indexOfOurBinary = [[NSNumber alloc] \
initWithInt: p_uit->i_f];
}
}
if( p_uit->release.i_status == UPDATE_RELEASE_STATUS_NEWER &&
!releaseChecked )
......@@ -263,33 +272,24 @@ static VLCUpdate *_o_sharedInstance = nil;
- (void)performDownload:(NSString *)path
{
/* enable this once notifications are completely available on OSX
update_iterator_t *p_uit = update_iterator_New( p_u );
if( p_uit )
{
update_iterator_Action( p_uit, UPDATE_MIRROR );
int i_count = 0;
while( update_iterator_Action( p_uit, UPDATE_FILE ) != UPDATE_FAIL )
while( update_iterator_Action( p_uit, UPDATE_FILE) != UPDATE_FAIL )
{
if( p_uit->file.psz_url == [o_hashOfOurBinary UTF8String] )
break;
i_count += 1;
}
if( p_uit->release.i_type == UPDATE_RELEASE_TYPE_STABLE &&
p_uit->release.i_status == UPDATE_RELEASE_STATUS_NEWER &&
p_uit->file.i_type == UPDATE_FILE_TYPE_BINARY )
{
/* that's our binary */
update_download( p_uit, (char *)[path UTF8String] );
}
}
update_iterator_Delete( p_uit );
}*/
/* delete the following afterwards */
msg_Dbg( p_intf, "url is %s, using default browser for download", \
[o_urlOfBinary UTF8String] );
NSURL * o_url = [NSURL URLWithString: o_urlOfBinary];
[[NSWorkspace sharedWorkspace] openURL: o_url];
}
[o_update_window close];
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment