Commit 5ea28c6c authored by Felix Paul Kühne's avatar Felix Paul Kühne

* display the GPL in a separate window linked in the About window and the Help...

* display the GPL in a separate window linked in the About window and the Help menu. Code cleanup (faster and less memory consuming).
parent 5f5fe279
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
{CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{CLASS = MPSlider; LANGUAGE = ObjC; SUPERCLASS = NSSlider; }, {CLASS = MPSlider; LANGUAGE = ObjC; SUPERCLASS = NSSlider; },
{ {
ACTIONS = {showGPL = id; };
CLASS = VLAboutBox; CLASS = VLAboutBox;
LANGUAGE = ObjC; LANGUAGE = ObjC;
OUTLETS = { OUTLETS = {
...@@ -10,8 +11,12 @@ ...@@ -10,8 +11,12 @@
"o_copyright_field" = id; "o_copyright_field" = id;
"o_credits_scrollview" = id; "o_credits_scrollview" = id;
"o_credits_textview" = id; "o_credits_textview" = id;
"o_gpl_btn" = id;
"o_gpl_field" = id;
"o_gpl_window" = id;
"o_help_web_view" = id; "o_help_web_view" = id;
"o_help_window" = id; "o_help_window" = id;
"o_name_field" = id;
"o_name_version_field" = id; "o_name_version_field" = id;
"o_revision_field" = id; "o_revision_field" = id;
}; };
......
...@@ -10,10 +10,11 @@ ...@@ -10,10 +10,11 @@
<array/> <array/>
<key>IBOpenObjects</key> <key>IBOpenObjects</key>
<array> <array>
<integer>1345</integer>
<integer>2239</integer> <integer>2239</integer>
<integer>1345</integer>
<integer>2245</integer>
</array> </array>
<key>IBSystem Version</key> <key>IBSystem Version</key>
<string>8R3032</string> <string>8S2167</string>
</dict> </dict>
</plist> </plist>
...@@ -206,6 +206,7 @@ ...@@ -206,6 +206,7 @@
openWebsite = id; openWebsite = id;
showBookmarks = id; showBookmarks = id;
showExtended = id; showExtended = id;
showLicense = id;
showMessagesPanel = id; showMessagesPanel = id;
showSFilters = id; showSFilters = id;
showWizard = id; showWizard = id;
...@@ -234,6 +235,7 @@ ...@@ -234,6 +235,7 @@
"o_dmi_stop" = id; "o_dmi_stop" = id;
"o_embedded_window" = id; "o_embedded_window" = id;
"o_info" = id; "o_info" = id;
"o_license_mi" = id;
"o_main_pgbar" = id; "o_main_pgbar" = id;
"o_messages" = id; "o_messages" = id;
"o_mi_about" = id; "o_mi_about" = id;
......
...@@ -26,11 +26,11 @@ ...@@ -26,11 +26,11 @@
<key>IBOpenObjects</key> <key>IBOpenObjects</key>
<array> <array>
<integer>21</integer> <integer>21</integer>
<integer>2416</integer>
<integer>2769</integer> <integer>2769</integer>
<integer>2730</integer> <integer>2416</integer>
<integer>1789</integer>
<integer>29</integer> <integer>29</integer>
<integer>1789</integer>
<integer>2730</integer>
</array> </array>
<key>IBSystem Version</key> <key>IBSystem Version</key>
<string>8S2167</string> <string>8S2167</string>
......
/***************************************************************************** /*****************************************************************************
* about.h: MacOS X About Panel * about.h: MacOS X About Panel
***************************************************************************** *****************************************************************************
* Copyright (C) 2001-2005 the VideoLAN team * Copyright (C) 2001-2007 the VideoLAN team
* $Id$ * $Id$
* *
* Authors: Derk-Jan Hartman <thedj@users.sourceforge.net> * Authors: Derk-Jan Hartman <thedj@users.sourceforge.net>
* Felix Paul Khne <fkuehne -at- videolan.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
...@@ -33,28 +34,28 @@ ...@@ -33,28 +34,28 @@
IBOutlet id o_copyright_field; IBOutlet id o_copyright_field;
IBOutlet id o_credits_textview; IBOutlet id o_credits_textview;
IBOutlet id o_credits_scrollview; IBOutlet id o_credits_scrollview;
IBOutlet id o_gpl_btn;
IBOutlet id o_name_field;
NSTimer *o_scroll_timer; NSTimer *o_scroll_timer;
float f_current; float f_current;
float f_end; float f_end;
NSTimeInterval i_start; NSTimeInterval i_start;
BOOL b_restart; BOOL b_restart;
BOOL b_isSetUp;
NSString *o_credits_path;
NSString *o_credits;
NSString *o_thanks;
NSString *o_copyright;
NSDictionary *o_info_dict;
CFBundleRef localInfoBundle;
NSDictionary *o_local_dict;
/* generic help window */ /* generic help window */
IBOutlet id o_help_window; IBOutlet id o_help_window;
IBOutlet id o_help_web_view; IBOutlet id o_help_web_view;
/* licence window */
IBOutlet id o_gpl_window;
IBOutlet id o_gpl_field;
} }
+ (VLAboutBox *)sharedInstance; + (VLAboutBox *)sharedInstance;
- (void)showAbout; - (void)showAbout;
- (void)showHelp; - (void)showHelp;
- (IBAction)showGPL:(id)sender;
@end @end
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
* $Id$ * $Id$
* *
* Authors: Derk-Jan Hartman <thedj@users.sourceforge.net> * Authors: Derk-Jan Hartman <thedj@users.sourceforge.net>
* Felix Paul Khne <fkuehne -at- videolan.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
...@@ -67,21 +68,15 @@ static VLAboutBox *_o_sharedInstance = nil; ...@@ -67,21 +68,15 @@ static VLAboutBox *_o_sharedInstance = nil;
- (void)showAbout - (void)showAbout
{ {
if (!o_credits_path) if(! b_isSetUp )
{ {
NSString *o_name; NSDictionary *o_local_dict;
NSString *o_version;
/* Get the info dictionary (Info.plist) */
o_info_dict = [[NSBundle mainBundle] infoDictionary];
/* Get the localized info dictionary (InfoPlist.strings) */ /* Get the localized info dictionary (InfoPlist.strings) */
localInfoBundle = CFBundleGetMainBundle(); o_local_dict = [[NSBundle mainBundle] localizedInfoDictionary];
o_local_dict = (NSDictionary *)
CFBundleGetLocalInfoDictionary( localInfoBundle );
/* Setup the name field */ /* Setup the name field */
o_name = [o_local_dict objectForKey:@"CFBundleName"]; o_name_field = [o_local_dict objectForKey:@"CFBundleName"];
/* Set the about box title */ /* Set the about box title */
[o_about_window setTitle:_NS("About VLC media player")]; [o_about_window setTitle:_NS("About VLC media player")];
...@@ -106,8 +101,7 @@ static VLAboutBox *_o_sharedInstance = nil; ...@@ -106,8 +101,7 @@ static VLAboutBox *_o_sharedInstance = nil;
[NSString stringWithUTF8String: psz_thanks]]]; [NSString stringWithUTF8String: psz_thanks]]];
/* Setup the copyright field */ /* Setup the copyright field */
o_copyright = [o_local_dict objectForKey:@"NSHumanReadableCopyright"]; [o_copyright_field setStringValue: [o_local_dict objectForKey:@"NSHumanReadableCopyright"]];
[o_copyright_field setStringValue:o_copyright];
/* Setup the window */ /* Setup the window */
[o_credits_textview setDrawsBackground: NO]; [o_credits_textview setDrawsBackground: NO];
...@@ -115,20 +109,23 @@ static VLAboutBox *_o_sharedInstance = nil; ...@@ -115,20 +109,23 @@ static VLAboutBox *_o_sharedInstance = nil;
[o_about_window setExcludedFromWindowsMenu:YES]; [o_about_window setExcludedFromWindowsMenu:YES];
[o_about_window setMenu:nil]; [o_about_window setMenu:nil];
[o_about_window center]; [o_about_window center];
[o_gpl_btn setTitle: _NS("License")];
b_isSetUp = YES;
} }
/* Show the window */ /* Show the window */
b_restart = YES; b_restart = YES;
[o_about_window makeKeyAndOrderFront:nil]; [o_about_window makeKeyAndOrderFront: nil];
} }
- (void)windowDidBecomeKey:(NSNotification *)notification - (void)windowDidBecomeKey:(NSNotification *)notification
{ {
o_scroll_timer = [NSTimer scheduledTimerWithTimeInterval:1/6 o_scroll_timer = [NSTimer scheduledTimerWithTimeInterval: 1/6
target:self target:self
selector:@selector(scrollCredits:) selector:@selector(scrollCredits:)
userInfo:nil userInfo:nil
repeats:YES]; repeats:YES];
} }
- (void)windowDidResignKey:(NSNotification *)notification - (void)windowDidResignKey:(NSNotification *)notification
...@@ -138,7 +135,7 @@ static VLAboutBox *_o_sharedInstance = nil; ...@@ -138,7 +135,7 @@ static VLAboutBox *_o_sharedInstance = nil;
- (void)scrollCredits:(NSTimer *)timer - (void)scrollCredits:(NSTimer *)timer
{ {
if (b_restart) if( b_restart )
{ {
/* Reset the starttime */ /* Reset the starttime */
i_start = [NSDate timeIntervalSinceReferenceDate] + 3.0; i_start = [NSDate timeIntervalSinceReferenceDate] + 3.0;
...@@ -147,7 +144,7 @@ static VLAboutBox *_o_sharedInstance = nil; ...@@ -147,7 +144,7 @@ static VLAboutBox *_o_sharedInstance = nil;
b_restart = NO; b_restart = NO;
} }
if ([NSDate timeIntervalSinceReferenceDate] >= i_start) if( [NSDate timeIntervalSinceReferenceDate] >= i_start )
{ {
/* Scroll to the position */ /* Scroll to the position */
[o_credits_textview scrollPoint:NSMakePoint( 0, f_current )]; [o_credits_textview scrollPoint:NSMakePoint( 0, f_current )];
...@@ -156,13 +153,26 @@ static VLAboutBox *_o_sharedInstance = nil; ...@@ -156,13 +153,26 @@ static VLAboutBox *_o_sharedInstance = nil;
f_current += 0.005; f_current += 0.005;
/* If at end, restart at the top */ /* If at end, restart at the top */
if ( f_current >= f_end ) if( f_current >= f_end )
{ {
b_restart = YES; b_restart = YES;
} }
} }
} }
/*****************************************************************************
* VLC GPL Window, action called from the about window and the help menu
*****************************************************************************/
- (IBAction)showGPL:(id)sender
{
[o_gpl_window setTitle: _NS("License")];
[o_gpl_field setString: [NSString stringWithUTF8String: psz_license]];
[o_gpl_window center];
[o_gpl_window makeKeyAndOrderFront: sender];
}
/***************************************************************************** /*****************************************************************************
* VLC Generic Help Window * VLC Generic Help Window
*****************************************************************************/ *****************************************************************************/
......
...@@ -256,6 +256,7 @@ struct intf_sys_t ...@@ -256,6 +256,7 @@ struct intf_sys_t
IBOutlet id o_mi_help; IBOutlet id o_mi_help;
IBOutlet id o_mi_readme; IBOutlet id o_mi_readme;
IBOutlet id o_mi_documentation; IBOutlet id o_mi_documentation;
IBOutlet id o_mi_license;
IBOutlet id o_mi_website; IBOutlet id o_mi_website;
IBOutlet id o_mi_donation; IBOutlet id o_mi_donation;
IBOutlet id o_mi_forum; IBOutlet id o_mi_forum;
...@@ -346,6 +347,7 @@ struct intf_sys_t ...@@ -346,6 +347,7 @@ struct intf_sys_t
- (IBAction)showSFilters:(id)sender; - (IBAction)showSFilters:(id)sender;
- (IBAction)viewAbout:(id)sender; - (IBAction)viewAbout:(id)sender;
- (IBAction)showLicense:(id)sender;
- (IBAction)viewPreferences:(id)sender; - (IBAction)viewPreferences:(id)sender;
- (IBAction)checkForUpdate:(id)sender; - (IBAction)checkForUpdate:(id)sender;
- (IBAction)viewHelp:(id)sender; - (IBAction)viewHelp:(id)sender;
......
...@@ -669,6 +669,7 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -669,6 +669,7 @@ static VLCMain *_o_sharedMainInstance = nil;
[o_mu_help setTitle: _NS("Help")]; [o_mu_help setTitle: _NS("Help")];
[o_mi_help setTitle: _NS("VLC media player Help...")]; [o_mi_help setTitle: _NS("VLC media player Help...")];
[o_mi_readme setTitle: _NS("ReadMe / FAQ...")]; [o_mi_readme setTitle: _NS("ReadMe / FAQ...")];
[o_mi_license setTitle: _NS("License")];
[o_mi_documentation setTitle: _NS("Online Documentation...")]; [o_mi_documentation setTitle: _NS("Online Documentation...")];
[o_mi_website setTitle: _NS("VideoLAN Website...")]; [o_mi_website setTitle: _NS("VideoLAN Website...")];
[o_mi_donation setTitle: _NS("Make a donation...")]; [o_mi_donation setTitle: _NS("Make a donation...")];
...@@ -1878,25 +1879,27 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -1878,25 +1879,27 @@ static VLCMain *_o_sharedMainInstance = nil;
} }
if ( !nib_bookmarks_loaded ) if ( !nib_bookmarks_loaded )
{
nib_bookmarks_loaded = [NSBundle loadNibNamed:@"Bookmarks" owner:self]; nib_bookmarks_loaded = [NSBundle loadNibNamed:@"Bookmarks" owner:self];
[o_bookmarks showBookmarks];
} else { [o_bookmarks showBookmarks];
[o_bookmarks showBookmarks];
}
} }
- (IBAction)viewAbout:(id)sender - (IBAction)viewAbout:(id)sender
{ {
if( !nib_about_loaded ) if( !nib_about_loaded )
{
nib_about_loaded = [NSBundle loadNibNamed:@"About" owner:self]; nib_about_loaded = [NSBundle loadNibNamed:@"About" owner:self];
[o_about showAbout];
} else { [o_about showAbout];
[o_about showAbout];
}
} }
- (IBAction)showLicense:(id)sender
{
if( !nib_about_loaded )
nib_about_loaded = [NSBundle loadNibNamed:@"About" owner:self];
[o_about showGPL: sender];
}
- (IBAction)viewPreferences:(id)sender - (IBAction)viewPreferences:(id)sender
{ {
/* GRUIIIIIIIK */ /* GRUIIIIIIIK */
......
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