OSDN Git Service

MacGUI: fix 64-bit icon to be used during dock-icon progress bar updates.
authorkonablend <konablend@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Thu, 18 Jun 2009 16:47:21 +0000 (16:47 +0000)
committerkonablend <konablend@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Thu, 18 Jun 2009 16:47:21 +0000 (16:47 +0000)
- also prevents icon from getting trumped back to 32-bit after encode completes.

git-svn-id: svn://localhost/HandBrake/trunk@2566 b64f7644-9d1e-0410-96f1-a4d463321fa5

macosx/Controller.mm

index bb1e776..4203c67 100644 (file)
@@ -559,7 +559,6 @@ static NSString *        ChooseSourceIdentifier             = @"Choose Source It
  **********************************************************************/
 - (void) UpdateDockIcon: (float) progress
 {
-    NSImage * icon;
     NSData * tiff;
     NSBitmapImageRep * bmp;
     uint32_t * pen;
@@ -569,17 +568,14 @@ static NSString *        ChooseSourceIdentifier             = @"Choose Source It
     int row_start, row_end;
     int i, j;
 
-    /* Get application original icon */
-    icon = [NSImage imageNamed: @"NSApplicationIcon"];
-
     if( progress < 0.0 || progress > 1.0 )
     {
-        [NSApp setApplicationIconImage: icon];
+        [NSApp setApplicationIconImage: fApplicationIcon];
         return;
     }
 
     /* Get it in a raw bitmap form */
-    tiff = [icon TIFFRepresentationUsingCompression:
+    tiff = [fApplicationIcon TIFFRepresentationUsingCompression:
             NSTIFFCompressionNone factor: 1.0];
     bmp = [NSBitmapImageRep imageRepWithData: tiff];
     
@@ -628,7 +624,7 @@ static NSString *        ChooseSourceIdentifier             = @"Choose Source It
     /* Now update the dock icon */
     tiff = [bmp TIFFRepresentationUsingCompression:
             NSTIFFCompressionNone factor: 1.0];
-    icon = [[NSImage alloc] initWithData: tiff];
+    NSImage* icon = [[NSImage alloc] initWithData: tiff];
     [NSApp setApplicationIconImage: icon];
     [icon release];
 }
@@ -1443,7 +1439,6 @@ static NSString *        ChooseSourceIdentifier             = @"Choose Source It
 
 - (IBAction)showAboutPanel:(id)sender
 {
-    //[NSApp orderFrontStandardAboutPanel:sender];
     NSMutableDictionary* d = [[NSMutableDictionary alloc] initWithObjectsAndKeys:
         fApplicationIcon, @"ApplicationIcon",
         nil ];