Commit c1f7a646 authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

Mac OS X gui: Check for update on startup.

parent 89c24db9
...@@ -737,6 +737,15 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -737,6 +737,15 @@ static VLCMain *_o_sharedMainInstance = nil;
return YES; return YES;
} }
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
/* Check for update silently on startup */
NSLog(@"checking for update");
if ( !nib_update_loaded )
nib_update_loaded = [NSBundle loadNibNamed:@"Update" owner:self];
[NSThread detachNewThreadSelector:@selector(checkForUpdate) toTarget:o_update withObject:NULL];
}
/* Listen to the remote in exclusive mode, only when VLC is the active /* Listen to the remote in exclusive mode, only when VLC is the active
application */ application */
- (void)applicationDidBecomeActive:(NSNotification *)aNotification - (void)applicationDidBecomeActive:(NSNotification *)aNotification
...@@ -1844,12 +1853,9 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -1844,12 +1853,9 @@ static VLCMain *_o_sharedMainInstance = nil;
- (IBAction)checkForUpdate:(id)sender - (IBAction)checkForUpdate:(id)sender
{ {
if ( !nib_update_loaded ) if ( !nib_update_loaded )
{
nib_update_loaded = [NSBundle loadNibNamed:@"Update" owner:self]; nib_update_loaded = [NSBundle loadNibNamed:@"Update" owner:self];
[o_update showUpdateWindow];
} else { [o_update showUpdateWindow];
[o_update showUpdateWindow];
}
} }
- (IBAction)openReadMe:(id)sender - (IBAction)openReadMe:(id)sender
......
...@@ -145,7 +145,7 @@ static VLCUpdate *_o_sharedInstance = nil; ...@@ -145,7 +145,7 @@ static VLCUpdate *_o_sharedInstance = nil;
NSString * pathToReleaseNote; NSString * pathToReleaseNote;
pathToReleaseNote = [NSString stringWithFormat: \ pathToReleaseNote = [NSString stringWithFormat: \
@"/tmp/vlc_releasenote_%d.tmp", mdate()]; @"/tmp/vlc_releasenote_%d.tmp", mdate()];
if( p_uit ) if( p_uit )
{ {
p_uit->i_rs = UPDATE_RELEASE_STATUS_NEWER; p_uit->i_rs = UPDATE_RELEASE_STATUS_NEWER;
...@@ -205,6 +205,10 @@ static VLCUpdate *_o_sharedInstance = nil; ...@@ -205,6 +205,10 @@ static VLCUpdate *_o_sharedInstance = nil;
p_uit->mirror.psz_type ); p_uit->mirror.psz_type );
/* make sure that we perform this check only once */ /* make sure that we perform this check only once */
releaseChecked = YES; releaseChecked = YES;
/* Make sure the update window is showed in case we have something */
[o_update_window center];
[o_update_window makeKeyAndOrderFront: self];
} }
else if(! releaseChecked ) else if(! releaseChecked )
{ {
...@@ -219,7 +223,7 @@ static VLCUpdate *_o_sharedInstance = nil; ...@@ -219,7 +223,7 @@ static VLCUpdate *_o_sharedInstance = nil;
} }
update_iterator_Delete( p_uit ); update_iterator_Delete( p_uit );
/* wait for our release notes if necessary, since the download is done /* wait for our release notes if necessary, since the download is done
* by another thread -- this does usually take 300000 to 500000 ms */ * by another thread -- this does usually take 300000 to 500000 ms */
if( gettingReleaseNote ) if( gettingReleaseNote )
......
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