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]; [o_update showUpdateWindow];
} else {
[o_update showUpdateWindow];
}
} }
- (IBAction)openReadMe:(id)sender - (IBAction)openReadMe:(id)sender
......
...@@ -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 )
{ {
......
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