From: konablend Date: Wed, 17 Jun 2009 00:05:07 +0000 (+0000) Subject: MacGUI: added 64-bit savvy application icon. X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=3d446caf558ce6398f0cf77821d8a804923a47b3;p=handbrake-jp%2Fhandbrake-jp-git.git MacGUI: added 64-bit savvy application icon. - icon is chosen based on compile-time architecture: HandBrake.icns or HandBrake-64.icns - added action for MainMenu->About to call Controller.showAboutPanel as the default about panel needs dictionary override to force icon. git-svn-id: svn://localhost/HandBrake/trunk@2547 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- diff --git a/macosx/Controller.h b/macosx/Controller.h index 798e4439..f1432b4e 100644 --- a/macosx/Controller.h +++ b/macosx/Controller.h @@ -31,6 +31,7 @@ BOOL fIsDragging; @interface HBController : NSObject { + NSImage * fApplicationIcon; IBOutlet NSWindow * fWindow; /* Main Menu Outlets */ @@ -267,6 +268,8 @@ BOOL fIsDragging; double dockIconProgress; } +- (IBAction) showAboutPanel:(id)sender; + - (void) writeToActivityLog:(const char *) format, ...; - (IBAction) browseSources: (id) sender; - (void) browseSourcesDone: (NSOpenPanel *) sheet diff --git a/macosx/Controller.mm b/macosx/Controller.mm index 25fe20c5..6ca4fdca 100644 --- a/macosx/Controller.mm +++ b/macosx/Controller.mm @@ -37,6 +37,15 @@ static NSString * ChooseSourceIdentifier = @"Choose Source It { return nil; } + + /* replace bundled app icon with one which is 32/64-bit savvy */ +#if defined( __LP64__ ) + fApplicationIcon = [[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForImageResource:@"HandBrake-64.icns"]]; +#else + fApplicationIcon = [[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForImageResource:@"HandBrake.icns"]]; +#endif + if( fApplicationIcon != nil ) + [NSApp setApplicationIconImage:fApplicationIcon]; [HBPreferencesController registerUserDefaults]; fHandle = NULL; @@ -310,7 +319,8 @@ static NSString * ChooseSourceIdentifier = @"Choose Source It [fQueueController release]; [fPreviewController release]; [fPictureController release]; - + [fApplicationIcon release]; + hb_close(&fHandle); hb_close(&fQueueEncodeLibhb); } @@ -1431,6 +1441,16 @@ static NSString * ChooseSourceIdentifier = @"Choose Source It } } +- (IBAction)showAboutPanel:(id)sender +{ + //[NSApp orderFrontStandardAboutPanel:sender]; + NSMutableDictionary* d = [[NSMutableDictionary alloc] initWithObjectsAndKeys: + fApplicationIcon, @"ApplicationIcon", + nil ]; + [NSApp orderFrontStandardAboutPanelWithOptions:d]; + [d release]; +} + /* Here we open the title selection sheet where we can specify an exact title to be scanned */ - (IBAction) showSourceTitleScanPanel: (id) sender { @@ -1489,7 +1509,7 @@ static NSString * ChooseSourceIdentifier = @"Choose Source It path = [detector devicePath]; [self writeToActivityLog: "trying to open a physical dvd at: %s", [scanPath UTF8String]]; -#ifdef __LP64__ +#if defined( __LP64__ ) /* If we are 64 bit, we cannot read encrypted dvd's as vlc is 32 bit only */ cancelScanDecrypt = 1; [self writeToActivityLog: "64 bit mode cannot read dvd's, scan cancelled"]; diff --git a/macosx/English.lproj/MainMenu.xib b/macosx/English.lproj/MainMenu.xib index 542f3453..48d64461 100644 --- a/macosx/English.lproj/MainMenu.xib +++ b/macosx/English.lproj/MainMenu.xib @@ -9,6 +9,7 @@ YES + YES @@ -4717,14 +4718,6 @@ 139 - - orderFrontStandardAboutPanel: - - - - 142 - - delegate @@ -6316,6 +6309,14 @@ 5214 + + + showAboutPanel: + + + + 5245 + @@ -10295,8 +10296,10 @@ 5232.IBPluginDependency 5233.IBPluginDependency 5234.IBPluginDependency + 5244.IBPluginDependency 56.IBPluginDependency 56.ImportedFromIB2 + 57.IBEditorWindowLastContentRect 57.IBPluginDependency 57.ImportedFromIB2 57.editorWindowContentRectSynchronizationRect @@ -10323,7 +10326,7 @@ com.apple.InterfaceBuilder.CocoaPlugin - {{262, 642}, {211, 183}} + {{263, 642}, {211, 183}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -10578,7 +10581,7 @@ com.apple.InterfaceBuilder.CocoaPlugin - {{195, 692}, {236, 133}} + {{196, 692}, {236, 133}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -10739,7 +10742,7 @@ com.apple.InterfaceBuilder.CocoaPlugin - {{0, 825}, {394, 20}} + {{1, 825}, {394, 20}} com.apple.InterfaceBuilder.CocoaPlugin {{63, 836}, {394, 20}} @@ -11081,7 +11084,9 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + {{13, 672}, {235, 153}} com.apple.InterfaceBuilder.CocoaPlugin {{75, 683}, {235, 153}} @@ -11115,7 +11120,7 @@ - 5244 + 5245 @@ -11166,6 +11171,7 @@ selectPreset: setDefaultPreset: setEnabledStateOfAudioMixdownControls: + showAboutPanel: showAddPresetPanel: showDebugOutputPanel: showNewScan: @@ -11234,6 +11240,7 @@ id id id + id diff --git a/macosx/HandBrake-64.icns b/macosx/HandBrake-64.icns new file mode 100644 index 00000000..df6aa4ef Binary files /dev/null and b/macosx/HandBrake-64.icns differ diff --git a/macosx/HandBrake.xcodeproj/project.pbxproj b/macosx/HandBrake.xcodeproj/project.pbxproj index 4b9b0217..892ab58e 100644 --- a/macosx/HandBrake.xcodeproj/project.pbxproj +++ b/macosx/HandBrake.xcodeproj/project.pbxproj @@ -17,6 +17,7 @@ 25DE1FB70C169A0C00F01FC8 /* HBPreferencesController.m in Sources */ = {isa = PBXBuildFile; fileRef = 25DE1FB50C169A0C00F01FC8 /* HBPreferencesController.m */; }; 2713E6300F676510002E0A01 /* libhb.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2713E50C0F675F32002E0A01 /* libhb.a */; }; 2713E6420F676526002E0A01 /* libhb.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2713E50C0F675F32002E0A01 /* libhb.a */; }; + 2728D25B0FE8419900758EC9 /* HandBrake-64.icns in Resources */ = {isa = PBXBuildFile; fileRef = 2728D25A0FE8419900758EC9 /* HandBrake-64.icns */; }; 2774BE900F66F47100B65FC6 /* libbz2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 2774BE8F0F66F47100B65FC6 /* libbz2.dylib */; }; 2774BE920F66F48200B65FC6 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 2774BE910F66F48200B65FC6 /* libz.dylib */; }; 2774BEC70F66F61A00B65FC6 /* libbz2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 2774BE8F0F66F47100B65FC6 /* libbz2.dylib */; }; @@ -144,6 +145,7 @@ 25DE1FB40C169A0C00F01FC8 /* HBPreferencesController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HBPreferencesController.h; sourceTree = ""; }; 25DE1FB50C169A0C00F01FC8 /* HBPreferencesController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HBPreferencesController.m; sourceTree = ""; }; 2713E50C0F675F32002E0A01 /* libhb.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libhb.a; path = libhb/libhb.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 2728D25A0FE8419900758EC9 /* HandBrake-64.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = "HandBrake-64.icns"; sourceTree = ""; }; 2774BE8F0F66F47100B65FC6 /* libbz2.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libbz2.dylib; path = usr/lib/libbz2.dylib; sourceTree = SDKROOT; }; 2774BE910F66F48200B65FC6 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; }; 27AC71840F5A0AF600053B83 /* fakexcode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = fakexcode.cpp; path = ../test/fakexcode.cpp; sourceTree = SOURCE_ROOT; }; @@ -287,6 +289,7 @@ A27BB4E80EFAB9310027CDF9 /* PicturePreview.xib */, A273E0460C57B39A00493A45 /* icons */, 0DFA5C7A0B8DD1E90020BC09 /* HandBrake.icns */, + 2728D25A0FE8419900758EC9 /* HandBrake-64.icns */, E39AA4DA0D32DC0B0007A415 /* MainMenu.xib */, E39AA4E20D32DC0B0007A415 /* AdvancedView.xib */, E39AA4E40D32DC0B0007A415 /* OutputPanel.xib */, @@ -578,6 +581,7 @@ E39AA4EB0D32DC0B0007A415 /* OutputPanel.xib in Resources */, A27BB4EA0EFAB9310027CDF9 /* PicturePreview.xib in Resources */, A256080C0FD06720006A4277 /* Brushed_Window.png in Resources */, + 2728D25B0FE8419900758EC9 /* HandBrake-64.icns in Resources */, ); runOnlyForDeploymentPostprocessing = 0; };