OSDN Git Service

MacGUI: added 64-bit savvy application icon.
authorkonablend <konablend@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Wed, 17 Jun 2009 00:05:07 +0000 (00:05 +0000)
committerkonablend <konablend@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Wed, 17 Jun 2009 00:05:07 +0000 (00:05 +0000)
- 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

macosx/Controller.h
macosx/Controller.mm
macosx/English.lproj/MainMenu.xib
macosx/HandBrake-64.icns [new file with mode: 0644]
macosx/HandBrake.xcodeproj/project.pbxproj

index 798e443..f1432b4 100644 (file)
@@ -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
index 25fe20c..6ca4fdc 100644 (file)
@@ -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"];
index 542f345..48d6446 100644 (file)
@@ -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>
                                        <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"/>
                                        </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">
                                        <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>
                                        <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>
                                        <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>
                                        <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>
                                        <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>
                                </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">
                                                        <string>selectPreset:</string>
                                                        <string>setDefaultPreset:</string>
                                                        <string>setEnabledStateOfAudioMixdownControls:</string>
+                                                       <string>showAboutPanel:</string>
                                                        <string>showAddPresetPanel:</string>
                                                        <string>showDebugOutputPanel:</string>
                                                        <string>showNewScan:</string>
                                                        <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
new file mode 100644 (file)
index 0000000..df6aa4e
Binary files /dev/null and b/macosx/HandBrake-64.icns differ
index 4b9b021..892ab58 100644 (file)
@@ -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 */; };
                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; };
                                A27BB4E80EFAB9310027CDF9 /* PicturePreview.xib */,
                                A273E0460C57B39A00493A45 /* icons */,
                                0DFA5C7A0B8DD1E90020BC09 /* HandBrake.icns */,
+                               2728D25A0FE8419900758EC9 /* HandBrake-64.icns */,
                                E39AA4DA0D32DC0B0007A415 /* MainMenu.xib */,
                                E39AA4E20D32DC0B0007A415 /* AdvancedView.xib */,
                                E39AA4E40D32DC0B0007A415 /* OutputPanel.xib */,
                                E39AA4EB0D32DC0B0007A415 /* OutputPanel.xib in Resources */,
                                A27BB4EA0EFAB9310027CDF9 /* PicturePreview.xib in Resources */,
                                A256080C0FD06720006A4277 /* Brushed_Window.png in Resources */,
+                               2728D25B0FE8419900758EC9 /* HandBrake-64.icns in Resources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };