X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fgui%2Fmacosx%2Fabout.m;h=d56ed7f59ed5596f9c8194b6e5e57c188e56100b;hb=d0248515a18f96b6658f59163c72841085338011;hp=f2e236cfb7c314a9303732b1fc9970054eba27a1;hpb=f25e0c78ab9c2ac87705454dfe7090715519714f;p=vlc diff --git a/modules/gui/macosx/about.m b/modules/gui/macosx/about.m index f2e236cfb7..d56ed7f59e 100644 --- a/modules/gui/macosx/about.m +++ b/modules/gui/macosx/about.m @@ -1,11 +1,11 @@ /***************************************************************************** * about.m: MacOS X About Panel ***************************************************************************** - * Copyright (C) 2001-2007 the VideoLAN team + * Copyright (C) 2001-2009 the VideoLAN team * $Id$ * * Authors: Derk-Jan Hartman - * Felix Paul KŸhne + * Felix Paul Kühne * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,18 +25,17 @@ /***************************************************************************** * Preamble *****************************************************************************/ -#include "intf.h" -#include "about.h" -#include -#include -#import +#import "intf.h" +#import "about.h" +#import +#import #ifdef __x86_64__ -#define PLATFORM "Intel" +#define PLATFORM "Intel 64bit" #elif __i386__ -#define PLATFORM "Intel" +#define PLATFORM "Intel 32bit" #else -#define PLATFORM "PowerPC" +#define PLATFORM "PowerPC 32bit" #endif /***************************************************************************** @@ -62,6 +61,12 @@ static VLAboutBox *_o_sharedInstance = nil; return _o_sharedInstance; } +- (void) dealloc +{ + [[NSNotificationCenter defaultCenter] removeObserver: self]; + [super dealloc]; +} + /***************************************************************************** * VLC About Window *****************************************************************************/ @@ -70,25 +75,25 @@ static VLAboutBox *_o_sharedInstance = nil; { if(! b_isSetUp ) { - NSDictionary *o_local_dict; - + /* we want to know when VLC wants to quit to prevent a crash while scrolling our credits */ + [[NSNotificationCenter defaultCenter] addObserver: self + selector: @selector(VLCWillTerminate) + name: NSApplicationWillTerminateNotification + object: nil]; + /* Get the localized info dictionary (InfoPlist.strings) */ + NSDictionary *o_local_dict; o_local_dict = [[NSBundle mainBundle] localizedInfoDictionary]; - /* Setup the name field */ - [o_name_field setStringValue: [o_local_dict objectForKey:@"CFBundleName"]]; - - /* Set the about box title */ + /* Setup the copyright field */ + [o_copyright_field setStringValue: [o_local_dict objectForKey:@"NSHumanReadableCopyright"]]; + + /* Set the box title */ [o_about_window setTitle: _NS("About VLC media player")]; /* setup the creator / revision field */ - if( VLC_Changeset() != "exported" ) - [o_revision_field setStringValue: - [NSString stringWithFormat: _NS("Compiled by %s, based on SVN revision %s"), - VLC_CompileBy(), VLC_Changeset()]]; - else - [o_revision_field setStringValue: [NSString stringWithFormat: - _NS("Compiled by %s"), VLC_CompileBy()]]; + [o_revision_field setStringValue: + [NSString stringWithFormat: _NS("Compiled by %s"), VLC_CompileBy()]]; /* Setup the nameversion field */ [o_name_version_field setStringValue: [NSString stringWithFormat:@"Version %s (%s)", VLC_Version(), PLATFORM]]; @@ -99,9 +104,6 @@ static VLAboutBox *_o_sharedInstance = nil; _NS("VLC was brought to you by:"), [NSString stringWithUTF8String: psz_authors], [NSString stringWithUTF8String: psz_thanks]]]; - - /* Setup the copyright field */ - [o_copyright_field setStringValue: [o_local_dict objectForKey:@"NSHumanReadableCopyright"]]; /* Setup the window */ [o_credits_textview setDrawsBackground: NO]; @@ -116,6 +118,7 @@ static VLAboutBox *_o_sharedInstance = nil; /* Show the window */ b_restart = YES; + [o_credits_textview scrollPoint:NSMakePoint( 0, 0 )]; [o_about_window makeKeyAndOrderFront: nil]; } @@ -138,7 +141,7 @@ static VLAboutBox *_o_sharedInstance = nil; if( b_restart ) { /* Reset the starttime */ - i_start = [NSDate timeIntervalSinceReferenceDate] + 3.0; + i_start = [NSDate timeIntervalSinceReferenceDate] + 5.0; f_current = 0; f_end = [o_credits_textview bounds].size.height - [o_credits_scrollview bounds].size.height; b_restart = NO; @@ -155,11 +158,18 @@ static VLAboutBox *_o_sharedInstance = nil; /* If at end, restart at the top */ if( f_current >= f_end ) { + [o_credits_textview scrollPoint:NSMakePoint( 0, 0 )]; b_restart = YES; } } } +- (void)VLCWillTerminate +{ + [o_scroll_timer invalidate]; + [[NSNotificationCenter defaultCenter] removeObserver: self]; +} + /***************************************************************************** * VLC GPL Window, action called from the about window and the help menu *****************************************************************************/ @@ -180,10 +190,27 @@ static VLAboutBox *_o_sharedInstance = nil; - (void)showHelp { [o_help_window setTitle: _NS("VLC media player Help")]; + [o_help_fwd_btn setToolTip: _NS("Next")]; + [o_help_bwd_btn setToolTip: _NS("Previous")]; + [o_help_home_btn setToolTip: _NS("Index")]; + [o_help_window makeKeyAndOrderFront: self]; + + [[o_help_web_view mainFrame] loadHTMLString: _NS(I_LONGHELP) + baseURL: [NSURL URLWithString:@"http://videolan.org"]]; +} - [[o_help_web_view mainFrame] loadHTMLString: [NSString stringWithString: _NS(I_LONGHELP)] +- (IBAction)helpGoHome:(id)sender +{ + [[o_help_web_view mainFrame] loadHTMLString: _NS(I_LONGHELP) baseURL: [NSURL URLWithString:@"http://videolan.org"]]; } +- (void)webView:(WebView *)sender didFinishLoadForFrame:(WebFrame *)frame +{ + /* delegate to update button states (we're the frameLoadDelegate for our help's webview)« */ + [o_help_fwd_btn setEnabled: [o_help_web_view canGoForward]]; + [o_help_bwd_btn setEnabled: [o_help_web_view canGoBack]]; +} + @end