diff --git a/Makefile.am b/Makefile.am index b66c21b674..3c7831a388 100644 --- a/Makefile.am +++ b/Makefile.am @@ -145,6 +145,7 @@ EXTRA_DIST += \ extras/package/macosx/Resources/English.lproj/ErrorPanel.xib \ extras/package/macosx/Resources/English.lproj/FSPanel.xib \ extras/package/macosx/Resources/English.lproj/InfoPlist.strings.in \ + extras/package/macosx/Resources/English.lproj/Help.xib \ extras/package/macosx/Resources/English.lproj/MainMenu.xib \ extras/package/macosx/Resources/English.lproj/MainWindow.xib \ extras/package/macosx/Resources/English.lproj/MediaInfo.xib \ diff --git a/extras/package/macosx/Resources/English.lproj/About.xib b/extras/package/macosx/Resources/English.lproj/About.xib index 22d02ddf6f..f9000ec436 100644 --- a/extras/package/macosx/Resources/English.lproj/About.xib +++ b/extras/package/macosx/Resources/English.lproj/About.xib @@ -2,14 +2,14 @@ 1060 - 14B25 - 6254 - 1343.16 - 755.00 - - 6254 - 6254 - + 14D136 + 7702 + 1347.57 + 758.70 + + com.apple.InterfaceBuilder.CocoaPlugin + 7702 + NSBox NSButton @@ -24,11 +24,9 @@ NSTextView NSView NSWindowTemplate - WebView com.apple.InterfaceBuilder.CocoaPlugin - com.apple.WebKitIBPlugin PluginDependencyRecalculationVersion @@ -36,7 +34,7 @@ - VLCApplication + AboutWindowController FirstResponder @@ -87,6 +85,7 @@ {415, 204} + @@ -154,7 +153,7 @@ 0 - 6 + 70 {564, 10000000} {430, 204} @@ -179,6 +178,7 @@ {{-100, -100}, {15, 99}} + NO _doScroller: @@ -192,6 +192,7 @@ {{-100, -100}, {87, 18}} + NO _doScroller: @@ -228,6 +229,7 @@ {{20, 93}, {240, 240}} + YES 134217728 @@ -250,6 +252,7 @@ {{271, 274}, {430, 18}} + YES -2077228991 @@ -284,6 +287,7 @@ {{271, 255}, {430, 16}} + YES -2077228991 @@ -310,6 +314,7 @@ {{271, 241}, {430, 13}} + YES -2078277631 @@ -332,6 +337,7 @@ {{271, 304}, {479, 29}} + YES 69206017 @@ -360,6 +366,7 @@ {{271, 88}, {430, 145}} + _NS:3939 YES @@ -398,6 +405,7 @@ YXRzIQpIZWxwIGFuZCBqb2luIHVzIS4 {{556, 49}, {106, 23}} + _NS:2498 YES @@ -422,6 +430,7 @@ YXRzIQpIZWxwIGFuZCBqb2luIHVzIS4 {{122, 49}, {106, 23}} + _NS:2498 YES @@ -446,6 +455,7 @@ YXRzIQpIZWxwIGFuZCBqb2luIHVzIS4 {{339, 49}, {106, 23}} + _NS:2498 YES @@ -498,12 +508,14 @@ YXRzIQpIZWxwIGFuZCBqb2luIHVzIS4 {{1, 1}, {745, 88}} + _NS:21 {{-10, -9}, {747, 90}} + _NS:18 {0, 0} @@ -537,175 +549,12 @@ YXRzIQpIZWxwIGFuZCBqb2luIHVzIS4 {721, 356} + - {{0, 0}, {1280, 778}} + {{0, 0}, {1680, 1027}} {231.86799999999999, 129} {10000000000000, 10000000000000} - about - YES - - - VLAboutBox - - - 15 - 2 - {{336, 164}, {480, 400}} - 1886912512 - Help - NSWindow - - View - - - {213, 107} - - - 256 - - - - 274 - - Apple HTML pasteboard type - Apple PDF pasteboard type - Apple PICT pasteboard type - Apple URL pasteboard type - Apple Web Archive pasteboard type - NSColor pasteboard type - NSFilenamesPboardType - NSStringPboardType - NeXT RTFD pasteboard type - NeXT Rich Text Format v1.0 pasteboard type - NeXT TIFF v4.0 pasteboard type - WebURLsWithTitlesPboardType - public.png - public.url - public.url-name - - {{0, 40}, {480, 360}} - - - - - - - - - - - - - - - - - - Hiragino Mincho Pro - - - YES - YES - - - - 256 - {{20, 8}, {39, 25}} - - YES - - 67108864 - 134217728 - - - YES - 20 - 2072 - - - -2038284288 - 35 - - LucidaGrande - 20 - 16 - - - - - - 200 - 25 - - NO - - - - 256 - {{67, 8}, {39, 25}} - - YES - - 67108864 - 134217728 - - - YES - 18 - 2072 - - - -2038284288 - 35 - - LucidaGrande - 18 - 16 - - - - - - 200 - 25 - - NO - - - - 256 - {{114, 8}, {39, 25}} - - YES - - 67108864 - 134217728 - - - YES - 18 - 2072 - - - -2038284288 - 35 - - - - - - 200 - 25 - - NO - - - {480, 400} - - {{0, 0}, {1280, 778}} - {213, 129} - {10000000000000, 10000000000000} - help + YES @@ -713,211 +562,139 @@ YXRzIQpIZWxwIGFuZCBqb2luIHVzIS4 - delegate - - - - 1357 - - - - o_credits_textview - - - - 1353 - - - - o_credits_scrollview - - + window + + - 1355 + 2317 - o_about_window - - + o_name_field + + - 1356 + 2318 o_name_version_field - + - 2236 + 2319 o_copyright_field - + - 2237 + 2320 o_revision_field - + - 2238 - - - - o_help_window - - - - 2242 - - - - o_help_web_view - - - - 2243 + 2321 - o_name_field - - - - 2252 - - - - o_help_home_btn - - + o_joinus_txt + + - 2259 + 2322 - o_help_bwd_btn - - + o_authors_btn + + - 2260 + 2323 - o_help_fwd_btn - - - - 2261 - - - - helpGoHome: - - + o_gpl_btn + + - 2262 + 2324 - o_authors_btn - - + o_credits_btn + + - 2292 + 2325 - o_gpl_btn - - + o_trademarks_txt + + - 2293 + 2326 - o_credits_btn - - + o_icon_view + + - 2294 + 2327 buttonAction: - - + + - 2295 + 2328 buttonAction: - + - 2296 + 2329 buttonAction: - - - - 2297 - - - - o_joinus_txt - - + + - 2299 + 2330 - o_icon_view - - + o_credits_scrollview + + - 2300 + 2333 - o_trademarks_txt - - + o_credits_textview + + - 2316 + 2334 - frameLoadDelegate - - - - 2265 - - - - goForward: - - - - 2266 - - - - goBack: - - + delegate + + - 2267 + 2332 @@ -1011,61 +788,6 @@ YXRzIQpIZWxwIGFuZCBqb2luIHVzIS4 - - 1349 - - - VLAboutBox - - - 2239 - - - - - - Help - - - 2240 - - - - - - - - - - - 2241 - - - - - 2256 - - - - - - - - 2257 - - - - - - - - 2258 - - - - - - 2270 @@ -1086,21 +808,6 @@ YXRzIQpIZWxwIGFuZCBqb2luIHVzIS4 - - 2275 - - - - - 2276 - - - - - 2277 - - - 2278 @@ -1217,27 +924,16 @@ YXRzIQpIZWxwIGFuZCBqb2luIHVzIS4 com.apple.InterfaceBuilder.CocoaPlugin {{154, 399}, {721, 356}} com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - {{452, 244}, {480, 400}} - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.WebKitIBPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -1258,40 +954,31 @@ YXRzIQpIZWxwIGFuZCBqb2luIHVzIS4 - 2316 + 2341 - VLAboutBox - NSObject - - id - id - - - + AboutWindowController + NSWindowController + + buttonAction: + id + + + buttonAction: + buttonAction: id - - helpGoHome: - id - - + - id id id id id id id - id - id - id - WebView - id id id id @@ -1300,10 +987,6 @@ YXRzIQpIZWxwIGFuZCBqb2luIHVzIS4 id - - o_about_window - id - o_authors_btn id @@ -1328,26 +1011,6 @@ YXRzIQpIZWxwIGFuZCBqb2luIHVzIS4 o_gpl_btn id - - o_help_bwd_btn - id - - - o_help_fwd_btn - id - - - o_help_home_btn - id - - - o_help_web_view - WebView - - - o_help_window - id - o_icon_view id @@ -1379,32 +1042,21 @@ YXRzIQpIZWxwIGFuZCBqb2luIHVzIS4 - VLAboutBox - - id - id - - - + AboutWindowController + + buttonAction: + id + + + buttonAction: + buttonAction: id - - helpGoHome: - id - - - - IBProjectSource - ../../../../modules/gui/macosx/about.m - - - VLCApplication - NSApplication IBProjectSource - ../../../../modules/gui/macosx/intf.h + ../../../../modules/gui/macosx/about.m @@ -1570,70 +1222,22 @@ YXRzIQpIZWxwIGFuZCBqb2luIHVzIS4 - WebView - NSView - - id - id - id - id - id - id - id - id - id - id - id - - - - goBack: - id - - - goForward: - id - - - makeTextLarger: - id - - - makeTextSmaller: - id - - - makeTextStandardSize: - id - - - reload: - id - - - reloadFromOrigin: - id - - - stopLoading: - id - - - takeStringURLFrom: - id - - - toggleContinuousSpellChecking: - id - - - toggleSmartInsertDelete: + NSWindowController + NSResponder + + showWindow: + id + + + showWindow: + + showWindow: id - + IBFrameworkSource - WebKit.framework/Headers/WebView.h + AppKit.framework/Headers/NSWindowController.h diff --git a/extras/package/macosx/Resources/English.lproj/Help.xib b/extras/package/macosx/Resources/English.lproj/Help.xib new file mode 100644 index 0000000000..bf7fc3ed10 --- /dev/null +++ b/extras/package/macosx/Resources/English.lproj/Help.xib @@ -0,0 +1,408 @@ + + + + 1060 + 14D136 + 7702 + 1347.57 + 758.70 + + 7702 + 7702 + + + NSButton + NSButtonCell + NSCustomObject + NSView + NSWindowTemplate + WebView + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.WebKitIBPlugin + + + PluginDependencyRecalculationVersion + + + + + HelpWindowController + + + FirstResponder + + + NSApplication + + + 15 + 2 + {{336, 164}, {480, 400}} + 1886912512 + Help + NSWindow + + View + + + {213, 107} + + + 256 + + + + 274 + + Apple HTML pasteboard type + Apple PDF pasteboard type + Apple PICT pasteboard type + Apple URL pasteboard type + Apple Web Archive pasteboard type + NSColor pasteboard type + NSFilenamesPboardType + NSStringPboardType + NeXT RTFD pasteboard type + NeXT Rich Text Format v1.0 pasteboard type + NeXT TIFF v4.0 pasteboard type + WebURLsWithTitlesPboardType + public.png + public.url + public.url-name + + {{0, 40}, {480, 360}} + + + + + + + + + + + + + + + + + + Hiragino Mincho Pro + + + YES + YES + + + + 256 + {{20, 8}, {39, 25}} + + + YES + + 67108864 + 134217728 + + + YES + 20 + 2072 + + + -2038284288 + 35 + + LucidaGrande + 20 + 16 + + + + + + 200 + 25 + + NO + + + + 256 + {{67, 8}, {39, 25}} + + + YES + + 67108864 + 134217728 + + + YES + 18 + 2072 + + + -2038284288 + 35 + + LucidaGrande + 18 + 16 + + + + + + 200 + 25 + + NO + + + + 256 + {{114, 8}, {39, 25}} + + YES + + 67108864 + 134217728 + + + YES + 18 + 2072 + + + -2038284288 + 35 + + + + + + 200 + 25 + + NO + + + {480, 400} + + + {{0, 0}, {1680, 1027}} + {213, 129} + {10000000000000, 10000000000000} + + YES + + + + + + + o_help_fwd_btn + + + + 2335 + + + + o_help_bwd_btn + + + + 2336 + + + + o_help_home_btn + + + + 2337 + + + + helpGoHome: + + + + 2338 + + + + o_help_web_view + + + + 2341 + + + + window + + + + 2342 + + + + goForward: + + + + 2266 + + + + goBack: + + + + 2267 + + + + frameLoadDelegate + + + + 2340 + + + + + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + 2239 + + + + + + Help + + + 2240 + + + + + + + + + + + 2241 + + + + + 2256 + + + + + + + + 2257 + + + + + + + + 2258 + + + + + + + + 2275 + + + + + 2276 + + + + + 2277 + + + + + -3 + + + Application + + + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + {{452, 244}, {480, 400}} + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.WebKitIBPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + + + 2342 + + + 0 + IBCocoaFramework + NO + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + 3 + + diff --git a/extras/package/macosx/vlc.xcodeproj/project.pbxproj b/extras/package/macosx/vlc.xcodeproj/project.pbxproj index c2c39a2c28..f169fd721e 100644 --- a/extras/package/macosx/vlc.xcodeproj/project.pbxproj +++ b/extras/package/macosx/vlc.xcodeproj/project.pbxproj @@ -342,6 +342,7 @@ 1C88BCC119DC7CB300645190 /* ys-fs_volume_slider_knob@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 1C88BC8B19DC7CB300645190 /* ys-fs_volume_slider_knob@2x.png */; }; 1C88BCC219DC7CB300645190 /* ys-fs_volume_slider_knob_highlight.png in Resources */ = {isa = PBXBuildFile; fileRef = 1C88BC8C19DC7CB300645190 /* ys-fs_volume_slider_knob_highlight.png */; }; 1C88BCC319DC7CB300645190 /* ys-fs_volume_slider_knob_highlight@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 1C88BC8D19DC7CB300645190 /* ys-fs_volume_slider_knob_highlight@2x.png */; }; + 1CBB2CC81B06A6DE00110ADA /* Help.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1CBB2CC61B06A6DE00110ADA /* Help.xib */; }; 1CCB5F511A62A724004C3E90 /* about.h in Sources */ = {isa = PBXBuildFile; fileRef = 8EE1AF9F044465080059A3A7 /* about.h */; }; 1CCB5F521A62A724004C3E90 /* about.m in Sources */ = {isa = PBXBuildFile; fileRef = 8EE1AFA0044465080059A3A7 /* about.m */; }; 1CCB5F531A62A724004C3E90 /* AddonListDataSource.h in Sources */ = {isa = PBXBuildFile; fileRef = 7DF0435E1972E26A0022B534 /* AddonListDataSource.h */; }; @@ -1204,6 +1205,7 @@ 1C88BC8B19DC7CB300645190 /* ys-fs_volume_slider_knob@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "ys-fs_volume_slider_knob@2x.png"; sourceTree = ""; }; 1C88BC8C19DC7CB300645190 /* ys-fs_volume_slider_knob_highlight.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "ys-fs_volume_slider_knob_highlight.png"; sourceTree = ""; }; 1C88BC8D19DC7CB300645190 /* ys-fs_volume_slider_knob_highlight@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "ys-fs_volume_slider_knob_highlight@2x.png"; sourceTree = ""; }; + 1CBB2CC71B06A6DE00110ADA /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = Resources/English.lproj/Help.xib; sourceTree = ""; }; 1CCB5F2F1A62A6A5004C3E90 /* pseudo-vlc.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "pseudo-vlc.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 1CE5ED1B19DD6AB700FCEFD3 /* lion-window-fullscreen-on.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "lion-window-fullscreen-on.png"; sourceTree = ""; }; 1CE5ED1C19DD6AB700FCEFD3 /* lion-window-fullscreen-on@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "lion-window-fullscreen-on@2x.png"; sourceTree = ""; }; @@ -2882,6 +2884,7 @@ children = ( E0FB95CC1615B6DF0005069A /* DetachedVideoWindow.xib */, CCD83E2E13FEA143004F1652 /* About.xib */, + 1CBB2CC61B06A6DE00110ADA /* Help.xib */, CCD83E3013FEA143004F1652 /* AudioEffects.xib */, CCD83E3213FEA143004F1652 /* Bookmarks.xib */, CCD83E3413FEA143004F1652 /* CoreDialogs.xib */, @@ -3691,6 +3694,7 @@ CC166FEC15F517660088201B /* backward-6btns@2x.png in Resources */, CC166FF115F517720088201B /* forward-6btns-pressed.png in Resources */, 1C88BCB319DC7CB300645190 /* ys-fs_time_slider_knob@2x.png in Resources */, + 1CBB2CC81B06A6DE00110ADA /* Help.xib in Resources */, CC166FF215F517720088201B /* forward-6btns-pressed@2x.png in Resources */, CC166FF315F517720088201B /* forward-6btns.png in Resources */, CC166FF415F517720088201B /* forward-6btns@2x.png in Resources */, @@ -3835,6 +3839,14 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXVariantGroup section */ + 1CBB2CC61B06A6DE00110ADA /* Help.xib */ = { + isa = PBXVariantGroup; + children = ( + 1CBB2CC71B06A6DE00110ADA /* English */, + ); + name = Help.xib; + sourceTree = ""; + }; 7D3F6523188051F2005776C4 /* BWQuincyMain.xib */ = { isa = PBXVariantGroup; children = ( @@ -4267,6 +4279,7 @@ 1CCB5F4C1A62A6A5004C3E90 /* Default */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Default; }; C2F2A6EA09588F1B00018C74 /* Build configuration list for PBXProject "vlc" */ = { isa = XCConfigurationList; diff --git a/modules/gui/macosx/MainMenu.h b/modules/gui/macosx/MainMenu.h index 91c53708fa..482a433fd2 100644 --- a/modules/gui/macosx/MainMenu.h +++ b/modules/gui/macosx/MainMenu.h @@ -25,11 +25,13 @@ #import #import +@class AboutWindowController; +@class HelpWindowController; + @interface VLCMainMenu : NSObject { intf_thread_t *p_intf; BOOL b_mainMenu_setup; - BOOL b_nib_about_loaded; BOOL b_nib_videoeffects_loaded; BOOL b_nib_audioeffects_loaded; BOOL b_nib_tracksynchro_loaded; @@ -37,7 +39,8 @@ BOOL b_nib_convertandsave_loaded; BOOL b_nib_addonmanager_loaded; - id o_about; /* VLAboutBox */ + AboutWindowController *o_about; + HelpWindowController *o_helpWin; id o_videoeffects; /* VLCVideoEffects */ id o_audioeffects; /* VLCAudioEffects */ id o_trackSynchronization; /* VLCTrackSynchronization */ @@ -346,4 +349,3 @@ - (int)type; @end - diff --git a/modules/gui/macosx/MainMenu.m b/modules/gui/macosx/MainMenu.m index 9593ad756c..3f3fae10a9 100644 --- a/modules/gui/macosx/MainMenu.m +++ b/modules/gui/macosx/MainMenu.m @@ -94,8 +94,8 @@ static VLCMainMenu *_o_sharedInstance = nil; { [[NSNotificationCenter defaultCenter] removeObserver: self]; - if (b_nib_about_loaded) - [o_about release]; + [o_about release]; + [o_helpWin release]; if (b_nib_videoeffects_loaded) [o_videoeffects release]; @@ -1200,11 +1200,8 @@ static VLCMainMenu *_o_sharedInstance = nil; - (void)initAbout { - if (! o_about) - o_about = [[VLAboutBox alloc] init]; - - if (!b_nib_about_loaded) - b_nib_about_loaded = [NSBundle loadNibNamed:@"About" owner: NSApp]; + if (!o_about) + o_about = [[AboutWindowController alloc] init]; } - (IBAction)viewAbout:(id)sender @@ -1221,8 +1218,10 @@ static VLCMainMenu *_o_sharedInstance = nil; - (IBAction)viewHelp:(id)sender { - [self initAbout]; - [o_about showHelp]; + if (!o_helpWin) + o_helpWin = [[HelpWindowController alloc] init]; + + [o_helpWin showHelp]; } - (IBAction)openReadMe:(id)sender diff --git a/modules/gui/macosx/about.h b/modules/gui/macosx/about.h index 8bab02e484..a454dd5dcb 100644 --- a/modules/gui/macosx/about.h +++ b/modules/gui/macosx/about.h @@ -27,10 +27,9 @@ /***************************************************************************** * VLAboutBox interface *****************************************************************************/ -@interface VLAboutBox : NSObject +@interface AboutWindowController : NSWindowController { /* main about panel and stuff related to its views */ - IBOutlet id o_about_window; IBOutlet id o_name_version_field; IBOutlet id o_revision_field; IBOutlet id o_copyright_field; @@ -49,23 +48,25 @@ CGFloat f_end; NSTimeInterval i_start; BOOL b_restart; - BOOL b_isSetUp; NSString *o_authors; +} + +- (void)showAbout; +- (void)showGPL; +- (IBAction)buttonAction:(id)sender; + +@end - /* generic help window */ - IBOutlet id o_help_window; +@interface HelpWindowController : NSWindowController +{ IBOutlet WebView *o_help_web_view; //we may _not_ use id here because of method name collisions IBOutlet id o_help_bwd_btn; IBOutlet id o_help_fwd_btn; IBOutlet id o_help_home_btn; } -+ (VLAboutBox *)sharedInstance; -- (void)showAbout; -- (void)showHelp; -- (void)showGPL; -- (IBAction)buttonAction:(id)sender; - (IBAction)helpGoHome:(id)sender; +- (void)showHelp; @end diff --git a/modules/gui/macosx/about.m b/modules/gui/macosx/about.m index d0d644d84f..5fad724d92 100644 --- a/modules/gui/macosx/about.m +++ b/modules/gui/macosx/about.m @@ -38,23 +38,17 @@ /***************************************************************************** * VLAboutBox implementation *****************************************************************************/ -@implementation VLAboutBox - -static VLAboutBox *_o_sharedInstance = nil; - -+ (VLAboutBox *)sharedInstance -{ - return _o_sharedInstance ? _o_sharedInstance : [[self alloc] init]; -} +@implementation AboutWindowController - (id)init { - if (_o_sharedInstance) - [self dealloc]; - else - _o_sharedInstance = [super init]; + self = [super initWithWindowNibName:@"About"]; + if (self) { + + [self setWindowFrameAutosaveName:@"about"]; + } - return _o_sharedInstance; + return self; } - (void) dealloc @@ -64,113 +58,13 @@ static VLAboutBox *_o_sharedInstance = nil; [super dealloc]; } -- (void)awakeFromNib -{ - if (!OSX_SNOW_LEOPARD) - [o_about_window setCollectionBehavior: NSWindowCollectionBehaviorFullScreenAuxiliary]; -} - /***************************************************************************** * VLC About Window *****************************************************************************/ - (void)showAbout { - if (! b_isSetUp) { - /* Get the localized info dictionary (InfoPlist.strings) */ - NSDictionary *o_local_dict; - o_local_dict = [[NSBundle mainBundle] localizedInfoDictionary]; - - /* Setup the copyright field */ - [o_copyright_field setStringValue: [o_local_dict objectForKey:@"NSHumanReadableCopyright"]]; - - /* l10n */ - [o_about_window setTitle: _NS("About VLC media player")]; - NSDictionary *stringAttributes = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithInt:NSUnderlineStyleSingle], NSUnderlineStyleAttributeName, [NSColor colorWithCalibratedRed:0. green:0.3411 blue:0.6824 alpha:1.], NSForegroundColorAttributeName, [NSFont systemFontOfSize:13], NSFontAttributeName, nil]; - NSAttributedString *attrStr; - attrStr = [[NSAttributedString alloc] initWithString:_NS("Credits") attributes:stringAttributes]; - [o_credits_btn setAttributedTitle:attrStr]; - [attrStr release]; - attrStr = [[NSAttributedString alloc] initWithString:_NS("License") attributes:stringAttributes]; - [o_gpl_btn setAttributedTitle:attrStr]; - [attrStr release]; - attrStr = [[NSAttributedString alloc] initWithString:_NS("Authors") attributes:stringAttributes]; - [o_authors_btn setAttributedTitle:attrStr]; - [attrStr release]; - [o_trademarks_txt setStringValue:_NS("VLC media player and VideoLAN are trademarks of the VideoLAN Association.")]; - - /* setup the creator / revision field */ - NSString *compiler; -#ifdef __clang__ - compiler = [NSString stringWithFormat:@"clang %s", __clang_version__]; -#else - compiler = [NSString stringWithFormat:@"llvm-gcc %s", __VERSION__]; -#endif - [o_revision_field setStringValue: [NSString stringWithFormat: _NS("Compiled by %s with %@"), VLC_CompileBy(), compiler]]; - - /* Setup the nameversion field */ - [o_name_version_field setStringValue: [NSString stringWithFormat:@"Version %s (%s)", VERSION_MESSAGE, PLATFORM]]; - - NSMutableArray *tmpArray = [NSMutableArray arrayWithArray: [[NSString stringWithUTF8String:psz_authors] componentsSeparatedByString:@"\n\n"]]; - NSUInteger count = [tmpArray count]; - for (NSUInteger i = 0; i < count; i++) { - [tmpArray replaceObjectAtIndex:i withObject:[[tmpArray objectAtIndex:i]stringByReplacingOccurrencesOfString:@"\n" withString:@", "]]; - [tmpArray replaceObjectAtIndex:i withObject:[[tmpArray objectAtIndex:i]stringByReplacingOccurrencesOfString:@", -" withString:@"\n-" options:0 range:NSRangeFromString(@"0 30")]]; - [tmpArray replaceObjectAtIndex:i withObject:[[tmpArray objectAtIndex:i]stringByReplacingOccurrencesOfString:@"-, " withString:@"-\n" options:0 range:NSRangeFromString(@"0 30")]]; - [tmpArray replaceObjectAtIndex:i withObject:[[tmpArray objectAtIndex:i]stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@","]]]; - } - o_authors = [tmpArray componentsJoinedByString:@"\n\n"]; - [o_authors retain]; - - /* setup join us! */ - NSString *joinus = [NSString stringWithUTF8String:_("" - "

VLC media player is a free and open source media player, encoder, and " - "streamer made by the volunteers of the VideoLAN community.

VLC uses its internal codecs, works on " - "essentially every popular platform, and can read almost all files, CDs, " - "DVDs, network streams, capture cards and other media formats!

Help and join us!")]; - NSString *fontfamily; - if (OSX_YOSEMITE) - fontfamily = @"Helvetica Neue"; - else - fontfamily = @"Lucida Grande"; - NSString *joinUsWithStyle = [NSString stringWithFormat:@"

%@
", - fontfamily, joinus]; - NSAttributedString *joinus_readytorender = [[NSAttributedString alloc] initWithHTML:[joinUsWithStyle dataUsingEncoding:NSUTF8StringEncoding allowLossyConversion:YES] options:[NSDictionary dictionaryWithObject:[NSNumber numberWithInt:NSUTF8StringEncoding] forKey:NSCharacterEncodingDocumentOption] documentAttributes:NULL]; - [o_joinus_txt setAllowsEditingTextAttributes: YES]; - [o_joinus_txt setSelectable: YES]; - [o_joinus_txt setAttributedStringValue:joinus_readytorender]; - - [joinus_readytorender release]; - [o_credits_textview setString: @""]; - - /* Setup the window */ - [o_credits_textview setDrawsBackground: NO]; - [o_credits_scrollview setDrawsBackground: NO]; - [o_about_window setExcludedFromWindowsMenu:YES]; - [o_about_window setMenu:nil]; - [o_about_window center]; - [o_about_window setBackgroundColor: [NSColor colorWithCalibratedWhite:.96 alpha:1.]]; - - if (config_GetInt(VLCIntf, "macosx-icon-change")) { - /* After day 354 of the year, the usual VLC cone is replaced by another cone - * wearing a Father Xmas hat. - * Note: this icon doesn't represent an endorsement of The Coca-Cola Company. - */ - NSCalendar *gregorian = - [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]; - NSUInteger dayOfYear = [gregorian ordinalityOfUnit:NSDayCalendarUnit inUnit:NSYearCalendarUnit forDate:[NSDate date]]; - [gregorian release]; - - if (dayOfYear >= 354) - [o_icon_view setImage: [NSImage imageNamed:@"vlc-xmas"]]; - } - - b_isSetUp = YES; - } + [self window]; /* Show the window */ b_restart = YES; @@ -181,7 +75,105 @@ static VLAboutBox *_o_sharedInstance = nil; [o_revision_field setHidden:NO]; [o_name_version_field setHidden:NO]; [o_credits_textview scrollPoint:NSMakePoint(0, 0)]; - [o_about_window makeKeyAndOrderFront: nil]; + + [self showWindow:nil]; +} + +- (void)windowDidLoad +{ + if (!OSX_SNOW_LEOPARD) + [[self window] setCollectionBehavior: NSWindowCollectionBehaviorFullScreenAuxiliary]; + + /* Get the localized info dictionary (InfoPlist.strings) */ + NSDictionary *o_local_dict; + o_local_dict = [[NSBundle mainBundle] localizedInfoDictionary]; + + /* Setup the copyright field */ + [o_copyright_field setStringValue: [o_local_dict objectForKey:@"NSHumanReadableCopyright"]]; + + /* l10n */ + [[self window] setTitle: _NS("About VLC media player")]; + NSDictionary *stringAttributes = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithInt:NSUnderlineStyleSingle], NSUnderlineStyleAttributeName, [NSColor colorWithCalibratedRed:0. green:0.3411 blue:0.6824 alpha:1.], NSForegroundColorAttributeName, [NSFont systemFontOfSize:13], NSFontAttributeName, nil]; + NSAttributedString *attrStr; + attrStr = [[NSAttributedString alloc] initWithString:_NS("Credits") attributes:stringAttributes]; + [o_credits_btn setAttributedTitle:attrStr]; + [attrStr release]; + attrStr = [[NSAttributedString alloc] initWithString:_NS("License") attributes:stringAttributes]; + [o_gpl_btn setAttributedTitle:attrStr]; + [attrStr release]; + attrStr = [[NSAttributedString alloc] initWithString:_NS("Authors") attributes:stringAttributes]; + [o_authors_btn setAttributedTitle:attrStr]; + [attrStr release]; + [o_trademarks_txt setStringValue:_NS("VLC media player and VideoLAN are trademarks of the VideoLAN Association.")]; + + /* setup the creator / revision field */ + NSString *compiler; +#ifdef __clang__ + compiler = [NSString stringWithFormat:@"clang %s", __clang_version__]; +#else + compiler = [NSString stringWithFormat:@"llvm-gcc %s", __VERSION__]; +#endif + [o_revision_field setStringValue: [NSString stringWithFormat: _NS("Compiled by %s with %@"), VLC_CompileBy(), compiler]]; + + /* Setup the nameversion field */ + [o_name_version_field setStringValue: [NSString stringWithFormat:@"Version %s (%s)", VERSION_MESSAGE, PLATFORM]]; + + NSMutableArray *tmpArray = [NSMutableArray arrayWithArray: [[NSString stringWithUTF8String:psz_authors] componentsSeparatedByString:@"\n\n"]]; + NSUInteger count = [tmpArray count]; + for (NSUInteger i = 0; i < count; i++) { + [tmpArray replaceObjectAtIndex:i withObject:[[tmpArray objectAtIndex:i]stringByReplacingOccurrencesOfString:@"\n" withString:@", "]]; + [tmpArray replaceObjectAtIndex:i withObject:[[tmpArray objectAtIndex:i]stringByReplacingOccurrencesOfString:@", -" withString:@"\n-" options:0 range:NSRangeFromString(@"0 30")]]; + [tmpArray replaceObjectAtIndex:i withObject:[[tmpArray objectAtIndex:i]stringByReplacingOccurrencesOfString:@"-, " withString:@"-\n" options:0 range:NSRangeFromString(@"0 30")]]; + [tmpArray replaceObjectAtIndex:i withObject:[[tmpArray objectAtIndex:i]stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@","]]]; + } + o_authors = [tmpArray componentsJoinedByString:@"\n\n"]; + [o_authors retain]; + + /* setup join us! */ + NSString *joinus = [NSString stringWithUTF8String:_("" + "

VLC media player is a free and open source media player, encoder, and " + "streamer made by the volunteers of the VideoLAN community.

VLC uses its internal codecs, works on " + "essentially every popular platform, and can read almost all files, CDs, " + "DVDs, network streams, capture cards and other media formats!

Help and join us!")]; + NSString *fontfamily; + if (OSX_YOSEMITE) + fontfamily = @"Helvetica Neue"; + else + fontfamily = @"Lucida Grande"; + NSString *joinUsWithStyle = [NSString stringWithFormat:@"

%@
", + fontfamily, joinus]; + NSAttributedString *joinus_readytorender = [[NSAttributedString alloc] initWithHTML:[joinUsWithStyle dataUsingEncoding:NSUTF8StringEncoding allowLossyConversion:YES] options:[NSDictionary dictionaryWithObject:[NSNumber numberWithInt:NSUTF8StringEncoding] forKey:NSCharacterEncodingDocumentOption] documentAttributes:NULL]; + [o_joinus_txt setAllowsEditingTextAttributes: YES]; + [o_joinus_txt setSelectable: YES]; + [o_joinus_txt setAttributedStringValue:joinus_readytorender]; + + [joinus_readytorender release]; + [o_credits_textview setString: @""]; + + /* Setup the window */ + [o_credits_textview setDrawsBackground: NO]; + [o_credits_scrollview setDrawsBackground: NO]; + [[self window] setExcludedFromWindowsMenu:YES]; + [[self window] setMenu:nil]; + [[self window] setBackgroundColor: [NSColor colorWithCalibratedWhite:.96 alpha:1.]]; + + if (config_GetInt(VLCIntf, "macosx-icon-change")) { + /* After day 354 of the year, the usual VLC cone is replaced by another cone + * wearing a Father Xmas hat. + * Note: this icon doesn't represent an endorsement of The Coca-Cola Company. + */ + NSCalendar *gregorian = + [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]; + NSUInteger dayOfYear = [gregorian ordinalityOfUnit:NSDayCalendarUnit inUnit:NSYearCalendarUnit forDate:[NSDate date]]; + [gregorian release]; + + if (dayOfYear >= 354) + [o_icon_view setImage: [NSImage imageNamed:@"vlc-xmas"]]; + } } - (void)windowDidBecomeKey:(NSNotification *)notification @@ -258,21 +250,37 @@ static VLAboutBox *_o_sharedInstance = nil; [self buttonAction:nil]; } +@end + /***************************************************************************** -* VLC Generic Help Window -*****************************************************************************/ + * VLC Help Window Controller + *****************************************************************************/ -- (void)showHelp +@implementation HelpWindowController + +- (id)init { - [o_help_window setTitle: _NS("VLC media player Help")]; + self = [super initWithWindowNibName:@"Help"]; + if (self) { + + [self setWindowFrameAutosaveName:@"help"]; + } + + return self; +} + +- (void)windowDidLoad +{ + [[self 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"]]; +- (void)showHelp +{ + [self showWindow:nil]; + [self helpGoHome:nil]; } - (IBAction)helpGoHome:(id)sender