diff options
author | konablend <[email protected]> | 2009-06-17 00:05:07 +0000 |
---|---|---|
committer | konablend <[email protected]> | 2009-06-17 00:05:07 +0000 |
commit | 77ace834b568f1a024b2f3aa4bee70cc3a1a6b65 (patch) | |
tree | b3e875353d1ac9c64a9c6b534fcaa9780bcc195c /macosx | |
parent | 3df17b7467c6db19715ae175bde37dd5dd6e33b5 (diff) |
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://svn.handbrake.fr/HandBrake/trunk@2547 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'macosx')
-rw-r--r-- | macosx/Controller.h | 3 | ||||
-rw-r--r-- | macosx/Controller.mm | 24 | ||||
-rw-r--r-- | macosx/English.lproj/MainMenu.xib | 31 | ||||
-rw-r--r-- | macosx/HandBrake-64.icns | bin | 0 -> 49638 bytes | |||
-rw-r--r-- | macosx/HandBrake.xcodeproj/project.pbxproj | 4 |
5 files changed, 48 insertions, 14 deletions
diff --git a/macosx/Controller.h b/macosx/Controller.h index 798e44393..f1432b4ed 100644 --- a/macosx/Controller.h +++ b/macosx/Controller.h @@ -31,6 +31,7 @@ BOOL fIsDragging; @interface HBController : NSObject <GrowlApplicationBridgeDelegate> { + 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 25fe20c56..6ca4fdca2 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 542f3453f..48d64461b 100644 --- a/macosx/English.lproj/MainMenu.xib +++ b/macosx/English.lproj/MainMenu.xib @@ -9,6 +9,7 @@ <object class="NSMutableArray" key="IBDocument.EditedObjectIDs"> <bool key="EncodedWithXMLCoder">YES</bool> <integer value="5196"/> + <integer value="58"/> </object> <object class="NSArray" key="IBDocument.PluginDependencies"> <bool key="EncodedWithXMLCoder">YES</bool> @@ -4717,14 +4718,6 @@ <int key="connectionID">139</int> </object> <object class="IBConnectionRecord"> - <object class="IBActionConnection" key="connection"> - <string key="label">orderFrontStandardAboutPanel:</string> - <reference key="source" ref="1046316778"/> - <reference key="destination" ref="218095211"/> - </object> - <int key="connectionID">142</int> - </object> - <object class="IBConnectionRecord"> <object class="IBOutletConnection" key="connection"> <string key="label">delegate</string> <reference key="source" ref="1046316778"/> @@ -6316,6 +6309,14 @@ </object> <int key="connectionID">5214</int> </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">showAboutPanel:</string> + <reference key="source" ref="2258723"/> + <reference key="destination" ref="218095211"/> + </object> + <int key="connectionID">5245</int> + </object> </object> <object class="IBMutableOrderedSet" key="objectRecords"> <object class="NSArray" key="orderedObjects"> @@ -10295,8 +10296,10 @@ <string>5232.IBPluginDependency</string> <string>5233.IBPluginDependency</string> <string>5234.IBPluginDependency</string> + <string>5244.IBPluginDependency</string> <string>56.IBPluginDependency</string> <string>56.ImportedFromIB2</string> + <string>57.IBEditorWindowLastContentRect</string> <string>57.IBPluginDependency</string> <string>57.ImportedFromIB2</string> <string>57.editorWindowContentRectSynchronizationRect</string> @@ -10323,7 +10326,7 @@ <reference ref="9"/> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <reference ref="9"/> - <string>{{262, 642}, {211, 183}}</string> + <string>{{263, 642}, {211, 183}}</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <reference ref="9"/> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> @@ -10578,7 +10581,7 @@ <reference ref="9"/> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <reference ref="9"/> - <string>{{195, 692}, {236, 133}}</string> + <string>{{196, 692}, {236, 133}}</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <reference ref="9"/> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> @@ -10739,7 +10742,7 @@ <reference ref="9"/> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <reference ref="9"/> - <string>{{0, 825}, {394, 20}}</string> + <string>{{1, 825}, {394, 20}}</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <reference ref="9"/> <string>{{63, 836}, {394, 20}}</string> @@ -11081,7 +11084,9 @@ <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> + <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <reference ref="9"/> + <string>{{13, 672}, {235, 153}}</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <reference ref="9"/> <string>{{75, 683}, {235, 153}}</string> @@ -11115,7 +11120,7 @@ </object> </object> <nil key="sourceID"/> - <int key="maxID">5244</int> + <int key="maxID">5245</int> </object> <object class="IBClassDescriber" key="IBDocument.Classes"> <object class="NSMutableArray" key="referencedPartialClassDescriptions"> @@ -11166,6 +11171,7 @@ <string>selectPreset:</string> <string>setDefaultPreset:</string> <string>setEnabledStateOfAudioMixdownControls:</string> + <string>showAboutPanel:</string> <string>showAddPresetPanel:</string> <string>showDebugOutputPanel:</string> <string>showNewScan:</string> @@ -11234,6 +11240,7 @@ <string>id</string> <string>id</string> <string>id</string> + <string>id</string> </object> </object> <object class="NSMutableDictionary" key="outlets"> diff --git a/macosx/HandBrake-64.icns b/macosx/HandBrake-64.icns Binary files differnew file mode 100644 index 000000000..df6aa4efc --- /dev/null +++ b/macosx/HandBrake-64.icns diff --git a/macosx/HandBrake.xcodeproj/project.pbxproj b/macosx/HandBrake.xcodeproj/project.pbxproj index 4b9b02175..892ab58e2 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 = "<group>"; }; 25DE1FB50C169A0C00F01FC8 /* HBPreferencesController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HBPreferencesController.m; sourceTree = "<group>"; }; 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 = "<group>"; }; 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; }; |